Browse Source

make gid, shell and home configurable

main
Dustin Frisch 1 year ago
parent
commit
44d9ba804f
No known key found for this signature in database GPG Key ID: B4C3BF012D9B26BE
  1. 1
      default.nix
  2. 8
      src/main/java/de/hsfulda/informatik/LdapSync.java

1
default.nix

@ -36,7 +36,6 @@ in stdenv.mkDerivation rec {
'';
installPhase = ''
ls -l target
install -Dm644 target/${name}-1.0-SNAPSHOT-jar-with-dependencies.jar $out/share/java/${name}.jar
makeWrapper ${jdk17_headless}/bin/java $out/bin/${name} \

8
src/main/java/de/hsfulda/informatik/LdapSync.java

@ -122,9 +122,11 @@ public class LdapSync {
e.addAttribute(new Attribute("givenname", s.getAttributeValue("givenName")));
e.addAttribute(new Attribute("uid", cn));
e.addAttribute(new Attribute("uidNumber", String.valueOf(computeUid(cn, this.userDefinedMappings))));
e.addAttribute(new Attribute("gidNumber", "20"));
e.addAttribute(new Attribute("loginShell", "/bin/zsh"));
e.addAttribute(new Attribute("homeDirectory", "/Users/" + cn));
e.addAttribute(new Attribute("gidNumber", properties.getProperty("sync.dst.gid", "1000")));
if (properties.getProperty("sync.dst.shell") != null) {
e.addAttribute(new Attribute("loginShell", properties.getProperty("sync.dst.shell")));
}
e.addAttribute(new Attribute("homeDirectory", String.format(properties.getProperty("sync.dst.home"), cn)));
e.addAttribute(new Attribute("userPassword", "{SASL}" + cn));
return e;

Loading…
Cancel
Save