forked from Fediversity/Fediversity
add tests, fix some things
upgrade memory to resolve oom
This commit is contained in:
parent
b0543ebfd8
commit
c943409354
7 changed files with 80 additions and 41 deletions
|
@ -14,6 +14,7 @@ let
|
||||||
"mastodon"
|
"mastodon"
|
||||||
"peertube"
|
"peertube"
|
||||||
"pixelfed"
|
"pixelfed"
|
||||||
|
"attic"
|
||||||
];
|
];
|
||||||
pathToRoot = /. + (builtins.unsafeDiscardStringContext self);
|
pathToRoot = /. + (builtins.unsafeDiscardStringContext self);
|
||||||
pathFromRoot = ./.;
|
pathFromRoot = ./.;
|
||||||
|
|
|
@ -48,6 +48,11 @@ in
|
||||||
s3AccessKeyFile = dummyFile;
|
s3AccessKeyFile = dummyFile;
|
||||||
s3SecretKeyFile = dummyFile;
|
s3SecretKeyFile = dummyFile;
|
||||||
};
|
};
|
||||||
|
attic = {
|
||||||
|
enable = true;
|
||||||
|
s3AccessKeyFile = dummyFile;
|
||||||
|
s3SecretKeyFile = dummyFile;
|
||||||
|
};
|
||||||
temp.cores = 1;
|
temp.cores = 1;
|
||||||
temp.initialUser = {
|
temp.initialUser = {
|
||||||
username = "dummy";
|
username = "dummy";
|
||||||
|
@ -72,6 +77,7 @@ in
|
||||||
nodes.mastodon.virtualisation.memorySize = 4 * 1024;
|
nodes.mastodon.virtualisation.memorySize = 4 * 1024;
|
||||||
nodes.pixelfed.virtualisation.memorySize = 4 * 1024;
|
nodes.pixelfed.virtualisation.memorySize = 4 * 1024;
|
||||||
nodes.peertube.virtualisation.memorySize = 5 * 1024;
|
nodes.peertube.virtualisation.memorySize = 5 * 1024;
|
||||||
|
nodes.attic.virtualisation.memorySize = 2 * 1024;
|
||||||
|
|
||||||
## FIXME: The test of presence of the services are very simple: we only
|
## FIXME: The test of presence of the services are very simple: we only
|
||||||
## check that there is a systemd service of the expected name on the
|
## check that there is a systemd service of the expected name on the
|
||||||
|
@ -86,6 +92,7 @@ in
|
||||||
mastodon.fail("systemctl status mastodon-web.service")
|
mastodon.fail("systemctl status mastodon-web.service")
|
||||||
peertube.fail("systemctl status peertube.service")
|
peertube.fail("systemctl status peertube.service")
|
||||||
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
|
|
||||||
with subtest("Run deployment with no services enabled"):
|
with subtest("Run deployment with no services enabled"):
|
||||||
deployer.succeed("nixops4 apply check-deployment-cli-nothing --show-trace --no-interactive 1>&2")
|
deployer.succeed("nixops4 apply check-deployment-cli-nothing --show-trace --no-interactive 1>&2")
|
||||||
|
@ -95,6 +102,7 @@ in
|
||||||
mastodon.fail("systemctl status mastodon-web.service")
|
mastodon.fail("systemctl status mastodon-web.service")
|
||||||
peertube.fail("systemctl status peertube.service")
|
peertube.fail("systemctl status peertube.service")
|
||||||
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
|
|
||||||
with subtest("Run deployment with Mastodon and Pixelfed enabled"):
|
with subtest("Run deployment with Mastodon and Pixelfed enabled"):
|
||||||
deployer.succeed("nixops4 apply check-deployment-cli-mastodon-pixelfed --show-trace --no-interactive 1>&2")
|
deployer.succeed("nixops4 apply check-deployment-cli-mastodon-pixelfed --show-trace --no-interactive 1>&2")
|
||||||
|
@ -104,6 +112,7 @@ in
|
||||||
mastodon.succeed("systemctl status mastodon-web.service")
|
mastodon.succeed("systemctl status mastodon-web.service")
|
||||||
peertube.fail("systemctl status peertube.service")
|
peertube.fail("systemctl status peertube.service")
|
||||||
pixelfed.succeed("systemctl status phpfpm-pixelfed.service")
|
pixelfed.succeed("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
|
|
||||||
with subtest("Run deployment with only Peertube enabled"):
|
with subtest("Run deployment with only Peertube enabled"):
|
||||||
deployer.succeed("nixops4 apply check-deployment-cli-peertube --show-trace --no-interactive 1>&2")
|
deployer.succeed("nixops4 apply check-deployment-cli-peertube --show-trace --no-interactive 1>&2")
|
||||||
|
@ -113,5 +122,6 @@ in
|
||||||
mastodon.fail("systemctl status mastodon-web.service")
|
mastodon.fail("systemctl status mastodon-web.service")
|
||||||
peertube.succeed("systemctl status peertube.service")
|
peertube.succeed("systemctl status peertube.service")
|
||||||
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ in
|
||||||
## default. These values have been trimmed down to the gigabyte.
|
## default. These values have been trimmed down to the gigabyte.
|
||||||
## Memory use is expected to be dominated by the NixOS evaluation,
|
## Memory use is expected to be dominated by the NixOS evaluation,
|
||||||
## which happens on the deployer.
|
## which happens on the deployer.
|
||||||
memorySize = 4 * 1024;
|
memorySize = 5 * 1024;
|
||||||
diskSize = 4 * 1024;
|
diskSize = 4 * 1024;
|
||||||
cores = 2;
|
cores = 2;
|
||||||
};
|
};
|
||||||
|
@ -59,7 +59,9 @@ in
|
||||||
inputs.nixops4
|
inputs.nixops4
|
||||||
inputs.nixops4-nixos
|
inputs.nixops4-nixos
|
||||||
inputs.nixpkgs
|
inputs.nixpkgs
|
||||||
|
|
||||||
sources.flake-inputs
|
sources.flake-inputs
|
||||||
|
sources.vars
|
||||||
|
|
||||||
pkgs.stdenv
|
pkgs.stdenv
|
||||||
pkgs.stdenvNoCC
|
pkgs.stdenvNoCC
|
||||||
|
|
|
@ -17,6 +17,7 @@ let
|
||||||
"mastodon"
|
"mastodon"
|
||||||
"peertube"
|
"peertube"
|
||||||
"pixelfed"
|
"pixelfed"
|
||||||
|
"attic"
|
||||||
];
|
];
|
||||||
pathToRoot = /. + (builtins.unsafeDiscardStringContext self);
|
pathToRoot = /. + (builtins.unsafeDiscardStringContext self);
|
||||||
pathFromRoot = ./.;
|
pathFromRoot = ./.;
|
||||||
|
|
|
@ -33,6 +33,7 @@ let
|
||||||
enableMastodon,
|
enableMastodon,
|
||||||
enablePeertube,
|
enablePeertube,
|
||||||
enablePixelfed,
|
enablePixelfed,
|
||||||
|
enableAttic,
|
||||||
}:
|
}:
|
||||||
hostPkgs.writers.writePython3Bin "interact-with-panel"
|
hostPkgs.writers.writePython3Bin "interact-with-panel"
|
||||||
{
|
{
|
||||||
|
@ -94,6 +95,7 @@ let
|
||||||
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'mastodon.enable']"), ${toPythonBool enableMastodon})
|
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'mastodon.enable']"), ${toPythonBool enableMastodon})
|
||||||
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'peertube.enable']"), ${toPythonBool enablePeertube})
|
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'peertube.enable']"), ${toPythonBool enablePeertube})
|
||||||
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'pixelfed.enable']"), ${toPythonBool enablePixelfed})
|
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'pixelfed.enable']"), ${toPythonBool enablePixelfed})
|
||||||
|
checkbox_set(driver.find_element(By.XPATH, "//input[@name = 'attic.enable']"), ${toPythonBool enableAttic})
|
||||||
|
|
||||||
print("Start deployment...")
|
print("Start deployment...")
|
||||||
driver.find_element(By.XPATH, "//button[@id = 'deploy-button']").click()
|
driver.find_element(By.XPATH, "//button[@id = 'deploy-button']").click()
|
||||||
|
@ -194,6 +196,11 @@ in
|
||||||
s3AccessKeyFile = dummyFile;
|
s3AccessKeyFile = dummyFile;
|
||||||
s3SecretKeyFile = dummyFile;
|
s3SecretKeyFile = dummyFile;
|
||||||
};
|
};
|
||||||
|
attic = {
|
||||||
|
enable = true;
|
||||||
|
s3AccessKeyFile = dummyFile;
|
||||||
|
s3SecretKeyFile = dummyFile;
|
||||||
|
};
|
||||||
temp.cores = 1;
|
temp.cores = 1;
|
||||||
temp.initialUser = {
|
temp.initialUser = {
|
||||||
username = "dummy";
|
username = "dummy";
|
||||||
|
@ -239,6 +246,7 @@ in
|
||||||
nodes.mastodon.virtualisation.memorySize = 4 * 1024;
|
nodes.mastodon.virtualisation.memorySize = 4 * 1024;
|
||||||
nodes.pixelfed.virtualisation.memorySize = 4 * 1024;
|
nodes.pixelfed.virtualisation.memorySize = 4 * 1024;
|
||||||
nodes.peertube.virtualisation.memorySize = 5 * 1024;
|
nodes.peertube.virtualisation.memorySize = 5 * 1024;
|
||||||
|
nodes.attic.virtualisation.memorySize = 2 * 1024;
|
||||||
|
|
||||||
## FIXME: The test of presence of the services are very simple: we only
|
## FIXME: The test of presence of the services are very simple: we only
|
||||||
## check that there is a systemd service of the expected name on the
|
## check that there is a systemd service of the expected name on the
|
||||||
|
@ -311,6 +319,7 @@ in
|
||||||
mastodon.fail("systemctl status mastodon-web.service")
|
mastodon.fail("systemctl status mastodon-web.service")
|
||||||
peertube.fail("systemctl status peertube.service")
|
peertube.fail("systemctl status peertube.service")
|
||||||
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
|
|
||||||
with subtest("Run deployment with no services enabled"):
|
with subtest("Run deployment with no services enabled"):
|
||||||
client.succeed("${
|
client.succeed("${
|
||||||
|
@ -319,6 +328,7 @@ in
|
||||||
enableMastodon = false;
|
enableMastodon = false;
|
||||||
enablePeertube = false;
|
enablePeertube = false;
|
||||||
enablePixelfed = false;
|
enablePixelfed = false;
|
||||||
|
enableAttic = false;
|
||||||
}
|
}
|
||||||
}/bin/interact-with-panel >&2")
|
}/bin/interact-with-panel >&2")
|
||||||
|
|
||||||
|
@ -327,6 +337,7 @@ in
|
||||||
mastodon.fail("systemctl status mastodon-web.service")
|
mastodon.fail("systemctl status mastodon-web.service")
|
||||||
peertube.fail("systemctl status peertube.service")
|
peertube.fail("systemctl status peertube.service")
|
||||||
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
|
|
||||||
with subtest("Run deployment with Mastodon and Pixelfed enabled"):
|
with subtest("Run deployment with Mastodon and Pixelfed enabled"):
|
||||||
client.succeed("${
|
client.succeed("${
|
||||||
|
@ -335,6 +346,7 @@ in
|
||||||
enableMastodon = true;
|
enableMastodon = true;
|
||||||
enablePeertube = false;
|
enablePeertube = false;
|
||||||
enablePixelfed = true;
|
enablePixelfed = true;
|
||||||
|
enableAttic = false;
|
||||||
}
|
}
|
||||||
}/bin/interact-with-panel >&2")
|
}/bin/interact-with-panel >&2")
|
||||||
|
|
||||||
|
@ -343,6 +355,7 @@ in
|
||||||
mastodon.succeed("systemctl status mastodon-web.service")
|
mastodon.succeed("systemctl status mastodon-web.service")
|
||||||
peertube.fail("systemctl status peertube.service")
|
peertube.fail("systemctl status peertube.service")
|
||||||
pixelfed.succeed("systemctl status phpfpm-pixelfed.service")
|
pixelfed.succeed("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
|
|
||||||
with subtest("Run deployment with only Peertube enabled"):
|
with subtest("Run deployment with only Peertube enabled"):
|
||||||
client.succeed("${
|
client.succeed("${
|
||||||
|
@ -351,6 +364,7 @@ in
|
||||||
enableMastodon = false;
|
enableMastodon = false;
|
||||||
enablePeertube = true;
|
enablePeertube = true;
|
||||||
enablePixelfed = false;
|
enablePixelfed = false;
|
||||||
|
enableAttic = false;
|
||||||
}
|
}
|
||||||
}/bin/interact-with-panel >&2")
|
}/bin/interact-with-panel >&2")
|
||||||
|
|
||||||
|
@ -359,5 +373,6 @@ in
|
||||||
mastodon.fail("systemctl status mastodon-web.service")
|
mastodon.fail("systemctl status mastodon-web.service")
|
||||||
peertube.succeed("systemctl status peertube.service")
|
peertube.succeed("systemctl status peertube.service")
|
||||||
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
pixelfed.fail("systemctl status phpfpm-pixelfed.service")
|
||||||
|
attic.fail("systemctl status atticd.service")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,10 @@ in
|
||||||
## should go into the `./nixos` subdirectory.
|
## should go into the `./nixos` subdirectory.
|
||||||
nixos.module = {
|
nixos.module = {
|
||||||
imports = [
|
imports = [
|
||||||
"${sources.agenix}/modules/age.nix"
|
"${agenix}/modules/age.nix"
|
||||||
"${sources.disko}/module.nix"
|
"${disko}/module.nix"
|
||||||
|
"${vars}/options.nix"
|
||||||
|
"${vars}/backends/on-machine.nix"
|
||||||
./options.nix
|
./options.nix
|
||||||
./nixos
|
./nixos
|
||||||
];
|
];
|
||||||
|
|
|
@ -48,12 +48,7 @@ in
|
||||||
attic = {
|
attic = {
|
||||||
inherit (config.fediversity.attic) s3AccessKeyFile s3SecretKeyFile;
|
inherit (config.fediversity.attic) s3AccessKeyFile s3SecretKeyFile;
|
||||||
ensureAccess = {
|
ensureAccess = {
|
||||||
peertube-videos = {
|
attic = {
|
||||||
read = true;
|
|
||||||
write = true;
|
|
||||||
owner = true;
|
|
||||||
};
|
|
||||||
peertube-playlists = {
|
|
||||||
read = true;
|
read = true;
|
||||||
write = true;
|
write = true;
|
||||||
owner = true;
|
owner = true;
|
||||||
|
@ -108,8 +103,8 @@ in
|
||||||
outPath = "./attic.env";
|
outPath = "./attic.env";
|
||||||
text = ''
|
text = ''
|
||||||
ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64=${fileContents config.vars.generators.attic.files.token.path}
|
ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64=${fileContents config.vars.generators.attic.files.token.path}
|
||||||
AWS_ACCESS_KEY_ID=$(cat ${config.fediversity.peertube.s3AccessKeyFile})
|
AWS_ACCESS_KEY_ID=$(cat ${config.fediversity.attic.s3AccessKeyFile})
|
||||||
AWS_SECRET_ACCESS_KEY=$(cat ${config.fediversity.peertube.s3SecretKeyFile})
|
AWS_SECRET_ACCESS_KEY=$(cat ${config.fediversity.attic.s3SecretKeyFile})
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
}/bin/attic.env";
|
}/bin/attic.env";
|
||||||
|
@ -255,41 +250,54 @@ in
|
||||||
#default-retention-period = "6 months";
|
#default-retention-period = "6 months";
|
||||||
};
|
};
|
||||||
|
|
||||||
jwt = {
|
# jwt = {
|
||||||
# WARNING: Changing _anything_ in this section will break any existing
|
# WARNING: Changing _anything_ in this section will break any existing
|
||||||
# tokens. If you need to regenerate them, ensure that you use the the
|
# tokens. If you need to regenerate them, ensure that you use the the
|
||||||
# correct secret and include the `iss` and `aud` claims.
|
# correct secret and include the `iss` and `aud` claims.
|
||||||
|
|
||||||
# JWT `iss` claim
|
# JWT `iss` claim
|
||||||
#
|
#
|
||||||
# Set this to the JWT issuer that you want to validate.
|
# Set this to the JWT issuer that you want to validate.
|
||||||
# If this is set, all received JWTs will validate that the `iss` claim
|
# If this is set, all received JWTs will validate that the `iss` claim
|
||||||
# matches this value.
|
# matches this value.
|
||||||
#token-bound-issuer = "some-issuer";
|
#token-bound-issuer = "some-issuer";
|
||||||
|
|
||||||
# JWT `aud` claim
|
# JWT `aud` claim
|
||||||
#
|
#
|
||||||
# Set this to the JWT audience(s) that you want to validate.
|
# Set this to the JWT audience(s) that you want to validate.
|
||||||
# If this is set, all received JWTs will validate that the `aud` claim
|
# If this is set, all received JWTs will validate that the `aud` claim
|
||||||
# contains at least one of these values.
|
# contains at least one of these values.
|
||||||
#token-bound-audiences = ["some-audience1", "some-audience2"];
|
#token-bound-audiences = ["some-audience1", "some-audience2"];
|
||||||
};
|
# };
|
||||||
|
|
||||||
# jwt.signing = {
|
# jwt.signing = {
|
||||||
# # JWT RS256 secret key
|
# You must configure JWT signing and verification inside your TOML configuration by setting one of the following options in the [jwt.signing] block:
|
||||||
# #
|
# * token-rs256-pubkey-base64
|
||||||
# # Set this to the base64-encoded private half of an RSA PEM PKCS1 key.
|
# * token-rs256-secret-base64
|
||||||
# # TODO
|
# * token-hs256-secret-base64
|
||||||
# # You can also set it via the `ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64`
|
# or by setting one of the following environment variables:
|
||||||
# # environment variable.
|
# * ATTIC_SERVER_TOKEN_RS256_PUBKEY_BASE64
|
||||||
# token-rs256-secret-base64 = "%token_rs256_secret_base64%";
|
# * ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64
|
||||||
|
# * ATTIC_SERVER_TOKEN_HS256_SECRET_BASE64
|
||||||
|
# Options will be tried in that same order (configuration options first, then environment options if none of the configuration options were set, starting with the respective RSA pubkey option, the RSA secret option, and finally the HMAC secret option). The first option that is found will be used.
|
||||||
|
# If an RS256 pubkey (asymmetric RSA PEM PKCS1 public key) is provided, it will only be possible to verify received JWTs, and not sign new JWTs.
|
||||||
|
# If an RS256 secret (asymmetric RSA PEM PKCS1 private key) is provided, it will be used for both signing new JWTs and verifying received JWTs.
|
||||||
|
# If an HS256 secret (symmetric HMAC secret) is provided, it will be used for both signing new JWTs and verifying received JWTs.
|
||||||
|
|
||||||
# # JWT HS256 secret key
|
# JWT RS256 secret key
|
||||||
# #
|
#
|
||||||
# # Set this to the base64-encoded HMAC secret key.
|
# Set this to the base64-encoded private half of an RSA PEM PKCS1 key.
|
||||||
# # You can also set it via the `ATTIC_SERVER_TOKEN_HS256_SECRET_BASE64`
|
# TODO
|
||||||
# # environment variable.
|
# You can also set it via the `ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64`
|
||||||
# #token-hs256-secret-base64 = "";
|
# environment variable.
|
||||||
|
# token-rs256-secret-base64 = "%token_rs256_secret_base64%";
|
||||||
|
|
||||||
|
# JWT HS256 secret key
|
||||||
|
#
|
||||||
|
# Set this to the base64-encoded HMAC secret key.
|
||||||
|
# You can also set it via the `ATTIC_SERVER_TOKEN_HS256_SECRET_BASE64`
|
||||||
|
# environment variable.
|
||||||
|
#token-hs256-secret-base64 = "";
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue