I am trying to set up a CouchDB instance to:
- Not require login at web user interface when to create/edit/delete documents for random people who go to
http://my_couchdb:5984
- Prevent random people from making admin level changes
- Ex: modify design docs, add users or remove pre-existing users
Basically, I would like random people to be something like the members
described here: https://docs.couchdb.org/en/2.3.1/api/database/security.html#api-db-security
What settings are necessary to make this happen? Do they live in etc/local.ini
?
I would not like to use cookies or individual user databases.
How I Set It Up
I configured CouchDB to have an admin user, boss
.
I also made a database bananas
: http://my_couchdb:5984/_utils/#database/bananas/_all_docs
What I've Tried So Far
Manipulating require_valid_user
in both httpd
and chttpd
inside etc/local.ini
(source) did not work for me, maybe I didn't quite do it right
Per this answer, I tried adding the admin user boss
to Permissions --> Admins --> Users of both _users
db and bananas
db, and it failed to achieve my desired result.
I then removed both of these, and the response of curl $HOST/bananas/_security
is now {}
.
This answer talks about creating a low-permissions user, but doesn't talk about how to bypass log in.
The below authentication_handler
works, but I don't want an Admin Party, so I need a better method.
[chttpd]
authentication_handlers = {couch_httpd_auth, null_authentication_handler}
**Update**
As pointed out by @uminder, out of the box it seems to be possible to make documents without credentials. I ran the following command from a second machine:
curl -X PUT http://my_couchdb:5984/bananas/test -d '{ "name": "test document" }'
And can then view (but not edit) the document by going here:
http://my_couchdb:5984/bananas/test
(Please ignore that the hostname is not actually my_couchdb
)
What I need is to use a web UI, without login, to edit that document. Currently, the UI is Fauxton. Here is what I do:
- Go here: http://my_couchdb:5984/_utils/#database/bananas/test
- It redirects to login page here: http://my_couchdb:5984/_utils/#login
How can I not get redirected to login, and just be able to edit the document using the Web UI?
Setup Information
- CouchDB Version:
2.3.1
- OS:
Ubuntu 16.04.3 LTS
Please let me know what other information is needed to arrive at a solution! I am new to configuring CouchDB.