2020-06-08 02:08:41 +02:00
|
|
|
# Configures an OpenLDAP instance for TVL
|
|
|
|
#
|
|
|
|
# TODO(tazjin): Configure ldaps://
|
2020-06-17 04:48:21 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2020-06-08 02:08:41 +02:00
|
|
|
|
2020-06-17 04:48:21 +02:00
|
|
|
with config.depot.nix.yants;
|
|
|
|
|
|
|
|
let
|
|
|
|
user = struct {
|
|
|
|
username = string;
|
|
|
|
email = string;
|
|
|
|
password = string;
|
|
|
|
displayName = option string;
|
|
|
|
};
|
|
|
|
|
|
|
|
toLdif = defun [ user string ] (u: ''
|
|
|
|
dn: cn=${u.username},ou=users,dc=tvl,dc=fyi
|
|
|
|
objectClass: organizationalPerson
|
|
|
|
objectClass: inetOrgPerson
|
|
|
|
sn: ${u.username}
|
|
|
|
cn: ${u.username}
|
|
|
|
displayName: ${u.displayName or u.username}
|
|
|
|
mail: ${u.email}
|
|
|
|
userPassword: ${u.password}
|
|
|
|
'');
|
|
|
|
|
|
|
|
users = [
|
2020-07-10 21:06:23 +02:00
|
|
|
{
|
|
|
|
username = "andi";
|
|
|
|
email = "andi@notmuch.email";
|
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$8lefg7+8UPAEh9Ott8zH0A$7YuLRraTC1IgxTNTxFJF03AWmqBS3GX2+vfD4XVTrb0";
|
|
|
|
}
|
2020-06-27 00:32:06 +02:00
|
|
|
{
|
|
|
|
username = "artemist";
|
|
|
|
email = "me@artem.ist";
|
|
|
|
password = "{SSHA}N6Tl/txGQwlmVa7xVJCXpGcD1U4bJaI+";
|
|
|
|
}
|
2020-06-23 20:26:22 +02:00
|
|
|
{
|
|
|
|
username = "camsbury";
|
|
|
|
email = "camsbury7@gmail.com";
|
2020-07-01 00:29:19 +02:00
|
|
|
password = "{SSHA}r6/I/zefrAb1jWTdhuqWik0CXT8E+/E5";
|
2020-06-23 20:26:22 +02:00
|
|
|
}
|
2020-06-17 04:48:21 +02:00
|
|
|
{
|
|
|
|
username = "cynthia";
|
|
|
|
email = "cynthia@tvl.fyi";
|
|
|
|
password = "{SSHA}aHx2keEnXv6u6oiV2xxqfXdxjom/K8CP";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
username = "edef";
|
|
|
|
email = "edef@edef.eu";
|
2020-08-03 13:07:50 +02:00
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$OORx4ERbkgvTmuYCJA8cIw$i5qaBzHkRVw7Tl+wZsTFTDqJwF0vuZqhW3VpknMYMc0";
|
2020-06-17 04:48:21 +02:00
|
|
|
}
|
2020-06-27 04:28:35 +02:00
|
|
|
{
|
|
|
|
username = "ericvolp12";
|
|
|
|
email = "ericvolp12@gmail.com";
|
|
|
|
password = "{SSHA}pSepaQ+/5KBLfJtRR5rfxGU8goAsXgvk";
|
|
|
|
}
|
2020-06-17 04:48:21 +02:00
|
|
|
{
|
|
|
|
username = "eta";
|
|
|
|
email = "eta@theta.eu.org";
|
|
|
|
password = "{SSHA}sOR5xzi7Lfv376XGQA8Hf6jyhTvo0XYc";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
username = "glittershark";
|
|
|
|
email = "grfn@gws.fyi";
|
|
|
|
password = "{SSHA}i7PSAsXwJT3jjmmvU77aar/tU/YPDCEO";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
username = "isomer";
|
|
|
|
email = "isomer@tvl.fyi";
|
|
|
|
password = "{SSHA}OhWQkPJgH1rRJqYIaMUbbKC4iLEzvCev";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
username = "lukegb";
|
|
|
|
email = "lukegb@tvl.fyi";
|
|
|
|
password = "{SSHA}7a85VNhpFElFw+N5xcjgGmt4HnBsaGp4";
|
|
|
|
}
|
2020-08-09 17:34:48 +02:00
|
|
|
{
|
|
|
|
username = "multi";
|
|
|
|
email = "depot@in-addr.xyz";
|
|
|
|
password = "{ARGON2}$argon2i$v=19$m=4096,t=3,p=1$qCfXhZUVft1YVPx7H4x7rw$dhtwtCrEMSpZfWQJbw2wpo5XHqiJqoZkiKeEbE6AdX0";
|
|
|
|
}
|
2020-06-17 04:48:21 +02:00
|
|
|
{
|
|
|
|
username = "nyanotech";
|
|
|
|
email = "nyanotechnology@gmail.com";
|
|
|
|
password = "{SSHA}NIJ2RCRb1+Q4Bs63cyE91VZyiN47DG6y";
|
|
|
|
}
|
2020-06-27 04:29:00 +02:00
|
|
|
{
|
|
|
|
username = "Profpatsch";
|
|
|
|
email = "mail@profpatsch.de";
|
|
|
|
password = "{SSHA}jcFXxRplMFxH4gpa0X5VdUzW64T95TwQ";
|
|
|
|
}
|
2020-06-17 04:48:21 +02:00
|
|
|
{
|
|
|
|
username = "q3k";
|
|
|
|
email = "q3k@q3k.org";
|
|
|
|
password = "{SSHA}BEccJdtnhVLDzOn+pxNfayNi3QFcEABE";
|
|
|
|
}
|
2020-07-18 00:33:15 +02:00
|
|
|
{
|
|
|
|
username = "qyliss";
|
2020-07-18 18:42:44 +02:00
|
|
|
displayName = "Alyssa Ross";
|
2020-07-18 00:33:15 +02:00
|
|
|
email = "hi@alyssa.is";
|
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$+uTpAKrN452D8wa7OFqPnw$GYi9/zns5iJCXDp1VuTPPsa35M5vkD6+rC8riT8cEHI";
|
|
|
|
}
|
2020-06-17 04:48:21 +02:00
|
|
|
{
|
|
|
|
username = "riking";
|
2020-07-17 22:33:49 +02:00
|
|
|
displayName = "kanepyork";
|
2020-06-17 04:48:21 +02:00
|
|
|
email = "rikingcoding@gmail.com";
|
2020-07-01 22:56:48 +02:00
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$o2OcfhfKOry+UrcmODyQCw$qloaQgoIRDESwaA3yqPxxy8sgLk3mrjYFBbF41elVrM";
|
2020-06-17 04:48:21 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
username = "tazjin";
|
|
|
|
email = "mail@tazj.in";
|
2020-07-01 20:28:58 +02:00
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$wOPEl9D3kSke//oLtbvqrg$j0npwwXgaXQ/emefKUwL59tH8hdmtzbgH2rQzWSmE2Y";
|
2020-06-17 04:48:21 +02:00
|
|
|
}
|
2020-07-23 23:53:18 +02:00
|
|
|
{
|
|
|
|
username = "implr";
|
|
|
|
email = "implr@hackerspace.pl";
|
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$SHRFps5sVgyUXYdmqGPw9g$tEx9DwKK1RjWlw52GLwOZ/iHep+QJboaZE83f1pXSwQ";
|
|
|
|
}
|
2020-08-19 01:27:42 +02:00
|
|
|
{
|
|
|
|
username = "V";
|
|
|
|
email = "v@anomalous.eu";
|
|
|
|
password = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$Wa11vk3gQKhJr1uzvtRTRQ$RHfvcC2j6rDUgWfezm05N03LeGIEezeKtmFmt+rfvM4";
|
|
|
|
}
|
2020-06-17 04:48:21 +02:00
|
|
|
];
|
|
|
|
in {
|
2020-07-01 20:24:49 +02:00
|
|
|
# Use our patched OpenLDAP derivation which enables stronger password hashing.
|
|
|
|
#
|
|
|
|
# Unfortunately the module for OpenLDAP has no package option, so we
|
|
|
|
# need to override it system-wide. Be aware that this triggers a
|
|
|
|
# *large* number of rebuilds of packages such as GPG and Python.
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
(_: _: {
|
|
|
|
inherit (config.depot.third_party) openldap;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-06-08 02:08:41 +02:00
|
|
|
services.openldap = {
|
|
|
|
enable = true;
|
|
|
|
dataDir = "/var/lib/openldap";
|
|
|
|
suffix = "dc=tvl,dc=fyi";
|
|
|
|
rootdn = "cn=admin,dc=tvl,dc=fyi";
|
2020-07-01 20:28:58 +02:00
|
|
|
rootpw = "{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$OfcgkOQ96VQ3aJj7NfA9vQ$oS6HQOkYl/bUYg4SejpltQYy7kvqx/RUxvoR4zo1vXU";
|
2020-06-08 02:08:41 +02:00
|
|
|
|
|
|
|
# ACL configuration
|
|
|
|
extraDatabaseConfig = ''
|
|
|
|
# Allow users to change their own password
|
|
|
|
access to attrs=userPassword
|
|
|
|
by self write
|
|
|
|
by anonymous auth
|
|
|
|
by users none
|
|
|
|
|
|
|
|
# Allow default read access to other directory elements
|
|
|
|
access to * by * read
|
|
|
|
'';
|
2020-06-17 04:48:21 +02:00
|
|
|
|
2020-07-01 20:24:49 +02:00
|
|
|
extraConfig = ''
|
|
|
|
moduleload pw-argon2
|
|
|
|
'';
|
|
|
|
|
2020-06-17 04:48:21 +02:00
|
|
|
# Contents are immutable at runtime, and adding user accounts etc.
|
|
|
|
# is done statically in the LDIF-formatted contents in this folder.
|
|
|
|
declarativeContents = ''
|
|
|
|
dn: dc=tvl,dc=fyi
|
|
|
|
dc: tvl
|
|
|
|
o: TVL LDAP server
|
|
|
|
description: Root entry for tvl.fyi
|
|
|
|
objectClass: top
|
|
|
|
objectClass: dcObject
|
|
|
|
objectClass: organization
|
|
|
|
|
|
|
|
dn: ou=users,dc=tvl,dc=fyi
|
|
|
|
ou: users
|
|
|
|
description: All users in TVL
|
|
|
|
objectClass: top
|
|
|
|
objectClass: organizationalUnit
|
|
|
|
|
|
|
|
dn: ou=groups,dc=tvl,dc=fyi
|
|
|
|
ou: groups
|
|
|
|
description: All groups in TVL
|
|
|
|
objectClass: top
|
|
|
|
objectClass: organizationalUnit
|
|
|
|
|
|
|
|
${lib.concatStringsSep "\n" (map toLdif users)}
|
|
|
|
'';
|
2020-06-08 02:08:41 +02:00
|
|
|
};
|
|
|
|
}
|