Lychee versionv7.7.1 Did you check the latest Lychee version?Yes, I did Which PHP version are you using?PHP 8.5 Detailed description of the problemBug: custom CSS/JS saves fail in Docker when PUID≠33 The problem When running Lychee in Docker with PUID=1000, saving custom CSS via Settings → Custom CSS & JS silently fails with "Could not save CSS". The same applies to custom JS. Root cause 05-permissions-check.sh chowns directories in /app/public/dist to www-data, but not files e.g. # Current — directories only user.css and custom.js are created inside the image with uid 33 (the Debian default for www-data). When PUID=1000, the entrypoint remaps www-data to uid 1000, so the PHP process runs as uid 1000 — but the files are still owned by uid 33. The PHP process can read them but cannot write to them. SettingsController::setCSS fails silently and the UI shows a generic error toast. A secondary consequence: because these are files inside the container, they reset on container recreation unless a volume mount is added manually — easy to miss and not in the default compose files. Fix Add a matching chown for files in 05-permissions-check.sh: find /app/public/dist -type f ( ! -user "www-data" -o ! -group "www-data" ) \ This mirrors the pattern already used for /app/storage and /app/bootstrap/cache. Longer-term consideration Is it worth considering whether user.css and custom.js should be stored in the database alongside every other Lychee config, rather than as files. That would eliminate both the permission issue and the persistence problem entirely — but that's a bigger change. The one-liner above solves the immediate problem. Steps to reproduce the issuePrerequisites: Lychee running in Docker with PUID=1000 and no volume mount for user.css.
To confirm the root cause: The file will show uid 33 as owner, while the PHP process runs as uid 1000 as shown below: Expected: CSS is saved and applied on next page load Actual: Save fails silently; user.css remains unchanged The error is logged in /app/storage/logs/daily-*.log inside the container. Diagnostics [REQUIRED]Browser & System [REQUIRED]Ubuntu 22.04.5 LTS (Jammy Jellyfish), kernel 6.8.0-124-generic. Chrome Version 138.0.7204.157 (Official Build) (64-bit) Please confirm (incomplete submissions will not be addressed)
|
#4580