Skip to content

Commit 750fa3c

Browse files
Merge pull request #380 from NuschtOS/oauth2-proxy-trustedProxyIP
portunus: set trustedProxyIP
2 parents 948aea9 + d74703e commit 750fa3c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/portunus.nix

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, lib, ... }:
1+
{ config, lib, options, ... }:
22

33
let
44
cfg = config.services.portunus;
@@ -180,7 +180,7 @@ in
180180
oauth2.skipApprovalScreen = true;
181181
};
182182

183-
oauth2-proxy = lib.mkIf cfg.oauth2-proxy.configure {
183+
oauth2-proxy = lib.mkIf cfg.oauth2-proxy.configure ({
184184
enable = true;
185185
inherit (cfg.oauth2-proxy) clientID;
186186
# if Portunus is not enabled locally, its domain is most likely wrong
@@ -199,7 +199,11 @@ in
199199
# checking for groups requires next to the default scopes also the `groups` scope, otherwise all authentication tries fail
200200
scope = lib.mkIf (lib.any (x: x.allowed_groups != null) (lib.attrValues cfgo.nginx.virtualHosts)) "openid email profile groups";
201201
};
202-
};
202+
}
203+
# TODO: remove with 26.05
204+
// lib.optionalAttrs (options.services.oauth2-proxy?trustedProxyIP) {
205+
trustedProxyIP = [ "127.0.0.1" "::1" ];
206+
});
203207

204208
portunus.dex = lib.mkIf (cfg.enable && cfg.oauth2-proxy.configure) {
205209
enable = true;

0 commit comments

Comments
 (0)