From 805858716efd00f66f5c86e50d7bd93ca56b41bd Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Tue, 14 Dec 2021 07:01:47 -0500 Subject: [PATCH] Fix file permission issue in toxchat/bootstrap-node /var/lib/tox-bootstrapd on the host is owned by hosts's tox-bootstrapd and chowned 700, but the container attempts to access it as its own tox-bootstrapd user with possibly different uid:gid, which will fail if host's tox-bootstrapd user has different uid:gid than the tox-bootstrapd user inside the container. This change makes the container use host's tox-bootstrapd uid:gid, which fixes the issue. --- .travis/tox-bootstrapd-docker | 1 + other/bootstrap_daemon/README.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.travis/tox-bootstrapd-docker b/.travis/tox-bootstrapd-docker index e370118d..b6682466 100755 --- a/.travis/tox-bootstrapd-docker +++ b/.travis/tox-bootstrapd-docker @@ -14,6 +14,7 @@ sudo useradd \ --user-group tox-bootstrapd sudo chmod 700 /var/lib/tox-bootstrapd docker run -d --name tox-bootstrapd \ + --user "$(id -u tox-bootstrapd):$(id -g tox-bootstrapd)" \ -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ \ --ulimit nofile=32768:32768 \ -p 443:443 \ diff --git a/other/bootstrap_daemon/README.md b/other/bootstrap_daemon/README.md index e108b415..2750d211 100644 --- a/other/bootstrap_daemon/README.md +++ b/other/bootstrap_daemon/README.md @@ -249,6 +249,7 @@ sudo useradd \ sudo chmod 700 /var/lib/tox-bootstrapd docker run -d --name tox-bootstrapd --restart always \ + --user "$(id -u tox-bootstrapd):$(id -g tox-bootstrapd)" \ -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ \ --ulimit nofile=32768:32768 \ -p 443:443 \ @@ -284,7 +285,9 @@ Then rebuild and run the image again: ```sh tar c $(git ls-files) | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - docker run -d --name tox-bootstrapd --restart always \ + --user "$(id -u tox-bootstrapd):$(id -g tox-bootstrapd)" \ -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ \ + --ulimit nofile=32768:32768 \ -p 443:443 \ -p 3389:3389 \ -p 33445:33445 \