Use DATA_DIR and taskchampion username in entrypoint

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:27:56 -05:00
parent 55892d3b2d
commit 58231619a7
No known key found for this signature in database

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 "$@"