Background
Security in a single CouchDB can only be set up to do either:
- Everyone can read/write everything (admin party)
- Everyone can read, some can write
- Some can read everything, and those same people can write everything
So in the very common situation where you want user data to be private, the current best practice is to give every user a database. This sounds nuts at first, but it turns out that databases are cheap in CouchDB; Cloudant boasts that 100k databases in a single Couch is not uncommon (source).
However, actually implementing one database per user is not open-and-shut. You need a separate server process outside of CouchDB to handle it. Everyone has their own solution; here are some popular ones:
Update: the CouchDB docker image now has a built-in couch-per-user
support, making this much easier to implement: https://hub.docker.com/r/klaemo/couchdb/
I've tested this too and it didn't work neither, I think. In my case, when you create a user, it never creates this user's correspondant database.
It's weird because this
couch_peruser
feature is in the official documentation, but I've activated this flag and I didn't see any magic flowing....Does anybody know if this couchperuser plugin works with Couch v2? Or it only works with the V1.6 only?
I've tried to install it on a Mac without success. When I've followed the README steps and executed the
make
command, I've received an error trying to find somecouch-config
command. I couldn't install this command in my PATH and couldn't find a way to have it available in my system.I would really appreciate if someone can help me with this!😄
Maybe a downgrade to Couch v1.6 and using this couch_peruser daemon is a possible answer...
Thanks!!!