auth and git

This commit is contained in:
Jana Dönszelmann 2025-08-19 21:12:39 +02:00
parent d35531c1bd
commit 2d9feaa634
No known key found for this signature in database
24 changed files with 787 additions and 16 deletions

View file

@ -0,0 +1,45 @@
{pkgs, config, ...}: let
lib = pkgs.lib;
domain = "auth.donsz.nl";
port = 3013;
backupsDir = "/var/lib/kanidm/backup";
in {
services.kanidm.enableServer = true;
services.kanidm.package = pkgs.kanidm_1_6;
services.kanidm.serverSettings = {
tls_chain = "/var/lib/acme/${domain}/fullchain.pem";
tls_key = "/var/lib/acme/${domain}/key.pem";
bindaddress = "[::1]:${toString port}";
ldapbindaddress = "[::1]:3636";
inherit domain;
origin = "https://${domain}";
trust_x_forward_for = true;
online_backup = {
path = backupsDir;
schedule = "0 0 * * *";
};
};
systemd.services.kanidm = {
preStart = lib.mkBefore ''
mkdir -p "${backupsDir}"
'';
serviceConfig = {
SupplementaryGroups =
[ config.security.acme.certs.${domain}.group ];
};
};
environment.systemPackages = [pkgs.kanidm];
services.nginx.virtualHosts.${domain} = {
forceSSL = true;
http2 = true;
enableACME = true;
locations."/" = {
proxyPass = "https://[::1]:${toString port}";
};
};
}