2026-04-04 00:16:41 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -e
|
|
|
|
|
|
2026-04-15 18:13:23 +08:00
|
|
|
# Apply auth defaults at runtime so they are never baked into image layers.
|
|
|
|
|
# Users can override any of these via -e flags at docker run time.
|
|
|
|
|
export AUTH_ENABLED="${AUTH_ENABLED:-true}"
|
|
|
|
|
export DEFAULT_USERNAME="${DEFAULT_USERNAME:-admin}"
|
|
|
|
|
export DEFAULT_PASSWORD="${DEFAULT_PASSWORD:-admin}"
|
|
|
|
|
|
2026-04-14 20:55:42 +08:00
|
|
|
# Fix ownership of mounted volumes so the non-root ashim user can write.
|
|
|
|
|
# This runs as root, fixes permissions, then drops to ashim via gosu.
|
2026-04-04 00:16:41 +08:00
|
|
|
if [ "$(id -u)" = "0" ]; then
|
2026-04-14 20:55:42 +08:00
|
|
|
chown -R ashim:ashim /data /tmp/workspace 2>&1 || \
|
2026-04-16 23:45:02 +08:00
|
|
|
echo "WARNING: Could not fix volume permissions. Use named volumes (not Windows bind mounts) to avoid this. See docs for details." >&2
|
2026-04-14 20:55:42 +08:00
|
|
|
exec gosu ashim "$@"
|
2026-04-04 00:16:41 +08:00
|
|
|
fi
|
|
|
|
|
|
2026-04-14 20:55:42 +08:00
|
|
|
# Already running as ashim (e.g. Kubernetes runAsUser)
|
2026-04-04 00:16:41 +08:00
|
|
|
exec "$@"
|