You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "willholley (via GitHub)" <gi...@apache.org> on 2023/03/24 14:02:13 UTC
[GitHub] [couchdb-docker] willholley opened a new pull request, #237: fix: set $HOME when stepping down from root
willholley opened a new pull request, #237:
URL: https://github.com/apache/couchdb-docker/pull/237
## Overview
Why:
In https://github.com/apache/couchdb-docker/pull/234 we moved from using `gosu` to `setpriv` to step down from the root user to the couchdb user.
There is a behavioural difference between and `gosu` and `setpriv` in that `gosu` will [set the $HOME environment variable](https://github.com/tianon/gosu/blob/master/setup-user.go#L45) to that of the target user.
Without this behaviour, `couchdb` includes the root user home directory (`/root`) in various search paths and crashes because it doesn't have read permissions.
How:
Explicitly set `$HOME` to the `couchdb` user home directory before we execute as the `couchdb` user, replicating the `gosu` behaviour.
## Testing recommendations
<!-- Describe how we can test your changes.
Does it provides any behaviour that the end users
could notice? -->
## GitHub issue number
https://github.com/apache/couchdb-docker/issues/236
## Related Pull Requests
<!-- If your changes affects multiple components in different
repositories please put links to those pull requests here. -->
## Checklist
- [ ] Code is written and works correctly;
- [ ] Changes are covered by tests;
- [ ] Documentation reflects the changes;
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] rnewson commented on pull request #237: fix: set $HOME when stepping down from root
Posted by "rnewson (via GitHub)" <gi...@apache.org>.
rnewson commented on PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237#issuecomment-1482863320
suggest adding `--reset-env` to the `setpriv` line instead.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] willholley commented on pull request #237: fix: set $HOME when stepping down from root
Posted by "willholley (via GitHub)" <gi...@apache.org>.
willholley commented on PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237#issuecomment-1482883300
`--reset-env` "Clears all the environment variables except TERM", which looks a bit aggressive to me. It would clear things like `ERL_FLAGS`, for instance. Perhaps something to try when a new version is created but, as a patch update, I would expect it to break some kubernetes or docker compose environments.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] aolmosj commented on pull request #237: fix: set $HOME when stepping down from root
Posted by "aolmosj (via GitHub)" <gi...@apache.org>.
aolmosj commented on PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237#issuecomment-1487173054
Hi!
What's the ETA for this being pushed to Dockerhub? It looks like the current version it's still having this issue. I'm having this error when setting the variable `COUCHDB_ERLANG_COOKIE`.
```Error when reading /root/.erlang.cookie```
Thanks!
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] willholley commented on pull request #237: fix: set $HOME when stepping down from root
Posted by "willholley (via GitHub)" <gi...@apache.org>.
willholley commented on PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237#issuecomment-1487375036
@aolmosj note the `apache/couchdb` image is different to the `couchdb` image published by docker. The latter may take a while to be updated - we don't control that directly.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] willholley merged pull request #237: fix: set $HOME when stepping down from root
Posted by "willholley (via GitHub)" <gi...@apache.org>.
willholley merged PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] willholley commented on pull request #237: fix: set $HOME when stepping down from root
Posted by "willholley (via GitHub)" <gi...@apache.org>.
willholley commented on PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237#issuecomment-1487223554
@aolmosj the fix is published for the `apache/couchdb:3.3.1` image. We'll push the update to `apache/couchdb:3.2.2` as well shortly.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb-docker] aolmosj commented on pull request #237: fix: set $HOME when stepping down from root
Posted by "aolmosj (via GitHub)" <gi...@apache.org>.
aolmosj commented on PR #237:
URL: https://github.com/apache/couchdb-docker/pull/237#issuecomment-1487256426
Strange...this isn't working for me.
```docker run --rm --name my-couchdb -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password -e COUCHDB_ERLANG_COOKIE="XXXXXXXXXX" -e NODENAME=couchdb couchdb:3.3.1```
I get this
```
[notice] 2023-03-28T16:30:26.793874Z nonode@nohost <0.422.0> -------- Missing system database _users
[error] 2023-03-28T16:30:26.815293Z nonode@nohost <0.9.0> -------- file:path_eval(["/root"],".erlang"): permission denied
[error] 2023-03-28T16:30:26.815310Z nonode@nohost <0.9.0> -------- file:path_eval(["/root"],".erlang"): permission denied
```
When using the tag 3.3.0, I don't get this error.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org