Skip to content

fix(dockerfile): normalize wwwroot permissions so the non-root runtime user can read static files#604

Draft
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:fix/wwwroot-permissions
Draft

fix(dockerfile): normalize wwwroot permissions so the non-root runtime user can read static files#604
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:fix/wwwroot-permissions

Conversation

@kevinheneveld
Copy link
Copy Markdown

Summary

Drafted for visibility per the pacing note on #590 — happy to leave this in draft until you have time.

The Docker final stage copies /app/publish from the build stage but doesn't normalize permissions on /app/wwwroot/*. Depending on the build host's umask and the source files' modes, the non-root runtime user (listenarr) can hit EACCES reading individual static assets — typically manifests itself as 403/404 on a subset of bundled FE files (e.g., a single chunk fails to load and the SPA boots into a blank screen).

Fix: add a single Dockerfile step right after COPY --from=build /app/publish . that walks /app/wwwroot and sets directories to 755 and files to 644. Matches the conventional mode for served static content and is no-op on most build hosts.

# Normalize frontend asset permissions so the non-root runtime user can read static files.
RUN find /app/wwwroot -type d -exec chmod 755 {} \; \
    && find /app/wwwroot -type f -exec chmod 644 {} \;

Test plan

  • Image builds clean on linux/amd64
  • Verified on a downstream deploy: a previously-403'd assets/*.js chunk now serves correctly under the listenarr user without root override.

🤖 Generated with Claude Code

kevinheneveld pushed a commit to kevinheneveld/Listenarr that referenced this pull request May 18, 2026
…rafting

State on top of the post-rebase baseline:
  - 5 more commits on kevin/live (preview button, hydrated audiobook,
    publish-date normalize, image-500 fix, modal z-index prop)
  - PR Listenarrs#600 + Listenarrs#603 opened (defensive fixes, non-draft)
  - PR Listenarrs#604 + Listenarrs#605 opened as drafts (wave 1 of the staggered
    feature-PR queue per Kevin's pacing instruction)
  - Issue #5 filed for LibriVox metadata source (deferred)
  - 8 features on kevin/live still without an upstream PR — queued
    with a per-day schedule

Live image: listenarr:local-20260517-1651 (head a712b49).
Two-step rollback: 1634 → 1617.
@kevinheneveld kevinheneveld force-pushed the fix/wwwroot-permissions branch from 440ba2b to cac533e Compare May 19, 2026 16:13
kevinheneveld pushed a commit to kevinheneveld/Listenarr that referenced this pull request May 19, 2026
…rafting

State on top of the post-rebase baseline:
  - 5 more commits on kevin/live (preview button, hydrated audiobook,
    publish-date normalize, image-500 fix, modal z-index prop)
  - PR Listenarrs#600 + Listenarrs#603 opened (defensive fixes, non-draft)
  - PR Listenarrs#604 + Listenarrs#605 opened as drafts (wave 1 of the staggered
    feature-PR queue per Kevin's pacing instruction)
  - Issue #5 filed for LibriVox metadata source (deferred)
  - 8 features on kevin/live still without an upstream PR — queued
    with a per-day schedule

Live image: listenarr:local-20260517-1651 (head a712b49).
Two-step rollback: 1634 → 1617.
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