migrate to new openldap module syntax

This commit is contained in:
Jörg Thalheim 2021-09-23 20:32:09 +02:00
parent 59cb44261d
commit e985a277b3

View file

@ -851,17 +851,21 @@
machine = { pkgs, ... }: {
imports = [ hydraServer ];
services.openldap = {
enable = true;
suffix = "dc=example";
rootdn = "cn=root,dc=example";
rootpw = "notapassword";
database = "bdb";
dataDir = "/var/lib/openldap";
services.openldap.enable = true;
services.openldap.settings.children = {
"olcDatabase={1}mdb".attrs = {
objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ];
database = "{1}mdbg";
olcSuffix = "dc=example";
olcRootDN = "cn=root,dc=example";
olcRootPW = "notapassword";
olcDbDirectory = "/var/lib/openldap";
};
};
# userPassword generated via `slappasswd`
# The admin user has the password `password` and `user` has the password `foobar`.
declarativeContents."dc=example" = ''
services.openldap.declarativeContents."dc=example" = ''
dn: dc=example
dc: example
o: Root
@ -903,8 +907,7 @@
mail: admin@example
userPassword: {SSHA}BsgOQcRnoiULzwLrGmuzVGH6EC5Dkwmf
'';
};
systemd.services.hdyra-server.environment.CATALYST_DEBUG = "1";
systemd.services.hydra-server.environment.CATALYST_DEBUG = "1";
systemd.services.hydra-server.environment.HYDRA_LDAP_CONFIG = pkgs.writeText "config.yaml"
# example config based on https://metacpan.org/source/ILMARI/Catalyst-Authentication-Store-LDAP-1.016/README#L103
''