mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2026-04-05 17:20:35 +00:00
Allow specifying client ID when running docker-compose (#101)
This also fixes up some handling of default values in the entrypoint.
This commit is contained in:
committed by
GitHub
parent
7430d6feec
commit
a7dc9e84b4
@ -2,12 +2,28 @@
|
||||
set -e
|
||||
echo "starting entrypoint script..."
|
||||
if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
||||
echo "setting data directories"
|
||||
: ${DATA_DIR:=/var/lib/taskchampion-sync-server}
|
||||
export DATA_DIR
|
||||
echo "setting up data directory ${DATA_DIR}"
|
||||
mkdir -p "${DATA_DIR}"
|
||||
chown -R taskchampion:users "${DATA_DIR}"
|
||||
chmod -R 700 "${DATA_DIR}"
|
||||
|
||||
: ${LISTEN:=0.0.0.0:8080}
|
||||
export LISTEN
|
||||
echo "Listen set to ${LISTEN}"
|
||||
|
||||
if [ -n "${CLIENT_ID}" ]; then
|
||||
export CLIENT_ID
|
||||
echo "Limiting to client ID ${CLIENT_ID}"
|
||||
else
|
||||
unset CLIENT_ID
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
echo "switching to user 'taskchampion'"
|
||||
echo "Running server as user 'taskchampion'"
|
||||
exec su-exec taskchampion "$@"
|
||||
fi
|
||||
else
|
||||
eval "${@}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user