mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-24 05:48:08 +08:00
Tweak: Improve ownership check and chown handling for .next dir (#5513)
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:
@@ -44,9 +44,15 @@ fi
|
||||
|
||||
if [ -d /app/.next ]; then
|
||||
CURRENT_UID=$(stat -c %u /app/.next)
|
||||
if [ "$CURRENT_UID" -ne "$PUID" ]; then
|
||||
CURRENT_GID=$(stat -c %g /app/.next)
|
||||
|
||||
if [ "$PUID" -ne 0 ] && ([ "$CURRENT_UID" -ne "$PUID" ] || [ "$CURRENT_GID" -ne "$PGID" ]); then
|
||||
echo "Fixing ownership of /app/.next"
|
||||
chown -R "$PUID:$PGID" /app/.next || echo "Warning: Could not chown /app/.next"
|
||||
if ! chown -R "$PUID:$PGID" /app/.next 2>/dev/null; then
|
||||
echo "Warning: Could not chown /app/.next; continuing anyway"
|
||||
fi
|
||||
else
|
||||
echo "/app/.next already owned by correct UID/GID or running as root, skipping chown"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user