Skip to content

Fix root-owned file/directory creation on host mounts#11

Open
Icenova20 wants to merge 1 commit intoRandomNinjaAtk:mainfrom
Icenova20:feature/fix-root-permissions
Open

Fix root-owned file/directory creation on host mounts#11
Icenova20 wants to merge 1 commit intoRandomNinjaAtk:mainfrom
Icenova20:feature/fix-root-permissions

Conversation

@Icenova20
Copy link
Contributor

Description

This PR addresses an issue where scripts running inside the container create directories and files
(logs, search records, and download folders) as the root user. In many setups, these paths are mapped
to host volumes, leading to Permission Denied errors for the main Arr applications
(Sonarr/Radarr/Lidarr) which typically run as a non-root user (UID 1000).

Changes

  • Added chown calls after every mkdir and touch command across all 9 scripts.
  • Updated logfileSetup to ensure log files created by the container are owned by the correct user.
  • Utilized ${PUID:-1000} and ${PGID:-1000} to respect Docker environment variables.

Note on Defaults

I have used 1000:1000 as the fallback default as it is the standard for most Docker home-server
environments (LinuxServer.io, hotio, etc.). I recognize that this default may not apply to every
system (e.g., Synology or custom UID setups), but by utilizing the environment variables, users can
easily override this in their docker-compose.yml or environment config without modifying the scripts.

Modified logfileSetup and directory creation to use chown with PUID/PGID environment variables, preventing root-owned files on host mounts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant