feat(lyra): open Tdarr server and web UI ports for LAN clients #375
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!375
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lyra-tdarr-lan-exposure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #372 (milestone: Lyra Tdarr LAN Exposure).
Lyra's Tdarr server already binds to
0.0.0.0; only the Nebulanebula.meshfirewall 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 checkpasses on the branch, including theservice-exposurecheck (the check was updated in the same change, so it enforces the new policy rather than the old one).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 = 8265Not yet run
just teston Lyra:sudois 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.Automated code review
Reviewed commit:
567764bd7d6db75031928b001613fd3b78fa8be1Verdict: 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.nixsetsservices.tdarr.server.openFirewall = true(line 149) while keepingserverIP = "0.0.0.0"and the unchangednetworking.firewall.interfaces."nebula.mesh".allowedTCPPortslist 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) definesserverPortdefault 8266,webUIPortdefault 8265, and implementsnetworking.firewall.allowedTCPPorts = lib.mkIf cfg.server.openFirewall [ serverPort webUIPort ];, so the new positive assertionlib.all (port: allowsPort firewall port) lanOpenPortsin scripts/check-service-exposure.nix is satisfiable and the removal of the Tdarr ports fromrestrictedPortsis 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
hosts/lyra/default.nix:149 sets
openFirewall = true;and never setsservices.tdarr.server.auth.enable. The upstream module declaresauth.enablewithdefault = false;and implementsnetworking.firewall.allowedTCPPorts = lib.mkIf cfg.server.openFirewall [ cfg.server.serverPort cfg.server.webUIPort ];withserverPortdefault 8266 (the API) andwebUIPortdefault 8265. scripts/check-service-exposure.nix now asserts both ports are present in the generalfirewall.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 = trueplus anenvironmentFilesupplyingauthSecretKey/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
Questions
restrictedPorts, so thenonMeshInterfacesnegative 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 andnebula.meshonly?just teston Lyra as the canary before switching; was that run performed, since the change alters a deployed host's firewall behaviour?Review limitations
nix flake check,nix eval, andjust testwere not run, so the assertions in scripts/check-service-exposure.nix were read and reasoned about, not observed to pass.Diff coverage
README.md: reviewed — included in a context-limited batchhosts/lyra/default.nix: reviewed — included in a context-limited batchscripts/check-service-exposure.nix: reviewed — included in a context-limited batchReview metadata
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 = truenecessarily 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. Enablingservices.tdarr.server.auth.enablewould also gate the mesh clients and Lyra's own nodes, which is a wider behaviour change than was requested. The intent is recorded inscripts/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 —
nonMeshInterfacesno 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 newlanOpenPortsassertion pins the intended state instead.Question — was
just testrun? No.sudois unavailable in the agent sandbox on this host, so the canary is outstanding.nix flake checkpassed on the branch including the updatedservice-exposurecheck, and the evaluated Lyra config showsnetworking.firewall.allowedTCPPorts = [ 22 8265 8266 10200 10300 50300 ]withnebula.meshstill carrying 8265/8266. Please runjust teston Lyra before switching; the change is a firewall option only and reverts with a normal generation rollback.