From 1be49e483506bf0bc89b98e2dfa065890775827a Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Fri, 28 Oct 2022 14:59:17 +0200 Subject: [PATCH] deluge: Add OpenID auth --- hosts/architect/deluge.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hosts/architect/deluge.nix b/hosts/architect/deluge.nix index 0ccbbf3..c254054 100644 --- a/hosts/architect/deluge.nix +++ b/hosts/architect/deluge.nix @@ -3,6 +3,7 @@ let domain = "htdel.giugl.io"; network = import ./network.nix; + auth_block = (import ./openid.nix).openresty_oidc_block; in { services = { deluge = { @@ -34,11 +35,12 @@ in { nginx.virtualHosts.${domain} = { locations."/" = { proxyPass = "http://localhost:8112"; - extraConfig = '' - allow 10.0.0.0/24; - ${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg} - deny all; - ''; + extraConfig = auth_block { + realm = "master"; + client_id = "deluge"; + client_secret = "AGa1U9S1zkaM3TJVxtyx4Er76DBk1APR"; + redirect_uri = "https://${domain}"; + }; }; }; };