feat(lyra): open Tdarr server and web UI ports for LAN clients #375

Merged
nimmo merged 1 commit from feat/lyra-tdarr-lan-exposure into main 2026-10-19 12:22:07 +01:00
Owner

Closes #372 (milestone: Lyra Tdarr LAN Exposure).

Lyra's Tdarr server already binds to 0.0.0.0; only the Nebula nebula.mesh firewall interface exposed its ports, so LAN clients could not reach the Tdarr UI (8265) or API (8266). This opens both ports in the general firewall as well.

Validation

  • nix flake check passes on the branch, including the service-exposure check (the check was updated in the same change, so it enforces the new policy rather than the old one).
  • Evaluated Lyra config (dirty working tree on this branch) reports:
    • networking.firewall.allowedTCPPorts = [ 22 8265 8266 10200 10300 50300 ]
    • networking.firewall.interfaces."nebula.mesh".allowedTCPPorts = [ 6767 8265 8266 11434 ]
    • services.tdarr.server.openFirewall = true, serverPort = 8266, webUIPort = 8265
  • Mesh access for the Vega and Nova nodes and loopback addressing for Lyra's own nodes are unchanged.

Not yet run

just test on Lyra: sudo is unavailable in the agent sandbox, so the operator should run it as the canary before switching. This change is a firewall option only - no disk, secret, or service-ownership state is mutated, so a normal generation rollback reverts it.

Closes #372 (milestone: Lyra Tdarr LAN Exposure). Lyra's Tdarr server already binds to `0.0.0.0`; only the Nebula `nebula.mesh` firewall interface exposed its ports, so LAN clients could not reach the Tdarr UI (8265) or API (8266). This opens both ports in the general firewall as well. ## Validation - `nix flake check` passes on the branch, including the `service-exposure` check (the check was updated in the same change, so it enforces the new policy rather than the old one). - Evaluated Lyra config (dirty working tree on this branch) reports: - `networking.firewall.allowedTCPPorts = [ 22 8265 8266 10200 10300 50300 ]` - `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts = [ 6767 8265 8266 11434 ]` - `services.tdarr.server.openFirewall = true`, `serverPort = 8266`, `webUIPort = 8265` - Mesh access for the Vega and Nova nodes and loopback addressing for Lyra's own nodes are unchanged. ## Not yet run `just test` on Lyra: `sudo` is unavailable in the agent sandbox, so the operator should run it as the canary before switching. This change is a firewall option only - no disk, secret, or service-ownership state is mutated, so a normal generation rollback reverts it.
feat(lyra): open Tdarr server and web UI ports for LAN clients
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m28s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 6m27s
567764bd7d
Lyra's Tdarr server already binds to 0.0.0.0, but the firewall only opened
its ports on the Nebula mesh interface, so LAN clients could not reach the
UI or API. Set services.tdarr.server.openFirewall = true and update the
service-exposure policy check plus the README fleet summary to match.

Mesh access is unchanged: the nebula.mesh interface rules still allow both
ports for the Vega and Nova nodes, and Lyra's own nodes keep using loopback.
clankbot left a comment

Automated code review

Reviewed commit: 567764bd7d6db75031928b001613fd3b78fa8be1

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

The three changed files are internally consistent. Verified against the checked-out code: hosts/lyra/default.nix sets services.tdarr.server.openFirewall = true (line 149) while keeping serverIP = "0.0.0.0" and the unchanged networking.firewall.interfaces."nebula.mesh".allowedTCPPorts list that still carries webUIPort/serverPort/ollama.port (hosts/lyra/default.nix:212). The upstream nixpkgs Tdarr server module (nixos/modules/services/misc/tdarr/server.nix in the Nix store) defines serverPort default 8266, webUIPort default 8265, and implements networking.firewall.allowedTCPPorts = lib.mkIf cfg.server.openFirewall [ serverPort webUIPort ];, so the new positive assertion lib.all (port: allowsPort firewall port) lanOpenPorts in scripts/check-service-exposure.nix is satisfiable and the removal of the Tdarr ports from restrictedPorts is exactly what the now-open general firewall requires. meshPorts = lanOpenPorts ++ [ ollama.port ] keeps the mesh-interface assertion intact, the loopback/node-serverURL assertions are untouched, and the README fleet paragraph matches the new policy. No evaluation or assertion defect is evident. One consequence of the widened exposure is worth operator review.

Blocking findings

None.

Important findings

None.

