5 Commits

Author SHA1 Message Date
Christian Dielitz db192989c1 fix(docker) Fix start up for non root users 2026-06-17 09:02:57 +02:00
Claude d32ec359cd perf(docker): skip recursive chown when volume is already owned
The entrypoint ran "chown -R" on the storage volume on every container
start. Storage is a content-addressable blob store that can hold millions
of objects, so a blind recursive chown re-stats and rewrites the inode of
every blob on each boot, adding minutes of startup time and saturating the
disk on spinning media.

Guard the chown behind a top-level ownership check: only recurse when the
directory root is not already owned by the oxicloud user. The first boot
fixes a freshly mounted (root-owned) volume; every later boot is a no-op.
The same guard is applied to the static dir, factored into a shared helper.
The target UID is resolved via "id -u oxicloud" instead of hardcoding 1001.

https://claude.ai/code/session_01GpprjxjtXFYLfXNkoKnHuL
2026-06-10 08:41:14 +00:00
Christian Dielitz e06e9c8b09 Adjusted entrypoint.sh to be posix conform 2026-05-29 16:51:05 +02:00
Christian Dielitz e87447f4e4 fix(docker) set file permissions only when running as root 2026-05-25 17:12:08 +02:00
Dionisio 6ca1ac4294 fix: resolve Docker volume permission denied on startup
Root cause: Docker named volumes are created as root, but the container
ran as the unprivileged 'oxicloud' user (UID 1001). Services like
thumbnail_service, image_transcode, and dedup_service call
create_dir_all under /app/storage during initialization, which fails
with 'Permission denied (os error 13)'.

Changes:
- Add entrypoint.sh that runs as root to chown /app/storage, then
  drops privileges via su-exec before executing the application
- Update Dockerfile to install su-exec, copy entrypoint, and use
  ENTRYPOINT instead of USER+CMD
- Downgrade id_mapping_service initial write failure from ERROR to WARN
  (empty in-memory map is perfectly valid, will persist on next save)
- Improve panic message in main.rs to hint at Docker permission issue

Fixes #<issue>
2026-02-12 09:57:33 +01:00