Fix alpine issue

This commit is contained in:
Chris Veleris 2025-12-06 09:23:40 +02:00
parent c1dd4c3814
commit b950418f4a

View file

@ -39,15 +39,15 @@ set_db_file_permissions() {
if [ "$CURRENT_UID" != "$PUID" ] || [ "$CURRENT_GID" != "$PGID" ]; then if [ "$CURRENT_UID" != "$PUID" ] || [ "$CURRENT_GID" != "$PGID" ]; then
echo "Configuring user permissions..." echo "Configuring user permissions..."
userdel app 2>/dev/null || true deluser app 2>/dev/null || true
groupdel app 2>/dev/null || true delgroup app 2>/dev/null || true
if getent group "$PGID" >/dev/null 2>&1; then if getent group "$PGID" >/dev/null 2>&1; then
TARGET_GROUP=$(getent group "$PGID" | cut -d: -f1) TARGET_GROUP=$(getent group "$PGID" | cut -d: -f1)
echo "Using existing group '$TARGET_GROUP' with GUID $PGID" echo "Using existing group '$TARGET_GROUP' with GUID $PGID"
else else
# Create group "app" with our target group id # Create group "app" with our target group id
groupadd -g "$PGID" app addgroup -g "$PGID" app
TARGET_GROUP="app" TARGET_GROUP="app"
echo "Created 'app' group with GID: $PGID" echo "Created 'app' group with GID: $PGID"
fi fi
@ -57,7 +57,7 @@ if [ "$CURRENT_UID" != "$PUID" ] || [ "$CURRENT_GID" != "$PGID" ]; then
echo "Using existing user '$TARGET_USER' with UID $PUID" echo "Using existing user '$TARGET_USER' with UID $PUID"
else else
# Create user "app" with our target user id # Create user "app" with our target user id
useradd -m -u "$PUID" -g "$TARGET_GROUP" app adduser -D -u "$PUID" -G "$TARGET_GROUP" app
echo "Created 'app' user with UID: $PUID" echo "Created 'app' user with UID: $PUID"
TARGET_USER=app TARGET_USER=app
fi fi