From 4a9c3cf2462f3fe69e20ca6f3803c7e9d71b6647 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sat, 10 Jun 2023 03:15:26 +0200 Subject: [PATCH] deluge: port to vhost --- hosts/architect/deluge.nix | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/hosts/architect/deluge.nix b/hosts/architect/deluge.nix index 98522f8..8f2fcd3 100644 --- a/hosts/architect/deluge.nix +++ b/hosts/architect/deluge.nix @@ -2,11 +2,6 @@ let domain = "htdel.giugl.io"; - auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block; - - utilities = import ./utilities.nix { inherit lib config; }; - inherit (utilities) architectInterfaceAddress; - listenPorts = [ 51413 51414 ]; in { @@ -41,25 +36,22 @@ in authFile = "/secrets/deluge/auth"; extraPackages = [ pkgs.unrar ]; }; + }; - nginx.virtualHosts.${domain} = { - forceSSL = true; - enableACME = true; + architect.vhost.${domain} = with config.architect.networks; { + dnsInterfaces = [ "lan" "wireguard" "tailscale" ]; + locations = { + "/" = { + allowLan = true; + port = 8112; - locations."/" = { - proxyPass = "http://127.0.0.1:8112"; - extraConfig = auth_block { - access_role = "deluge"; - }; + allow = [ + wireguard.net + tailscale.net + ]; }; }; }; - networking.extraHosts = '' - ${architectInterfaceAddress "lan"} ${domain} - ${architectInterfaceAddress "wireguard"} ${domain} - ${architectInterfaceAddress "tailscale"} ${domain} - ''; - users.groups.media.members = [ "deluge" ]; }