- Fix issues with cache dir
GoReleaser / goreleaser (push) Has been cancelled
Release Docker Build / docker (push) Has been cancelled

- Fix responsiveness issue with navbars
- Support user entry for users running as non-root
- Other minor fixes
This commit is contained in:
Mukhtar Akere
2025-08-12 15:14:42 +01:00
parent a0e9f7f553
commit 742d8fb088
10 changed files with 132 additions and 29 deletions
+33 -1
View File
@@ -4,6 +4,38 @@ set -e
# Default values
PUID=${PUID:-1000}
PGID=${PGID:-1000}
UMASK=${UMASK:-022}
# Set umask
umask "$UMASK"
# Function to create directories and files
setup_directories() {
# Ensure directories exist
mkdir -p /app/logs /app/cache 2>/dev/null || true
# Create log file if it doesn't exist
touch /app/logs/decypharr.log 2>/dev/null || true
# Try to set permissions if possible
chmod 755 /app 2>/dev/null || true
chmod 666 /app/logs/decypharr.log 2>/dev/null || true
}
# Check if we're running as root
if [ "$(id -u)" != "0" ]; then
echo "Running as non-root user $(id -u):$(id -g) with umask $UMASK"
# Try to create directories as the current user
setup_directories
export USER="$(id -un)"
export HOME="/app"
exec "$@"
fi
echo "Running as root, setting up user $PUID:$PGID with umask $UMASK"
# Create group if it doesn't exist
if ! getent group "$PGID" > /dev/null 2>&1; then
@@ -19,7 +51,7 @@ fi
USERNAME=$(getent passwd "$PUID" | cut -d: -f1)
GROUPNAME=$(getent group "$PGID" | cut -d: -f1)
# Ensure directories exist and have correct permissions
# Create directories and set proper ownership
mkdir -p /app/logs /app/cache
chown -R "$PUID:$PGID" /app
chmod 755 /app