2024-01-31 09:41:17 -05:00
|
|
|
{config, ...}: {
|
|
|
|
networking.firewall.allowedTCPPorts = [80 443 8080];
|
|
|
|
sops.secrets.cloudflare-api-key = {};
|
|
|
|
systemd.services.traefik = {
|
|
|
|
environment = {
|
|
|
|
CLOUDFLARE_EMAIL = "jch0tm2e@notohh.dev";
|
|
|
|
};
|
|
|
|
serviceConfig = {
|
|
|
|
EnvironmentFile = [config.sops.secrets.cloudflare-api-key.path];
|
|
|
|
};
|
|
|
|
};
|
2023-06-11 18:24:13 -04:00
|
|
|
services.traefik = {
|
|
|
|
enable = true;
|
|
|
|
dynamicConfigOptions = {
|
|
|
|
http = {
|
2024-02-06 13:40:38 -05:00
|
|
|
routers = let
|
|
|
|
fqdn = "internal.flake.sh";
|
|
|
|
in {
|
2024-01-31 09:41:17 -05:00
|
|
|
# local
|
2023-06-11 18:24:13 -04:00
|
|
|
api = {
|
|
|
|
rule = "PathPrefix(`/api/`)";
|
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "api@internal";
|
|
|
|
};
|
2023-11-11 16:27:11 -05:00
|
|
|
homepage = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`dashboard.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2023-11-11 16:27:11 -05:00
|
|
|
service = "homepage";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2023-06-14 03:58:30 -04:00
|
|
|
};
|
2023-06-13 12:11:08 -04:00
|
|
|
stash = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`stash.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2023-06-13 12:11:08 -04:00
|
|
|
service = "stash";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2023-06-13 12:11:08 -04:00
|
|
|
};
|
2023-09-17 14:06:53 -04:00
|
|
|
jellyfin = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`jellyfin.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2023-09-17 14:06:53 -04:00
|
|
|
service = "jellyfin";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2023-09-17 14:06:53 -04:00
|
|
|
};
|
|
|
|
jellyseerr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`jellyseerr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2023-09-17 14:06:53 -04:00
|
|
|
service = "jellyseerr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2023-09-17 14:06:53 -04:00
|
|
|
};
|
2023-11-11 16:27:11 -05:00
|
|
|
wallos = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`wallos.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2023-11-11 16:27:11 -05:00
|
|
|
service = "wallos";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2023-11-11 16:27:11 -05:00
|
|
|
};
|
2024-01-23 22:06:44 -05:00
|
|
|
hass = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`hass.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2024-01-23 22:06:44 -05:00
|
|
|
service = "hass";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2024-01-23 22:06:44 -05:00
|
|
|
};
|
2024-01-30 19:28:30 -05:00
|
|
|
paperless = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`paperless.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
2024-01-30 19:28:30 -05:00
|
|
|
service = "paperless";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
2024-02-01 07:39:28 -05:00
|
|
|
miniflux = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`rss.${fqdn}`)";
|
2024-02-01 07:39:28 -05:00
|
|
|
entrypoints = ["websecure"];
|
|
|
|
service = "miniflux";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-02-01 07:39:28 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
2024-01-31 09:41:17 -05:00
|
|
|
# kariru
|
|
|
|
sonarr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`sonarr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "sonarr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
|
|
|
radarr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`radarr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "radarr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
|
|
|
readarr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`readarr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "readarr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
|
|
|
lidarr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`lidarr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "lidarr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
|
|
|
bazarr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`bazarr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "bazarr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
|
|
|
whisparr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`whisparr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entryPoints = ["websecure"];
|
|
|
|
service = "whisparr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
|
|
|
};
|
|
|
|
prowlarr = {
|
2024-02-06 13:40:38 -05:00
|
|
|
rule = "Host(`prowlarr.${fqdn}`)";
|
2024-01-31 09:41:17 -05:00
|
|
|
entrypoints = ["websecure"];
|
|
|
|
service = "prowlarr";
|
2024-02-06 13:40:38 -05:00
|
|
|
tls.domains = [{main = "*.${fqdn}";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
tls.certresolver = "production";
|
2024-01-30 19:28:30 -05:00
|
|
|
};
|
2023-06-11 18:24:13 -04:00
|
|
|
};
|
2024-02-06 13:40:38 -05:00
|
|
|
services = let
|
|
|
|
kariruHost = "192.168.1.54:";
|
|
|
|
in {
|
2024-01-31 09:41:17 -05:00
|
|
|
# local
|
2023-06-13 12:11:08 -04:00
|
|
|
stash.loadBalancer.servers = [{url = "http://localhost:9999";}];
|
2023-11-11 16:27:11 -05:00
|
|
|
homepage.loadBalancer.servers = [{url = "http://localhost:7676";}];
|
2023-09-17 14:06:53 -04:00
|
|
|
jellyfin.loadBalancer.servers = [{url = "http://localhost:8096";}];
|
|
|
|
jellyseerr.loadBalancer.servers = [{url = "http://localhost:5055";}];
|
2023-11-11 16:27:11 -05:00
|
|
|
wallos.loadBalancer.servers = [{url = "http://localhost:8282";}];
|
2024-01-23 22:06:44 -05:00
|
|
|
hass.loadBalancer.servers = [{url = "http://localhost:8123";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
paperless.loadBalancer.servers = [{url = "http://localhost:28981";}];
|
2024-02-01 07:39:28 -05:00
|
|
|
miniflux.loadBalancer.servers = [{url = "http://localhost:9000";}];
|
2024-01-31 09:41:17 -05:00
|
|
|
# kariru
|
2024-02-06 13:40:38 -05:00
|
|
|
sonarr.loadBalancer.servers = [{url = "http://${kariruHost}8989";}];
|
|
|
|
radarr.loadBalancer.servers = [{url = "http://${kariruHost}7878";}];
|
|
|
|
readarr.loadBalancer.servers = [{url = "http://${kariruHost}8787";}];
|
|
|
|
lidarr.loadBalancer.servers = [{url = "http://${kariruHost}8686";}];
|
|
|
|
bazarr.loadBalancer.servers = [{url = "http://${kariruHost}6767";}];
|
|
|
|
whisparr.loadBalancer.servers = [{url = "http://${kariruHost}6969";}];
|
|
|
|
prowlarr.loadBalancer.servers = [{url = "http://${kariruHost}9696";}];
|
2023-06-11 18:24:13 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
staticConfigOptions = {
|
|
|
|
log.level = "DEBUG";
|
2024-01-31 09:41:17 -05:00
|
|
|
api.dashboard = true;
|
|
|
|
api.insecure = true;
|
2023-06-11 18:24:13 -04:00
|
|
|
global = {
|
|
|
|
checkNewVersion = false;
|
|
|
|
sendAnonymousUsage = false;
|
|
|
|
};
|
|
|
|
entryPoints = {
|
2023-06-14 02:59:32 -04:00
|
|
|
websecure = {
|
|
|
|
address = ":443";
|
|
|
|
forwardedHeaders.insecure = true;
|
|
|
|
};
|
|
|
|
web = {
|
|
|
|
address = ":80";
|
|
|
|
forwardedHeaders.insecure = true;
|
|
|
|
};
|
2023-06-11 18:24:13 -04:00
|
|
|
};
|
2024-01-31 09:41:17 -05:00
|
|
|
certificatesResolvers = {
|
|
|
|
production.acme = {
|
|
|
|
email = "x3xr6n66@notohh.dev";
|
|
|
|
storage = "/var/lib/traefik/acme.json";
|
|
|
|
caServer = "https://acme-v02.api.letsencrypt.org/directory";
|
|
|
|
dnsChallenge = {
|
|
|
|
provider = "cloudflare";
|
|
|
|
resolvers = ["1.1.1.1:53" "1.0.0.1:53"];
|
|
|
|
delayBeforeCheck = "0";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-06-11 18:24:13 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|