Home

infra @9e9d01d3a7a385ef214288b72455566d67ec9155 - refs - log -
-
https://git.jolheiser.com/infra.git
dragonwell flake
infra / dragonwell / services / oa2p.nix
- raw -
 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
26
{ jolheiser, config, ... }:
let
  port = 6227;
in
{
  age.secrets.oa2p.file = ../../secrets/oa2p.age;
  services = {
    oauth2-proxy = {
      enable = true;
      provider = "oidc";
      httpAddress = "localhost:${builtins.toString port}";
      reverseProxy = true;
      cookie = {
        secure = true;
        domain = "wiki.${jolheiser.domain}";
      };
      email.domains = [ "*" ];
      keyFile = config.age.secrets.oa2p.path;
      redirectURL = "https://wiki.${jolheiser.domain}/oauth2/callback";
      oidcIssuerUrl = "https://id.${jolheiser.domain}";
    };
    caddy.virtualHosts."oa2p.${jolheiser.domain}".extraConfig = ''
      reverse_proxy localhost:${builtins.toString port}
    '';
  };
}