mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat: remove caddy, enable nginx with oauth2_proxy
This commit is contained in:
parent
041cf9cc33
commit
5f02889bd0
6 changed files with 37 additions and 76 deletions
33
hosts/sentinel/oauth2.nix
Normal file
33
hosts/sentinel/oauth2.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
extra.oauth2_proxy = {
|
||||
enable = true;
|
||||
cookieDomain = config.repo.secrets.local.personalDomain;
|
||||
authProxyDomain = "sentinel.${config.repo.secrets.local.personalDomain}";
|
||||
};
|
||||
|
||||
age.secrets.oauth2-proxy-secret = {
|
||||
rekeyFile = ./secrets/oauth2-proxy-secret.age;
|
||||
mode = "440";
|
||||
group = "oauth2_proxy";
|
||||
};
|
||||
|
||||
services.oauth2_proxy = {
|
||||
# TODO cookie refresh
|
||||
provider = "oidc";
|
||||
scope = "openid";
|
||||
loginURL = "https://${config.proxiedDomains.kanidm}/ui/oauth2";
|
||||
redeemURL = "https://${config.proxiedDomains.kanidm}/oauth2/token";
|
||||
validateURL = "https://${config.proxiedDomains.kanidm}/oauth2/openid/web-sentinel/userinfo";
|
||||
clientID = "web-sentinel";
|
||||
keyFile = config.age.secrets.oauth2-proxy-secret.path;
|
||||
|
||||
email.domains = ["*"];
|
||||
|
||||
extraConfig.skip-provider-button = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue