-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·29 lines (23 loc) · 905 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·29 lines (23 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -e
# Default to nobody:users (Unraid standard) if PUID/PGID not set
PUID="${PUID:-99}"
PGID="${PGID:-100}"
# Ensure the app directories exist and have correct ownership
# This fixes the root-owned dirs created by Docker on first run
for dir in /app/config /app/data; do
mkdir -p "$dir"
chown "$PUID:$PGID" "$dir"
chmod 755 "$dir"
done
# Also fix ownership of any existing files in data/config dirs
chown -R "$PUID:$PGID" /app/data 2>/dev/null || true
chown -R "$PUID:$PGID" /app/config 2>/dev/null || true
# Update appuser UID/GID to match PUID/PGID
usermod -o -u "$PUID" appuser 2>/dev/null || true
groupmod -o -g "$PGID" appuser 2>/dev/null || true
# Set permissive umask so created files (config.yaml, mute/ignore JSON)
# are readable/writable by group and others (ownership handles access control)
umask 0022
# Drop privileges and run as appuser
exec gosu appuser "$@"