Commit graph

162 commits

Author SHA1 Message Date
5426e3847b router: expose forwarded ports on eno1; AdGuard rewrite for LAN hostname
- Input chain now accepts WAN traffic for every port in ports.toml so
  external access (SSH, HTTP, HTTPS, game ports) works through the eero's
  upstream port forwards during phase 1, and via our own DNAT in phase 2.
- Add AdGuard DNS rewrite nordhammer.it → 192.168.4.25 so LAN clients
  hit the mediaserver directly instead of relying on eero hairpin NAT.
  Target changes to 10.0.0.1 at phase 2 cutover.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 10:22:56 +01:00
661ad14948 router: trust the legacy eero subnet on eno1 during phase 1
Without this, the default-drop input policy blocked SSH and AdGuard DNS
from existing 192.168.4.x clients because they arrive on eno1 (still
acting as a client on the eero network until phase 2 cutover).

The trustedLegacyCidrs list is meant to be emptied in phase 2 when
eno1 becomes the ISP-facing WAN.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 10:17:06 +01:00
77eafded92 Turn mediaserver into a home router
Adds services/router.nix with systemd-networkd (eno1=WAN via DHCP,
eth0=LAN 10.0.0.1/24), nftables (NAT + firewall, default drop on WAN
in), dnsmasq (DHCP only — AdGuard Home keeps :53 for DNS), and sysctl
IP forwarding. NetworkManager is forced off on this host.

Port forwards live in ports.toml at the repo root and are imported via
builtins.fromTOML. Supports single ports, ranges ("26901-26902"), and
"both" protocol. Initial forwards: 22, 80, 443, 26900, 26901-26902.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 09:48:38 +01:00
7ee5a37fc5 arr-interconnect: add gawk to PATH for idempotency check
The quality-floor helper uses awk to compare floats (since jq output
can be 10 vs 10.0 depending on type). Without gawk on PATH, the check
failed silently and every run issued PUTs even when values already
matched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 21:44:02 +01:00
194d488942 arr-interconnect: floor 1080p quality at 10 MB/min
Sonarr/Radarr default minSize=0 let through tiny sub-bitrate releases
(e.g. 163 MiB for a 40-min episode = 0.8 Mbps, unwatchable). Set min to
10 MB/min (~1.3 Mbps) across HDTV/WEBDL/WEBRip/Bluray 1080p so anything
below that is rejected on grab. Idempotent: only PUTs when value differs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 21:41:50 +01:00
a825e36e2e Make AdGuard settings authoritative; add busybox; drop fallback DNS
- services/adguard.nix: mutableSettings = false so Nix config overrides
  UI-made changes on rebuild (settings are the source of truth)
- common.nix: add busybox for its collection of handy utilities
- common.nix: remove networking.nameservers — DNS now comes purely from
  per-host NetworkManager config (AdGuard as the only resolver, no leaks)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 19:57:55 +01:00
b7aa8e20ef nginx: move adguard vhost behind Authelia forward auth
Pairs with the prior commit that added the ACL rule.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 14:16:52 +01:00
070efb961a Wire AdGuard Home into Authelia SSO and Homepage dashboard
- adguard.nordhammer.it now routes through Authelia forward auth
  (AdGuard Home itself has no login, so this becomes the single gate)
- Added Authelia ACL rule for the subdomain so default_policy=deny
  returns 401 for redirect instead of 403
