Adding ldap, nginx, postgresql config in SOGo

This commit is contained in:
tenksom 2023-03-07 13:06:24 +01:00
parent a3f4e289e1
commit 4f5137c6b9
No known key found for this signature in database
GPG key ID: B712039D23133661

View file

@ -1,15 +1,20 @@
{config, pkgs, ... }: {config, pkgs, ... }:
let let
hostname = "webmail.${config.fsr.domain}"; SOGo-hostname = "mail.${config.fsr.domain}";
domain = config.fsr.domain; domain = config.fsr.domain;
in in
{ {
sops.secrets.sogo_ldap_search = {
key = "portunus_search";
# owner = config.systemd.services keine Ahnung was hier hin soll
};
services = { services = {
sogo = { sogo = {
enable = true; enable = true;
language = "German"; language = "German";
extraConfig = " extraConfig = ''
WOWorkersCount = 10; WOWorkersCount = 10;
SOGoUserSources = ({ SOGoUserSources = ({
type = ldap; type = ldap;
@ -17,15 +22,40 @@ in
UIDFieldName = uid; UIDFieldName = uid;
baseDN = "ou = users, dc=ifsr, dc=de"; baseDN = "ou = users, dc=ifsr, dc=de";
bindDN = "uid=search, ou=users, dc=ifsr, dc=de"; bindDN = "uid=search, ou=users, dc=ifsr, dc=de";
bindPassword = qwertz; bindPassword = ${config.sops.secrets.SOGo_ldap_search.path};
hostname = "ldap://localhost"; hostname = "ldap://localhost";
}); canAuthenticate = YES;
id = directory;
});
SOGoProfileURL = "postgresql://sogo:sogo@localhost:5432/
"; ''; # Hier ist bindPassword noch nicht vollständig
} };
postgresql = { postgresql = {
enable = true; ensureUsers = [{
} name = "SOGo";
}];
ensureDatabases = [ "SOGo" ];
};
nginx = {
recommendedProxySettings = true;
virtualHosts."${SOGo-hostname}" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:443";
proxyWebsockets = true;
};
};
}
};
};
}