network: use internal domains

This commit is contained in:
Rouven Seifert 2025-05-09 14:25:56 +02:00
parent f511f7d146
commit cc59943638
Signed by: rouven.seifert
SSH key fingerprint: SHA256:WedRxwyCvqwDG6cd16qf/fizYDK1pvN4p5bawXlnKk0
7 changed files with 40 additions and 34 deletions

View file

@ -1,6 +1,12 @@
{ config, ... }:
let
domain = "media.vpn.rfive.de";
in
{ {
services.jellyfin = { services.jellyfin = {
enable = true; enable = true;
openFirewall = true;
}; };
services.caddy.virtualHosts."http://${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:8096
'';
} }

View file

@ -1,13 +1,19 @@
{ ... }: { ... }:
let
domain = "adguard.vpn.rfive.de";
port = 3000;
in
{ {
networking.firewall.allowedTCPPorts = [ 53 ]; networking.firewall.allowedTCPPorts = [ 53 ];
networking.firewall.allowedUDPPorts = [ 53 ]; networking.firewall.allowedUDPPorts = [ 53 ];
services.adguardhome = { services.adguardhome = {
enable = true; enable = true;
openFirewall = true;
settings = { settings = {
dns.bind_hosts = [ "192.168.42.2" ]; dns.bind_hosts = [ "192.168.42.2" ];
http.address = "0.0.0.0:3000"; http.address = "127.0.0.1:${toString port}";
}; };
}; };
services.caddy.virtualHosts."http://${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:${toString port}
'';
} }

View file

@ -1,24 +0,0 @@
{ config, ... }:
{
services.caddy = {
enable = true;
email = "ca@${config.networking.domain}";
logFormat = "format console";
globalConfig = ''
servers {
metrics
}
'';
virtualHosts.":2018" = {
extraConfig = ''
metrics
'';
logFormat = ''
output discard
'';
};
};
systemd.services.caddy.environment.XDG_DATA_HOME = "/var/lib";
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 443 ];
}

View file

@ -1,7 +1,12 @@
{ ... }: { config, ... }:
let
domain = "index.vpn.rfive.de";
in
{ {
services.prowlarr = { services.prowlarr = {
enable = true; enable = true;
openFirewall = true;
}; };
services.caddy.virtualHosts."http://${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:${toString config.services.prowlarr.settings.server.port}
'';
} }

View file

@ -1,7 +1,12 @@
{ ... }: { config, ... }:
let
domain = "movies.vpn.rfive.de";
in
{ {
services.radarr = { services.radarr = {
enable = true; enable = true;
openFirewall = true;
}; };
services.caddy.virtualHosts."http://${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:${toString config.services.radarr.settings.server.port}
'';
} }

View file

@ -1,7 +1,12 @@
{ ... }: { config, ... }:
let
domain = "shows.vpn.rfive.de";
in
{ {
services.sonarr = { services.sonarr = {
enable = true; enable = true;
openFirewall = true;
}; };
services.caddy.virtualHosts."http://${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:${toString config.services.sonarr.settings.server.port}
'';
} }

View file

@ -1,5 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
domain = "torrents.vpn.rfive.de";
cfg = { cfg = {
stateDir = "/var/lib/qbittorrent"; stateDir = "/var/lib/qbittorrent";
downloadDir = "/var/videos/"; # TODO support other Media Types downloadDir = "/var/videos/"; # TODO support other Media Types
@ -124,7 +125,9 @@ in
SystemCallFilter = "@system-service"; SystemCallFilter = "@system-service";
}; };
}; };
networking.firewall.allowedTCPPorts = [ cfg.port ]; services.caddy.virtualHosts."http://${domain}".extraConfig = ''
reverse_proxy 127.0.0.1:${toString cfg.port}
'';
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
# ensure downloads directory is created, set permissions # ensure downloads directory is created, set permissions
"d ${cfg.stateDir} - ${cfg.user} ${cfg.user} - -" "d ${cfg.stateDir} - ${cfg.user} ${cfg.user} - -"