Compare commits
No commits in common. "a072ba0dd73947d905c1936c51036fb71e8c997b" and "0a8af07b0886a03ba0b5c5aea60f3f6e00d4afc8" have entirely different histories.
a072ba0dd7
...
0a8af07b08
3 changed files with 1 additions and 73 deletions
|
@ -3,7 +3,6 @@
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -31,10 +30,6 @@ with lib;
|
||||||
"nextcloud30"
|
"nextcloud30"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
adminpassFile = options.services.nextcloud.config.adminpassFile // {
|
|
||||||
default = config.sops.secrets."nextcloud/admin".path;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -64,7 +59,7 @@ with lib;
|
||||||
database.createLocally = true;
|
database.createLocally = true;
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
inherit (cfg) adminpassFile;
|
adminpassFile = config.sops.secrets."nextcloud/admin".path;
|
||||||
adminuser = "root";
|
adminuser = "root";
|
||||||
dbtype = "pgsql";
|
dbtype = "pgsql";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
# Note: This extends the default configuration from ${self}/checks/nixos-modules
|
|
||||||
nodes.webserver =
|
|
||||||
{ pkgs, lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (pkgs) curl gnugrep;
|
|
||||||
inherit (lib) mkForce genAttrs const;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
qois.cloud = {
|
|
||||||
enable = true;
|
|
||||||
domain = "cloud.example.com";
|
|
||||||
package = pkgs.nextcloud31;
|
|
||||||
adminpassFile = (pkgs.writeText "nextcloud-test-adminpass-file" "super secret password").outPath;
|
|
||||||
};
|
|
||||||
|
|
||||||
qois.postgresql.package = pkgs.postgresql;
|
|
||||||
sops.secrets = mkForce { };
|
|
||||||
|
|
||||||
# Disable TLS services
|
|
||||||
services.nginx.virtualHosts = genAttrs [ "cloud.example.com" ] (const {
|
|
||||||
forceSSL = mkForce false;
|
|
||||||
enableACME = mkForce false;
|
|
||||||
});
|
|
||||||
|
|
||||||
# Test environment
|
|
||||||
environment.systemPackages = [
|
|
||||||
curl
|
|
||||||
gnugrep
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
def test(subtest, webserver):
|
|
||||||
webserver.wait_for_unit("nginx")
|
|
||||||
webserver.wait_for_open_port(80)
|
|
||||||
|
|
||||||
# Helpers
|
|
||||||
def curl_variable_test(node, variable, expected, url):
|
|
||||||
value = node.succeed(
|
|
||||||
f"curl -s --no-location -o /dev/null -w '%{{{variable}}}' '{url}'"
|
|
||||||
)
|
|
||||||
assert value == expected, (
|
|
||||||
f"expected {variable} to be '{expected}' but got '{value}'"
|
|
||||||
)
|
|
||||||
|
|
||||||
def expect_http_code(node, code, url):
|
|
||||||
curl_variable_test(node, "http_code", code, url)
|
|
||||||
|
|
||||||
def expect_http_content_contains(node, expectedContentSnippet, url):
|
|
||||||
content = node.succeed(f"curl --no-location --silent '{url}'")
|
|
||||||
assert expectedContentSnippet in content, f"""
|
|
||||||
expected in content:
|
|
||||||
{expectedContentSnippet}
|
|
||||||
at {url} but got following content:
|
|
||||||
{content}
|
|
||||||
"""
|
|
||||||
|
|
||||||
# Tests
|
|
||||||
with subtest("website is successfully served on cloud.example.com"):
|
|
||||||
webserver.succeed("grep cloud.example.com /etc/hosts")
|
|
||||||
expect_http_code(webserver, "200", "http://cloud.example.com")
|
|
||||||
expect_http_content_contains(
|
|
||||||
webserver, "Log in to cloud.qoo.is", "http://docs.example.com"
|
|
||||||
)
|
|
Loading…
Add table
Add a link
Reference in a new issue