Skip to content

improve self-hosting permission handling#1072

Open
Onatcer wants to merge 4 commits into
mainfrom
feature/docker_runtime_uid_remap
Open

improve self-hosting permission handling#1072
Onatcer wants to merge 4 commits into
mainfrom
feature/docker_runtime_uid_remap

Conversation

@Onatcer
Copy link
Copy Markdown
Contributor

@Onatcer Onatcer commented May 11, 2026

This PR adds support for remapping UID/GID at runtime to improve the file permission handling on certain systems.
Until now the image only supported UID 1000 in practice. Docker's --user override accepted other UIDs but several writable paths weren't set up for them, causing Laravel to fail on startup. By adding PUID/PGID (which default to 1000:1000) we now allow users to customize the user. This is especially helpful for users on NAS systems (Synology, TrueNAS...) and also Portainer who do not follow the linux convention of having the first non-root user as UID 1000.

To achieve this we start the container as root by default just for the init and then immediately drop to the desired user by the env arguments (or to 1000:1000 by default). This is a common pattern for self-hosting containers.

This change will make sure that containers that are started as a non-root user (because of a user/runAsUser override) will run as this non-root user. If you need to have the container running as root you can set SOLIDTIME_DROP_PRIVILEGES=never

We also check for the bootstrap directories at startup now and make sure they exist, rather than only in the build step. This fixes bind mounts and K8s PVCs with missing directory structure.

TODO:

[] drop the user overrides in the docker compose examples
[] update docs

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.70%. Comparing base (b73aa54) to head (595132e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1072      +/-   ##
============================================
+ Coverage     88.63%   88.70%   +0.06%     
  Complexity     1875     1875              
============================================
  Files           275      275              
  Lines          9817     9753      -64     
============================================
- Hits           8701     8651      -50     
+ Misses         1116     1102      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread .github/workflows/image-smoke-test.yml Fixed
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.

2 participants