Compare commits

..

No commits in common. "1d3ca2a6821510ddac71d2e32be5c8e7386fa33c" and "86a6dbdab2f9fcabec5228388cb4e84d32664318" have entirely different histories.

21 changed files with 30 additions and 437 deletions

View file

@ -434,22 +434,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1614513358, "lastModified": 1614513358,
@ -562,21 +546,6 @@
} }
}, },
"flake-utils_8": { "flake-utils_8": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_9": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
}, },
@ -648,23 +617,6 @@
"type": "github" "type": "github"
} }
}, },
"haskellTar": {
"flake": false,
"locked": {
"lastModified": 1657046996,
"narHash": "sha256-gDxF+1L0sMzwogCCTGtiYnPgZMIg5fTWV8d062F7iR0=",
"owner": "haskell",
"repo": "tar",
"rev": "dbf8c995153c8a80450724d9f94cf33403740c80",
"type": "github"
},
"original": {
"owner": "haskell",
"repo": "tar",
"rev": "dbf8c995153c8a80450724d9f94cf33403740c80",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -1303,7 +1255,6 @@
"private_assets": "private_assets", "private_assets": "private_assets",
"retiolum": "retiolum", "retiolum": "retiolum",
"secrets": "secrets", "secrets": "secrets",
"smoke": "smoke",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"stylix": "stylix", "stylix": "stylix",
"taskshell": "taskshell" "taskshell": "taskshell"
@ -1375,29 +1326,6 @@
"type": "github" "type": "github"
} }
}, },
"smoke": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_8",
"haskellTar": "haskellTar",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1677715661,
"narHash": "sha256-O4jQBF76GcvqtJbBZT13bh3kEnEGPEu5coW8aBtDivQ=",
"owner": "SamirTalwar",
"repo": "smoke",
"rev": "3a3c12dcfe49fc6ec847516fc49b0804f4151fe0",
"type": "github"
},
"original": {
"owner": "SamirTalwar",
"repo": "smoke",
"type": "github"
}
},
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_7",
@ -1427,7 +1355,7 @@
"base16-kitty": "base16-kitty", "base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux", "base16-tmux": "base16-tmux",
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_2",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_8"
}, },
@ -1492,7 +1420,7 @@
}, },
"taskshell": { "taskshell": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_9", "flake-utils": "flake-utils_8",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]

View file

@ -12,7 +12,6 @@
nixpkgs-legacy_2205.url = "github:nixos/nixpkgs/nixos-22.05"; nixpkgs-legacy_2205.url = "github:nixos/nixpkgs/nixos-22.05";
nixpkgs-legacy_2105.url = "github:nixos/nixpkgs/nixos-21.05"; nixpkgs-legacy_2105.url = "github:nixos/nixpkgs/nixos-21.05";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-23.11"; url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -74,10 +73,6 @@
#inputs.nixpkgs.follows = "nixpkgs"; #inputs.nixpkgs.follows = "nixpkgs";
#inputs.home-manager.follows = "home-manager"; #inputs.home-manager.follows = "home-manager";
}; };
smoke = {
url = github:SamirTalwar/smoke;
inputs.nixpkgs.follows = "nixpkgs";
};
taskshell = { taskshell = {
url = "github:mrvandalo/taskshell"; url = "github:mrvandalo/taskshell";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -110,7 +105,6 @@
, private_assets , private_assets
, retiolum , retiolum
, secrets , secrets
, smoke
, sops-nix , sops-nix
, stylix , stylix
, taskshell , taskshell
@ -149,7 +143,6 @@
kmonad = kmonad.packages.${system}.kmonad; kmonad = kmonad.packages.${system}.kmonad;
tasksh = taskshell.packages.${system}.tasksh; tasksh = taskshell.packages.${system}.tasksh;
overviewer = overviewer.packages.${system}.overviewer; overviewer = overviewer.packages.${system}.overviewer;
smoke = smoke.packages.${system}.default;
}) })
(import ./nixos/pkgs) (import ./nixos/pkgs)
]; ];

View file

