mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-12 12:02:09 +08:00
Tweak: skip chown operations when running as root (#6170)
Some checks failed
Crowdin Action / Crowdin Sync (push) Has been cancelled
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Repository Maintenance / Stale (push) Has been cancelled
Repository Maintenance / Lock Old Threads (push) Has been cancelled
Repository Maintenance / Close Answered Discussions (push) Has been cancelled
Repository Maintenance / Close Outdated Discussions (push) Has been cancelled
Repository Maintenance / Close Unsupported Feature Requests (push) Has been cancelled
Some checks failed
Crowdin Action / Crowdin Sync (push) Has been cancelled
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Repository Maintenance / Stale (push) Has been cancelled
Repository Maintenance / Lock Old Threads (push) Has been cancelled
Repository Maintenance / Close Answered Discussions (push) Has been cancelled
Repository Maintenance / Close Outdated Discussions (push) Has been cancelled
Repository Maintenance / Close Unsupported Feature Requests (push) Has been cancelled
This commit is contained in:
@@ -22,7 +22,9 @@ if [ "$HOSTNAME" = "::" ]; then
|
||||
fi
|
||||
|
||||
# Check ownership before chown
|
||||
if [ -e /app/config ]; then
|
||||
if [ "$PUID" = "0" ]; then
|
||||
echo "Skipping ownership changes for /app/config"
|
||||
elif [ -e /app/config ]; then
|
||||
CURRENT_UID=$(stat -c %u /app/config)
|
||||
CURRENT_GID=$(stat -c %g /app/config)
|
||||
|
||||
@@ -39,7 +41,9 @@ else
|
||||
fi
|
||||
|
||||
# Ensure /app/config/logs exists and is owned
|
||||
if [ -n "$PUID" ] && [ -n "$PGID" ]; then
|
||||
if [ "$PUID" = "0" ]; then
|
||||
echo "Skipping ownership changes for /app/config/logs"
|
||||
elif [ -n "$PUID" ] && [ -n "$PGID" ]; then
|
||||
mkdir -p /app/config/logs 2>/dev/null || true
|
||||
if [ -d /app/config/logs ]; then
|
||||
LOG_UID=$(stat -c %u /app/config/logs)
|
||||
|
||||
Reference in New Issue
Block a user