From 5cc4714fbb833d154ff3fb6c1079c5e8205f1fea Mon Sep 17 00:00:00 2001 From: kity Date: Wed, 30 Oct 2024 17:44:54 +0100 Subject: [PATCH] huge refactoring --- features/server/backups.nix | 1 - features/server/caddy.nix | 68 ------------------- features/server/multimedia/arr-suite.nix | 29 ++++++++ features/server/multimedia/calibre-web.nix | 4 ++ features/server/multimedia/jellyfin.nix | 10 +++ features/server/multimedia/slskd.nix | 4 ++ features/server/multimedia/transmission.nix | 4 ++ features/server/prometheus.nix | 1 - features/server/services/default.nix | 2 +- features/server/services/forgejo.nix | 4 ++ features/server/services/grafana.nix | 4 ++ .../server/services/homelab-dashboard.nix | 4 ++ features/server/services/uptime-kuma.nix | 10 +++ 13 files changed, 74 insertions(+), 71 deletions(-) diff --git a/features/server/backups.nix b/features/server/backups.nix index 505917e..ad0407a 100644 --- a/features/server/backups.nix +++ b/features/server/backups.nix @@ -78,7 +78,6 @@ "/srv/Minecraft" ]; postgresql_databases = [ - { name = "forgejo"; } { name = "nextcloud"; } { name = "matrix-synapse"; } ]; diff --git a/features/server/caddy.nix b/features/server/caddy.nix index 5b27bfb..c3405b2 100644 --- a/features/server/caddy.nix +++ b/features/server/caddy.nix @@ -4,81 +4,13 @@ enable = true; virtualHosts = { - "http://sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :8082 - ''; - - "http://git.hypervirtual.world".extraConfig = '' - reverse_proxy :3333 - ''; - - "http://books.hypervirtual.world".extraConfig = '' - reverse_proxy :8083 - ''; - "http://fish.hypervirtual.world".extraConfig = '' reverse_proxy :3030 ''; - "http://jellyfin.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :8096 - ''; - - "http://media.hypervirtual.world".extraConfig = '' - reverse_proxy :8096 - ''; - - "http://slskd.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :5030 - ''; - - "http://radarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :7878 - ''; - - "http://sonarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :8989 - ''; - - "http://sonarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :8999 - ''; - - "http://prowlarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :9696 - ''; - - "http://grafana.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :3000 - ''; - - "http://status.hypervirtual.world".extraConfig = '' - reverse_proxy :4000 - ''; - - "http://transmission.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :9091 - ''; - - "http://uptime.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :4000 - ''; - "http://mc.sisyphe.normandy.hypervirtual.world".extraConfig = '' reverse_proxy :8443 ''; - - "http://katflix.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :5055 - ''; - - "http://bazarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :6767 - ''; - - "http://bazarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :6777 - ''; }; }; diff --git a/features/server/multimedia/arr-suite.nix b/features/server/multimedia/arr-suite.nix index d5e940c..17b55cb 100644 --- a/features/server/multimedia/arr-suite.nix +++ b/features/server/multimedia/arr-suite.nix @@ -55,4 +55,33 @@ in }; */ + services.caddy.virtualHosts = { + "http://radarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :7878 + ''; + + "http://sonarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :8989 + ''; + + "http://sonarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :8999 + ''; + + "http://prowlarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :9696 + ''; + + "http://katflix.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :5055 + ''; + + "http://bazarr.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :6767 + ''; + + "http://bazarr-anime.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :6777 + ''; + }; } diff --git a/features/server/multimedia/calibre-web.nix b/features/server/multimedia/calibre-web.nix index 554d879..f8caa9d 100644 --- a/features/server/multimedia/calibre-web.nix +++ b/features/server/multimedia/calibre-web.nix @@ -10,4 +10,8 @@ enableKepubify = true; }; }; + + services.caddy.virtualHosts."http://books.hypervirtual.world".extraConfig = '' + reverse_proxy :8083 + ''; } diff --git a/features/server/multimedia/jellyfin.nix b/features/server/multimedia/jellyfin.nix index a2001bc..b90b9bb 100644 --- a/features/server/multimedia/jellyfin.nix +++ b/features/server/multimedia/jellyfin.nix @@ -21,4 +21,14 @@ enable = true; openFirewall = true; }; + + services.caddy.virtualHosts = { + "http://jellyfin.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :8096 + ''; + + "http://media.hypervirtual.world".extraConfig = '' + reverse_proxy :8096 + ''; + }; } diff --git a/features/server/multimedia/slskd.nix b/features/server/multimedia/slskd.nix index f9d1efe..c4b6337 100644 --- a/features/server/multimedia/slskd.nix +++ b/features/server/multimedia/slskd.nix @@ -35,5 +35,9 @@ in directories.incomplete = "${cfg.directory}/incomplete"; }; }; + + services.caddy.virtualHosts."http://slskd.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :5030 + ''; }; } diff --git a/features/server/multimedia/transmission.nix b/features/server/multimedia/transmission.nix index 6362b54..179b59c 100644 --- a/features/server/multimedia/transmission.nix +++ b/features/server/multimedia/transmission.nix @@ -39,5 +39,9 @@ in ratio-limit-enabled = true; }; }; + + services.caddt.virtualHosts."http://transmission.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :9091 + ''; }; } diff --git a/features/server/prometheus.nix b/features/server/prometheus.nix index acc78d1..cb1bc96 100644 --- a/features/server/prometheus.nix +++ b/features/server/prometheus.nix @@ -1,6 +1,5 @@ { config, ... }: { - services.prometheus = { enable = true; exporters = { diff --git a/features/server/services/default.nix b/features/server/services/default.nix index f9e118f..6863dda 100644 --- a/features/server/services/default.nix +++ b/features/server/services/default.nix @@ -1,7 +1,7 @@ { config, ... }: { imports = [ - ./akkoma.nix + # ./akkoma.nix ./homelab-dashboard.nix ./nextcloud.nix # ./photoprism.nix diff --git a/features/server/services/forgejo.nix b/features/server/services/forgejo.nix index 708d1c6..69362c5 100644 --- a/features/server/services/forgejo.nix +++ b/features/server/services/forgejo.nix @@ -40,4 +40,8 @@ create="${lib.getExe config.services.forgejo.package} admin user create" $create --admin --email "`cat ${config.sops.secrets.forgejoInitialMail.path}`" --username you --password "`cat ${config.sops.secrets.forgejoInitialPassword.path}`" &>/dev/null || true ''; + + services.caddy.virtualHosts."http://git.hypervirtual.world".extraConfig = '' + reverse_proxy :3333 + ''; } diff --git a/features/server/services/grafana.nix b/features/server/services/grafana.nix index 98ca6aa..d7b2f72 100644 --- a/features/server/services/grafana.nix +++ b/features/server/services/grafana.nix @@ -8,4 +8,8 @@ }; }; }; + + services.caddy.virtualHosts."http://grafana.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :3000 + ''; } diff --git a/features/server/services/homelab-dashboard.nix b/features/server/services/homelab-dashboard.nix index 8aa225f..3ca9d89 100644 --- a/features/server/services/homelab-dashboard.nix +++ b/features/server/services/homelab-dashboard.nix @@ -38,6 +38,10 @@ in format = "dotenv"; }; + services.caddy.virtualHosts."http://sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :8082 + ''; + services.homepage-dashboard = { enable = true; environmentFile = config.sops.secrets."homepage".path; diff --git a/features/server/services/uptime-kuma.nix b/features/server/services/uptime-kuma.nix index c66d2ae..2ed8136 100644 --- a/features/server/services/uptime-kuma.nix +++ b/features/server/services/uptime-kuma.nix @@ -7,4 +7,14 @@ PORT = "4000"; }; }; + + services.caddy.virtualHosts."http://status.hypervirtual.world".extraConfig = '' + reverse_proxy :4000 + ''; + + services.caddy.virtualHosts."http://uptime.sisyphe.normandy.hypervirtual.world".extraConfig = '' + reverse_proxy :4000 + ''; + + }