✅ add some smoke tests.
This commit is contained in:
parent
a52e1b39a0
commit
743a9fc885
4 changed files with 82 additions and 1 deletions
|
@ -1,4 +1,9 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
networking.firewall.interfaces.wg0.allowedTCPPorts = [
|
||||
7878
|
||||
|
@ -11,6 +16,27 @@
|
|||
8989
|
||||
8686
|
||||
];
|
||||
verify.localCommands =
|
||||
let
|
||||
curl = lib.getExe pkgs.curl;
|
||||
grep = lib.getExe pkgs.gnugrep;
|
||||
|
||||
command = domain: grepString: ''
|
||||
if ${curl} -s -o /dev/null -w "%{http_code}" ${domain} | ${grep} -q "200"; then
|
||||
if ${curl} -s ${domain} | ${grep} -q "${grepString}"; then
|
||||
echo "[ OK ] Die Seite hat Statuscode 200 und enthält den String '${grepString}'."
|
||||
else
|
||||
echo "[Fail] Der Statuscode ist 200, aber die Seite enthält den String '${grepString}' nicht."
|
||||
fi
|
||||
else
|
||||
echo "[Fail] Die Seite hat keinen Statuscode 200."
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
sonarr = command "sonarr.ingolf-wagner.de" "Sonarr";
|
||||
radarr = command "radarr.ingolf-wagner.de" "Radarr";
|
||||
};
|
||||
|
||||
# download series
|
||||
services.sonarr = {
|
||||
|
|
|
@ -6,6 +6,25 @@
|
|||
}:
|
||||
{
|
||||
|
||||
verify.localCommands.forgejo =
|
||||
let
|
||||
domain = "https://git.ingolf-wagner.de/explore/repos";
|
||||
curl = lib.getExe pkgs.curl;
|
||||
grep = lib.getExe pkgs.gnugrep;
|
||||
grepString = "palo/nixos-config";
|
||||
in
|
||||
''
|
||||
if ${curl} -s -o /dev/null -w "%{http_code}" ${domain} | ${grep} -q "200"; then
|
||||
if ${curl} -s ${domain} | ${grep} -q "${grepString}"; then
|
||||
echo "[ OK ] Die Seite hat Statuscode 200 und enthält den String '${grepString}'."
|
||||
else
|
||||
echo "[Fail] Der Statuscode ist 200, aber die Seite enthält den String '${grepString}' nicht."
|
||||
fi
|
||||
else
|
||||
echo "[Fail] Die Seite hat keinen Statuscode 200."
|
||||
fi
|
||||
'';
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
statusPage = true;
|
||||
|
|
|
@ -33,6 +33,24 @@
|
|||
};
|
||||
|
||||
verify.closed.public.ports.nix-serve = [ config.services.nix-serve.port ];
|
||||
verify.localCommands.nix-serve =
|
||||
let
|
||||
domain = "cache.${config.networking.hostName}.wg0/nix-cache-info";
|
||||
curl = lib.getExe pkgs.curl;
|
||||
grep = lib.getExe pkgs.gnugrep;
|
||||
grepString = "Priority: 50";
|
||||
in
|
||||
''
|
||||
if ${curl} -s -o /dev/null -w "%{http_code}" ${domain} | ${grep} -q "200"; then
|
||||
if ${curl} -s ${domain} | ${grep} -q "${grepString}"; then
|
||||
echo "[ OK ] Die Seite hat Statuscode 200 und enthält den String '${grepString}'."
|
||||
else
|
||||
echo "[Fail] Der Statuscode ist 200, aber die Seite enthält den String '${grepString}' nicht."
|
||||
fi
|
||||
else
|
||||
echo "[Fail] Die Seite hat keinen Statuscode 200."
|
||||
fi
|
||||
'';
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
|
|
@ -17,6 +17,24 @@ in
|
|||
# networking.firewall.interfaces.wg0.allowedUDPPorts = [ photoprismPort ];
|
||||
|
||||
verify.closed.public.ports.photoprism = [ photoprismPort ];
|
||||
verify.localCommands.photoprism =
|
||||
let
|
||||
domain = "http://10.100.0.1:2342/library/login";
|
||||
curl = lib.getExe pkgs.curl;
|
||||
grep = lib.getExe pkgs.gnugrep;
|
||||
grepString = "AI-Powered Photos App";
|
||||
in
|
||||
''
|
||||
if ${curl} -s -o /dev/null -w "%{http_code}" ${domain} | ${grep} -q "200"; then
|
||||
if ${curl} -s ${domain} | ${grep} -q "${grepString}"; then
|
||||
echo "[ OK ] Die Seite hat Statuscode 200 und enthält den String '${grepString}'."
|
||||
else
|
||||
echo "[Fail] Der Statuscode ist 200, aber die Seite enthält den String '${grepString}' nicht."
|
||||
fi
|
||||
else
|
||||
echo "[Fail] Die Seite hat keinen Statuscode 200."
|
||||
fi
|
||||
'';
|
||||
|
||||
containers.photoprism = {
|
||||
privateNetwork = false;
|
||||
|
|
Loading…
Reference in a new issue