Merge staging-next into staging
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import ../make-test-python.nix (
|
||||
import ../make-test-python.nix (
|
||||
{
|
||||
pkgs, ...
|
||||
}:
|
||||
}:
|
||||
# copy_from_host works only for store paths
|
||||
rec {
|
||||
name = "fcitx";
|
||||
machine =
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
machine =
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
virtualisation.memorySize = 1024;
|
||||
|
||||
@@ -19,11 +19,11 @@ import ../make-test-python.nix (
|
||||
|
||||
environment.systemPackages = [
|
||||
# To avoid clashing with xfce4-terminal
|
||||
pkgs.alacritty
|
||||
pkgs.alacritty
|
||||
];
|
||||
|
||||
|
||||
services.xserver =
|
||||
services.xserver =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
@@ -37,7 +37,7 @@ import ../make-test-python.nix (
|
||||
|
||||
desktopManager.xfce.enable = true;
|
||||
};
|
||||
|
||||
|
||||
i18n = {
|
||||
inputMethod = {
|
||||
enabled = "fcitx";
|
||||
@@ -50,14 +50,14 @@ import ../make-test-python.nix (
|
||||
}
|
||||
;
|
||||
|
||||
testScript = { nodes, ... }:
|
||||
let
|
||||
testScript = { nodes, ... }:
|
||||
let
|
||||
user = nodes.machine.config.users.users.alice;
|
||||
userName = user.name;
|
||||
userHome = user.home;
|
||||
xauth = "${userHome}/.Xauthority";
|
||||
fcitx_confdir = "${userHome}/.config/fcitx";
|
||||
in
|
||||
in
|
||||
''
|
||||
# We need config files before login session
|
||||
# So copy first thing
|
||||
@@ -92,7 +92,7 @@ import ../make-test-python.nix (
|
||||
machine.send_key("ctrl-alt-shift-u")
|
||||
machine.sleep(5)
|
||||
machine.sleep(1)
|
||||
|
||||
|
||||
### Search for smiling face
|
||||
machine.send_chars("smil")
|
||||
machine.sleep(1)
|
||||
|
||||
@@ -33,9 +33,9 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : with lib; {
|
||||
initialRootPasswordFile = pkgs.writeText "rootPassword" initialRootPassword;
|
||||
smtp.enable = true;
|
||||
secrets = {
|
||||
secretFile = pkgs.writeText "secret" "Aig5zaic";
|
||||
otpFile = pkgs.writeText "otpsecret" "Riew9mue";
|
||||
dbFile = pkgs.writeText "dbsecret" "we2quaeZ";
|
||||
secretFile = pkgs.writeText "secret" "r8X9keSKynU7p4aKlh4GO1Bo77g5a7vj";
|
||||
otpFile = pkgs.writeText "otpsecret" "Zu5hGx3YvQx40DvI8WoZJQpX2paSDOlG";
|
||||
dbFile = pkgs.writeText "dbsecret" "lsGltKWTejOf6JxCVa7nLDenzkO9wPLR";
|
||||
jwsFile = pkgs.runCommand "oidcKeyBase" {} "${pkgs.openssl}/bin/openssl genrsa 2048 > $out";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -12,9 +12,9 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
{ ... }:
|
||||
{ services.morty = {
|
||||
enable = true;
|
||||
key = "78a9cd0cfee20c672f78427efb2a2a96036027f0";
|
||||
port = 3001;
|
||||
};
|
||||
key = "78a9cd0cfee20c672f78427efb2a2a96036027f0";
|
||||
port = 3001;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
+117
-25
@@ -1,33 +1,125 @@
|
||||
import ./make-test-python.nix {
|
||||
name = "openldap";
|
||||
|
||||
machine = { pkgs, ... }: {
|
||||
services.openldap = {
|
||||
enable = true;
|
||||
suffix = "dc=example";
|
||||
rootdn = "cn=root,dc=example";
|
||||
rootpw = "notapassword";
|
||||
database = "bdb";
|
||||
extraDatabaseConfig = ''
|
||||
directory /var/db/openldap
|
||||
'';
|
||||
declarativeContents = ''
|
||||
dn: dc=example
|
||||
objectClass: domain
|
||||
dc: example
|
||||
|
||||
dn: ou=users,dc=example
|
||||
objectClass: organizationalUnit
|
||||
ou: users
|
||||
'';
|
||||
};
|
||||
};
|
||||
{ pkgs, system ? builtins.currentSystem, ... }: let
|
||||
dbContents = ''
|
||||
dn: dc=example
|
||||
objectClass: domain
|
||||
dc: example
|
||||
|
||||
dn: ou=users,dc=example
|
||||
objectClass: organizationalUnit
|
||||
ou: users
|
||||
'';
|
||||
testScript = ''
|
||||
machine.wait_for_unit("openldap.service")
|
||||
machine.succeed(
|
||||
"systemctl status openldap.service",
|
||||
'ldapsearch -LLL -D "cn=root,dc=example" -w notapassword -b "dc=example"',
|
||||
)
|
||||
'';
|
||||
in {
|
||||
# New-style configuration
|
||||
current = import ./make-test-python.nix {
|
||||
inherit testScript;
|
||||
name = "openldap";
|
||||
|
||||
machine = { pkgs, ... }: {
|
||||
environment.etc."openldap/root_password".text = "notapassword";
|
||||
services.openldap = {
|
||||
enable = true;
|
||||
settings = {
|
||||
children = {
|
||||
"cn=schema".includes = [
|
||||
"${pkgs.openldap}/etc/schema/core.ldif"
|
||||
"${pkgs.openldap}/etc/schema/cosine.ldif"
|
||||
"${pkgs.openldap}/etc/schema/inetorgperson.ldif"
|
||||
"${pkgs.openldap}/etc/schema/nis.ldif"
|
||||
];
|
||||
"olcDatabase={1}mdb" = {
|
||||
# This tests string, base64 and path values, as well as lists of string values
|
||||
attrs = {
|
||||
objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ];
|
||||
olcDatabase = "{1}mdb";
|
||||
olcDbDirectory = "/var/db/openldap";
|
||||
olcSuffix = "dc=example";
|
||||
olcRootDN = {
|
||||
# cn=root,dc=example
|
||||
base64 = "Y249cm9vdCxkYz1leGFtcGxl";
|
||||
};
|
||||
olcRootPW = {
|
||||
path = "/etc/openldap/root_password";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
declarativeContents."dc=example" = dbContents;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Old-style configuration
|
||||
oldOptions = import ./make-test-python.nix {
|
||||
inherit testScript;
|
||||
name = "openldap";
|
||||
|
||||
machine = { pkgs, ... }: {
|
||||
services.openldap = {
|
||||
enable = true;
|
||||
logLevel = "stats acl";
|
||||
defaultSchemas = true;
|
||||
database = "mdb";
|
||||
suffix = "dc=example";
|
||||
rootdn = "cn=root,dc=example";
|
||||
rootpw = "notapassword";
|
||||
declarativeContents."dc=example" = dbContents;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Manually managed configDir, for example if dynamic config is essential
|
||||
manualConfigDir = import ./make-test-python.nix {
|
||||
name = "openldap";
|
||||
|
||||
machine = { pkgs, ... }: {
|
||||
services.openldap = {
|
||||
enable = true;
|
||||
configDir = "/var/db/slapd.d";
|
||||
};
|
||||
};
|
||||
|
||||
testScript = let
|
||||
contents = pkgs.writeText "data.ldif" dbContents;
|
||||
config = pkgs.writeText "config.ldif" ''
|
||||
dn: cn=config
|
||||
cn: config
|
||||
objectClass: olcGlobal
|
||||
olcLogLevel: stats
|
||||
olcPidFile: /run/slapd/slapd.pid
|
||||
|
||||
dn: cn=schema,cn=config
|
||||
cn: schema
|
||||
objectClass: olcSchemaConfig
|
||||
|
||||
include: file://${pkgs.openldap}/etc/schema/core.ldif
|
||||
include: file://${pkgs.openldap}/etc/schema/cosine.ldif
|
||||
include: file://${pkgs.openldap}/etc/schema/inetorgperson.ldif
|
||||
|
||||
dn: olcDatabase={1}mdb,cn=config
|
||||
objectClass: olcDatabaseConfig
|
||||
objectClass: olcMdbConfig
|
||||
olcDatabase: {1}mdb
|
||||
olcDbDirectory: /var/db/openldap
|
||||
olcDbIndex: objectClass eq
|
||||
olcSuffix: dc=example
|
||||
olcRootDN: cn=root,dc=example
|
||||
olcRootPW: notapassword
|
||||
'';
|
||||
in ''
|
||||
machine.succeed(
|
||||
"mkdir -p /var/db/slapd.d /var/db/openldap",
|
||||
"slapadd -F /var/db/slapd.d -n0 -l ${config}",
|
||||
"slapadd -F /var/db/slapd.d -n1 -l ${contents}",
|
||||
"chown -R openldap:openldap /var/db/slapd.d /var/db/openldap",
|
||||
"systemctl restart openldap",
|
||||
)
|
||||
'' + testScript;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
parentHash =
|
||||
"0x0000000000000000000000000000000000000000000000000000000000000000";
|
||||
timestamp = "0x5cffc201";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -209,7 +209,7 @@ in
|
||||
return false
|
||||
end,
|
||||
score = 5.0,
|
||||
description = 'Allow no cows',
|
||||
description = 'Allow no cows',
|
||||
group = "cows",
|
||||
}
|
||||
rspamd_logger.infox(rspamd_config, 'Work dammit!!!')
|
||||
|
||||
+46
-28
@@ -1,4 +1,4 @@
|
||||
import ./make-test-python.nix ({ pkgs, ... }:
|
||||
({ pkgs, ... }:
|
||||
let
|
||||
dbDomain = "example.org";
|
||||
dbSuffix = "dc=example,dc=org";
|
||||
@@ -7,8 +7,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
ldapRootPassword = "foobar";
|
||||
|
||||
testUser = "alice";
|
||||
in
|
||||
{
|
||||
in import ./make-test-python.nix {
|
||||
name = "sssd-ldap";
|
||||
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
@@ -18,34 +17,53 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
machine = { pkgs, ... }: {
|
||||
services.openldap = {
|
||||
enable = true;
|
||||
rootdn = "cn=${ldapRootUser},${dbSuffix}";
|
||||
rootpw = ldapRootPassword;
|
||||
suffix = dbSuffix;
|
||||
declarativeContents = ''
|
||||
dn: ${dbSuffix}
|
||||
objectClass: top
|
||||
objectClass: dcObject
|
||||
objectClass: organization
|
||||
o: ${dbDomain}
|
||||
settings = {
|
||||
children = {
|
||||
"cn=schema".includes = [
|
||||
"${pkgs.openldap}/etc/schema/core.ldif"
|
||||
"${pkgs.openldap}/etc/schema/cosine.ldif"
|
||||
"${pkgs.openldap}/etc/schema/inetorgperson.ldif"
|
||||
"${pkgs.openldap}/etc/schema/nis.ldif"
|
||||
];
|
||||
"olcDatabase={1}mdb" = {
|
||||
attrs = {
|
||||
objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ];
|
||||
olcDatabase = "{1}mdb";
|
||||
olcDbDirectory = "/var/db/openldap";
|
||||
olcSuffix = dbSuffix;
|
||||
olcRootDN = "cn=${ldapRootUser},${dbSuffix}";
|
||||
olcRootPW = ldapRootPassword;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
declarativeContents = {
|
||||
${dbSuffix} = ''
|
||||
dn: ${dbSuffix}
|
||||
objectClass: top
|
||||
objectClass: dcObject
|
||||
objectClass: organization
|
||||
o: ${dbDomain}
|
||||
|
||||
dn: ou=posix,${dbSuffix}
|
||||
objectClass: top
|
||||
objectClass: organizationalUnit
|
||||
dn: ou=posix,${dbSuffix}
|
||||
objectClass: top
|
||||
objectClass: organizationalUnit
|
||||
|
||||
dn: ou=accounts,ou=posix,${dbSuffix}
|
||||
objectClass: top
|
||||
objectClass: organizationalUnit
|
||||
dn: ou=accounts,ou=posix,${dbSuffix}
|
||||
objectClass: top
|
||||
objectClass: organizationalUnit
|
||||
|
||||
dn: uid=${testUser},ou=accounts,ou=posix,${dbSuffix}
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
# userPassword: somePasswordHash
|
||||
homeDirectory: /home/${testUser}
|
||||
uidNumber: 1234
|
||||
gidNumber: 1234
|
||||
cn: ""
|
||||
sn: ""
|
||||
'';
|
||||
dn: uid=${testUser},ou=accounts,ou=posix,${dbSuffix}
|
||||
objectClass: person
|
||||
objectClass: posixAccount
|
||||
# userPassword: somePasswordHash
|
||||
homeDirectory: /home/${testUser}
|
||||
uidNumber: 1234
|
||||
gidNumber: 1234
|
||||
cn: ""
|
||||
sn: ""
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
services.sssd = {
|
||||
|
||||
Reference in New Issue
Block a user