summaryrefslogtreecommitdiff
path: root/hosts/auth/oauth2-proxy.nix
blob: 81cdf8f3ae629f6d7ced7b91915209984a28d1e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ config, ... }:
{
  sops.secrets."oauth2-proxy/env" = {
    owner = config.users.users.oauth2-proxy.name;
  };

  services.oauth2-proxy = {
    enable = true;
    reverseProxy = true;
    provider = "keycloak-oidc";
    httpAddress = "0.0.0.0:4180";
    oidcIssuerUrl = "https://auth.oxapentane.com/realms/0xalab-prod";
    clientID = "radicale-proxy";
    redirectURL = "https://dav.oxapentane.com/oauth2/callback";
    keyFile = config.sops.secrets."oauth2-proxy/env".path;
    scope = "openid";
    email.domains = [ "*" ];
    setXauthrequest = true;
    cookie = {
      secure = true;
      refresh = "48h0m0s";
      domain = ".oxapentane.com";
    };
  };
}