From 5052d16d6456208b283fa1643b3d340b7e260b7b Mon Sep 17 00:00:00 2001 From: ibizaman Date: Thu, 30 Nov 2023 12:02:18 -0800 Subject: [PATCH] rename oidcEndpoint option --- modules/blocks/nginx.nix | 13 +++++++------ modules/services/arr.nix | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/blocks/nginx.nix b/modules/blocks/nginx.nix index 99670a2..a8bd93c 100644 --- a/modules/blocks/nginx.nix +++ b/modules/blocks/nginx.nix @@ -19,9 +19,10 @@ let example = "mydomain.com"; }; - oidcEndpoint = lib.mkOption { - type = lib.types.str; - description = "OIDC endpoint for SSO."; + authEndpoint = lib.mkOption { + type = lib.types.nullOr lib.types.str; + description = "Auth endpoint for SSO."; + default = null; example = "https://authelia.example.com"; }; @@ -142,8 +143,8 @@ in # proxy_set_header Cookie $new_cookie; auth_request_set $redirect $scheme://$http_host$request_uri; - error_page 401 =302 ${c.oidcEndpoint}?rd=$redirect; - error_page 403 = ${c.oidcEndpoint}/error/403; + error_page 401 =302 ${c.authEndpoint}?rd=$redirect; + error_page 403 = ${c.authEndpoint}/error/403; proxy_pass ${c.upstream}; ''; @@ -151,7 +152,7 @@ in # Virtual endpoint created by nginx to forward auth requests. locations."/authelia".extraConfig = '' internal; - proxy_pass ${c.oidcEndpoint}/api/verify; + proxy_pass ${c.authEndpoint}/api/verify; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Original-URI $request_uri; diff --git a/modules/services/arr.nix b/modules/services/arr.nix index 78cb7d6..a650d59 100644 --- a/modules/services/arr.nix +++ b/modules/services/arr.nix @@ -152,7 +152,7 @@ let default = "/var/lib/${name}"; }; - oidcEndpoint = lib.mkOption { + authEndpoint = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Endpoint to the SSO provider. Leave null to not have SSO configured."; @@ -297,8 +297,8 @@ config.xml" templatedSettings) "${config.services.radarr.dataDir}/config.xml" ( let c = cfg.${name}; in - lib.mkIf (c.oidcEndpoint != null) { - inherit (c) subdomain domain oidcEndpoint; + lib.mkIf (c.authEndpoint != null) { + inherit (c) subdomain domain authEndpoint; upstream = "http://127.0.0.1:${toString c.port}"; autheliaRules = [ {