- Added AdGuard Home widget to Homepage under Infrastructure

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 14:15:57 +01:00
8aeb8e2de7 adguard: parallel upstreams + plain UDP fallbacks for speed
DoH-only sequential upstreams made first-time lookups slow. Add plain
UDP 1.1.1.1/9.9.9.9 alongside DoH and set upstream_mode=parallel so
AdGuard queries all four simultaneously and uses the fastest response.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 14:04:24 +01:00
919c991e3d Add AdGuard Home for network-wide DNS ad blocking
New services/adguard.nix runs AdGuard Home on the mediaserver with DoH
upstreams (Cloudflare + Quad9) and three default blocklists. DNS listens
on :53; web UI on 127.0.0.1:3000, reverse-proxied at adguard.nordhammer.it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 13:40:30 +01:00
032693ef39 Authorize 7dtd.nordhammer.it in Authelia ACL
Without this rule the subdomain falls under default_policy=deny,
which returns 403 instead of the 401 that nginx needs to redirect
to the Authelia login page.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 23:23:48 +01:00
dfbc727f5f Disable EAC on 7DTD server so Proton clients can connect
Proton-based clients (e.g. CachyOS native install hitting 7DTD via
the Proton runtime) fail EAC handshake against a Linux dedicated
server. Disabling server-side lets Proton clients join via the
"Play without EasyAntiCheat" splash option.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 23:05:08 +01:00
740fca4fcf Expose 7DTD WebDashboard behind Authelia at 7dtd.nordhammer.it
Publishes the container's web dashboard port only on host loopback
(127.0.0.1:8090) so nginx can reverse-proxy it with Authelia
forward-auth, matching the Homepage/camera vhost pattern. Also flips
WebDashboardEnabled to true in the XML patcher so the server actually
starts the web server.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 21:43:11 +01:00
c05f986e1c Add 7 Days to Die dedicated server container; drop V-Rising
Enables the previously-disabled game-servers module with a new 7DTD
container (vinanrra/7dtd-server) on ports 26900 TCP + 26900-26902 UDP.
A oneshot systemd service waits for LGSM's first install to drop
sdtdserver.xml, then patches in the server name, password, and
random-gen world before restarting the container. V-Rising is removed
— the module hadn't been imported, so this just drops dead code.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 22:28:49 +01:00
d80ccf4e6d Stop Sonarr/Radarr from nuking qBittorrent torrents after import
Sonarr was silently removing torrents from qBittorrent once imports
completed, killing seeding. Set removeCompletedDownloads to false for
both clients so torrents stick around and keep seeding post-import.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 21:23:28 +01:00
d450b8e021 Seed placeholder latest.json so Homepage widget doesn't 404 pre-update
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-16 21:19:23 +01:00
f57c6e99ec Add Last Update widget to Homepage via record-update script
record-update parses nvd diff after switch and writes latest.json;
Homepage polls a local-only nginx listener and renders date/changes/
closure/kernel via a customapi widget.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-16 20:58:19 +01:00
2e29d3dce5 Force UMask=0002 on Radarr, Sonarr, Bazarr
New nixpkgs defaults for the *arr services set UMask=0022, which
conflicts with the media-group-writable overrides. Wrap with
lib.mkForce alongside the existing Jellyfin fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 20:22:37 +01:00
c4421b32a8 Force Jellyfin UMask=0002 to override new nixpkgs default
nixpkgs now sets UMask=0077 on the Jellyfin service, conflicting with
our override that ensures media-group writes. Wrapping with lib.mkForce
restores the intended permission bits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 20:20:01 +01:00
2096330eb8 Theme btop and Homepage via matugen on the mediaserver
Share the wallpaper symlink across all hosts by moving it from gnome.nix
into home-manager/fred.nix, and add matugen templates for btop and the
Homepage dashboard.

The Homepage NixOS module writes custom.css into /etc (read-only), so
bind-mount /var/lib/homepage-custom-css/custom.css over it. A systemd
path unit restarts homepage-dashboard whenever matugen rewrites the
file, so regeneration works without sudo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 20:17:38 +01:00
984f45e1d4 Set UMask 0002 on all media services for group-writable files
Sonarr, Radarr, qBittorrent, Jellyfin, and Bazarr all need to create
files that are writable by the media group. Without this, Jellyfin
can't write thumbnails/artwork to media directories and services
can't collaborate on shared files. Also fixes radarr movies directory
to use setgid (2775) consistently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 23:23:56 +01:00
df227ad173 Revert "Add Tdarr transcoding manager for bulk H.264→HEVC conversion"
This reverts commit 91c437de6d.
2026-04-15 10:23:28 +01:00
91c437de6d Add Tdarr transcoding manager for bulk H.264→HEVC conversion
Runs Tdarr server with internal node on the mediaserver for managing
library-wide re-encoding to save disk space. Web UI at tdarr.nordhammer.it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 10:17:09 +01:00
Claude
98cc3de7bc
jellyfin: enable NVENC hardware transcoding via Quadro M2000
- Add NVIDIA proprietary driver config to FredOS-Mediaserver hardware
  (Maxwell/GM206, open=false, modesetting enabled, headless)
- Enable hardware.graphics for DRM/KMS infrastructure
- Add jellyfin user to video and render groups for device access

