deluge: port to vhost

This commit is contained in:
Giulio De Pasquale 2023-06-10 03:15:26 +02:00
parent 127bcfa2f5
commit 4a9c3cf246

View File

@ -2,11 +2,6 @@
let let
domain = "htdel.giugl.io"; 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 ]; listenPorts = [ 51413 51414 ];
in in
{ {
@ -41,25 +36,22 @@ in
authFile = "/secrets/deluge/auth"; authFile = "/secrets/deluge/auth";
extraPackages = [ pkgs.unrar ]; extraPackages = [ pkgs.unrar ];
}; };
nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8112";
extraConfig = auth_block {
access_role = "deluge";
};
};
};
}; };
networking.extraHosts = '' architect.vhost.${domain} = with config.architect.networks; {
${architectInterfaceAddress "lan"} ${domain} dnsInterfaces = [ "lan" "wireguard" "tailscale" ];
${architectInterfaceAddress "wireguard"} ${domain} locations = {
${architectInterfaceAddress "tailscale"} ${domain} "/" = {
''; allowLan = true;
port = 8112;
allow = [
wireguard.net
tailscale.net
];
};
};
};
users.groups.media.members = [ "deluge" ]; users.groups.media.members = [ "deluge" ];
} }