Suggestions

  • General-firewall opening exposes the unauthenticated Tdarr API (8266) to all LAN clients, not only the web UI (hosts/lyra/default.nix:149; medium confidence)
    hosts/lyra/default.nix:149 sets openFirewall = true; and never sets services.tdarr.server.auth.enable. The upstream module declares auth.enable with default = false; and implements networking.firewall.allowedTCPPorts = lib.mkIf cfg.server.openFirewall [ cfg.server.serverPort cfg.server.webUIPort ]; with serverPort default 8266 (the API) and webUIPort default 8265. scripts/check-service-exposure.nix now asserts both ports are present in the general firewall.allowedTCPPorts.
    Impact: The stated goal is UI browsing from LAN clients, but the module has no per-port option, so the Tdarr server API port 8266 becomes reachable and usable without authentication from any LAN client, in addition to the pre-existing mesh-interface exposure. Any LAN device can drive library/transcode operations, not just view the UI.
    Suggested fix: If unauthenticated LAN control is not acceptable, pair the change with services.tdarr.server.auth.enable = true plus an environmentFile supplying authSecretKey/seededApiKey (SOPS-backed), or record in the private firewall/security notes that the API port is intentionally LAN-open; the check script already encodes the latter as policy.

Tests and validation

  • No configured deterministic checks.

Questions

  • scripts/check-service-exposure.nix now drops the Tdarr ports from restrictedPorts, so the nonMeshInterfaces negative assertion no longer guards 8265/8266 against a stray per-interface declaration on a named physical interface. Is that acceptable because the general firewall already opens them by design, or should a separate assertion pin them to the general firewall and nebula.mesh only?
  • The PR notes describe running just test on Lyra as the canary before switching; was that run performed, since the change alters a deployed host's firewall behaviour?

Review limitations

  • No commands were executed: nix flake check, nix eval, and just test were not run, so the assertions in scripts/check-service-exposure.nix were read and reasoned about, not observed to pass.
  • The upstream Tdarr module behaviour was read from a nixpkgs source tree in the Nix store (nixos/modules/services/misc/tdarr/server.nix); I could not confirm that copy is byte-identical to the rev pinned in flake.lock (nixpkgs rev f20cd90e28fe0403873f473b29e42662cd86e8c4).
  • Runtime LAN reachability, Nebula overlay behaviour, and actual firewall rule output on Lyra were not observed; only the supplied diff and checked-out configuration were available.
  • No KiwiFS or wiki pages describing this fleet's firewall baseline were supplied, so the documented security baseline could not be compared against the new policy.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • scripts/check-service-exposure.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/hermes-fleet-ssh.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 1
  • Previous automated review: none found
  • Findings: 1
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `567764bd7d6db75031928b001613fd3b78fa8be1` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment The three changed files are internally consistent. Verified against the checked-out code: `hosts/lyra/default.nix` sets `services.tdarr.server.openFirewall = true` (line 149) while keeping `serverIP = "0.0.0.0"` and the unchanged `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts` list that still carries webUIPort/serverPort/ollama.port (hosts/lyra/default.nix:212). The upstream nixpkgs Tdarr server module (nixos/modules/services/misc/tdarr/server.nix in the Nix store) defines `serverPort` default 8266, `webUIPort` default 8265, and implements `networking.firewall.allowedTCPPorts = lib.mkIf cfg.server.openFirewall [ serverPort webUIPort ];`, so the new positive assertion `lib.all (port: allowsPort firewall port) lanOpenPorts` in scripts/check-service-exposure.nix is satisfiable and the removal of the Tdarr ports from `restrictedPorts` is exactly what the now-open general firewall requires. `meshPorts = lanOpenPorts ++ [ ollama.port ]` keeps the mesh-interface assertion intact, the loopback/node-serverURL assertions are untouched, and the README fleet paragraph matches the new policy. No evaluation or assertion defect is evident. One consequence of the widened exposure is worth operator review. ### Blocking findings None. ### Important findings None. ### Suggestions - **General-firewall opening exposes the unauthenticated Tdarr API (8266) to all LAN clients, not only the web UI** (hosts/lyra/default.nix:149; medium confidence) hosts/lyra/default.nix:149 sets `openFirewall = true;` and never sets `services.tdarr.server.auth.enable`. The upstream module declares `auth.enable` with `default = false;` and implements `networking.firewall.allowedTCPPorts = lib.mkIf cfg.server.openFirewall [ cfg.server.serverPort cfg.server.webUIPort ];` with `serverPort` default 8266 (the API) and `webUIPort` default 8265. scripts/check-service-exposure.nix now asserts both ports are present in the general `firewall.allowedTCPPorts`. Impact: The stated goal is UI browsing from LAN clients, but the module has no per-port option, so the Tdarr server API port 8266 becomes reachable and usable without authentication from any LAN client, in addition to the pre-existing mesh-interface exposure. Any LAN device can drive library/transcode operations, not just view the UI. Suggested fix: If unauthenticated LAN control is not acceptable, pair the change with `services.tdarr.server.auth.enable = true` plus an `environmentFile` supplying `authSecretKey`/`seededApiKey` (SOPS-backed), or record in the private firewall/security notes that the API port is intentionally LAN-open; the check script already encodes the latter as policy. ### Tests and validation - No configured deterministic checks. ### Questions - scripts/check-service-exposure.nix now drops the Tdarr ports from `restrictedPorts`, so the `nonMeshInterfaces` negative assertion no longer guards 8265/8266 against a stray per-interface declaration on a named physical interface. Is that acceptable because the general firewall already opens them by design, or should a separate assertion pin them to the general firewall and `nebula.mesh` only? - The PR notes describe running `just test` on Lyra as the canary before switching; was that run performed, since the change alters a deployed host's firewall behaviour? ### Review limitations - No commands were executed: `nix flake check`, `nix eval`, and `just test` were not run, so the assertions in scripts/check-service-exposure.nix were read and reasoned about, not observed to pass. - The upstream Tdarr module behaviour was read from a nixpkgs source tree in the Nix store (nixos/modules/services/misc/tdarr/server.nix); I could not confirm that copy is byte-identical to the rev pinned in flake.lock (nixpkgs rev f20cd90e28fe0403873f473b29e42662cd86e8c4). - Runtime LAN reachability, Nebula overlay behaviour, and actual firewall rule output on Lyra were not observed; only the supplied diff and checked-out configuration were available. - No KiwiFS or wiki pages describing this fleet's firewall baseline were supplied, so the documented security baseline could not be compared against the new policy. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `scripts/check-service-exposure.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/hermes-fleet-ssh.md, docs/nova-remote-builder.md, README.md - Commits considered: 1 - Previous automated review: none found - Findings: 1 </details>
Author
Owner

