gerd.members-area: adds member website on <domain>/members

This commit is contained in:
eyjhb 2024-08-13 13:47:14 +02:00
parent 0ca49ba790
commit 23faf44b39
Signed by: eyjhb
GPG key ID: 609F508E3239F920
4 changed files with 153 additions and 6 deletions

View file

@ -76,20 +76,22 @@ let
error_page 401 =302 https://auth.fricloud.dk/?rd=$target_url;
'';
in {
mine.shared.lib.authelia.mkProtectedWebsite = virtualHostConfig: lib.recursiveUpdate {
mine.shared.lib.authelia.mkProtectedWebsite = { vhostConfig, endpoint ? "/" }: lib.recursiveUpdate {
forceSSL = true;
enableACME = true;
extraConfig = "include ${autheliaLocation};";
locations."/" = {
locations."${endpoint}" = {
extraConfig = "include ${autheliaRequest};";
};
} virtualHostConfig;
} vhostConfig;
services.nginx.virtualHosts."test.fricloud.dk" = config.mine.shared.lib.authelia.mkProtectedWebsite {
locations."/".root = pkgs.writeTextDir "index.html" ''
ACCESS GRANTED!
'';
vhostConfig = {
locations."/".root = pkgs.writeTextDir "index.html" ''
ACCESS GRANTED!
'';
};
};
}