feat: promote oauth proxy config to a nginx virtualHosts option

This commit is contained in:
oddlama 2023-06-22 02:55:22 +02:00
parent a092a5a846
commit 71dbda6262
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
8 changed files with 136 additions and 98 deletions

View file

@ -24,7 +24,6 @@ in {
nodes.sentinel = {
proxiedDomains.adguard = adguardhomeDomain;
extra.oauth2_proxy.nginx.virtualHosts."${adguardhomeDomain}".allowedGroups = ["adguardhome"];
services.nginx = {
upstreams.adguardhome = {
servers."${config.services.adguardhome.settings.bind_host}:${toString config.services.adguardhome.settings.bind_port}" = {};
@ -36,8 +35,10 @@ in {
virtualHosts.${adguardhomeDomain} = {
forceSSL = true;
useACMEHost = sentinelCfg.lib.extra.matchingWildcardCert adguardhomeDomain;
oauth2.enable = true;
oauth2.allowedGroups = ["adguardhome"];
locations."/" = {
proxyPass = "https://adguardhome";
proxyPass = "http://adguardhome";
proxyWebsockets = true;
};
};