From 2058847d251a91ff73fde5e37f659df7dc5423a2 Mon Sep 17 00:00:00 2001 From: Alois Date: Wed, 29 Jul 2026 23:55:06 +0200 Subject: [PATCH] Update stuff --- README.md | 2 +- flake.nix | 28 +++------------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index dce0000..4c531e6 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ ssh -L 8081:127.0.0.1:8081 status-host ## NixOS -The included module serves the SPA with nginx on TCP 443 and MTP HTTP/3/WebTransport on UDP 443. Both use the same ACME certificate and origin. +The included module serves the SPA with MTP HTTP/3/WebTransport on UDP 443 using an ACME certificate. ```nix { diff --git a/flake.nix b/flake.nix index 8585b41..b315676 100644 --- a/flake.nix +++ b/flake.nix @@ -257,7 +257,7 @@ publicPort = lib.mkOption { type = lib.types.port; default = 443; - description = "Shared nginx TCP and MTP UDP public port."; + description = "Public UDP port for the MTP server."; }; adminAddress = lib.mkOption { type = lib.types.str; @@ -287,7 +287,7 @@ openFirewall = lib.mkOption { type = lib.types.bool; default = false; - description = "Open the public TCP and UDP port in the firewall."; + description = "Open the public UDP port in the firewall."; }; openAdminFirewall = lib.mkOption { type = lib.types.bool; @@ -332,32 +332,12 @@ isSystemUser = true; group = "methanium-status"; }; - users.users.nginx.extraGroups = [ "methanium-status" ]; security.acme.certs.${acmeHost} = { group = "methanium-status"; reloadServices = [ "methanium-status.service" ]; }; - services.nginx = { - enable = true; - virtualHosts.${cfg.hostName} = { - forceSSL = true; - enableACME = cfg.acmeHost == null; - useACMEHost = lib.mkIf (cfg.acmeHost != null) acmeHost; - root = cfg.frontendPackage; - listen = [ - { addr = "0.0.0.0"; port = cfg.publicPort; ssl = true; } - { addr = "[::]"; port = cfg.publicPort; ssl = true; } - ]; - extraConfig = '' - add_header Alt-Svc 'h3=":${toString cfg.publicPort}"; ma=86400' always; - ''; - locations."/".tryFiles = "$uri $uri/ /index.html"; - locations."^~ /edit".return = "404"; - }; - }; - systemd.services.methanium-status = { description = "Methanium Status monitor"; wantedBy = [ "multi-user.target" ]; @@ -393,9 +373,7 @@ }; }; - networking.firewall.allowedTCPPorts = - lib.optionals cfg.openFirewall [ cfg.publicPort ] - ++ lib.optionals cfg.openAdminFirewall [ cfg.adminPort ]; + networking.firewall.allowedTCPPorts = lib.optionals cfg.openAdminFirewall [ cfg.adminPort ]; networking.firewall.allowedUDPPorts = lib.optionals cfg.openFirewall [ cfg.publicPort ]; }; };