Skip to content

Commit f52f177

Browse files
authored
Merge pull request #735 from WeldFire/master
Allow the startup chown to be optional
2 parents 9131096 + 72b4e22 commit f52f177

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ EXPOSE ${PORT}
207207
ENV SIGNAL_CLI_CONFIG_DIR=/home/.local/share/signal-cli
208208
ENV SIGNAL_CLI_UID=1000
209209
ENV SIGNAL_CLI_GID=1000
210+
ENV SIGNAL_CLI_CHOWN_ON_STARTUP=true
210211

211212
ENTRYPOINT ["/entrypoint.sh"]
212213

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ There are a bunch of environmental variables that can be set inside the docker c
139139

140140
* `SIGNAL_CLI_GID`: Specifies the gid of the `signal-api` group inside the docker container. Defaults to `1000`
141141

142+
* `SIGNAL_CLI_CHOWN_ON_STARTUP`: If set to `false` will skip the sometimes time consuming chown on startup. Defaults to `true`
143+
142144
* `SWAGGER_HOST`: The host that's used in the Swagger UI for the interactive examples (and useful when this runs behind a reverse proxy). Defaults to SWAGGER_IP:PORT.
143145

144146
* `SWAGGER_IP`: The IP that's used in the Swagger UI for the interactive examples. Defaults to the container ip.

entrypoint.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ set -e
88
usermod -u ${SIGNAL_CLI_UID} signal-api
99
groupmod -o -g ${SIGNAL_CLI_GID} signal-api
1010

11-
# Fix permissions to ensure backward compatibility
12-
chown ${SIGNAL_CLI_UID}:${SIGNAL_CLI_GID} -R ${SIGNAL_CLI_CONFIG_DIR}
11+
# Fix permissions to ensure backward compatibility if SIGNAL_CLI_CHOWN_ON_STARTUP is not set to "false"
12+
if [ "$SIGNAL_CLI_CHOWN_ON_STARTUP" != "false" ]; then
13+
echo "Changing ownership of ${SIGNAL_CLI_CONFIG_DIR} to ${SIGNAL_CLI_UID}:${SIGNAL_CLI_GID}"
14+
chown ${SIGNAL_CLI_UID}:${SIGNAL_CLI_GID} -R ${SIGNAL_CLI_CONFIG_DIR}
15+
else
16+
echo "Skipping chown on startup since SIGNAL_CLI_CHOWN_ON_STARTUP is set to 'false'"
17+
fi
1318

1419
# Show warning on docker exec
1520
cat <<EOF >> /root/.bashrc

0 commit comments

Comments
 (0)