You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/03/05 20:17:35 UTC

[GitHub] [couchdb-docker] desmap opened a new issue #139: Expose required_valid_user via env var

desmap opened a new issue #139: Expose required_valid_user via env var
URL: https://github.com/apache/couchdb-docker/issues/139
 
 
   Since securing a DB is important and `required_valid_user` is set to false as default in this Docker image, I propose to have an env var to change this within the `docker-compose.yml`. A nice side effect would be that we signal the importance of `required_valid_user` and the DB security in general.
   
   Just to give you an illustration, what needs to be done w/o an env var. E.g. in node, I have to put following code in front of my app if I want to have the automatic setting of `required_valid_user` without fiddling with config files.. 
   Btw, I cannot use regular nano functions because `required_valid_user` is not exposed there. So, I end up with custom requests (using superagent as request lib):
   ```
   const dbUrl = `http://${process.env.COUCHDB_USER}:${process.env.COUCHDB_PASSWORD}@db:5984`
   const nano = require('nano')(dbUrl)
   request
     .put(`${dbUrl}/_node/nonode@nohost/_config/chttpd/require_valid_user`)
     .send('"true"')
     .catch(err => {
       console.log(err.message, err.response)
     })
   request
     .put(`${dbUrl}/_node/nonode@nohost/_config/couch_httpd_auth/require_valid_user`)
     .send('"true"')
     .catch(err => {
       console.log(err.message, err.response)
     })
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services