2024-07-16 10:38:26 +02:00
|
|
|
{ pkgs, ... }:
|
2024-03-05 05:36:47 +01:00
|
|
|
let
|
2024-03-20 06:50:41 +01:00
|
|
|
pkgs' = pkgs;
|
|
|
|
|
2024-07-12 13:01:26 +02:00
|
|
|
testLib = pkgs.callPackage ../common.nix {};
|
|
|
|
|
|
|
|
subdomain = "j";
|
|
|
|
domain = "example.com";
|
|
|
|
|
|
|
|
commonTestScript = testLib.accessScript {
|
2024-07-16 10:38:26 +02:00
|
|
|
inherit subdomain domain;
|
2024-07-12 13:01:26 +02:00
|
|
|
hasSSL = { node, ... }: !(isNull node.config.shb.jellyfin.ssl);
|
|
|
|
waitForServices = { ... }: [
|
|
|
|
"jellyfin.service"
|
|
|
|
"nginx.service"
|
|
|
|
];
|
|
|
|
waitForPorts = { node, ... }: [
|
|
|
|
8096
|
|
|
|
];
|
|
|
|
};
|
2024-07-16 10:38:26 +02:00
|
|
|
|
|
|
|
base = testLib.base pkgs' [
|
|
|
|
../../modules/services/jellyfin.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
basic = {
|
|
|
|
shb.jellyfin = {
|
|
|
|
enable = true;
|
|
|
|
inherit domain subdomain;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
https = { config, ... }: {
|
|
|
|
shb.jellyfin = {
|
|
|
|
ssl = config.shb.certs.certs.selfsigned.n;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
ldap = { config, ... }: {
|
|
|
|
shb.jellyfin = {
|
|
|
|
ldap = {
|
|
|
|
enable = true;
|
|
|
|
host = "127.0.0.1";
|
|
|
|
port = config.shb.ldap.ldapPort;
|
|
|
|
dcdomain = config.shb.ldap.dcdomain;
|
2024-10-01 23:01:00 +02:00
|
|
|
passwordFile = config.shb.ldap.ldapUserPassword.result.path;
|
2024-07-16 10:38:26 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
sso = { config, ... }: {
|
|
|
|
shb.jellyfin = {
|
|
|
|
sso = {
|
|
|
|
enable = true;
|
|
|
|
endpoint = "https://${config.shb.authelia.subdomain}.${config.shb.authelia.domain}";
|
|
|
|
secretFile = pkgs.writeText "ssoSecretFile" "ssoSecretFile";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-03-05 05:36:47 +01:00
|
|
|
in
|
2024-03-03 07:58:36 +01:00
|
|
|
{
|
2024-03-20 06:50:41 +01:00
|
|
|
basic = pkgs.testers.runNixOSTest {
|
2024-07-16 10:38:26 +02:00
|
|
|
name = "jellyfin_basic";
|
2024-03-03 07:58:36 +01:00
|
|
|
|
2024-07-16 10:38:26 +02:00
|
|
|
nodes.server = {
|
2024-03-03 07:58:36 +01:00
|
|
|
imports = [
|
2024-07-16 10:38:26 +02:00
|
|
|
base
|
|
|
|
basic
|
2024-03-03 07:58:36 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.client = {};
|
|
|
|
|
2024-03-05 05:36:47 +01:00
|
|
|
testScript = commonTestScript;
|
2024-03-03 07:58:36 +01:00
|
|
|
};
|
|
|
|
|
2024-07-16 10:38:26 +02:00
|
|
|
https = pkgs.testers.runNixOSTest {
|
|
|
|
name = "jellyfin_https";
|
2024-03-03 07:58:36 +01:00
|
|
|
|
2024-07-16 10:38:26 +02:00
|
|
|
nodes.server = {
|
2024-03-03 07:58:36 +01:00
|
|
|
imports = [
|
2024-07-16 10:38:26 +02:00
|
|
|
base
|
|
|
|
(testLib.certs domain)
|
|
|
|
basic
|
|
|
|
https
|
2024-03-03 07:58:36 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.client = {};
|
|
|
|
|
2024-03-05 05:36:47 +01:00
|
|
|
testScript = commonTestScript;
|
2024-03-03 07:58:36 +01:00
|
|
|
};
|
|
|
|
|
2024-07-16 10:38:26 +02:00
|
|
|
ldap = pkgs.testers.runNixOSTest {
|
|
|
|
name = "jellyfin_ldap";
|
2024-03-03 07:58:36 +01:00
|
|
|
|
2024-07-16 10:38:26 +02:00
|
|
|
nodes.server = {
|
2024-03-03 07:58:36 +01:00
|
|
|
imports = [
|
2024-07-16 10:38:26 +02:00
|
|
|
base
|
|
|
|
basic
|
|
|
|
(testLib.ldap domain pkgs')
|
|
|
|
ldap
|
2024-03-03 07:58:36 +01:00
|
|
|
];
|
|
|
|
};
|
2024-07-16 10:38:26 +02:00
|
|
|
|
2024-03-03 07:58:36 +01:00
|
|
|
nodes.client = {};
|
2024-07-16 10:38:26 +02:00
|
|
|
|
2024-03-05 05:36:47 +01:00
|
|
|
testScript = commonTestScript;
|
2024-03-03 07:58:36 +01:00
|
|
|
};
|
|
|
|
|
2024-03-20 06:50:41 +01:00
|
|
|
sso = pkgs.testers.runNixOSTest {
|
2024-03-03 07:58:36 +01:00
|
|
|
name = "jellyfin_sso";
|
|
|
|
|
|
|
|
nodes.server = { config, pkgs, ... }: {
|
|
|
|
imports = [
|
2024-07-16 10:38:26 +02:00
|
|
|
base
|
|
|
|
(testLib.certs domain)
|
|
|
|
basic
|
|
|
|
https
|
|
|
|
(testLib.ldap domain pkgs')
|
|
|
|
(testLib.sso domain pkgs' config.shb.certs.certs.selfsigned.n)
|
|
|
|
sso
|
2024-03-03 07:58:36 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes.client = {};
|
|
|
|
|
2024-03-05 05:36:47 +01:00
|
|
|
testScript = commonTestScript;
|
2024-03-03 07:58:36 +01:00
|
|
|
};
|
|
|
|
}
|