Automated-review assessment (head 567764bd):

Suggestion — unauthenticated Tdarr API (8266) reachable from LAN clients: assessed, not implemented as a code change. The upstream nixpkgs module has no per-port option, so openFirewall = true necessarily opens 8265 and 8266 together. Both ports were already unauthenticated and reachable from every Nebula mesh member before this change, so the LAN path is the same exposure class rather than a new one. Enabling services.tdarr.server.auth.enable would also gate the mesh clients and Lyra's own nodes, which is a wider behaviour change than was requested. The intent is recorded in scripts/check-service-exposure.nix (lanOpenPorts), in the README fleet summary, and in the private operator notes. If unauthenticated LAN control is not acceptable, say so and I will add SOPS-backed auth as a follow-up.

Question — nonMeshInterfaces no longer guards 8265/8266: accepted as-is. The general firewall opens both ports by design, so a stray per-interface declaration cannot widen access further; the new lanOpenPorts assertion pins the intended state instead.

Question — was just test run? No. sudo is unavailable in the agent sandbox on this host, so the canary is outstanding. nix flake check passed on the branch including the updated service-exposure check, and the evaluated Lyra config shows networking.firewall.allowedTCPPorts = [ 22 8265 8266 10200 10300 50300 ] with nebula.mesh still carrying 8265/8266. Please run just test on Lyra before switching; the change is a firewall option only and reverts with a normal generation rollback.

Automated-review assessment (head 567764bd): **Suggestion — unauthenticated Tdarr API (8266) reachable from LAN clients:** assessed, not implemented as a code change. The upstream nixpkgs module has no per-port option, so `openFirewall = true` necessarily opens 8265 and 8266 together. Both ports were already unauthenticated and reachable from every Nebula mesh member before this change, so the LAN path is the same exposure class rather than a new one. Enabling `services.tdarr.server.auth.enable` would also gate the mesh clients and Lyra's own nodes, which is a wider behaviour change than was requested. The intent is recorded in `scripts/check-service-exposure.nix` (`lanOpenPorts`), in the README fleet summary, and in the private operator notes. If unauthenticated LAN control is not acceptable, say so and I will add SOPS-backed auth as a follow-up. **Question — `nonMeshInterfaces` no longer guards 8265/8266:** accepted as-is. The general firewall opens both ports by design, so a stray per-interface declaration cannot widen access further; the new `lanOpenPorts` assertion pins the intended state instead. **Question — was `just test` run?** No. `sudo` is unavailable in the agent sandbox on this host, so the canary is outstanding. `nix flake check` passed on the branch including the updated `service-exposure` check, and the evaluated Lyra config shows `networking.firewall.allowedTCPPorts = [ 22 8265 8266 10200 10300 50300 ]` with `nebula.mesh` still carrying 8265/8266. Please run `just test` on Lyra before switching; the change is a firewall option only and reverts with a normal generation rollback.
nimmo merged commit f1acee0ba9 into main 2026-10-19 12:22:07 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
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
nimmo/nixos-config!375
No description provided.