After deploying, enable NVENC in Jellyfin: Dashboard → Playback →
Transcoding → Hardware acceleration: Nvidia NVENC.

https://claude.ai/code/session_016jJU8ZtWLSnJQBdbMr5pxK
2026-04-15 07:17:09 +00:00
fb8f75e9c7 Increase ACME DNS propagation timeout to 10 minutes
Cloudflare's authoritative nameservers take longer than the
default 2-minute timeout to propagate TXT records created via
API. Set CLOUDFLARE_PROPAGATION_TIMEOUT=600 to give enough
time for DNS-01 challenge validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 22:48:58 +01:00
337b90ced3 Fix ACME DNS resolver flag placement (global, not subcommand)
--dns.resolvers is a global lego flag, not a run/renew subcommand
flag. Use extraLegoFlags instead of extraLegoRunFlags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 22:41:55 +01:00
6ae3f8be97 Use Cloudflare resolver for ACME DNS propagation check
Route DNS propagation checks through 1.1.1.1 only, bypassing
the local resolver that caches stale responses and causes
wildcard cert DNS-01 challenges to time out.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 22:38:20 +01:00
beadcc5397 Use propagation wait instead of disabling ACME DNS check
Disabling the propagation check caused lego to submit to Let's
Encrypt before Cloudflare's authoritative nameservers had the
TXT record. A 30s wait gives Cloudflare time to propagate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 22:36:48 +01:00
3c0746e23b Skip ACME DNS propagation check for local resolver caching
Local DNS resolver caches stale responses causing the wildcard
cert DNS-01 challenge to time out before propagation is confirmed.
Cloudflare's authoritative servers propagate fast enough for
Let's Encrypt to validate without the client-side check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 22:33:13 +01:00
0f27ac2da8 Fix V Rising container CRLF issue by stripping carriage returns on start
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 20:00:30 +01:00
Claude
b2e6844e9e
Comment out Hytale server in game-servers.nix
https://claude.ai/code/session_01Ays1x4CUUJE1jPLkeNMojV
2026-04-11 14:48:23 +00:00
Claude
a35281419f
Move V-Rising Docker server into game-servers.nix
Consolidates V-Rising into the existing game-servers module instead of
a separate file. Also uncomments the game-servers import in common.nix
and adds UDP 9876/9877 to the shared firewall rules.

https://claude.ai/code/session_01Ays1x4CUUJE1jPLkeNMojV
2026-04-11 14:46:04 +00:00
Claude
f556d887c3
Add V-Rising dedicated server via Docker on FredOS-Mediaserver
Uses NixOS virtualisation.oci-containers (Docker backend) with the
trueosiris/vrising image. Persists server files and save data under
/var/lib/v-rising/. Opens UDP 9876/9877 in the firewall.

https://claude.ai/code/session_01Ays1x4CUUJE1jPLkeNMojV
2026-04-11 14:45:02 +00:00
6a2563f058 Fix go2rtc: use RuntimeDirectory instead of mkdir /run/go2rtc
DynamicUser can't write to /run directly. RuntimeDirectory lets systemd
create and manage the directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 20:51:22 +01:00
595efbb25a Move go2rtc RTSP credentials out of nix store, document all secrets
- go2rtc.nix: template config at runtime from /var/secrets/go2rtc-rtsp-url
  instead of embedding credentials in the nix store
- readme.md: add Mediaserver secrets section documenting all secrets
  needed for a fresh deploy (Cloudflare, go2rtc, Authelia)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 20:49:04 +01:00
08669d7eb5 Update docs: add new services to readme, remove obsolete go2rtc-readme
- readme.md: add authelia, fail2ban, homepage, arr-interconnect, nginx
  description updated to mention ACME. Remove omnisearch, add cachyos
  kernel to flake inputs table.
- cloudflare-ddns.md: document shared token usage with ACME, note
  Zone:Zone:Read permission requirement.
