2022-12-04 08:53:28 +01:00
|
|
|
{ config, ... }:
|
2022-07-23 00:06:12 +02:00
|
|
|
|
|
|
|
{
|
2022-12-18 22:16:29 +01:00
|
|
|
c3d2.deployment.server = "server10";
|
2022-07-23 00:06:12 +02:00
|
|
|
|
|
|
|
system.stateVersion = "22.05";
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "auth";
|
|
|
|
hosts = {
|
|
|
|
# required for ldaps connection over localhost
|
|
|
|
"::1" = [ "auth.c3d2.de" ];
|
|
|
|
"127.0.0.1" = [ "auth.c3d2.de" ];
|
|
|
|
};
|
2022-07-23 02:04:42 +02:00
|
|
|
firewall.allowedTCPPorts = [
|
|
|
|
80 # http
|
|
|
|
443 # https
|
|
|
|
636 # ldaps
|
|
|
|
];
|
2022-07-23 00:06:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts."auth.c3d2.de" = {
|
|
|
|
default = true;
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations = {
|
|
|
|
"/dex".proxyPass ="http://localhost:${toString config.services.portunus.dex.port}";
|
|
|
|
"/" = {
|
|
|
|
proxyPass = "http://localhost:${toString config.services.portunus.port}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
portunus = {
|
|
|
|
enable = true;
|
|
|
|
dex = {
|
|
|
|
# enable = true;
|
|
|
|
};
|
|
|
|
domain = "auth.c3d2.de";
|
|
|
|
ldap = {
|
|
|
|
suffix = "dc=c3d2,dc=de";
|
|
|
|
tls = true;
|
|
|
|
};
|
2022-08-01 00:16:40 +02:00
|
|
|
seedPath = config.sops.secrets."portunus/seed".path;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
sops = {
|
|
|
|
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
|
|
defaultSopsFile = ./secrets.yaml;
|
|
|
|
secrets."portunus/seed" = {
|
2022-12-04 08:53:28 +01:00
|
|
|
inherit (config.services.portunus) group;
|
2022-08-01 00:16:40 +02:00
|
|
|
owner = config.services.portunus.user;
|
2022-07-23 00:06:12 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|