From bafcfad1904c53fd7eea20041e1798d8ae622a31 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 23 Oct 2025 21:21:43 -0700 Subject: [PATCH] Update entrypoint.sh --- script/docker/entrypoint.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/script/docker/entrypoint.sh b/script/docker/entrypoint.sh index 214285d..9671042 100644 --- a/script/docker/entrypoint.sh +++ b/script/docker/entrypoint.sh @@ -1,6 +1,13 @@ #!/bin/bash -# instruction set the meshing-around docker container entrypoint -# Substitute environment variables in the config file (what is the purpose of this?) -# envsubst < /app/config.ini > /app/config.tmp && mv /app/config.tmp /app/config.ini -# Run the bot -exec python /app/mesh_bot.py \ No newline at end of file + +# if /app/logs is not writable, change ownership +if [ -w /app/logs ]; then + chown -R appuser:appuser /app/logs +fi +# if /app/data is not writable, change ownership +if [ -w /app/data ]; then + chown -R appuser:appuser /app/data +fi + +# Run the bot as appuser (if you want to drop privileges) +exec su appuser -c "python /app/mesh_bot.py" \ No newline at end of file