fix: initcfg dead code — chdir/no-crt directives never applied at runtime #6

Closed
opened 2026-11-04 16:21:27 +00:00 by wazolab · 0 comments
Owner

Bug

The Dockerfile creates /app/code/initcfg with critical directives:

[global]
  chdir: /app/data/state
  no-crt

% /app/data/cfg

But start.sh launches copyparty with -c /app/data/cfg/copyparty.conf only — initcfg is never passed to the process.

Consequences

  • chdir: /app/data/state not applied → copyparty uses its CWD = /app/code (read-only at runtime) to write its SQLite index and state files → crash on first indexing operation (e2dsa / e2ts flags enabled)
  • no-crt not applied → copyparty attempts TLS certificate generation in /app/code → same read-only crash
  • % /app/data/cfg not applied → the user config directory include is ignored

Fix

Change the launch command in start.sh to:

exec /usr/local/bin/gosu cloudron:cloudron python3 -m copyparty \\
    -c /app/code/initcfg \\
    -p 3923 \\
    --rproxy 1 \\
    --xff-src "${CLOUDRON_PROXY_IP:-172.18.0.1}"

This way initcfg applies chdir, no-crt, and includes /app/data/cfg (which contains the user config written on first run).

References

Cloudron packaging rule: "Treat the filesystem as readonly at runtime. Write only to /tmp, /run, and /app/data"

## Bug The Dockerfile creates `/app/code/initcfg` with critical directives: ``` [global] chdir: /app/data/state no-crt % /app/data/cfg ``` But `start.sh` launches copyparty with `-c /app/data/cfg/copyparty.conf` only — `initcfg` is **never passed** to the process. ## Consequences - **`chdir: /app/data/state` not applied** → copyparty uses its CWD = `/app/code` (read-only at runtime) to write its SQLite index and state files → crash on first indexing operation (`e2dsa` / `e2ts` flags enabled) - **`no-crt` not applied** → copyparty attempts TLS certificate generation in `/app/code` → same read-only crash - **`% /app/data/cfg` not applied** → the user config directory include is ignored ## Fix Change the launch command in `start.sh` to: ```bash exec /usr/local/bin/gosu cloudron:cloudron python3 -m copyparty \\ -c /app/code/initcfg \\ -p 3923 \\ --rproxy 1 \\ --xff-src "${CLOUDRON_PROXY_IP:-172.18.0.1}" ``` This way `initcfg` applies `chdir`, `no-crt`, and includes `/app/data/cfg` (which contains the user config written on first run). ## References Cloudron packaging rule: *"Treat the filesystem as readonly at runtime. Write only to `/tmp`, `/run`, and `/app/data`"*
wazolab self-assigned this 2026-11-04 16:21:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
wazolab/cloudron-copyparty#6
No description provided.