apache / couchdb-fauxton

Fauxton is the new Web UI for CouchDB

Home Page:https://github.com/apache/couchdb-fauxton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deleting an option in Fauxton causes it to be forced to empty instead, overriding local.ini!

alenl opened this issue · comments

commented

If you click on the trashcan icon by some option, it will not remove that option from local.d/10-admin.ini, but will set the option line to:
That_Olde_Option =
So, if that option has an actual value assigned in local.ini , it will be overwritten with nothing.

Expected Behavior

Deleting an option from the Fauxton list would remove the option-value line completely from the admin file, which would make the value from local.ini take over.

Current Behavior

Right now it puts an empty assignment, which is not the same as doing nothing.

Possible Solution

I suggest deleting the line from 10-admin.ini completely. The fact that it is not done that way seems like a small oversight, and simple to fix - but with big and very confusing effects to the admin-user of Fauxton.

Steps to Reproduce (for bugs)

Below, when I say "observe the realm", I mean execute this:

curl -is https://couch-test-server:6984/ | grep realm

(Or whatever protocol/port you use.)
and check the output.

  1. Have a test server that uses WWW authentication and requires authorized user .
    (This is the simplest test, because WWW-Authenticate realm is a string that can be set to anything and is easily obtainable from the browser.)
  2. In local.ini, set [httpd] WWW-Authenticate = Basic realm="set_in_local"
    observe the realm is now "set_in_local"
  3. In Fauxton [httpd] WWW-Authenticate = Basic realm="set__in_Fauxton"
    observe the realm is now "set_in_Fauxton"
  4. Click on the trashcan icon for the WWW-Authenticate in Fauxton
    observe the realm is now "server". (This originates from the internal defaults.)
  5. Check contents of etc/local.d/10-admin.ini and notice the line
    WWW-Authenticate=

Context

When doing any changes, it can be very confusing. If you add a new option in Fauxton, and then remove it, you'd expect that the state of the configuration is as it was before. Alas, it is something completely different! Now that I know about this, I simply will not be using that trashcan icon, because this is definitely no what I wanted to do. But it was super-confusing before I realized what's going on.

Your Environment

  • Version used: 2.2.0 (installed on Ubuntu 16.04)
  • Browser Name and version: Firefox 62.0/x64
  • Operating System and version (desktop or mobile): desktop
  • Link to your project: N/A

When you delete a config option in Fauxton, we call the DELETE /_config/{section}/{key}. This should be moved to https://github.com/apache/couchdb as it concerns the API behavior

commented

This issue was moved to apache/couchdb#1624