lldap nginx config

This commit is contained in:
mc-fucker 2023-06-22 16:05:36 +02:00
parent eafd0289a0
commit 1e24392601
2 changed files with 19 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{ config, ... }: { config, ... }:
let let
cfg = import ./vars.nix; cfg = import ./vars.nix;
#web_port = "17170"; port = cfg.lldap.webPort;
domain = cfg.lldap.domain; domain = cfg.lldap.domain;
in in
{ {
@ -22,8 +22,9 @@ in
environment = { environment = {
TZ = "Europe/Berlin"; TZ = "Europe/Berlin";
UID = "389"; UID = "389";
GID = "389";
LLDAP_VERBOSE = "true"; LLDAP_VERBOSE = "true";
LLDAP_LDAP_BASE_DN = "dc=mc-fucker,cd=cool"; LLDAP_LDAP_BASE_DN = "dc=mc-fucker,dc=cool";
LLDAP_LDAP_USER_DN = "ldapadmin"; LLDAP_LDAP_USER_DN = "ldapadmin";
LLDAP_HTTP_URL = "https://${domain}"; LLDAP_HTTP_URL = "https://${domain}";
LLDAP_JWT_SECRET_FILE = config.sops.secrets."lldap/jwt".path; LLDAP_JWT_SECRET_FILE = config.sops.secrets."lldap/jwt".path;
@ -36,14 +37,27 @@ in
}; };
ports = [ ports = [
"389:3890" "389:3890"
"17170:17170" "${port}:${port}"
]; ];
extraOptions = cfg.podman.extraOptions; extraOptions = cfg.podman.extraOptions;
volumes = [ volumes = [
"${config.sops.secrets."lldap/jwt".path}:${config.sops.secrets."lldap/jwt".path}:ro" "${config.sops.secrets."lldap/jwt".path}:${config.sops.secrets."lldap/jwt".path}:ro"
"${config.sops.secrets."lldap/admin".path}:${config.sops.secrets."lldap/admin".path}:ro" "${config.sops.secrets."lldap/admin".path}:${config.sops.secrets."lldap/admin".path}:ro"
"/var/lib/lldap:/data"
]; ];
}; };
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
extraConfig = ''
access_log /var/log/nginx/${domain}_access.log;
error_log /var/log/nginx/${domain}_error.log;
'';
};
} }
# vim: set et ts=2 sw=2 ai: # vim: set et ts=2 sw=2 ai:

View file

@ -41,7 +41,8 @@
}; };
lldap = { lldap = {
domain = "lldap.mc-fucker.cool"; domain = "user.mc-fucker.cool";
webPort = "17170";
}; };
mail = { mail = {