Restrict administrative service access to local and Nebula paths #317

Merged
nimmo merged 4 commits from fix/issue-38-service-exposure into main 2026-10-12 14:57:28 +01:00
Owner

Lyra admitted administrative/media ports across physical interfaces after its SWAG routes were replaced by native Newt. Restrict Tdarr and Ollama to Nebula, bind Immich to loopback, and remove Jellyfin’s general HTTP opening and obsolete SWAG/wishlist/Beszel openings. Preserve host-local clients and existing Wyoming speech access. Nova’s unregistered NixOS draft defaults Ollama to loopback and drops its historical administrative-port list.

Related to #38; milestone: Security Hardening. Live Docker changes were applied separately in their existing Compose owners: Nova’s AI/media administrative ports and Lyra’s Stash are mesh-only; Signal is loopback-only with its private voice-pipeline route preserved. Compose validation, mesh/LAN probes, Pangolin routes, health checks, and no-op follow-ups passed. Existing dirty stack edits were preserved. Nova’s migrated PostgreSQL/Adminer deployment is excluded at the user’s instruction.

The evaluated-host guard checks global and physical-interface port lists/ranges, mesh openings for loopback-only backends, declared listener addresses, and every enabled local Tdarr node’s loopback URL. Ports derive from evaluated service options where available. Jellyfin’s verified 8096 target remains an external UI/Pangolin contract; the pinned NixOS module has no Jellyfin port option.

Validation: rebased onto main f131213 after MR #318; range-diff confirmed all four patches unchanged. Combined nix flake check and full Lyra build passed, as did injected exposure-regression rejection checks. Required MR CI passed on 1bcc2d7. Existing upstream Framework stdenv deprecation warnings are unrelated.

Native acceptance: operator completed just test-remote lyra twice, including the identical no-op follow-up. All seven affected native services are active. Tdarr/Ollama are reachable over Nebula and rejected on the physical LAN; Immich/Jellyfin backends reject direct mesh and LAN access while Pangolin routes return HTTP 200. Local and Vega Tdarr consumers work. Beszel remains active with fresh post-canary hub metrics via its outbound transport; no inbound 45876 listener is required. Evidence and review assessment are recorded in comments 3293 and 3294.

This MR does not close #38: test activation reverts on reboot. Persistent activation and its follow-up acceptance remain to be recorded.

Lyra admitted administrative/media ports across physical interfaces after its SWAG routes were replaced by native Newt. Restrict Tdarr and Ollama to Nebula, bind Immich to loopback, and remove Jellyfin’s general HTTP opening and obsolete SWAG/wishlist/Beszel openings. Preserve host-local clients and existing Wyoming speech access. Nova’s unregistered NixOS draft defaults Ollama to loopback and drops its historical administrative-port list. Related to #38; milestone: Security Hardening. Live Docker changes were applied separately in their existing Compose owners: Nova’s AI/media administrative ports and Lyra’s Stash are mesh-only; Signal is loopback-only with its private voice-pipeline route preserved. Compose validation, mesh/LAN probes, Pangolin routes, health checks, and no-op follow-ups passed. Existing dirty stack edits were preserved. Nova’s migrated PostgreSQL/Adminer deployment is excluded at the user’s instruction. The evaluated-host guard checks global and physical-interface port lists/ranges, mesh openings for loopback-only backends, declared listener addresses, and every enabled local Tdarr node’s loopback URL. Ports derive from evaluated service options where available. Jellyfin’s verified 8096 target remains an external UI/Pangolin contract; the pinned NixOS module has no Jellyfin port option. Validation: rebased onto main f131213 after MR #318; range-diff confirmed all four patches unchanged. Combined nix flake check and full Lyra build passed, as did injected exposure-regression rejection checks. Required MR CI passed on 1bcc2d7. Existing upstream Framework stdenv deprecation warnings are unrelated. Native acceptance: operator completed just test-remote lyra twice, including the identical no-op follow-up. All seven affected native services are active. Tdarr/Ollama are reachable over Nebula and rejected on the physical LAN; Immich/Jellyfin backends reject direct mesh and LAN access while Pangolin routes return HTTP 200. Local and Vega Tdarr consumers work. Beszel remains active with fresh post-canary hub metrics via its outbound transport; no inbound 45876 listener is required. Evidence and review assessment are recorded in comments 3293 and 3294. This MR does not close #38: test activation reverts on reboot. Persistent activation and its follow-up acceptance remain to be recorded.
Restrict Lyra administrative services to local and mesh access
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m32s
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 7m6s
e85582f275
clankbot left a comment

Automated code review

