Skip to content

Commit 35a22b2

Browse files
fix: restore execute bit on bind-mounted data dir
bind mounts can lose the dir x bit (drw-rw-rw-), making the dir untraversable; entrypoint now chmod u+rwx the log dir before dropping privileges.
1 parent 748a852 commit 35a22b2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

entrypoint.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/sh
2-
# Fix ownership of the data dir (bind mounts are often owned by root),
3-
# then drop privileges and run as the unprivileged monitor user.
2+
# Fix ownership AND permissions of the data dir (bind mounts are often
3+
# owned by root or lose mode bits), then drop privileges and run as the
4+
# unprivileged monitor user.
45
set -e
56

67
DATA_DIR="$(dirname "${LOG_FILE:-/app/data/status.txt}")"
78
mkdir -p "$DATA_DIR" 2>/dev/null || true
89
chown -R monitor:monitor "$DATA_DIR" 2>/dev/null || true
10+
# ensure the owner can traverse/write the dir (x bit is required to open files inside)
11+
chmod u+rwx "$DATA_DIR" 2>/dev/null || true
912

10-
# if the targets file is read-only and unreadable, that's fine — the app will error clearly
1113
exec su-exec monitor:monitor /app/TinyUptimeRobot "$@"

0 commit comments

Comments
 (0)