- Delete go2rtc-readme.md (documented Docker setup, now native NixOS).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 20:42:19 +01:00
372275da5e Fix Authelia forward-auth to match proven working NPM config
- Use /api/verify endpoint instead of /api/authz/forward-auth
- Add proxy_pass_request_body off to auth location
- Put redirect URL inline in error_page instead of using a variable
- Use X-Forwarded-Uri (matching old config) instead of X-Forwarded-URI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 20:35:59 +01:00
09d24eecf3 Fix Authelia forward-auth: use set instead of auth_request_set for redirect URL
auth_request_set reads variables from the auth subrequest context where
$scheme/$http_host/$request_uri are empty, causing a 500 instead of a
302 redirect. Using set captures from the main request context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 20:31:03 +01:00
64bd0b8f0b Fix nginx proxy_headers_hash warning from Authelia forward-auth headers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 17:27:23 +01:00
9ce1e00ea5 Remove broken --dns.propagation-wait flag, rely on default propagation check
The CNAME interference is resolved so the default lego propagation check
(querying Cloudflare authoritative NS) should work correctly now.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 17:20:19 +01:00
476379f4e4 Fix ACME: add 30s propagation wait and re-enable full DNS check
The previous dnsPropagationCheck=false caused lego to ask LE to validate
before the TXT record was globally visible. Adding --dns.propagation-wait
gives Cloudflare time to serve the record from all edge locations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 17:16:07 +01:00
b27d2913e8 Disable ACME DNS propagation check for Cloudflare
Cloudflare is the authoritative NS so API-created TXT records are
immediately visible — the propagation poll was timing out unnecessarily.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 16:53:00 +01:00
9838154b25 Fix authelia-setup: create state directory before migrating user database
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 15:58:51 +01:00
eadbc92126 Replace Docker containers with native NixOS modules for nginx, Authelia, and go2rtc
- Native nginx with ACME wildcard cert (*.nordhammer.it) via Cloudflare DNS-01
- Native Authelia SSO with forward auth protecting homepage + camera
- Native go2rtc camera streaming (no more Docker)
- Auto-migration script for Authelia secrets and user database from Docker
- Homepage hrefs updated to use HTTPS domain names
- Fail2ban updated for native nginx log paths + new Authelia jail

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 15:47:56 +01:00
f59fce5087 Add auto-interconnect service for *arr stack
Systemd oneshot that runs after all services start and configures:
- Prowlarr → Sonarr (TV indexers, full sync)
- Prowlarr → Radarr (movie indexers, full sync)
- Sonarr → qBittorrent (download client, category: tv-sonarr)
- Radarr → qBittorrent (download client, category: radarr)
- Bazarr → Sonarr (subtitle management for TV)
- Bazarr → Radarr (subtitle management for movies)

Fully idempotent — checks for existing connections before creating.
API keys extracted from each app's config files at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 13:45:53 +01:00
d878d3b20c Auto-extract API keys for Homepage dashboard
Adds a systemd oneshot that runs before homepage-dashboard and:
- Reads *arr API keys from their config.xml files
- Reads Bazarr key from config.ini
- Creates a Jellyfin API key in the DB if one named "Homepage" doesn't exist
- Uses localhost for qBittorrent (LocalHostAuth=false, no creds needed)
- Writes everything to /etc/homepage-secrets

Zero manual setup — all keys are extracted or generated automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 13:13:17 +01:00
29dae0c5ea Add Homepage dashboard for FredOS-Mediaserver
Covers all running services: Jellyfin, Sonarr, Radarr, Bazarr, Prowlarr,
qBittorrent, Nginx Proxy Manager, Authelia, go2rtc. Live widgets for
*arr apps, Jellyfin now-playing, and qBittorrent speed use API keys
loaded from /etc/homepage-secrets (outside the Nix store).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 12:55:42 +01:00
39450ca786 Remove Suricata/ELK; add SSH key auth and disable password login
Adds authorised keys for FredOS-Gaming and phone. Disables SSH password
authentication on FredOS-Mediaserver — key auth only going forward.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:48:08 +01:00
ddb208b95d Fix ELK: explicitly disable ES 8.x security on both containers
ES 8.x enables security and enrollment by default. Adding
xpack.security.enrollment.enabled=false to Elasticsearch and
xpack.security.enabled=false to Kibana suppresses the enrollment
token screen and lets Kibana connect directly over HTTP.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:31:02 +01:00
699bbd9f9a Add ELK stack for Suricata log visualisation
Elasticsearch + Kibana + Filebeat in Docker, bridged via an elk network.
Filebeat uses the Suricata module to parse eve.json and auto-installs
Kibana dashboards on first run. ES heap capped at 1g; Kibana Node heap
at 512m — total stack ~2-2.5 GB RAM.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:25:29 +01:00