Skip to content

feat(media): add Navidrome to stacks/media, with its state in the NAS pull - #628

Merged
Gerrrt merged 5 commits into
mainfrom
gerrrt/github-issue-141-e0d8aa
Sep 22, 2026
Merged

Gerrrt merged 5 commits into
mainfrom
gerrrt/github-issue-141-e0d8aa

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Refs #141. This PR authors Navidrome into stacks/media. It does not deploy it, so the issue stays open until the service is running on smaug and the fifth pass exists.

What changes

  • stacks/media/compose.yaml, .env.example: a navidrome service in the stack's existing shape: digest-pinned, uid 65534, read_only, cap_drop: ALL and a 1 GiB ceiling. It publishes 4533. It gets /data as a bind mount on erebor/apps/navidrome/data and /music read-only from erebor/media/music. Everything non-obvious comes from a scratch boot of the pinned image, and the comments record it:
    • The image has no /cache. With a root named volume mounted there, the process aborts a second after it reports ready, so /cache is a tmpfs owned by 65534.
    • ND_PLUGINS_ENABLED=false stops it creating a 0700 /data/plugins.
    • /ping answers 200 before any admin exists, so the healthcheck can't deadlock on first boot.
    • Idle RSS is 49 MiB.
  • Admin credential: navidrome user create --admin, run from the TrueNAS shell right after up. After that, the web form that would hand the admin to the first visitor answers 403. The stack still has no secrets file, per stacks/media has no secrets file: Jellyfin's admin credential lives only in a password manager #528.
  • Firewall: a fifth pass, 50 → 10.0.40.30:4533. The issue said no rule was needed, but Media tier: Jellyfin — placement answers the terminal-VLAN problem #138's passes are port-scoped (443 and 8096) and the phones are on Hicks. It is written into build-the-nas.md §0.5 and was created on 2026-09-22, ahead of the deploy (§6.5 step 1). It sits directly under Allow 8096 to smaug on Hicks. pfctl -sr -vv reads https, 8096, 4533 and then the block, the monitoring host is refused on 4533, and the igc0.40 tripwire reads 0 packets.
  • Backup: scripts/backup-nas.sh now pulls two archives from one snapshot, jellyfin-config and navidrome-data:
    • It sizes both before transferring either, and names a directory the snapshot doesn't have.
    • It verifies each set against its own MANIFEST, so the one-archive sets already retained stay valid.
    • backup-volumes.sh gains navidrome-data's sentinel and companions.
    • §6.3's restore now covers both archives.
  • Docs: the media README, runbooks, roadmap and changelog.

Verified

  • scripts/validate.sh: all checks pass (3 skipped, the usual worktree skips). The media health probe ran wget inside the pinned Navidrome image.
  • The real navidrome service block, booted against scratch paths: healthy as 65534, /ping 200, no plugins directory in /data.
  • backup-nas.sh bench-run over real ssh against a fake snapshot tree on oracle:
    • A two-archive set was written and verified, with two MANIFEST rows.
    • --verify-only --all passed on a legacy one-archive set beside it.
    • A snapshot without navidrome/data failed by name before any set directory was created.

Deploy notes (after merge, by hand)

🤖 Generated with Claude Code

Gerrrt and others added 5 commits September 22, 2026 22:22
… pull

Navidrome joins Jellyfin on smaug as the tier's music server. It speaks
the Subsonic API, so its clients are existing phone apps. The service
shape comes from a scratch boot of the pinned image (0.64.1):

- It runs as 65534, read-only, with cap_drop ALL. The image declares no
  user.
- /cache is a 65534-owned tmpfs. The image has no /cache, and a root
  named volume there aborts the process a second after it reports ready.
- Plugins are off, which keeps a 0700 /data/plugins out of what the
  backup user reads.
- The wget healthcheck hits /ping, which answers 200 before any admin
  exists.
- The admin is created with `navidrome user create --admin` from the
  TrueNAS shell. After that the web form that hands it to the first
  visitor answers 403. There is still no secrets file (#528).

The issue said no new firewall rule was needed. The 50 -> 40 it relied
on is two port-scoped passes, 443 and 8096, and the phones are on Hicks.
So a fifth pass, 50 -> 10.0.40.30:4533, is written into build-the-nas
§0.5, and the new §6.5 creates it along with the deploy.

Navidrome's database holds playlists and play counts, so it is backed up
the way Jellyfin's watch history is. backup-nas.sh now pulls two
archives, jellyfin-config and navidrome-data, from one snapshot. It
sizes both before transferring either, and names a directory missing
from the snapshot. It verifies each set against its own MANIFEST, so
the one-archive sets already retained stay valid.

Authored, not deployed: the deploy waits on the mirror being whole
(#558).

Refs #141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Allow 4533 to smaug now exists on Hicks (opt2 / igc0.50), directly under
Allow 8096 to smaug and above Block access to CasaBonita. It was inserted
from morpheus's shell as a copy of the 8096 rule with the port changed,
and saved as a config revision named for #141.

`pfctl -sr -vv` reads https, 8096, 4533 and then the block on igc0.50.
The monitoring host is refused on 4533, and the igc0.40 tripwire reads 0
packets. The rule came before the service because a pass to a port with
no listener opens nothing. The rest of §6.5 still waits on #558.

Refs #141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#629 and this branch each rewrote the same files for a second media
service. Main's side is the base and Navidrome is added on top of it:

- backup-nas.sh is #629's table, including its pending/required state.
  navidrome-data joins it as a pending row. This branch's own two-archive
  rewrite is dropped.
- backup-volumes.sh gains the navidrome-data sentinel and companions in
  #629's version of the tables.
- compose.yaml and .env.example carry all four services.
- build-the-nas.md keeps §6.5 for Audiobookshelf. Navidrome's steps move
  to §6.6 and use the same pending -> required flip, which replaces the
  Saturday-ordering hazard this branch used to document.
- Passes are named by port. 4533 exists as of 2026-09-22, so it is the
  fifth. 13378, which ADR-0050 calls the fifth, will be the sixth.

Refs #141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit c2b4f5b into main Sep 22, 2026
3 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/github-issue-141-e0d8aa branch September 22, 2026 23:00
Gerrrt added a commit that referenced this pull request Sep 22, 2026
Navidrome took build-the-nas.md §6.6 first, so version collection is
§6.7 and every reference this branch added moves with it. Changelog:
both 2026-09-22 entries kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt Gerrrt mentioned this pull request Sep 26, 2026
3 tasks
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.

1 participant