Reviewed commit: e85582f2751d487774b7257a09746ab9babbc339

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The supplied changes are internally consistent and I found no evaluation-breaking defect in them. Lyra's global openings for 80/443/3280/8888/9999/45876 are dropped, 8265/8266/11434 move to networking.firewall.interfaces."nebula.mesh".allowedTCPPorts (hosts/lyra/default.nix:210-214), Immich moves to host = "127.0.0.1" with its 2283 opening removed (modules/services/immich.nix:121), Jellyfin's 8096 opening is removed (modules/services/jellyfin.nix:89), and the unregistered Nova draft drops its historical port list and defaults Ollama to loopback. Cross-checks confirm the removals are safe within the tree: modules/services/immich.nix and modules/services/jellyfin.nix are imported only by hosts/lyra (vega uses the unrelated modules/databases/immich.nix), modules/services/beszel-agent.nix:18 already sets openFirewall = false so 45876 was never opened by that module, no module imported by Lyra reopens any port in the new restrictedPorts list (the only global openings reachable from Lyra are slskd's 50300, mosh/SSH ports, and 10200/10300), and the sibling check pattern in scripts/check-token-tv-config.nix:35 shows the same interface-scoped idiom. The remaining issues are gaps in what the new flake check actually enforces plus an unexercised runtime behaviour change.

Blocking findings

None.

Important findings

  • Deployment-affecting exposure restriction has no activation evidence, which AGENTS.md requires before merge/closure (hosts/lyra/default.nix:210; high confidence)
    The change removes host-wide firewall openings and re-scopes 8265/8266/11434 to the nebula.mesh input interface (hosts/lyra/default.nix:210-214), leaves 10200/10300 as the only global openings (hosts/lyra/default.nix:225-228), and removes the 8096/2283 openings from the shared modules (modules/services/jellyfin.nix:89, modules/services/immich.nix:134). The added gate is a pure evaluation assert (scripts/check-service-exposure.nix, wired at flake.nix:223) and cannot observe iptables or route reachability. The README addition states that deployment and the live Docker audit are deferred to issue #38. AGENTS.md:43 requires a canary appropriate to the risk before merging a deployment-affecting change, and AGENTS.md:45 requires just test (not raw nixos-rebuild test) for test deployments.
    Impact: Nothing in the supplied material demonstrates that Jellyfin/Immich remain reachable through the Newt/Pangolin routes, that Tdarr and Ollama remain reachable over the mesh, or that direct LAN access is in fact rejected; all of that only becomes observable after activation on Lyra.
    Suggested fix: Before closing the change: hold auto-update, run just test on Lyra, then probe Tdarr/Ollama from a mesh consumer, Jellyfin/Immich through the Newt/Pangolin routes, and confirm a direct LAN request is refused; follow with the no-op pass and record the canary.

Suggestions

  • New check guards only global firewall lists, not interface-scoped openings (scripts/check-service-exposure.nix:21; medium confidence)
    globallyAllowed inspects only firewall.allowedTCPPorts and firewall.allowedTCPPortRanges (lines 21-22). The repo's established idiom opens ports per interface instead: modules/services/bookstack.nix:249 opens 80 on nebula.mesh, modules/services/searxng.nix:93, modules/services/paseo-daemon.nix:95 (6767), modules/services/sabnzbd.nix:278 (8383), hosts/vega/default.nix:274. The check asserts membership only for the literal nebula.mesh key (line 27), so a restricted port from restrictedPorts (80, 443, 8096, 2283, 11434, ...) admitted on any other interface would keep nix flake check green.
    Impact: The stated invariant ('no native proxy backend or mesh API is LAN-exposed') is only partly enforced; a future or already-present interface-scoped opening escapes the guard.
    Suggested fix: Also assert that no firewall.interfaces.<name>.allowedTCPPorts/allowedTCPPortRanges outside nebula.mesh contains a port from restrictedPorts, e.g. by filtering firewall.interfaces attribute names rather than reading one key.

  • Check hard-codes the Lyra host and duplicates its port literals, so the guard can drift from the host policy (scripts/check-service-exposure.nix:4; medium confidence)
    cfg = flake.nixosConfigurations.lyra.config; is an unguarded lookup, and the mesh expectation at line 27 ([ 8265 8266 11434 ]) restates the literals in hosts/lyra/default.nix:210-214. The sibling check in the same directory derives its expectation from configuration instead: scripts/check-token-tv-config.nix:35 asserts cfg.nixosConfig.tokenTv.port is a member of cfg.networking.firewall.interfaces."nebula.mesh".allowedTCPPorts, and lines 20-21 enumerate hosts with builtins.attrNames flake.nixosConfigurations.
    Impact: Two copies of the same port list must be edited together, so the assertion can silently stop matching the host policy; and if Lyra is ever unregistered or renamed (the pattern used for potential/nova), nix flake check fails with an attribute error rather than a diagnostic about the exposure policy.
    Suggested fix: Derive the expected mesh ports from a shared option consumed by both hosts/lyra/default.nix and the check (as token-tv does via nixosConfig.tokenTv.port), and guard the host lookup (flake.nixosConfigurations ? lyra) or select hosts by an enabled option as check-token-tv-config.nix does.

Tests and validation

  • No configured deterministic checks.

Questions

  • Same-host Tdarr connection: hosts/lyra/default.nix:164 sets nodes.lyra-intel.serverURL = "http://10.10.0.3:8266", i.e. Lyra's own Nebula overlay address (modules/networking/nebula.nix). With 8266 now admitted only via -i nebula.mesh, can you confirm that a locally generated request from the tdarr-node-lyra-intel unit to that overlay address is attributed to the nebula.mesh interface at runtime, rather than being filtered by the now-closed global rules?
  • Docker-published ports: the removed openings 8888 (signal-cli REST) and 9999 (stash) are now described in hosts/lyra/default.nix:219-221 as owned by Compose stacks that 'bypass the host input firewall'. Have those Compose owners been given explicit host bindings, or do those stacks still publish 8888/9999 publicly on Lyra?
  • Retired stacks: 80/443/3280 (SWAG, wishlist) are not declared anywhere in this repository; can you confirm those stacks were removed from Lyra rather than still running, since the README now claims only Newt/Pangolin serves the native backends?
  • Nova draft: potential/nova/default.nix now binds Ollama to 127.0.0.1 and removes 11434/45876, but modules/profiles/pi-pangolin.nix:56 and modules/services/hermes.nix:113 still default to https://ollama-nova.nimmog.uk/v1. Is that route served by the live Fedora host today, and will it survive the draft's registration?

Review limitations

  • I could not run nix flake check, just test, or any repository code; the claim that the full Lyra build and the new check evaluate successfully comes from the pull-request text, not from anything I verified.
  • Upstream nixpkgs option definitions (services.tdarr.server.openFirewall, services.jellyfin.openFirewall, services.immich.host/openFirewall, services.ollama.openFirewall, services.newt, services.beszel.agent) are not present in the supplied tree, so I inferred their existence and defaults from the fact that the changed modules and host configuration assign those paths.
  • Live host state is not supplied: Lyra's iptables after activation, its Docker Compose stacks, the Beszel hub configuration, and the Newt/Pangolin route table (secrets/newt/lyra.yaml is SOPS-encrypted and unreadable) could not be inspected, so I cannot confirm or refute reachability of 8096/2283/8266/11434 at runtime.
  • potential/nova/default.nix is not registered in flake.nix's nixosConfigurations, so none of its changes are evaluated by any flake check; I could not compare them against Nova's running Fedora configuration.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • modules/services/immich.nix: reviewed — included in a context-limited batch
  • modules/services/jellyfin.nix: reviewed — included in a context-limited batch
  • potential/nova/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/nova-remote-builder.md, README.md
  • Commits considered: 1
  • Previous automated review: none found
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `e85582f2751d487774b7257a09746ab9babbc339` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The supplied changes are internally consistent and I found no evaluation-breaking defect in them. Lyra's global openings for 80/443/3280/8888/9999/45876 are dropped, 8265/8266/11434 move to networking.firewall.interfaces."nebula.mesh".allowedTCPPorts (hosts/lyra/default.nix:210-214), Immich moves to host = "127.0.0.1" with its 2283 opening removed (modules/services/immich.nix:121), Jellyfin's 8096 opening is removed (modules/services/jellyfin.nix:89), and the unregistered Nova draft drops its historical port list and defaults Ollama to loopback. Cross-checks confirm the removals are safe within the tree: modules/services/immich.nix and modules/services/jellyfin.nix are imported only by hosts/lyra (vega uses the unrelated modules/databases/immich.nix), modules/services/beszel-agent.nix:18 already sets openFirewall = false so 45876 was never opened by that module, no module imported by Lyra reopens any port in the new restrictedPorts list (the only global openings reachable from Lyra are slskd's 50300, mosh/SSH ports, and 10200/10300), and the sibling check pattern in scripts/check-token-tv-config.nix:35 shows the same interface-scoped idiom. The remaining issues are gaps in what the new flake check actually enforces plus an unexercised runtime behaviour change. ### Blocking findings None. ### Important findings - **Deployment-affecting exposure restriction has no activation evidence, which AGENTS.md requires before merge/closure** (hosts/lyra/default.nix:210; high confidence) The change removes host-wide firewall openings and re-scopes 8265/8266/11434 to the nebula.mesh input interface (hosts/lyra/default.nix:210-214), leaves 10200/10300 as the only global openings (hosts/lyra/default.nix:225-228), and removes the 8096/2283 openings from the shared modules (modules/services/jellyfin.nix:89, modules/services/immich.nix:134). The added gate is a pure evaluation assert (scripts/check-service-exposure.nix, wired at flake.nix:223) and cannot observe iptables or route reachability. The README addition states that deployment and the live Docker audit are deferred to issue #38. AGENTS.md:43 requires a canary appropriate to the risk before merging a deployment-affecting change, and AGENTS.md:45 requires `just test` (not raw `nixos-rebuild test`) for test deployments. Impact: Nothing in the supplied material demonstrates that Jellyfin/Immich remain reachable through the Newt/Pangolin routes, that Tdarr and Ollama remain reachable over the mesh, or that direct LAN access is in fact rejected; all of that only becomes observable after activation on Lyra. Suggested fix: Before closing the change: hold auto-update, run `just test` on Lyra, then probe Tdarr/Ollama from a mesh consumer, Jellyfin/Immich through the Newt/Pangolin routes, and confirm a direct LAN request is refused; follow with the no-op pass and record the canary. ### Suggestions - **New check guards only global firewall lists, not interface-scoped openings** (scripts/check-service-exposure.nix:21; medium confidence) `globallyAllowed` inspects only `firewall.allowedTCPPorts` and `firewall.allowedTCPPortRanges` (lines 21-22). The repo's established idiom opens ports per interface instead: modules/services/bookstack.nix:249 opens 80 on `nebula.mesh`, modules/services/searxng.nix:93, modules/services/paseo-daemon.nix:95 (6767), modules/services/sabnzbd.nix:278 (8383), hosts/vega/default.nix:274. The check asserts membership only for the literal `nebula.mesh` key (line 27), so a restricted port from `restrictedPorts` (80, 443, 8096, 2283, 11434, ...) admitted on any other interface would keep `nix flake check` green. Impact: The stated invariant ('no native proxy backend or mesh API is LAN-exposed') is only partly enforced; a future or already-present interface-scoped opening escapes the guard. Suggested fix: Also assert that no `firewall.interfaces.<name>.allowedTCPPorts`/`allowedTCPPortRanges` outside `nebula.mesh` contains a port from `restrictedPorts`, e.g. by filtering `firewall.interfaces` attribute names rather than reading one key. - **Check hard-codes the Lyra host and duplicates its port literals, so the guard can drift from the host policy** (scripts/check-service-exposure.nix:4; medium confidence) `cfg = flake.nixosConfigurations.lyra.config;` is an unguarded lookup, and the mesh expectation at line 27 (`[ 8265 8266 11434 ]`) restates the literals in hosts/lyra/default.nix:210-214. The sibling check in the same directory derives its expectation from configuration instead: scripts/check-token-tv-config.nix:35 asserts `cfg.nixosConfig.tokenTv.port` is a member of `cfg.networking.firewall.interfaces."nebula.mesh".allowedTCPPorts`, and lines 20-21 enumerate hosts with `builtins.attrNames flake.nixosConfigurations`. Impact: Two copies of the same port list must be edited together, so the assertion can silently stop matching the host policy; and if Lyra is ever unregistered or renamed (the pattern used for `potential/nova`), `nix flake check` fails with an attribute error rather than a diagnostic about the exposure policy. Suggested fix: Derive the expected mesh ports from a shared option consumed by both hosts/lyra/default.nix and the check (as token-tv does via `nixosConfig.tokenTv.port`), and guard the host lookup (`flake.nixosConfigurations ? lyra`) or select hosts by an enabled option as check-token-tv-config.nix does. ### Tests and validation - No configured deterministic checks. ### Questions - Same-host Tdarr connection: hosts/lyra/default.nix:164 sets `nodes.lyra-intel.serverURL = "http://10.10.0.3:8266"`, i.e. Lyra's own Nebula overlay address (modules/networking/nebula.nix). With 8266 now admitted only via `-i nebula.mesh`, can you confirm that a locally generated request from the tdarr-node-lyra-intel unit to that overlay address is attributed to the nebula.mesh interface at runtime, rather than being filtered by the now-closed global rules? - Docker-published ports: the removed openings 8888 (signal-cli REST) and 9999 (stash) are now described in hosts/lyra/default.nix:219-221 as owned by Compose stacks that 'bypass the host input firewall'. Have those Compose owners been given explicit host bindings, or do those stacks still publish 8888/9999 publicly on Lyra? - Retired stacks: 80/443/3280 (SWAG, wishlist) are not declared anywhere in this repository; can you confirm those stacks were removed from Lyra rather than still running, since the README now claims only Newt/Pangolin serves the native backends? - Nova draft: potential/nova/default.nix now binds Ollama to 127.0.0.1 and removes 11434/45876, but modules/profiles/pi-pangolin.nix:56 and modules/services/hermes.nix:113 still default to `https://ollama-nova.nimmog.uk/v1`. Is that route served by the live Fedora host today, and will it survive the draft's registration? ### Review limitations - I could not run `nix flake check`, `just test`, or any repository code; the claim that the full Lyra build and the new check evaluate successfully comes from the pull-request text, not from anything I verified. - Upstream nixpkgs option definitions (services.tdarr.server.openFirewall, services.jellyfin.openFirewall, services.immich.host/openFirewall, services.ollama.openFirewall, services.newt, services.beszel.agent) are not present in the supplied tree, so I inferred their existence and defaults from the fact that the changed modules and host configuration assign those paths. - Live host state is not supplied: Lyra's iptables after activation, its Docker Compose stacks, the Beszel hub configuration, and the Newt/Pangolin route table (secrets/newt/lyra.yaml is SOPS-encrypted and unreadable) could not be inspected, so I cannot confirm or refute reachability of 8096/2283/8266/11434 at runtime. - potential/nova/default.nix is not registered in flake.nix's nixosConfigurations, so none of its changes are evaluated by any flake check; I could not compare them against Nova's running Fedora configuration. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `modules/services/immich.nix`: **reviewed** — included in a context-limited batch - `modules/services/jellyfin.nix`: **reviewed** — included in a context-limited batch - `potential/nova/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/nova-remote-builder.md, README.md - Commits considered: 1 - Previous automated review: none found - Findings: 3 </details>
Author
Owner

Review assessment before fixes:

  • Agree with checking interface-specific openings as well as global lists/ranges. I will extend the evaluated-host guard and derive its mesh ports from the Tdarr/Ollama service settings rather than adding a new policy abstraction. Lyra is intentionally the host covered by this guard; I will make a missing-host failure diagnostic explicit.
  • Agree that genuine native activation/no-op evidence is required before merge. This was already an explicit remaining gate in the MR and #38. The MR will remain unmerged and the issue open until that evidence exists.
  • Same-host Tdarr: traffic to the host’s own overlay address is locally routed through loopback, which the NixOS firewall accepts. I will verify that route and normal unit connectivity in the live acceptance checks; using loopback explicitly for the local Intel node is clearer and removes the overlay dependency.
  • Docker bindings are already applied and accepted: Stash is bound to Lyra’s Nebula address; Signal to loopback, and voice-pipeline -> Signal still returns 200. Nova’s changed administrative publications are mesh-only. Each had a no-op follow-up; LAN rejection and existing Pangolin access were verified.
  • Live Docker inventory has no SWAG or wishlist container/listener. Pangolin’s inspected native Lyra targets for Immich/Jellyfin are loopback, and those routes are currently healthy.
  • Nova remains Fedora. Its current Ollama/Open WebUI containers retain their internal Newt network route and now expose direct ports only on Nebula; API/WebUI health and public WebUI access were verified. potential/nova is an unregistered draft, not a migration/deployment plan, and its eventual registration must configure and validate the live proxy/backend route explicitly.

No changes to deployed Docker images, model configuration or database services are planned in this review response.

Review assessment before fixes: - Agree with checking interface-specific openings as well as global lists/ranges. I will extend the evaluated-host guard and derive its mesh ports from the Tdarr/Ollama service settings rather than adding a new policy abstraction. Lyra is intentionally the host covered by this guard; I will make a missing-host failure diagnostic explicit. - Agree that genuine native activation/no-op evidence is required before merge. This was already an explicit remaining gate in the MR and #38. The MR will remain unmerged and the issue open until that evidence exists. - Same-host Tdarr: traffic to the host’s own overlay address is locally routed through loopback, which the NixOS firewall accepts. I will verify that route and normal unit connectivity in the live acceptance checks; using loopback explicitly for the local Intel node is clearer and removes the overlay dependency. - Docker bindings are already applied and accepted: Stash is bound to Lyra’s Nebula address; Signal to loopback, and voice-pipeline -> Signal still returns 200. Nova’s changed administrative publications are mesh-only. Each had a no-op follow-up; LAN rejection and existing Pangolin access were verified. - Live Docker inventory has no SWAG or wishlist container/listener. Pangolin’s inspected native Lyra targets for Immich/Jellyfin are loopback, and those routes are currently healthy. - Nova remains Fedora. Its current Ollama/Open WebUI containers retain their internal Newt network route and now expose direct ports only on Nebula; API/WebUI health and public WebUI access were verified. potential/nova is an unregistered draft, not a migration/deployment plan, and its eventual registration must configure and validate the live proxy/backend route explicitly. No changes to deployed Docker images, model configuration or database services are planned in this review response.
Guard interface exposure and use local Tdarr loopback
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m29s
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 6m48s
cdd8e84120
Author
Owner

Review fixes are published as cdd8e84120. Full flake checks and the exact clean Lyra build pass. Injecting either an administrative port or an administrative port range on eth0 makes the exposure check fail as intended. Read-only live checks confirm local overlay routing uses dev lo, Tdarr loopback responds (302), and the Intel node is active.

Prepared an isolated operator canary checkout on Lyra at /home/nimmo/nixos-issue38-canary, clean at the current MR head. No native activation has been performed. Repository constraints prohibit agent sudo except nixos-rebuild, while the required hold and just test recipes use other privileged commands; operator execution is needed for that acceptance step. Keep the MR unmerged and #38 open until the canary/no-op and post-activation reachability checks pass. The automated review timer has restarted for this push.

Review fixes are published as cdd8e841200ee4056bec24ba26977ea69c6a3b3b. Full flake checks and the exact clean Lyra build pass. Injecting either an administrative port or an administrative port range on eth0 makes the exposure check fail as intended. Read-only live checks confirm local overlay routing uses dev lo, Tdarr loopback responds (302), and the Intel node is active. Prepared an isolated operator canary checkout on Lyra at /home/nimmo/nixos-issue38-canary, clean at the current MR head. No native activation has been performed. Repository constraints prohibit agent sudo except nixos-rebuild, while the required hold and just test recipes use other privileged commands; operator execution is needed for that acceptance step. Keep the MR unmerged and #38 open until the canary/no-op and post-activation reachability checks pass. The automated review timer has restarted for this push.
clankbot left a comment

Automated code review

Reviewed commit: cdd8e841200ee4056bec24ba26977ea69c6a3b3b

Verdict: Ready to merge

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

Overall assessment

The change set narrows Lyra's host firewall (Tdarr/Ollama admitted only on the nebula.mesh interface, Immich bound to loopback, Jellyfin/Immich/SWAG/wishlist/Beszel openings removed), stops the Nova draft from pre-opening a historical port list, and adds a service-exposure flake check that evaluates flake.nixosConfigurations.lyra.config and asserts the restricted ports stay closed globally and on non-mesh interfaces while the mesh ports are open on nebula.mesh. I checked the new gate against the composed Lyra config: the only networking.firewall.allowedTCPPorts contributions reachable from hosts/lyra/default.nix are the retained 10200/10300 speech ports and slskd's 50300 (modules/containers/slskd.nix:115), and every other module that opens ports does so on interfaces."nebula.mesh" only, so none of the asserted restricted ports (80, 443, 2283, 3280, 8096, 8888, 9999, 45876, or the mesh ports) is added globally; the gate's wiring in flake.nix matches the existing check-*.nix style, and its assertions match the values set in hosts/lyra/default.nix (identical serverURL expression, services.newt.enable = true via modules/services/newt.nix). Vega's unchanged Tdarr node still targets http://10.10.0.3:8266, which Lyra now admits on the mesh interface, consistent with the established interfaces."nebula.mesh" pattern used on Vega/Lena/Electra. I found no defect demonstrable from the supplied evidence; the two findings are coverage gaps in the new guard itself.

Blocking findings

None.

Important findings

None.

Suggestions

  • The new guard never asserts the loopback-only ports are absent from nebula.mesh (scripts/check-service-exposure.nix:41; medium confidence)
    nonMeshInterfaces filters out nebula.mesh (line 31), and the only mesh-interface assertion is lib.all (port: allowsPort firewall.interfaces."nebula.mesh" port) meshPorts, which tests membership of the three mesh ports but never tests the other members of restrictedPorts (80, 443, 2283, 3280, 8096, 8888, 9999, 45876) against that interface. Several unchanged modules already use exactly this mesh-interface form to open ports (modules/services/trilium-web.nix:194, kiwifs.nix:194, token-tv.nix:52, paseo-daemon.nix:95, bookstack.nix:249 opens 80 on nebula.mesh).
    Impact: The stated policy in the changed comments (modules/services/immich.nix: 'no direct LAN/mesh listener'; modules/services/jellyfin.nix: 'do not admit direct LAN/mesh HTTP traffic') is enforced only against the global list, not against the mesh interface, so a module that opens 2283 or 8096 on nebula.mesh would satisfy the gate while contradicting the policy the change introduces.
    Suggested fix: Add an assertion that the loopback-only ports (at minimum cfg.services.immich port 2283 and Jellyfin's 8096) are absent from firewall.interfaces."nebula.mesh".allowedTCPPorts and its allowedTCPPortRanges, so the policy is enforced on every interface rather than only globally.

  • The guard pins one Tdarr node by literal attribute name and leaves the other node's serverURL unchecked (scripts/check-service-exposure.nix:43; medium confidence)
    cfg.services.tdarr.nodes.lyra-intel.serverURL names one attribute literally. hosts/lyra/default.nix defines two nodes (nodes.lyra and nodes.lyra-intel), and nodes.lyra sets no serverURL, so it inherits the upstream default; modules/services/tdarr.nix:13 derives the unit set from builtins.attrNames enabledNodes, so the check is not tied to the nodes that actually exist.
    Impact: Renaming or retiring lyra-intel turns the gate into an opaque 'attribute is not in attribute set' evaluation failure rather a diagnostic message, and the node that relies on an upstream default is not covered, so a default that resolves to a non-loopback address would depend on a firewall hole Lyra no longer provides.
    Suggested fix: Iterate over cfg.services.tdarr.nodes and assert each node's serverURL is a loopback URL or an explicitly intended mesh address, with an assertion message naming the offending node, instead of asserting one hardcoded attribute.

Tests and validation

  • No configured deterministic checks.

Questions

  • Does the Beszel hub at dashboard.nimmog.uk ever contact a host's agent by address (e.g. 10.10.0.3:45876 over the mesh)? modules/services/beszel-agent.nix sets openFirewall = false and posts to HUB_URL, which suggests the agent only pushes to the hub, so removing 45876 from Lyra's firewall appears safe; the hub owner is outside this repository and was not supplied.
  • Are the Pangolin routes for Jellyfin and Immich confirmed to target localhost:8096 and 127.0.0.1:2283? The route definitions are not in the supplied material, so the change's reliance on Newt for ingress cannot be verified here.
  • Should an equivalent exposure guard be added for potential/nova/default.nix once it is registered in flake.nix; no supplied check evaluates its firewall or its loopback Ollama setting today?

Review limitations

  • No Nix evaluation was performed: the supplied material was read only, so nix flake check, the new service-exposure gate, and Lyra's build were not run here; the passing status is inferred from reading the composed configuration, not from evaluation.
  • Upstream nixpkgs module definitions (services.tdarr.nodes.*.serverURL, services.immich.host, services.jellyfin.openFirewall, services.ollama.openFirewall, services.newt.enable, networking.firewall.interfaces) were not inspected; option names and defaults were inferred only from their usage in this repository, so an assertion such as !cfg.services.ollama.openFirewall could fail if an upstream default differs from that inference.
  • Live state outside this repository was not supplied: the Pangolin/Newt route configuration, the Beszel hub's host addresses, and the Docker/Compose owners for Signal and Stash (whose published ports bypass the host input firewall) were not inspected.
  • The guard covers only nixosConfigurations.lyra; the exposure of other registered hosts (e.g. Vega's allowedTCPPorts = [ 5432 ] at hosts/vega/default.nix) is outside the changed files and was not assessed as a defect.
  • Findings are limited to the changed files; no defect was inferred in unchanged code that was not supplied.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • modules/services/immich.nix: reviewed — included in a context-limited batch
  • modules/services/jellyfin.nix: reviewed — included in a context-limited batch
  • potential/nova/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/nova-remote-builder.md, README.md
  • Commits considered: 2
  • Previous automated review: none found
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `cdd8e841200ee4056bec24ba26977ea69c6a3b3b` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment The change set narrows Lyra's host firewall (Tdarr/Ollama admitted only on the `nebula.mesh` interface, Immich bound to loopback, Jellyfin/Immich/SWAG/wishlist/Beszel openings removed), stops the Nova draft from pre-opening a historical port list, and adds a `service-exposure` flake check that evaluates `flake.nixosConfigurations.lyra.config` and asserts the restricted ports stay closed globally and on non-mesh interfaces while the mesh ports are open on `nebula.mesh`. I checked the new gate against the composed Lyra config: the only `networking.firewall.allowedTCPPorts` contributions reachable from `hosts/lyra/default.nix` are the retained 10200/10300 speech ports and slskd's 50300 (`modules/containers/slskd.nix:115`), and every other module that opens ports does so on `interfaces."nebula.mesh"` only, so none of the asserted restricted ports (80, 443, 2283, 3280, 8096, 8888, 9999, 45876, or the mesh ports) is added globally; the gate's wiring in `flake.nix` matches the existing `check-*.nix` style, and its assertions match the values set in `hosts/lyra/default.nix` (identical `serverURL` expression, `services.newt.enable = true` via `modules/services/newt.nix`). Vega's unchanged Tdarr node still targets `http://10.10.0.3:8266`, which Lyra now admits on the mesh interface, consistent with the established `interfaces."nebula.mesh"` pattern used on Vega/Lena/Electra. I found no defect demonstrable from the supplied evidence; the two findings are coverage gaps in the new guard itself. ### Blocking findings None. ### Important findings None. ### Suggestions - **The new guard never asserts the loopback-only ports are absent from `nebula.mesh`** (scripts/check-service-exposure.nix:41; medium confidence) `nonMeshInterfaces` filters out `nebula.mesh` (line 31), and the only mesh-interface assertion is `lib.all (port: allowsPort firewall.interfaces."nebula.mesh" port) meshPorts`, which tests membership of the three mesh ports but never tests the other members of `restrictedPorts` (80, 443, 2283, 3280, 8096, 8888, 9999, 45876) against that interface. Several unchanged modules already use exactly this mesh-interface form to open ports (`modules/services/trilium-web.nix:194`, `kiwifs.nix:194`, `token-tv.nix:52`, `paseo-daemon.nix:95`, `bookstack.nix:249` opens 80 on `nebula.mesh`). Impact: The stated policy in the changed comments (`modules/services/immich.nix`: 'no direct LAN/mesh listener'; `modules/services/jellyfin.nix`: 'do not admit direct LAN/mesh HTTP traffic') is enforced only against the global list, not against the mesh interface, so a module that opens 2283 or 8096 on `nebula.mesh` would satisfy the gate while contradicting the policy the change introduces. Suggested fix: Add an assertion that the loopback-only ports (at minimum `cfg.services.immich` port 2283 and Jellyfin's 8096) are absent from `firewall.interfaces."nebula.mesh".allowedTCPPorts` and its `allowedTCPPortRanges`, so the policy is enforced on every interface rather than only globally. - **The guard pins one Tdarr node by literal attribute name and leaves the other node's serverURL unchecked** (scripts/check-service-exposure.nix:43; medium confidence) `cfg.services.tdarr.nodes.lyra-intel.serverURL` names one attribute literally. `hosts/lyra/default.nix` defines two nodes (`nodes.lyra` and `nodes.lyra-intel`), and `nodes.lyra` sets no `serverURL`, so it inherits the upstream default; `modules/services/tdarr.nix:13` derives the unit set from `builtins.attrNames enabledNodes`, so the check is not tied to the nodes that actually exist. Impact: Renaming or retiring `lyra-intel` turns the gate into an opaque 'attribute is not in attribute set' evaluation failure rather a diagnostic message, and the node that relies on an upstream default is not covered, so a default that resolves to a non-loopback address would depend on a firewall hole Lyra no longer provides. Suggested fix: Iterate over `cfg.services.tdarr.nodes` and assert each node's `serverURL` is a loopback URL or an explicitly intended mesh address, with an assertion message naming the offending node, instead of asserting one hardcoded attribute. ### Tests and validation - No configured deterministic checks. ### Questions - Does the Beszel hub at `dashboard.nimmog.uk` ever contact a host's agent by address (e.g. `10.10.0.3:45876` over the mesh)? `modules/services/beszel-agent.nix` sets `openFirewall = false` and posts to `HUB_URL`, which suggests the agent only pushes to the hub, so removing 45876 from Lyra's firewall appears safe; the hub owner is outside this repository and was not supplied. - Are the Pangolin routes for Jellyfin and Immich confirmed to target `localhost:8096` and `127.0.0.1:2283`? The route definitions are not in the supplied material, so the change's reliance on Newt for ingress cannot be verified here. - Should an equivalent exposure guard be added for `potential/nova/default.nix` once it is registered in `flake.nix`; no supplied check evaluates its firewall or its loopback Ollama setting today? ### Review limitations - No Nix evaluation was performed: the supplied material was read only, so `nix flake check`, the new `service-exposure` gate, and Lyra's build were not run here; the passing status is inferred from reading the composed configuration, not from evaluation. - Upstream nixpkgs module definitions (`services.tdarr.nodes.*.serverURL`, `services.immich.host`, `services.jellyfin.openFirewall`, `services.ollama.openFirewall`, `services.newt.enable`, `networking.firewall.interfaces`) were not inspected; option names and defaults were inferred only from their usage in this repository, so an assertion such as `!cfg.services.ollama.openFirewall` could fail if an upstream default differs from that inference. - Live state outside this repository was not supplied: the Pangolin/Newt route configuration, the Beszel hub's host addresses, and the Docker/Compose owners for Signal and Stash (whose published ports bypass the host input firewall) were not inspected. - The guard covers only `nixosConfigurations.lyra`; the exposure of other registered hosts (e.g. Vega's `allowedTCPPorts = [ 5432 ]` at `hosts/vega/default.nix`) is outside the changed files and was not assessed as a defect. - Findings are limited to the changed files; no defect was inferred in unchanged code that was not supplied. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `modules/services/immich.nix`: **reviewed** — included in a context-limited batch - `modules/services/jellyfin.nix`: **reviewed** — included in a context-limited batch - `potential/nova/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/nova-remote-builder.md, README.md - Commits considered: 2 - Previous automated review: none found - Findings: 2 </details>
Author
Owner

Assessment of review63 before fixes: both coverage suggestions are reasonable. I will assert that Immich/Jellyfin backend ports are also closed on nebula.mesh, explicitly configure both Lyra-local Tdarr nodes to loopback, and validate all enabled local nodes with a named diagnostic rather than hard-coding lyra-intel in the guard.

The external questions are already covered by live evidence: the inspected Pangolin native targets are localhost:8096 and 127.0.0.1:2283. Lyra's live baseline has no 45876 listener, its Beszel module uses outbound hub connectivity, and monitoring remains active after Docker changes; removing an unused opening does not disable the agent. Nova's draft will require its own evaluated guard and live-route acceptance when it becomes a registered NixOS host; that deployment remains outside this MR. The native Lyra canary/no-op remains explicitly required before merge.

Assessment of review63 before fixes: both coverage suggestions are reasonable. I will assert that Immich/Jellyfin backend ports are also closed on nebula.mesh, explicitly configure both Lyra-local Tdarr nodes to loopback, and validate all enabled local nodes with a named diagnostic rather than hard-coding lyra-intel in the guard. The external questions are already covered by live evidence: the inspected Pangolin native targets are localhost:8096 and 127.0.0.1:2283. Lyra's live baseline has no 45876 listener, its Beszel module uses outbound hub connectivity, and monitoring remains active after Docker changes; removing an unused opening does not disable the agent. Nova's draft will require its own evaluated guard and live-route acceptance when it becomes a registered NixOS host; that deployment remains outside this MR. The native Lyra canary/no-op remains explicitly required before merge.
Guard mesh backend access and all local Tdarr nodes
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m32s
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 7m41s
c2d5f6b8ba
clankbot left a comment

Automated code review

Reviewed commit: c2d5f6b8bafc560de3cf4568664946f5e6d03541

Verdict: Ready to merge

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

Overall assessment

Scope: README.md, flake.nix (new service-exposure check), hosts/lyra/default.nix, modules/services/immich.nix, modules/services/jellyfin.nix, potential/nova/default.nix, scripts/check-service-exposure.nix. I traced the cross-host consumers of the removed openings. The only cross-host consumer of a Lyra port is hosts/vega/default.nix:221 (serverURL = "http://10.10.0.3:8266"), and Lyra's overlay address is 10.10.0.3 (modules/networking/nebula.nix:27, justfiles/nebula.just:56); the new networking.firewall.interfaces."nebula.mesh".allowedTCPPorts block (hosts/lyra/default.nix:211-215) re-opens the Tdarr webUI/server ports and config.services.ollama.port there, so the mesh path stays covered while the LAN hole is closed. Lyra's Tdarr nodes now derive their loopback URL from config.services.tdarr.server.serverPort, which matches the new check's node assertion (scripts/check-service-exposure.nix:47-54). Lyra keeps serverIP = "0.0.0.0" and profiles.ollama.nvidia.host = "0.0.0.0", so loopback clients still work. No other file in the tree references 2283, 8096, 3280, 8888, 9999, 45876 or 10.10.0.3 as a consumer (grep over the checkout); justfiles/maintenance.just:505 already uses 127.0.0.1:11434; modules/services/beszel-agent.nix:18 already sets openFirewall = false, so dropping 45876 matches the rest of the fleet. potential/nova/default.nix is not in flake.nix's nixosConfigurations (only electra/lena/vega/lyra), so its firewall/Ollama changes have no evaluation effect. No blocking or important defect is demonstrated by the supplied evidence; two coverage gaps in the new gate remain as suggestions.

Blocking findings

None.

Important findings

None.

Suggestions

  • Exposure gate mixes derived service ports with hard-coded backend literals (scripts/check-service-exposure.nix:15; medium confidence)
    The same file already derives the service ports it guards: meshPorts reads cfg.services.tdarr.server.webUIPort/serverPort and cfg.services.ollama.port (lines 10-14), and loopbackPorts reads cfg.services.immich.port (line 34). But restrictedPorts (lines 15-25) lists 80, 443, 2283, 3280, 8096, 8888, 9999, 45876 as literals, and loopbackPorts hard-codes 8096 (line 35) even though modules/services/jellyfin.nix configures services.jellyfin (line 23) and modules/services/immich.nix configures services.immich (line 110) with a host/openFirewall pair.
    Impact: The guard is keyed to historical port numbers rather than to the services it is meant to protect: if a backend's port option is ever overridden (or an upstream default changes), the gate stops guarding that listener and a LAN/global reopening at the new port would pass nix flake check, while the stale 2283/8096 assertions keep passing vacuously. The PR's stated purpose of the gate ('The evaluated-host check catches a global port/range reopening these services') would not hold for such a change.
    Suggested fix: Derive the backend part of restrictedPorts and loopbackPorts from the evaluated options (cfg.services.immich.port, cfg.services.jellyfin.port) and keep the retired SWAG/wishlist/Signal/Stash/Beszel literals (80, 443, 3280, 8888, 9999, 45876) in a separately named legacy list so the two intents stay distinguishable.

  • Gate verifies the mesh firewall openings but not the wildcard listeners those mesh consumers depend on (scripts/check-service-exposure.nix:46; medium confidence)
    The gate asserts the mesh openings (lib.all (port: allowsPort firewall.interfaces."nebula.mesh" port) meshPorts, line 46) and only the firewall flags !cfg.services.tdarr.server.openFirewall / !cfg.services.ollama.openFirewall (lines 58-59); it never asserts the listener addresses. The listener half is what the cross-host consumer needs: hosts/vega/default.nix:221 reaches Lyra at http://10.10.0.3:8266, and hosts/lyra/default.nix keeps serverIP = "0.0.0.0" (line 144) and profiles.ollama.nvidia.host = "0.0.0.0" (line 195) with the comment 'Lyra serves Ollama to the rest of the fleet'.
    Impact: A later narrowing of services.tdarr.server.serverIP or services.ollama.host to loopback would keep nix flake check green while silently breaking Vega's Tdarr node and mesh Ollama clients: the firewall half of the contract would be verified, the listener half would not.
    Suggested fix: Add companion assertions that the mesh-reachable listeners stay non-loopback (e.g. cfg.services.tdarr.server.serverIP and cfg.services.ollama.host are not "127.0.0.1"/"localhost"), so the mesh opening and its listener are checked as one contract.

Tests and validation

  • No configured deterministic checks.

Questions

  • The diff removes Lyra's LAN openings for 8265/8266/11434 and states host-local clients use loopback. The only cross-host consumer I can find is hosts/vega/default.nix:221 (covered by the new nebula.mesh rule), and justfiles/maintenance.just:505 already uses 127.0.0.1:11434, but I cannot prove absence: please confirm no operator tooling or desktop client on Lyra's physical network still connects to the Tdarr UI/API or Ollama over the LAN.
  • The new comment asserts the Beszel opening is unnecessary. modules/services/beszel-agent.nix sets openFirewall = false with LISTEN = "45876" and HUB_URL = "https://dashboard.nimmog.uk", and no host in the tree opens 45876, so removing it makes Lyra consistent with the rest of the fleet - please confirm the hub reaches agents over SSH rather than a mesh socket, since a mesh socket would now be blocked on every host.
  • The gate asserts 80 and 443 are closed on every Lyra interface and that cfg.services.newt.enable is true. The services.newt option is not declared in this checkout (modules/services/newt.nix only assigns it), and secrets/newt/lyra.yaml is SOPS-encrypted, so please confirm the native Newt/Pangolin ingress needs no host port on 80/443.
  • The diff states Docker-published ports bypass the NixOS firewalled INPUT rules, so Signal (8888) and Stash (9999) must be restricted in their Compose owners. That runtime behaviour is not observable in the supplied material; please confirm the live Compose host bindings for those Lyra stacks.

Review limitations

  • No Nix toolchain in this container: I did not run nix flake check, build Lyra, or run just test; the PR's validation claims (flake check, full build, mesh/LAN probes, injected rejection checks) are unverified.
  • Option definitions for services.tdarr (serverPort/webUIPort/serverIP/nodes), services.immich (host/port), services.jellyfin (port/openFirewall), services.ollama, services.newt and services.beszel.agent come from nixpkgs or external flake inputs that are not present in the checked-out tree; I inferred their names and defaults only from usage in this repository.
  • Live Docker/Compose owners (Signal, Stash), Newt/Pangolin route configuration (secrets/newt/lyra.yaml is SOPS-encrypted), Nebula certificates, and the live Fedora Nova host are outside the supplied evidence.
  • potential/nova/default.nix is unregistered in flake.nix, so its loopback Ollama default and removed port list have no evaluation or build effect; I could not assess them against Nova's actual Fedora deployment.
  • No other pull-request material was available: no access to issue #38, milestone state, or the live deployment/canary evidence the PR says is still outstanding.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • modules/services/immich.nix: reviewed — included in a context-limited batch
  • modules/services/jellyfin.nix: reviewed — included in a context-limited batch
  • potential/nova/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/nova-remote-builder.md, README.md
  • Commits considered: 3
  • Previous automated review: none found
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `c2d5f6b8bafc560de3cf4568664946f5e6d03541` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment Scope: README.md, flake.nix (new `service-exposure` check), hosts/lyra/default.nix, modules/services/immich.nix, modules/services/jellyfin.nix, potential/nova/default.nix, scripts/check-service-exposure.nix. I traced the cross-host consumers of the removed openings. The only cross-host consumer of a Lyra port is hosts/vega/default.nix:221 (`serverURL = "http://10.10.0.3:8266"`), and Lyra's overlay address is 10.10.0.3 (modules/networking/nebula.nix:27, justfiles/nebula.just:56); the new `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts` block (hosts/lyra/default.nix:211-215) re-opens the Tdarr webUI/server ports and `config.services.ollama.port` there, so the mesh path stays covered while the LAN hole is closed. Lyra's Tdarr nodes now derive their loopback URL from `config.services.tdarr.server.serverPort`, which matches the new check's node assertion (scripts/check-service-exposure.nix:47-54). Lyra keeps `serverIP = "0.0.0.0"` and `profiles.ollama.nvidia.host = "0.0.0.0"`, so loopback clients still work. No other file in the tree references 2283, 8096, 3280, 8888, 9999, 45876 or 10.10.0.3 as a consumer (grep over the checkout); `justfiles/maintenance.just:505` already uses 127.0.0.1:11434; modules/services/beszel-agent.nix:18 already sets `openFirewall = false`, so dropping 45876 matches the rest of the fleet. potential/nova/default.nix is not in `flake.nix`'s `nixosConfigurations` (only electra/lena/vega/lyra), so its firewall/Ollama changes have no evaluation effect. No blocking or important defect is demonstrated by the supplied evidence; two coverage gaps in the new gate remain as suggestions. ### Blocking findings None. ### Important findings None. ### Suggestions - **Exposure gate mixes derived service ports with hard-coded backend literals** (scripts/check-service-exposure.nix:15; medium confidence) The same file already derives the service ports it guards: `meshPorts` reads `cfg.services.tdarr.server.webUIPort/serverPort` and `cfg.services.ollama.port` (lines 10-14), and `loopbackPorts` reads `cfg.services.immich.port` (line 34). But `restrictedPorts` (lines 15-25) lists 80, 443, 2283, 3280, 8096, 8888, 9999, 45876 as literals, and `loopbackPorts` hard-codes 8096 (line 35) even though modules/services/jellyfin.nix configures `services.jellyfin` (line 23) and modules/services/immich.nix configures `services.immich` (line 110) with a `host`/`openFirewall` pair. Impact: The guard is keyed to historical port numbers rather than to the services it is meant to protect: if a backend's port option is ever overridden (or an upstream default changes), the gate stops guarding that listener and a LAN/global reopening at the new port would pass `nix flake check`, while the stale 2283/8096 assertions keep passing vacuously. The PR's stated purpose of the gate ('The evaluated-host check catches a global port/range reopening these services') would not hold for such a change. Suggested fix: Derive the backend part of `restrictedPorts` and `loopbackPorts` from the evaluated options (`cfg.services.immich.port`, `cfg.services.jellyfin.port`) and keep the retired SWAG/wishlist/Signal/Stash/Beszel literals (80, 443, 3280, 8888, 9999, 45876) in a separately named legacy list so the two intents stay distinguishable. - **Gate verifies the mesh firewall openings but not the wildcard listeners those mesh consumers depend on** (scripts/check-service-exposure.nix:46; medium confidence) The gate asserts the mesh openings (`lib.all (port: allowsPort firewall.interfaces."nebula.mesh" port) meshPorts`, line 46) and only the firewall flags `!cfg.services.tdarr.server.openFirewall` / `!cfg.services.ollama.openFirewall` (lines 58-59); it never asserts the listener addresses. The listener half is what the cross-host consumer needs: hosts/vega/default.nix:221 reaches Lyra at `http://10.10.0.3:8266`, and hosts/lyra/default.nix keeps `serverIP = "0.0.0.0"` (line 144) and `profiles.ollama.nvidia.host = "0.0.0.0"` (line 195) with the comment 'Lyra serves Ollama to the rest of the fleet'. Impact: A later narrowing of `services.tdarr.server.serverIP` or `services.ollama.host` to loopback would keep `nix flake check` green while silently breaking Vega's Tdarr node and mesh Ollama clients: the firewall half of the contract would be verified, the listener half would not. Suggested fix: Add companion assertions that the mesh-reachable listeners stay non-loopback (e.g. `cfg.services.tdarr.server.serverIP` and `cfg.services.ollama.host` are not "127.0.0.1"/"localhost"), so the mesh opening and its listener are checked as one contract. ### Tests and validation - No configured deterministic checks. ### Questions - The diff removes Lyra's LAN openings for 8265/8266/11434 and states host-local clients use loopback. The only cross-host consumer I can find is hosts/vega/default.nix:221 (covered by the new `nebula.mesh` rule), and `justfiles/maintenance.just:505` already uses 127.0.0.1:11434, but I cannot prove absence: please confirm no operator tooling or desktop client on Lyra's physical network still connects to the Tdarr UI/API or Ollama over the LAN. - The new comment asserts the Beszel opening is unnecessary. modules/services/beszel-agent.nix sets `openFirewall = false` with `LISTEN = "45876"` and `HUB_URL = "https://dashboard.nimmog.uk"`, and no host in the tree opens 45876, so removing it makes Lyra consistent with the rest of the fleet - please confirm the hub reaches agents over SSH rather than a mesh socket, since a mesh socket would now be blocked on every host. - The gate asserts 80 and 443 are closed on every Lyra interface and that `cfg.services.newt.enable` is true. The `services.newt` option is not declared in this checkout (modules/services/newt.nix only assigns it), and secrets/newt/lyra.yaml is SOPS-encrypted, so please confirm the native Newt/Pangolin ingress needs no host port on 80/443. - The diff states Docker-published ports bypass the NixOS firewalled INPUT rules, so Signal (8888) and Stash (9999) must be restricted in their Compose owners. That runtime behaviour is not observable in the supplied material; please confirm the live Compose host bindings for those Lyra stacks. ### Review limitations - No Nix toolchain in this container: I did not run `nix flake check`, build Lyra, or run `just test`; the PR's validation claims (flake check, full build, mesh/LAN probes, injected rejection checks) are unverified. - Option definitions for `services.tdarr` (serverPort/webUIPort/serverIP/nodes), `services.immich` (host/port), `services.jellyfin` (port/openFirewall), `services.ollama`, `services.newt` and `services.beszel.agent` come from nixpkgs or external flake inputs that are not present in the checked-out tree; I inferred their names and defaults only from usage in this repository. - Live Docker/Compose owners (Signal, Stash), Newt/Pangolin route configuration (secrets/newt/lyra.yaml is SOPS-encrypted), Nebula certificates, and the live Fedora Nova host are outside the supplied evidence. - potential/nova/default.nix is unregistered in flake.nix, so its loopback Ollama default and removed port list have no evaluation or build effect; I could not assess them against Nova's actual Fedora deployment. - No other pull-request material was available: no access to issue #38, milestone state, or the live deployment/canary evidence the PR says is still outstanding. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `modules/services/immich.nix`: **reviewed** — included in a context-limited batch - `modules/services/jellyfin.nix`: **reviewed** — included in a context-limited batch - `potential/nova/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/nova-remote-builder.md, README.md - Commits considered: 3 - Previous automated review: none found - Findings: 2 </details>
Author
Owner

Assessment of review65 before fixes:

  • Agree that the evaluated Immich backend port must be protected on global/physical interfaces as well as nebula.mesh. I will compose restrictedPorts from the actual backend/mesh ports plus a separate retired-port list.
  • The proposed services.jellyfin.port lookup is not valid for the pinned nixpkgs module. Its upstream source exposes no such option and documents that HTTP/HTTPS ports are managed through Jellyfin's web UI. The current, verified Newt target is 8096, so that explicit contract stays in the guard with an explanatory comment; future UI/ingress changes require live review rather than an invented Nix option.
  • Agree with checking the declared Tdarr/Ollama wildcard listeners, since this host intentionally serves both loopback and mesh clients. I will assert those declarations remain 0.0.0.0.
  • The user explicitly chose Pangolin/Nebula and removal of unnecessary direct LAN administrative access. Native Newt initiates outbound tunnel connections and the inspected Pangolin targets are loopback; it requires no inbound 80/443 opening. Signal/Stash binding and repeat-start evidence was recorded earlier. Beszel connectivity is outbound to its hub, not dependent on the removed, unused Lyra 45876 opening.

The native operator canary remains pending, so Ready to merge is not being treated as deployment acceptance.

Assessment of review65 before fixes: - Agree that the evaluated Immich backend port must be protected on global/physical interfaces as well as nebula.mesh. I will compose restrictedPorts from the actual backend/mesh ports plus a separate retired-port list. - The proposed services.jellyfin.port lookup is not valid for the pinned nixpkgs module. Its upstream source exposes no such option and documents that HTTP/HTTPS ports are managed through Jellyfin's web UI. The current, verified Newt target is 8096, so that explicit contract stays in the guard with an explanatory comment; future UI/ingress changes require live review rather than an invented Nix option. - Agree with checking the declared Tdarr/Ollama wildcard listeners, since this host intentionally serves both loopback and mesh clients. I will assert those declarations remain 0.0.0.0. - The user explicitly chose Pangolin/Nebula and removal of unnecessary direct LAN administrative access. Native Newt initiates outbound tunnel connections and the inspected Pangolin targets are loopback; it requires no inbound 80/443 opening. Signal/Stash binding and repeat-start evidence was recorded earlier. Beszel connectivity is outbound to its hub, not dependent on the removed, unused Lyra 45876 opening. The native operator canary remains pending, so Ready to merge is not being treated as deployment acceptance.
Derive backend exposure ports and guard mesh listeners
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m27s
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 14m34s
d79fb36466
Author
Owner

Review65 follow-up published as d79fb36466. The exposure check now derives backend protection from the evaluated Immich port, separates retired-port literals, and asserts the declared wildcard Tdarr/Ollama listeners. Jellyfin's verified8096 Newt contract remains explicit because pinned nixpkgs has no services.jellyfin.port option.

Full flake checks pass. Injected overridden-Immich-port reopening and loopback-only Ollama/Tdarr declarations are rejected. This revision changes only the guard, not service runtime configuration; the last runtime configuration/full Lyra build is unchanged from c2d5f6b. The isolated operator canary checkout is updated; native activation/no-op acceptance remains pending and the MR stays unmerged. A new35-minute review window is active.

Review65 follow-up published as d79fb36466d57f17a6ec156c7ab4f95f31a2d3a0. The exposure check now derives backend protection from the evaluated Immich port, separates retired-port literals, and asserts the declared wildcard Tdarr/Ollama listeners. Jellyfin's verified8096 Newt contract remains explicit because pinned nixpkgs has no services.jellyfin.port option. Full flake checks pass. Injected overridden-Immich-port reopening and loopback-only Ollama/Tdarr declarations are rejected. This revision changes only the guard, not service runtime configuration; the last runtime configuration/full Lyra build is unchanged from c2d5f6b. The isolated operator canary checkout is updated; native activation/no-op acceptance remains pending and the MR stays unmerged. A new35-minute review window is active.
clankbot left a comment

Automated code review

Reviewed commit: d79fb36466d57f17a6ec156c7ab4f95f31a2d3a0

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The change set is internally consistent with the repository's established Lyra pattern: native backends already use loopback plus the native Newt client (modules/services/atticd.nix:78 sets listen = "127.0.0.1:8081" with the same 'Pangolin reaches each backend through the local Newt client' rationale), so binding Immich to 127.0.0.1 (modules/services/immich.nix:121) and dropping the 2283/8096 firewall openings (modules/services/immich.nix, modules/services/jellyfin.nix:89) matches the existing convention. Lyra's Tdarr nodes now derive their serverURL from config.services.tdarr.server.serverPort over loopback, and the mesh opening for webUIPort/serverPort/ollama.port keeps Vega's unchanged node URL (hosts/vega/default.nix:221, http://10.10.0.3:8266 against Lyra's overlay IP 10.10.0.3 from modules/networking/nebula.nix:27) resolvable. The new gate is wired into flake.nix with the same assert-then-runCommand pattern as the neighbouring checks, and I found no Lyra-enabled module that re-adds any of its restrictedPorts (80, 443, 3280, 8888, 9999, 45876, 2283, 8096, 8265, 8266, 11434) to the global list or to a non-mesh interface, so the gate does not contradict the host configuration. Two items remain actionable: the repository's own acceptance rule for a deployment-affecting change is not yet satisfied, and the gate only half-enforces the Jellyfin loopback invariant because Jellyfin's listener is UI-managed and the port is a literal in the check. The Beszel 45876 removal is not reported as a defect: modules/services/beszel-agent.nix:18 already sets openFirewall = false with LISTEN = "45876" for every host (imported by modules/common/base.nix:24), and no other host ever opened 45876, so the removal aligns Lyra with the existing fleet state rather than breaking it.

Blocking findings

None.

Important findings

  • Required canary for Lyra's changed listener/firewall policy has not been exercised (hosts/lyra/default.nix:211; high confidence)
    The diff changes live service exposure on a deployed host (openFirewall = false for the Tdarr server, Immich host = "127.0.0.1", removal of 80/443/3280/8265/8266/8888/9999/11434/45876 from networking.firewall.allowedTCPPorts, and a new nebula.mesh opening). AGENTS.md:43 states 'Before merging a deployment-affecting change: Confirm local validation, required MR checks, and a canary appropriate to the risk', and AGENTS.md:45 requires 'just test' rather than raw nixos-rebuild test, with an auto-update hold when testing remotely. The PR text states the native NixOS changes have not yet been activated and the Lyra canary is still outstanding; README.md:256-266 points deployment and the live Docker audit to issue #38.
    Impact: The new gate proves only the evaluated firewall lists and service bindings; nothing supplied demonstrates that mesh clients (Vega's Tdarr node at 10.10.0.3:8266, Ollama consumers) still connect, that Newt's routes to 127.0.0.1:2283 and 127.0.0.1:8096 serve after activation, or that direct LAN access is in fact rejected. A regression here would be caught only at runtime.
    Suggested fix: Run the documented test-deployment path on Lyra (just test, with an auto-update hold first if testing remotely) and record the mesh reachability of Tdarr/Ollama, the Newt-served Jellyfin/Immich routes, and a rejected LAN-address probe as the acceptance evidence for issue #38 before the MR is closed.

Suggestions

  • Exposure gate hardcodes 8096, so the Jellyfin loopback invariant is only half-enforced (scripts/check-service-exposure.nix:35; medium confidence)
    loopbackPorts is built from cfg.services.immich.port plus the literal 8096, with the in-file comment 'Nixpkgs has no Jellyfin port option: its UI owns this setting.' modules/services/jellyfin.nix:89 carries the matching comment 'Preserve Jellyfin's UI-managed listener configuration'. The gate therefore asserts only that 8096 is not firewall-opened; nothing in the supplied configuration ties that literal to Jellyfin's actual UI-managed listener or to the Newt target.
    Impact: If Jellyfin's UI-managed listener ever moves off 8096, the gate still passes while the Pangolin/Newt route to 127.0.0.1:8096 silently breaks, so the 'loopback-only Jellyfin' claim in README.md:257-259 is unenforced for that one service, unlike Immich, Tdarr, and Ollama, which are derived from option values.
    Suggested fix: Keep the literal in one place rather than two: record the verified Jellyfin listener as a single host-level value consumed by both the Newt target and the gate, and have the gate assert that the Newt target list matches the configured listeners, so a listener change fails the check instead of the route.

Tests and validation

  • No configured deterministic checks.

Questions

  • Does the Beszel hub reach Lyra's agent through the listener on 45876, or does it only consume the agent's push to HUB_URL = "https://dashboard.nimmog.uk"? No host in the repository opens 45876 after this change, and modules/services/beszel-agent.nix:18 sets openFirewall = false for every host, so the answer determines whether the removal is a deliberate no-op or needs a nebula.mesh replacement.
  • Are Pangolin's Newt targets for Jellyfin and Immich configured outside this repository, and were they re-pointed to 127.0.0.1:8096 and 127.0.0.1:2283 as part of this change? No target list exists in the supplied tree, so the gate cannot cross-check it.
  • Should the Signal/Stash/wishlist Compose owners gain explicit host bindings in a companion change, given that removing 3280/8888/9999 from Lyra's firewall list does not restrict Docker-published ports (as the new comment at hosts/lyra/default.nix:222-224 and README.md state)?

Review limitations

  • No Nix tooling was run here: nothing was evaluated, built, or type-checked. The option names and defaults the gate relies on (services.tdarr.server.webUIPort/serverPort/serverIP/openFirewall, services.immich.port/host/openFirewall, services.ollama.port/host/openFirewall, services.jellyfin.openFirewall, services.newt.enable, networking.firewall.interfaces..allowedTCPPortRanges) are taken from the supplied diff; the nixpkgs module sources were not supplied, so I could not confirm that services.immich.host is the listener binding or that the Tdarr server (rather than a node) serves webUIPort.
  • Static reading only: I checked that no Lyra-enabled module re-adds any restrictedPorts value to the global list or a non-mesh interface, but I could not evaluate the composed configuration to prove the new asserts pass.
  • No live host, Docker, or Compose access: mesh reachability of Tdarr/Ollama, the Newt-served Jellyfin/Immich routes, and rejection of direct LAN access are unverified at runtime, and the Compose-side restrictions referenced in the PR text are not part of this diff.
  • potential/nova/default.nix is not registered in flake.nix, so no flake check, host build, or exposure gate covers its new loopback-Ollama/no-pre-opened-ports policy; only its syntax is covered by nix flake check, and scripts/check-service-exposure.nix throws for any host other than flake.nixosConfigurations.lyra.
  • The gate is Lyra-scoped and does not evaluate flake.nixosConfigurations.vega, so it cannot detect drift between Lyra's derived mesh port and Vega's hardcoded node URL at hosts/vega/default.nix:221; both currently resolve to 8266, so this is not a present defect.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • modules/services/immich.nix: reviewed — included in a context-limited batch
  • modules/services/jellyfin.nix: reviewed — included in a context-limited batch
  • potential/nova/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/nova-remote-builder.md, README.md
  • Commits considered: 4
  • Previous automated review: none found
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `d79fb36466d57f17a6ec156c7ab4f95f31a2d3a0` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The change set is internally consistent with the repository's established Lyra pattern: native backends already use loopback plus the native Newt client (modules/services/atticd.nix:78 sets listen = "127.0.0.1:8081" with the same 'Pangolin reaches each backend through the local Newt client' rationale), so binding Immich to 127.0.0.1 (modules/services/immich.nix:121) and dropping the 2283/8096 firewall openings (modules/services/immich.nix, modules/services/jellyfin.nix:89) matches the existing convention. Lyra's Tdarr nodes now derive their serverURL from config.services.tdarr.server.serverPort over loopback, and the mesh opening for webUIPort/serverPort/ollama.port keeps Vega's unchanged node URL (hosts/vega/default.nix:221, http://10.10.0.3:8266 against Lyra's overlay IP 10.10.0.3 from modules/networking/nebula.nix:27) resolvable. The new gate is wired into flake.nix with the same assert-then-runCommand pattern as the neighbouring checks, and I found no Lyra-enabled module that re-adds any of its restrictedPorts (80, 443, 3280, 8888, 9999, 45876, 2283, 8096, 8265, 8266, 11434) to the global list or to a non-mesh interface, so the gate does not contradict the host configuration. Two items remain actionable: the repository's own acceptance rule for a deployment-affecting change is not yet satisfied, and the gate only half-enforces the Jellyfin loopback invariant because Jellyfin's listener is UI-managed and the port is a literal in the check. The Beszel 45876 removal is not reported as a defect: modules/services/beszel-agent.nix:18 already sets openFirewall = false with LISTEN = "45876" for every host (imported by modules/common/base.nix:24), and no other host ever opened 45876, so the removal aligns Lyra with the existing fleet state rather than breaking it. ### Blocking findings None. ### Important findings - **Required canary for Lyra's changed listener/firewall policy has not been exercised** (hosts/lyra/default.nix:211; high confidence) The diff changes live service exposure on a deployed host (openFirewall = false for the Tdarr server, Immich host = "127.0.0.1", removal of 80/443/3280/8265/8266/8888/9999/11434/45876 from networking.firewall.allowedTCPPorts, and a new nebula.mesh opening). AGENTS.md:43 states 'Before merging a deployment-affecting change: Confirm local validation, required MR checks, and a canary appropriate to the risk', and AGENTS.md:45 requires 'just test' rather than raw nixos-rebuild test, with an auto-update hold when testing remotely. The PR text states the native NixOS changes have not yet been activated and the Lyra canary is still outstanding; README.md:256-266 points deployment and the live Docker audit to issue #38. Impact: The new gate proves only the evaluated firewall lists and service bindings; nothing supplied demonstrates that mesh clients (Vega's Tdarr node at 10.10.0.3:8266, Ollama consumers) still connect, that Newt's routes to 127.0.0.1:2283 and 127.0.0.1:8096 serve after activation, or that direct LAN access is in fact rejected. A regression here would be caught only at runtime. Suggested fix: Run the documented test-deployment path on Lyra (just test, with an auto-update hold first if testing remotely) and record the mesh reachability of Tdarr/Ollama, the Newt-served Jellyfin/Immich routes, and a rejected LAN-address probe as the acceptance evidence for issue #38 before the MR is closed. ### Suggestions - **Exposure gate hardcodes 8096, so the Jellyfin loopback invariant is only half-enforced** (scripts/check-service-exposure.nix:35; medium confidence) loopbackPorts is built from cfg.services.immich.port plus the literal 8096, with the in-file comment 'Nixpkgs has no Jellyfin port option: its UI owns this setting.' modules/services/jellyfin.nix:89 carries the matching comment 'Preserve Jellyfin's UI-managed listener configuration'. The gate therefore asserts only that 8096 is not firewall-opened; nothing in the supplied configuration ties that literal to Jellyfin's actual UI-managed listener or to the Newt target. Impact: If Jellyfin's UI-managed listener ever moves off 8096, the gate still passes while the Pangolin/Newt route to 127.0.0.1:8096 silently breaks, so the 'loopback-only Jellyfin' claim in README.md:257-259 is unenforced for that one service, unlike Immich, Tdarr, and Ollama, which are derived from option values. Suggested fix: Keep the literal in one place rather than two: record the verified Jellyfin listener as a single host-level value consumed by both the Newt target and the gate, and have the gate assert that the Newt target list matches the configured listeners, so a listener change fails the check instead of the route. ### Tests and validation - No configured deterministic checks. ### Questions - Does the Beszel hub reach Lyra's agent through the listener on 45876, or does it only consume the agent's push to HUB_URL = "https://dashboard.nimmog.uk"? No host in the repository opens 45876 after this change, and modules/services/beszel-agent.nix:18 sets openFirewall = false for every host, so the answer determines whether the removal is a deliberate no-op or needs a nebula.mesh replacement. - Are Pangolin's Newt targets for Jellyfin and Immich configured outside this repository, and were they re-pointed to 127.0.0.1:8096 and 127.0.0.1:2283 as part of this change? No target list exists in the supplied tree, so the gate cannot cross-check it. - Should the Signal/Stash/wishlist Compose owners gain explicit host bindings in a companion change, given that removing 3280/8888/9999 from Lyra's firewall list does not restrict Docker-published ports (as the new comment at hosts/lyra/default.nix:222-224 and README.md state)? ### Review limitations - No Nix tooling was run here: nothing was evaluated, built, or type-checked. The option names and defaults the gate relies on (services.tdarr.server.webUIPort/serverPort/serverIP/openFirewall, services.immich.port/host/openFirewall, services.ollama.port/host/openFirewall, services.jellyfin.openFirewall, services.newt.enable, networking.firewall.interfaces.<name>.allowedTCPPortRanges) are taken from the supplied diff; the nixpkgs module sources were not supplied, so I could not confirm that services.immich.host is the listener binding or that the Tdarr server (rather than a node) serves webUIPort. - Static reading only: I checked that no Lyra-enabled module re-adds any restrictedPorts value to the global list or a non-mesh interface, but I could not evaluate the composed configuration to prove the new asserts pass. - No live host, Docker, or Compose access: mesh reachability of Tdarr/Ollama, the Newt-served Jellyfin/Immich routes, and rejection of direct LAN access are unverified at runtime, and the Compose-side restrictions referenced in the PR text are not part of this diff. - potential/nova/default.nix is not registered in flake.nix, so no flake check, host build, or exposure gate covers its new loopback-Ollama/no-pre-opened-ports policy; only its syntax is covered by nix flake check, and scripts/check-service-exposure.nix throws for any host other than flake.nixosConfigurations.lyra. - The gate is Lyra-scoped and does not evaluate flake.nixosConfigurations.vega, so it cannot detect drift between Lyra's derived mesh port and Vega's hardcoded node URL at hosts/vega/default.nix:221; both currently resolve to 8266, so this is not a present defect. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `modules/services/immich.nix`: **reviewed** — included in a context-limited batch - `modules/services/jellyfin.nix`: **reviewed** — included in a context-limited batch - `potential/nova/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/nova-remote-builder.md, README.md - Commits considered: 4 - Previous automated review: none found - Findings: 2 </details>
Author
Owner

Assessment of review67:

The required native canary is valid and still outstanding. The MR remains unmerged and #38 remains open; the isolated Lyra checkout and operator hold/just test/no-op instructions have already been prepared. No additional source edit can supply activation evidence.

I am not implementing the advisory shared Jellyfin/Newt value. Pangolin targets are managed outside this repository, and Jellyfin's listener is UI-managed with no pinned nixpkgs port option. Adding an unused host value or a local copy of that target list would not validate either live authority and would create a misleading static guarantee. The guard deliberately checks the confirmed 8096 backend route; README states that Jellyfin's HTTP port has no general firewall opening, not that its mutable listener is declaratively loopback-bound. A future listener/ingress change requires the documented live review and reachability tests.

The topology questions have already been answered with inspected live state: native Pangolin targets were already localhost:8096 and 127.0.0.1:2283; Signal/Stash bindings were changed and tested in their Compose owners; wishlist/SWAG are absent; Lyra has no 45876 listener and its monitoring uses the existing outbound hub path. Those external facts cannot be proven from this Nix diff alone.

All actionable source-review improvements have been implemented and validated. CI passes for d79fb36. No further meaningful code changes are warranted by this review, so the polling timer is stopped. Native deployment/no-op acceptance and subsequent owning wiki updates are still required before merge/issue closure.

Assessment of review67: The required native canary is valid and still outstanding. The MR remains unmerged and #38 remains open; the isolated Lyra checkout and operator hold/just test/no-op instructions have already been prepared. No additional source edit can supply activation evidence. I am not implementing the advisory shared Jellyfin/Newt value. Pangolin targets are managed outside this repository, and Jellyfin's listener is UI-managed with no pinned nixpkgs port option. Adding an unused host value or a local copy of that target list would not validate either live authority and would create a misleading static guarantee. The guard deliberately checks the confirmed 8096 backend route; README states that Jellyfin's HTTP port has no general firewall opening, not that its mutable listener is declaratively loopback-bound. A future listener/ingress change requires the documented live review and reachability tests. The topology questions have already been answered with inspected live state: native Pangolin targets were already localhost:8096 and 127.0.0.1:2283; Signal/Stash bindings were changed and tested in their Compose owners; wishlist/SWAG are absent; Lyra has no 45876 listener and its monitoring uses the existing outbound hub path. Those external facts cannot be proven from this Nix diff alone. All actionable source-review improvements have been implemented and validated. CI passes for d79fb36. No further meaningful code changes are warranted by this review, so the polling timer is stopped. Native deployment/no-op acceptance and subsequent owning wiki updates are still required before merge/issue closure.
Author
Owner

Main advanced to f131213 through MR #318 (Nebula IPv6 host mapping and local self-resolution). The feature branch rebased cleanly; git range-diff confirms all four issue #38 commits retain identical patches. Full flake checks pass on the combined configuration. The combined Lyra build is being completed before publishing the rebased head.

Native acceptance is still outstanding: read-only live inspection shows Lyra's old system active, Immich still listening on 0.0.0.0:2283, and no activation of the exposure-policy canary. Therefore the source integration can be prepared safely, but this MR must not be merged yet under the repository's deployment gate. No deployed Docker binding or database configuration is changed by this integration.

Main advanced to f131213 through MR #318 (Nebula IPv6 host mapping and local self-resolution). The feature branch rebased cleanly; git range-diff confirms all four issue #38 commits retain identical patches. Full flake checks pass on the combined configuration. The combined Lyra build is being completed before publishing the rebased head. Native acceptance is still outstanding: read-only live inspection shows Lyra's old system active, Immich still listening on 0.0.0.0:2283, and no activation of the exposure-policy canary. Therefore the source integration can be prepared safely, but this MR must not be merged yet under the repository's deployment gate. No deployed Docker binding or database configuration is changed by this integration.
nimmo force-pushed fix/issue-38-service-exposure from d79fb36466
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m27s
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 14m34s
to 1bcc2d7aa2
All checks were successful
AI pull-request review / review (pull_request) Successful in 7m17s
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
Build and Push Attic Cache / test (push) Successful in 1m29s
Build and Push Attic Cache / pin-lifecycle (push) Has been skipped
Build and Push Attic Cache / build (push) Successful in 5m34s
Build and Push Attic Cache / remediate (push) Has been skipped
Build and Push Attic Cache / notify-remediation (push) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (push) Has been skipped
2026-10-12 14:38:51 +01:00
Compare
Author
Owner

The rebased MR head is now 1bcc2d7aa2 on main f131213. Combined flake checks and full Lyra build pass. Publication used an exact force-with-lease against the previously reviewed remote head, preserving any unexpected intervening work.

Lyra's isolated canary checkout is clean at the rebased head; its prior revision was retained on a backup branch, and the new closure is preloaded. No native activation was performed. CI and automated review were retriggered; two-minute review monitoring has restarted for 35 minutes. Merge remains gated on the already requested operator hold/just test/no-op and post-activation service/mesh/LAN checks, including the newly merged mesh name-resolution changes.

The rebased MR head is now 1bcc2d7aa26f82c6d8abe68e9e83f849650fe623 on main f131213. Combined flake checks and full Lyra build pass. Publication used an exact force-with-lease against the previously reviewed remote head, preserving any unexpected intervening work. Lyra's isolated canary checkout is clean at the rebased head; its prior revision was retained on a backup branch, and the new closure is preloaded. No native activation was performed. CI and automated review were retriggered; two-minute review monitoring has restarted for 35 minutes. Merge remains gated on the already requested operator hold/just test/no-op and post-activation service/mesh/LAN checks, including the newly merged mesh name-resolution changes.
clankbot left a comment

Automated code review

Reviewed commit: 1bcc2d7aa26f82c6d8abe68e9e83f849650fe623

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The change set is internally consistent and I found no evaluation-breaking defect in the supplied files. Lyra moves its Tdarr/Ollama firewall openings from the global list to networking.firewall.interfaces."nebula.mesh" (hosts/lyra/default.nix:211-215) while keeping the wildcard listeners (serverIP = "0.0.0.0", profiles.ollama.nvidia.host = "0.0.0.0"), Immich is bound to 127.0.0.1 with openFirewall = false (modules/services/immich.nix:120-122), Jellyfin and Immich lose their host firewall ports, the Wyoming speech ports 10200/10300 remain globally open, and the unregistered Nova draft drops its historical port list and sets amd.host = "127.0.0.1", which matches the profiles.ollama.amd.host default in modules/profiles/ollama.nix. Vega's cross-host Tdarr node (hosts/vega/default.nix:221, http://10.10.0.3:8266) still resolves because 8266 is now opened on nebula.mesh. The new scripts/check-service-exposure.nix gate is wired into flake.nix in the same style as the existing token-tv/redview checks and its assertions match the values written in hosts/lyra/default.nix. The real defects are narrower than the initial review claimed: one removed port (45876) belongs to a native agent that is enabled on Lyra and has no remaining access path, and the new gate's assertions are snapshot-based rather than derived from enablement or configured options.

Blocking findings

None.

Important findings

  • Lyra's Beszel agent listener on 45876 loses its only firewall path, but the new gate treats 45876 as retired (hosts/lyra/default.nix:222; medium confidence)
    The diff deletes 45876 from networking.firewall.allowedTCPPorts and adds it to no interface; the replacement comment at hosts/lyra/default.nix:222 states 'wishlist and Beszel openings are unnecessary'. Unlike Signal/Stash, Beszel on Lyra is not Docker-published: modules/common/base.nix:24 imports ../services/beszel-agent.nix for every host, and that module unconditionally sets services.beszel.agent.enable = true, openFirewall = false, LISTEN = "45876", HUB_URL = "https://dashboard.nimmog.uk" (modules/services/beszel-agent.nix:11-23); secrets/beszel/lyra.yaml exists, so the agent runs on Lyra. scripts/check-service-exposure.nix:21 then lists 45876 in retiredPorts, and lines 41-45 assert it is absent from the global firewall and from every non-mesh interface, so the new flake check actively enforces the closure rather than flagging it.
    Impact: After this change nothing in Lyra's configuration opens 45876 on any interface, so the agent is reachable only through loopback. If the Beszel hub at the external HTTPS URL polls Lyra's agent over the LAN or the mesh, Lyra's monitoring silently stops while nix flake check still reports success - the opposite of the intended 'local and Nebula paths' policy, because no mesh opening was added for this port.
    Suggested fix: Confirm the hub's transport to Lyra's agent. If it reaches the agent from outside the host, open 45876 on nebula.mesh (hosts/lyra/default.nix:211-215) and drop 45876 from retiredPorts in scripts/check-service-exposure.nix so the gate encodes the mesh path instead of a blanket retirement; otherwise record in the comment that the hub connects agent-to-hub only.

Suggestions

  • The new exposure gate asserts mesh and loopback invariants unconditionally, so it fails on opt-in services (scripts/check-service-exposure.nix:46; medium confidence)
    meshPorts (lines 10-14) is built from cfg.services.tdarr.server.webUIPort, cfg.services.tdarr.server.serverPort and cfg.services.ollama.port, and line 46 asserts all three are present on nebula.mesh with no enablement condition; the same unconditional pattern applies to loopbackPorts (line 31) and cfg.services.immich.host (line 55). The guarded services are opt-in: modules/services/tdarr.nix wraps its units in lib.optionalAttrs config.services.tdarr.server.enable, and Lyra gates them behind nixosConfig.tdarr.enable (hosts/lyra/default.nix:140) and profiles.ollama.enable.
    Impact: A later, otherwise-valid change that disables native Tdarr or Ollama on Lyra - or moves Ollama to another port - makes nix flake check fail on a bare assertion and blocks evaluation instead of reporting that the policy no longer applies. The file already anticipates drift elsewhere (line 6 throws a named message for a retired/renamed lyra host), so the inconsistency is local to these assertions.
    Suggested fix: Derive the asserted port lists from enablement, e.g. build meshPorts only for entries where cfg.services.tdarr.server.enable and cfg.services.ollama.enable are true (as modules/services/tdarr.nix already filters on node.enable), or phrase the invariant as 'when enabled' so the gate tracks policy rather than the current host snapshot.

  • The Jellyfin half of the new guard asserts a hard-coded 8096 that no option binds (scripts/check-service-exposure.nix:35; medium confidence)
    loopbackPorts hard-codes 8096 with the comment 'Nixpkgs has no Jellyfin port option: its UI owns this setting', and modules/services/jellyfin.nix deliberately keeps the listener under UI management (forceEncodingConfig = false, no port setting, comment at line 89 'Native Newt targets localhost:8096'). Nothing in the changed files binds 8096 to the actual listener, whereas Immich is covered correctly through cfg.services.immich.port.
    Impact: Lines 42-47 can pass while Jellyfin's real UI-managed listener port differs, so a future reopening of the actual Jellyfin port on a physical interface would not be caught and the check would no longer describe the backend.
    Suggested fix: Make the value authoritative: introduce a repository option (or reuse an existing ingress/listener option) for the Jellyfin backend port and assert both the Newt target and the firewall guard against it, so drift is visible at review time rather than remembered in a literal.

Tests and validation

  • No configured deterministic checks.

Questions

  • Do Lyra's Compose owners for Signal (8888) and Stash (9999) now declare loopback-only host bindings? hosts/lyra/default.nix:223-224 and README.md state this is required, but those Compose stacks live under /srv/stacks and are not in this repository, so the host firewall and the new gate cannot constrain them.
  • Does the Beszel hub reach Lyra's agent over the LAN/mesh, or only agent-to-hub over HTTPS? This determines whether removing 45876 (hosts/lyra/default.nix) is safe.
  • Have the Pangolin/Newt targets for Jellyfin and Immich been repointed to localhost:8096 and 127.0.0.1:2283 outside this repository? The change removes the LAN/mesh listeners those routes previously relied on, and nothing in the supplied files records the Pangolin-side edit.
  • Is Vega's Tdarr node (hosts/vega/default.nix:221, http://10.10.0.3:8266) still exercised over the mesh after this change? The configuration permits it via the new nebula.mesh opening, but no live probe result was supplied.
  • Should the Tdarr WebUI port 8265 remain mesh-opened for every mesh node, or only for operator hosts? Both hosts/lyra/default.nix:212 and scripts/check-service-exposure.nix:46 open/assert it fleet-wide; the intended audience is not stated in the changed files.

Review limitations

  • No Nix evaluation was performed here: nix flake check, the Lyra build, and the new gate's own pass/fail are inferred from the supplied sources, not executed.
  • Upstream nixpkgs option definitions were not available for inspection (services.tdarr.server.serverPort/webUIPort, services.immich.port, services.ollama.*, services.jellyfin.openFirewall, services.newt.enable, networking.firewall.interfaces); the gate's assertions depend on those defaults existing as assumed.
  • The new gate inspects only allowedTCPPorts and allowedTCPPortRanges on the global firewall and non-mesh interfaces; UDP ports, extraCommands/extra iptables chains, and Docker's own rule sets are outside its scope, so a green result does not prove Docker-published ports (Signal 8888, Stash 9999, SWAG 80/443) are LAN-restricted.
  • Live Docker/Compose state, Pangolin/Newt route configuration, Nebula runtime behaviour and physical-interface probes are outside the supplied material; only repository source was examined.
  • Nova's NixOS draft under potential/nova/ is unregistered in flake.nix, so none of its changes are covered by any flake check; no evaluation evidence for it was supplied.
  • The initial review's claim that the removed 8888/9999/45876 openings leave Docker-published services LAN-reachable was not promoted to a finding: the 8888/9999 half is stated by the diff's own comment and its fix lies outside this repository, and the 45876 half is reported separately as the Beszel finding above.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • modules/services/immich.nix: reviewed — included in a context-limited batch
  • modules/services/jellyfin.nix: reviewed — included in a context-limited batch
  • potential/nova/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/nova-remote-builder.md, README.md
  • Commits considered: 4
  • Previous automated review: none found
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `1bcc2d7aa26f82c6d8abe68e9e83f849650fe623` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The change set is internally consistent and I found no evaluation-breaking defect in the supplied files. Lyra moves its Tdarr/Ollama firewall openings from the global list to `networking.firewall.interfaces."nebula.mesh"` (hosts/lyra/default.nix:211-215) while keeping the wildcard listeners (`serverIP = "0.0.0.0"`, `profiles.ollama.nvidia.host = "0.0.0.0"`), Immich is bound to 127.0.0.1 with `openFirewall = false` (modules/services/immich.nix:120-122), Jellyfin and Immich lose their host firewall ports, the Wyoming speech ports 10200/10300 remain globally open, and the unregistered Nova draft drops its historical port list and sets `amd.host = "127.0.0.1"`, which matches the `profiles.ollama.amd.host` default in modules/profiles/ollama.nix. Vega's cross-host Tdarr node (hosts/vega/default.nix:221, `http://10.10.0.3:8266`) still resolves because 8266 is now opened on `nebula.mesh`. The new `scripts/check-service-exposure.nix` gate is wired into flake.nix in the same style as the existing token-tv/redview checks and its assertions match the values written in hosts/lyra/default.nix. The real defects are narrower than the initial review claimed: one removed port (45876) belongs to a native agent that is enabled on Lyra and has no remaining access path, and the new gate's assertions are snapshot-based rather than derived from enablement or configured options. ### Blocking findings None. ### Important findings - **Lyra's Beszel agent listener on 45876 loses its only firewall path, but the new gate treats 45876 as retired** (hosts/lyra/default.nix:222; medium confidence) The diff deletes `45876` from `networking.firewall.allowedTCPPorts` and adds it to no interface; the replacement comment at hosts/lyra/default.nix:222 states 'wishlist and Beszel openings are unnecessary'. Unlike Signal/Stash, Beszel on Lyra is not Docker-published: `modules/common/base.nix:24` imports `../services/beszel-agent.nix` for every host, and that module unconditionally sets `services.beszel.agent.enable = true`, `openFirewall = false`, `LISTEN = "45876"`, `HUB_URL = "https://dashboard.nimmog.uk"` (modules/services/beszel-agent.nix:11-23); `secrets/beszel/lyra.yaml` exists, so the agent runs on Lyra. `scripts/check-service-exposure.nix:21` then lists 45876 in `retiredPorts`, and lines 41-45 assert it is absent from the global firewall and from every non-mesh interface, so the new flake check actively enforces the closure rather than flagging it. Impact: After this change nothing in Lyra's configuration opens 45876 on any interface, so the agent is reachable only through loopback. If the Beszel hub at the external HTTPS URL polls Lyra's agent over the LAN or the mesh, Lyra's monitoring silently stops while `nix flake check` still reports success - the opposite of the intended 'local and Nebula paths' policy, because no mesh opening was added for this port. Suggested fix: Confirm the hub's transport to Lyra's agent. If it reaches the agent from outside the host, open 45876 on `nebula.mesh` (hosts/lyra/default.nix:211-215) and drop 45876 from `retiredPorts` in scripts/check-service-exposure.nix so the gate encodes the mesh path instead of a blanket retirement; otherwise record in the comment that the hub connects agent-to-hub only. ### Suggestions - **The new exposure gate asserts mesh and loopback invariants unconditionally, so it fails on opt-in services** (scripts/check-service-exposure.nix:46; medium confidence) `meshPorts` (lines 10-14) is built from `cfg.services.tdarr.server.webUIPort`, `cfg.services.tdarr.server.serverPort` and `cfg.services.ollama.port`, and line 46 asserts all three are present on `nebula.mesh` with no enablement condition; the same unconditional pattern applies to `loopbackPorts` (line 31) and `cfg.services.immich.host` (line 55). The guarded services are opt-in: `modules/services/tdarr.nix` wraps its units in `lib.optionalAttrs config.services.tdarr.server.enable`, and Lyra gates them behind `nixosConfig.tdarr.enable` (hosts/lyra/default.nix:140) and `profiles.ollama.enable`. Impact: A later, otherwise-valid change that disables native Tdarr or Ollama on Lyra - or moves Ollama to another port - makes `nix flake check` fail on a bare assertion and blocks evaluation instead of reporting that the policy no longer applies. The file already anticipates drift elsewhere (line 6 throws a named message for a retired/renamed `lyra` host), so the inconsistency is local to these assertions. Suggested fix: Derive the asserted port lists from enablement, e.g. build `meshPorts` only for entries where `cfg.services.tdarr.server.enable` and `cfg.services.ollama.enable` are true (as `modules/services/tdarr.nix` already filters on `node.enable`), or phrase the invariant as 'when enabled' so the gate tracks policy rather than the current host snapshot. - **The Jellyfin half of the new guard asserts a hard-coded 8096 that no option binds** (scripts/check-service-exposure.nix:35; medium confidence) `loopbackPorts` hard-codes `8096` with the comment 'Nixpkgs has no Jellyfin port option: its UI owns this setting', and `modules/services/jellyfin.nix` deliberately keeps the listener under UI management (`forceEncodingConfig = false`, no port setting, comment at line 89 'Native Newt targets localhost:8096'). Nothing in the changed files binds 8096 to the actual listener, whereas Immich is covered correctly through `cfg.services.immich.port`. Impact: Lines 42-47 can pass while Jellyfin's real UI-managed listener port differs, so a future reopening of the actual Jellyfin port on a physical interface would not be caught and the check would no longer describe the backend. Suggested fix: Make the value authoritative: introduce a repository option (or reuse an existing ingress/listener option) for the Jellyfin backend port and assert both the Newt target and the firewall guard against it, so drift is visible at review time rather than remembered in a literal. ### Tests and validation - No configured deterministic checks. ### Questions - Do Lyra's Compose owners for Signal (8888) and Stash (9999) now declare loopback-only host bindings? hosts/lyra/default.nix:223-224 and README.md state this is required, but those Compose stacks live under /srv/stacks and are not in this repository, so the host firewall and the new gate cannot constrain them. - Does the Beszel hub reach Lyra's agent over the LAN/mesh, or only agent-to-hub over HTTPS? This determines whether removing 45876 (hosts/lyra/default.nix) is safe. - Have the Pangolin/Newt targets for Jellyfin and Immich been repointed to localhost:8096 and 127.0.0.1:2283 outside this repository? The change removes the LAN/mesh listeners those routes previously relied on, and nothing in the supplied files records the Pangolin-side edit. - Is Vega's Tdarr node (hosts/vega/default.nix:221, `http://10.10.0.3:8266`) still exercised over the mesh after this change? The configuration permits it via the new `nebula.mesh` opening, but no live probe result was supplied. - Should the Tdarr WebUI port 8265 remain mesh-opened for every mesh node, or only for operator hosts? Both hosts/lyra/default.nix:212 and scripts/check-service-exposure.nix:46 open/assert it fleet-wide; the intended audience is not stated in the changed files. ### Review limitations - No Nix evaluation was performed here: `nix flake check`, the Lyra build, and the new gate's own pass/fail are inferred from the supplied sources, not executed. - Upstream nixpkgs option definitions were not available for inspection (`services.tdarr.server.serverPort`/`webUIPort`, `services.immich.port`, `services.ollama.*`, `services.jellyfin.openFirewall`, `services.newt.enable`, `networking.firewall.interfaces`); the gate's assertions depend on those defaults existing as assumed. - The new gate inspects only `allowedTCPPorts` and `allowedTCPPortRanges` on the global firewall and non-mesh interfaces; UDP ports, `extraCommands`/extra iptables chains, and Docker's own rule sets are outside its scope, so a green result does not prove Docker-published ports (Signal 8888, Stash 9999, SWAG 80/443) are LAN-restricted. - Live Docker/Compose state, Pangolin/Newt route configuration, Nebula runtime behaviour and physical-interface probes are outside the supplied material; only repository source was examined. - Nova's NixOS draft under potential/nova/ is unregistered in flake.nix, so none of its changes are covered by any flake check; no evaluation evidence for it was supplied. - The initial review's claim that the removed 8888/9999/45876 openings leave Docker-published services LAN-reachable was not promoted to a finding: the 8888/9999 half is stated by the diff's own comment and its fix lies outside this repository, and the 45876 half is reported separately as the Beszel finding above. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `modules/services/immich.nix`: **reviewed** — included in a context-limited batch - `modules/services/jellyfin.nix`: **reviewed** — included in a context-limited batch - `potential/nova/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/nova-remote-builder.md, README.md - Commits considered: 4 - Previous automated review: none found - Findings: 3 </details>
Author
Owner

Native canary evidence (2026-10-12): the operator completed the documented just test-remote lyra command. Its Gitless source snapshot does not carry a configurationRevision; the controller branch is clean at 1bcc2d7, and the active snapshot closure is /nix/store/5aybxhmgxdag3dphksdb4z7kgd6g487d-nixos-system-lyra-26.11.20261008.8edc0c7.

Read-only post-activation checks confirm Newt, Immich, Jellyfin, Tdarr server, both local Tdarr nodes and Ollama are active. Immich now binds 127.0.0.1:2283. From Electra, native Tdarr UI/API and Ollama return HTTP200 over Nebula; direct LAN TCP probes to 2283/8096/8265/8266/11434 all fail. Jellyfin/Immich backends reject direct mesh probes and return200 locally and through their existing Pangolin health routes. From Vega, Tdarr responds302 and Ollama200; Vega's Tdarr node remains active. The newly merged Lyra hosts mapping resolves both overlay families, and the active interface has both addresses.

The user has been asked whether the identical command was run a second time for the no-op follow-up; no confirmation is assumed. The updater is inactive with its next scheduled run later this afternoon; a hold was not observed, so this record does not claim a hold was used. Required CI for the rebased head remains queued. The MR is still unmerged pending no-op confirmation and required checks.

Native canary evidence (2026-10-12): the operator completed the documented just test-remote lyra command. Its Gitless source snapshot does not carry a configurationRevision; the controller branch is clean at 1bcc2d7, and the active snapshot closure is /nix/store/5aybxhmgxdag3dphksdb4z7kgd6g487d-nixos-system-lyra-26.11.20261008.8edc0c7. Read-only post-activation checks confirm Newt, Immich, Jellyfin, Tdarr server, both local Tdarr nodes and Ollama are active. Immich now binds 127.0.0.1:2283. From Electra, native Tdarr UI/API and Ollama return HTTP200 over Nebula; direct LAN TCP probes to 2283/8096/8265/8266/11434 all fail. Jellyfin/Immich backends reject direct mesh probes and return200 locally and through their existing Pangolin health routes. From Vega, Tdarr responds302 and Ollama200; Vega's Tdarr node remains active. The newly merged Lyra hosts mapping resolves both overlay families, and the active interface has both addresses. The user has been asked whether the identical command was run a second time for the no-op follow-up; no confirmation is assumed. The updater is inactive with its next scheduled run later this afternoon; a hold was not observed, so this record does not claim a hold was used. Required CI for the rebased head remains queued. The MR is still unmerged pending no-op confirmation and required checks.
Author
Owner

Assessment of review68 and completed canary/no-op:

The operator confirms a second identical just test-remote lyra pass completed. Read-only checks show Immich and the local Intel Tdarr node retain their activation timestamps from the first pass; all tested native routes and direct-LAN restrictions remain correct. The native canary/no-op gate is now satisfied.

The Beszel finding is not a live defect. After activation, beszel-agent.service is active, no TCP45876 listener exists, and the hub reports Lyra UP with a fresh update at 2026-10-12T13:48:02Z, later than the canary. Service monitoring reports zero failed units. This confirms monitoring still works with inbound45876 closed. Beszel supports agent-initiated WebSocket transport to HUB_URL independently of its optional inbound SSH listener: https://beszel.dev/guide/security. No extra mesh/LAN port will be opened without an actual consumer requirement.

The opt-in suggestion is a possible future generalisation, not a current defect: this check intentionally validates Lyra's reviewed native-service composition, whose hosts/lyra/default.nix explicitly enables these services. An intentional service retirement or migration must update the corresponding exposure contract rather than silently preserve unused openings. Port moves are already derived from the service options and checked with injected overrides.

The shared Jellyfin/Newt option suggestion remains declined for the reason in comment3280: both authoritative settings are external and a local copy cannot assert their live state. The canary now verifies the actual local/Pangolin endpoints.

No further source changes are warranted by this feedback. The remaining merge gate is the required CI job for 1bcc2d7, currently waiting for the Nova runner. I am inspecting that queue; no checks will be bypassed.

Assessment of review68 and completed canary/no-op: The operator confirms a second identical just test-remote lyra pass completed. Read-only checks show Immich and the local Intel Tdarr node retain their activation timestamps from the first pass; all tested native routes and direct-LAN restrictions remain correct. The native canary/no-op gate is now satisfied. The Beszel finding is not a live defect. After activation, beszel-agent.service is active, no TCP45876 listener exists, and the hub reports Lyra UP with a fresh update at 2026-10-12T13:48:02Z, later than the canary. Service monitoring reports zero failed units. This confirms monitoring still works with inbound45876 closed. Beszel supports agent-initiated WebSocket transport to HUB_URL independently of its optional inbound SSH listener: https://beszel.dev/guide/security. No extra mesh/LAN port will be opened without an actual consumer requirement. The opt-in suggestion is a possible future generalisation, not a current defect: this check intentionally validates Lyra's reviewed native-service composition, whose hosts/lyra/default.nix explicitly enables these services. An intentional service retirement or migration must update the corresponding exposure contract rather than silently preserve unused openings. Port moves are already derived from the service options and checked with injected overrides. The shared Jellyfin/Newt option suggestion remains declined for the reason in comment3280: both authoritative settings are external and a local copy cannot assert their live state. The canary now verifies the actual local/Pangolin endpoints. No further source changes are warranted by this feedback. The remaining merge gate is the required CI job for 1bcc2d7, currently waiting for the Nova runner. I am inspecting that queue; no checks will be bypassed.
nimmo merged commit 1bcc2d7aa2 into main 2026-10-12 14:57:28 +01:00
Sign in to join this conversation.
No reviewers
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!317
No description provided.