2021-11-21 11:53:30 +01:00
|
|
|
{ config, pkgs, ... }:
|
2021-07-26 01:29:05 +02:00
|
|
|
let
|
|
|
|
my = config.my;
|
|
|
|
port = 8080;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services.keycloak = {
|
|
|
|
enable = true;
|
2021-11-21 11:53:30 +01:00
|
|
|
package = pkgs.keycloak.override {
|
|
|
|
jre = pkgs.jre8;
|
|
|
|
};
|
2021-07-26 01:29:05 +02:00
|
|
|
initialAdminPassword = "changemeasap";
|
|
|
|
database.createLocally = true;
|
|
|
|
database.passwordFile = config.age.secrets.keycloakDatabasePasswordFile.path;
|
|
|
|
frontendUrl = "https://auth.${my.subZone}/auth/";
|
|
|
|
forceBackendUrlToFrontendUrl = true;
|
|
|
|
httpPort = toString port;
|
|
|
|
extraConfig = {
|
|
|
|
"subsystem=undertow"."server=default-server"."http-listener=default".proxy-address-forwarding = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."auth.${my.subZone}" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:${toString port}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|