@ -44,7 +44,7 @@ with lib;
services.nginx.package = pkgs.nginxMainline; services.nginx.package = pkgs.nginxMainline;
services.nginx.virtualHosts."${config.networking.hostName}.private" = { services.nginx.virtualHosts."${config.networking.hostName}.private" = {
default = lib.mkDefault true; default = true;
locations."/" = { locations."/" = {
root = pkgs.landingpage.override { root = pkgs.landingpage.override {
jsonConfig = [ jsonConfig = [

View file

@ -11,8 +11,6 @@ with lib;
ipcalc ipcalc
units units
parallel
]; ];
} }
(mkIf config.gui.enable { (mkIf config.gui.enable {
@ -26,11 +24,9 @@ with lib;
aspellDicts.en aspellDicts.en
aspellDicts.es aspellDicts.es
#joplin-desktop joplin-desktop
evince evince
transmission-remote-gtk
]; ];
}) })
]; ];

View file

@ -110,8 +110,6 @@ with lib;
in in
[ [
# smoke
tmux tmux
nethogs nethogs

View file

@ -23,7 +23,7 @@ in
services.dendrite = { services.dendrite = {
enable = true; enable = true;
httpPort = 8448; httpPort = 8043;
settings = { settings = {
global = { global = {
server_name = "terranix.org"; server_name = "terranix.org";
@ -100,11 +100,10 @@ in
locations."/".root = element-web-terranix.org; locations."/".root = element-web-terranix.org;
}; };
#services.nginx.virtualHosts.${server_name} = { services.nginx.virtualHosts.${server_name} = {
# locations."= /.well-known/matrix/server".alias = locations."= /.well-known/matrix/server".alias =
# pkgs.writeText "matrix-server" (builtins.toJSON { "m.server" = "${nginx-vhost}:443"; }); pkgs.writeText "matrix-server" (builtins.toJSON { "m.server" = "${nginx-vhost}:443"; });
# locations."= /.well-known/matrix/client".alias = locations."= /.well-known/matrix/client".alias =
# pkgs.writeText "matrix-client" (builtins.toJSON { "m.homeserver".base_url = "https://${nginx-vhost}"; }); pkgs.writeText "matrix-client" (builtins.toJSON { "m.homeserver".base_url = "https://${nginx-vhost}"; });
#}; };
} }

View file

@ -1,7 +1,7 @@
{ lib, config, pkgs, ... }: { { lib, config, pkgs, ... }: {
imports = [ imports = [
# ../../system/all/nginx.nix ../../system/all/nginx.nix
../../system/all/borg-jobs.nix ../../system/all/borg-jobs.nix
../../system/all/defaults.nix ../../system/all/defaults.nix
../../system/server/packages.nix ../../system/server/packages.nix
@ -12,6 +12,8 @@
./hetzner.nix ./hetzner.nix
#./screeps.nix
./borg.nix ./borg.nix
./codimd.nix ./codimd.nix
./gitea.nix ./gitea.nix
@ -31,9 +33,24 @@
./media-transmission.nix ./media-transmission.nix
./media-transmission2.nix ./media-transmission2.nix
./media-arr.nix ./media-arr.nix
#./media-tdarr.nix
#./media-unmanic.nix
./social-jitsi.nix ./social-jitsi.nix
#./webhook-ring.nix
#../../system/server
#./hardware-configuration.nix
#./finance.nix
#./graylog.nix
#./kibana.nix
#./mysql.nix
#./prometheus.nix
#./weechat.nix
#./property.nix # flask sucks, find something else
# matrix # matrix
./terranix-dendrite.nix ./terranix-dendrite.nix

View file

@ -39,10 +39,7 @@ in
recommendedProxySettings = true; recommendedProxySettings = true;
virtualHosts = { virtualHosts = {
"${config.networking.hostName}.private".default = false;
"ingolf-wagner.de" = { "ingolf-wagner.de" = {
default = true;
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
extraConfig = error.extraConfig; extraConfig = error.extraConfig;

View file

@ -1,71 +0,0 @@
#!/usr/bin/env bash
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
source $SCRIPT_DIR/smoke.sh
smoke_url_ok "https://git.ingolf-wagner.de/"
smoke_assert_body "explore"
smoke_url_ok "https://bitwarden.ingolf-wagner.de/#/login"
smoke_assert_body "Vaultwarden"
smoke_url_ok "https://nextcloud.ingolf-wagner.de/login"
smoke_assert_body "Login"
smoke_url_ok "https://flix.ingolf-wagner.de/web/index.html#!/login.html"
smoke_assert_body "jellyfin"
# todo this should not show landingpage
# smoke_url_ok "http://taskserver.ingolf-wagner.de/"
# todo this should not show landingpage
# smoke_url_ok "http://taskd.ingolf-wagner.de/"
smoke_url_ok "http://sync.robi.private/"
smoke_assert_body "Transmission Web Interface"
smoke_url_ok "http://transmission.robi.private/"
smoke_assert_body "Transmission Web Interface"
smoke_url_ok "http://transmission2.robi.private/"
smoke_assert_body "Transmission Web Interface"
smoke_url_ok "http://sonarr.robi.private/"
smoke_assert_body "Sonarr"
smoke_url_ok "http://radarr.robi.private/"
smoke_assert_body "Radarr"
smoke_url_ok "http://prowlarr.robi.private/"
smoke_assert_body "Prowlarr"
smoke_url_ok "http://jellyseerr.robi.private/"
smoke_assert_body "Welcome to Jellyseerr"
smoke_url_ok "http://grafana.robi.private/login"
smoke_assert_body "Grafana"
smoke_url_ok "http://prometheus.robi.private/"
smoke_assert_body "Prometheus Time Series Collection and Processing Server"
smoke_url_ok "http://robi.private:8384/"
smoke_assert_body "Syncthing admin interface"
smoke_url_ok "http://robi.private:19999/"
smoke_assert_body "netdata dashboard"
smoke_url_ok "https://matrix.terranix.org/#/welcome"
smoke_assert_body "Sorry, Element requires JavaScript to be enabled"
smoke_url_ok "https://terranix.org/"
smoke_assert_body "terraform"
smoke_assert_body "terranix"
smoke_assert_body "nix"
smoke_url_ok "https://meet.ingolf-wagner.de/test"
smoke_assert_body "Jitsi"
smoke_url_ok "https://md.ingolf-wagner.de/test"
smoke_assert_body "HedgeDoc - Ideas grow better together"
smoke_report

View file

@ -1,264 +0,0 @@
#!/bin/bash
# downloaded from : https://github.com/asm89/smoke.sh
SMOKE_TMP_DIR=$(mktemp -d)
SMOKE_AFTER_RESPONSE=""
SMOKE_CURL_CODE="$SMOKE_TMP_DIR/smoke_curl_code"
SMOKE_CURL_HEADERS="$SMOKE_TMP_DIR/smoke_curl_headers"
SMOKE_CURL_BODY="$SMOKE_TMP_DIR/smoke_curl_body"
SMOKE_CURL_COOKIE_JAR="$SMOKE_TMP_DIR/smoke_curl_cookie_jar"
SMOKE_CSRF_TOKEN=""
SMOKE_CSRF_FORM_DATA="$SMOKE_TMP_DIR/smoke_csrf_form_data"
SMOKE_TESTS_FAILED=0
SMOKE_TESTS_RUN=0
SMOKE_URL_PREFIX=""
SMOKE_HEADERS=()
## "Public API"
smoke_csrf() {
SMOKE_CSRF_TOKEN="$1"
}
smoke_form() {
URL="$1"
FORMDATA="$2"
if [[ ! -f $FORMDATA ]]; then
_smoke_print_failure "No formdata file"
_smoke_cleanup
exit 1
fi
_curl_post $URL $FORMDATA
}
smoke_form_ok() {
URL="$1"
FORMDATA="$2"
smoke_form "$URL" "$FORMDATA"
smoke_assert_code_ok
}
smoke_report() {
_smoke_cleanup
if [[ $SMOKE_TESTS_FAILED -ne 0 ]]; then
_smoke_print_report_failure "FAIL ($SMOKE_TESTS_FAILED/$SMOKE_TESTS_RUN)"
exit 1
fi
_smoke_print_report_success "OK ($SMOKE_TESTS_RUN/$SMOKE_TESTS_RUN)"
}
smoke_response_code() {
cat $SMOKE_CURL_CODE
}
smoke_response_body() {
cat $SMOKE_CURL_BODY
}
smoke_response_headers() {
cat $SMOKE_CURL_HEADERS
}
smoke_tcp_ok() {
URL="$1 $2"
_smoke_print_url "$URL"
echo EOF | telnet $URL >$SMOKE_CURL_BODY
smoke_assert_body "Connected"
}
smoke_url() {
URL="$1"
_curl_get $URL
}
smoke_url_ok() {
URL="$1"
smoke_url "$URL"
smoke_assert_code_ok
}
smoke_url_prefix() {
SMOKE_URL_PREFIX="$1"
}
smoke_header() {
SMOKE_HEADERS+=("$1")
}
smoke_host() {
smoke_header "Host: $1"
}
remove_smoke_headers() {
unset SMOKE_HEADERS
}
## Assertions
smoke_assert_code() {
EXPECTED="$1"
CODE=$(cat $SMOKE_CURL_CODE)
if [[ $CODE == $1 ]]; then
_smoke_success "$1 Response code"
else
_smoke_fail "$1 Response code"
fi
}
smoke_assert_code_ok() {
CODE=$(cat $SMOKE_CURL_CODE)
if [[ $CODE == 2* ]]; then
_smoke_success "2xx Response code"
else
_smoke_fail "2xx Response code"
fi
}
smoke_assert_body() {
STRING="$1"
smoke_response_body | grep --quiet "$STRING"
if [[ $? -eq 0 ]]; then
_smoke_success "Body contains \"$STRING\""
else
_smoke_fail "Body does not contain \"$STRING\""
fi
}
smoke_assert_headers() {
STRING="$1"
smoke_response_headers | grep --quiet "$STRING"
if [[ $? -eq 0 ]]; then
_smoke_success "Headers contain \"$STRING\""
else
_smoke_fail "Headers do not contain \"$STRING\""
fi
}
## Smoke "private" functions
_smoke_after_response() {
$SMOKE_AFTER_RESPONSE
}
_smoke_cleanup() {
rm -rf $SMOKE_TMP_DIR
}
_smoke_fail() {
REASON="$1"
((++SMOKE_TESTS_FAILED))
((++SMOKE_TESTS_RUN))
_smoke_print_failure "$REASON"
}
_smoke_prepare_formdata() {
FORMDATA="$1"
if [[ "" != $SMOKE_CSRF_TOKEN ]]; then
cat $FORMDATA | sed "s/__SMOKE_CSRF_TOKEN__/$SMOKE_CSRF_TOKEN/" >$SMOKE_CSRF_FORM_DATA
echo $SMOKE_CSRF_FORM_DATA
else
echo $FORMDATA
fi
}
_smoke_success() {
REASON="$1"
_smoke_print_success "$REASON"
((++SMOKE_TESTS_RUN))
}
## Curl helpers
_curl() {
local opt=(--cookie $SMOKE_CURL_COOKIE_JAR --cookie-jar $SMOKE_CURL_COOKIE_JAR --location --dump-header $SMOKE_CURL_HEADERS --silent)
if ((${#SMOKE_HEADERS[@]})); then
for header in "${SMOKE_HEADERS[@]}"; do
opt+=(-H "$header")
done
fi
curl "${opt[@]}" "$@" >$SMOKE_CURL_BODY
}
_curl_get() {
URL="$1"
SMOKE_URL="$SMOKE_URL_PREFIX$URL"
_smoke_print_url "$SMOKE_URL"
_curl $SMOKE_URL
grep -oE 'HTTP[^ ]+ [0-9]{3}' $SMOKE_CURL_HEADERS | tail -n1 | grep -oE '[0-9]{3}' >$SMOKE_CURL_CODE
$SMOKE_AFTER_RESPONSE
}
_curl_post() {
URL="$1"
FORMDATA="$2"
FORMDATA_FILE="@"$(_smoke_prepare_formdata $FORMDATA)
SMOKE_URL="$SMOKE_URL_PREFIX$URL"
_smoke_print_url "$SMOKE_URL"
_curl --data "$FORMDATA_FILE" $SMOKE_URL
grep -oE 'HTTP[^ ]+ [0-9]{3}' $SMOKE_CURL_HEADERS | tail -n1 | grep -oE '[0-9]{3}' >$SMOKE_CURL_CODE
$SMOKE_AFTER_RESPONSE
}
## Print helpers
# test for color support, inspired by:
# http://unix.stackexchange.com/questions/9957/how-to-check-if-bash-can-print-colors
if [ -t 1 ]; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold="$(tput bold)"
normal="$(tput sgr0)"
red="$(tput setaf 1)"
redbg="$(tput setab 1)"
green="$(tput setaf 2)"
greenbg="$(tput setab 2)"
fi
fi
_smoke_print_failure() {
TEXT="$1"
echo " [${red}${bold}FAIL${normal}] $TEXT"
}
_smoke_print_report_failure() {
TEXT="$1"
echo -e "${redbg}$TEXT${normal}"
}
_smoke_print_report_success() {
TEXT="$1"
echo -e "${greenbg}$TEXT${normal}"
}
_smoke_print_success() {
TEXT="$1"
echo " [ ${green}${bold}OK${normal} ] $TEXT"
}
_smoke_print_url() {
TEXT="$1"
echo "> $TEXT"
}