openldap: polish documentation
authorJulien Moutinho <julm@autogeree.net>
Fri, 21 Jun 2019 12:44:42 +0000 (12:44 +0000)
committerJulien Moutinho <julm@autogeree.net>
Fri, 21 Jun 2019 12:45:35 +0000 (12:45 +0000)
install/logical/friot/openldap.nix
install/logical/friot/openldap/commonsoft.nix

index 4edfc52caec827aad108c206b16aff2af71ed7d8..15e1e963d3331c83bdd144a20e41909c0fabc443 100644 (file)
@@ -129,6 +129,7 @@ in
     };
     systemd.services.openldap = {
       preStart = ''
+          set -e
           # NOTE: slapd's config is always re-initialized.
           rm -rf "${openldap.configDir}"/cn=config \
                  "${openldap.configDir}"/cn=config.ldif
@@ -142,16 +143,19 @@ in
             install -D -d -m 0700 -o "${openldap.user}" -g "${openldap.group}" "${olcDbDirectory}"
             '') openldap.databases
           + ''
-          # NOTE: slapd is supposed to be stopped while in preStart,
-          #       hence slap* commands can safely be used.
+          # NOTE: slapd is supposed to have been stopped by systemd
+          # before entering this preStart,
+          # hence slap* commands can safely be used.
+          #
+          # NOTE: slapadd(8):
+          # To populate the config database slapd-config(5),
+          # use -n 0 as it is always the first database.
+          # It must physically exist on the filesystem prior to this, however.
           umask 0077
           ${pkgs.openldap}/bin/slapadd -n 0 \
            -F "${openldap.configDir}" \
            -l ${configLDIF}
           chown -R "${openldap.user}:${openldap.group}" "${openldap.configDir}"
-          # NOTE: slapadd(8): To populate the config database slapd-config(5),
-          #                   use -n 0 as it is always the first database.
-          #                   It must physically exist on the filesystem prior to this, however.
         '' +
         unlinesAttrs (olcSuffix: {data, olcDbDirectory, resetData, ...}:
           lib.optionalString resetData ''
index 12a54e03a03b3a3d85dbb89e33261e87016d15ae..9a13f28b95338085f3369f8201b3a6fa060adab7 100644 (file)
@@ -10,7 +10,8 @@ let inherit (config) networking;
      , gidNumber ? uidNumber
      , cn ? ""
      , sn ? ""
-     , userPassword ? "{SSHA}xeJMEPlG8UKU3iTPwOgFyadeCHwSZH+z"
+     , userPassword ? "{SSHA}JtC8S4nzm+eX9cVgbyL6gquPWDZD4xXY"
+       # NOTE: doveadm pw -s SSHA -u $user -p $pass
      , mailAlias ? []
      , loginShell ? "/run/current-system/sw/bin/bash"
      , mailEnabled ? true
@@ -130,9 +131,9 @@ in
             dn: cn=${networking.domainBase},ou=groups,ou=posix,${domainSuffix}
             objectClass: top
             objectClass: posixGroup
-            gidnumber: 20000
-            memberuid: ju
-            memberuid: sevy
+            gidNumber: 20000
+            memberUid: ju
+            memberUid: sevy
 
           ''
           + lib.concatMapStrings posixAccount [