Use DATA_DIR and taskchampion username in entrypoint (#99)

In fact, there is no taskchampion group (1092 is not a defined gid).
Instead taskchampion is in the `users` group.
This commit is contained in:
Dustin J. Mitchell 2025-03-03 16:53:53 -05:00 committed by GitHub
parent 55892d3b2d
commit ecdfb6bdfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,9 +3,9 @@ set -e
echo "starting entrypoint script..." echo "starting entrypoint script..."
if [ "$1" = "/bin/taskchampion-sync-server" ]; then if [ "$1" = "/bin/taskchampion-sync-server" ]; then
echo "setting data directories" echo "setting data directories"
mkdir -p "/var/lib/taskchampion-sync-server/data" mkdir -p "${DATA_DIR}"
chown -R 1092:1092 "/var/lib/taskchampion-sync-server/data" chown -R taskchampion:users "${DATA_DIR}"
chmod -R 700 "/var/lib/taskchampion-sync-server/data" chmod -R 700 "${DATA_DIR}"
if [ "$(id -u)" = "0" ]; then if [ "$(id -u)" = "0" ]; then
echo "switching to user 'taskchampion'" echo "switching to user 'taskchampion'"
exec su-exec taskchampion "$@" exec su-exec taskchampion "$@"