- 19 user-facing Router in 16 Modulen um middlewares = ["error-pages"] ergaenzt (502-504 -> Wartungsseite, analog CLD-1-Bestand): azess, azion-scheduler, bpi, n8n, pgadmin, phishboard, netbox (app + static), prtg/AZHA/AZDESK, grafana, technitium-dns, semaphore, kestra, online3dviewer, atrocore, stirling-pdf, excalidraw - Dokumentierte Ausnahmen (Kommentar am Router, Policy aus Brief): r.l-Dashboard (api-Router, Kontrollflaeche) und loki-push (Prometheus/Alloy brauchen echte Statuscodes) — bestehende Middleware-Listen unangetastet - Traefik errors-Middleware haelt den Original-Status 502-504 bei (keine statusRewrites) -> Blackbox-http_2xx-Probes auf g/wf/k/sem melden weiterhin Ausfaelle, keine zusaetzliche Metrik-Ausnahme noetig - Verifikation: nix eval aller 3 Hosts sauber; Router-Inspektion per jq bestaetigt 19x error-pages, api=auth, loki-push=loki-basic-auth
95 lines
2.5 KiB
Nix
95 lines
2.5 KiB
Nix
{config, ...}: let
|
|
httpPort = config.m3ta.ports.get "traefik";
|
|
httpsPort = config.m3ta.ports.get "traefik-ssl";
|
|
in {
|
|
services.traefik = {
|
|
enable = true;
|
|
staticConfigOptions = {
|
|
log = {level = "WARN";};
|
|
serversTransport.insecureSkipVerify = true;
|
|
certificatesResolvers = {
|
|
ionos = {
|
|
acme = {
|
|
email = "sascha.koenig@azintec.com";
|
|
storage = "/var/lib/traefik/acme.json";
|
|
caserver = "https://acme-v02.api.letsencrypt.org/directory";
|
|
dnsChallenge = {
|
|
provider = "ionos";
|
|
resolvers = ["1.1.1.1:53" "8.8.8.8:53"];
|
|
propagation = {
|
|
delayBeforeChecks = 60;
|
|
disableChecks = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
api = {};
|
|
entryPoints = {
|
|
web = {
|
|
address = ":${toString httpPort}";
|
|
http.redirections.entryPoint = {
|
|
to = "websecure";
|
|
scheme = "https";
|
|
};
|
|
};
|
|
websecure = {
|
|
address = ":${toString httpsPort}";
|
|
http.tls = {
|
|
certResolver = "ionos";
|
|
domains = [
|
|
{
|
|
main = "l.az-gruppe.com";
|
|
sans = ["*.l.az-gruppe.com"];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
dynamicConfigOptions = {
|
|
http = {
|
|
services = {
|
|
dummy = {
|
|
loadBalancer.servers = [
|
|
{url = "http://192.168.0.1";}
|
|
];
|
|
};
|
|
};
|
|
middlewares = {
|
|
auth = {
|
|
basicAuth = {
|
|
users = ["sascha.koenig:$apr1$1xqdta2b$DIVNvvp5iTUGNccJjguKh."];
|
|
};
|
|
};
|
|
};
|
|
routers = {
|
|
# Wartungsmodus-Ausnahme: Dashboard ist Kontrollfläche, kein
|
|
# Nutzer-Dienst — bewusst ohne error-pages (dokumentierte Policy).
|
|
api = {
|
|
rule = "Host(`r.l.az-gruppe.com`)";
|
|
service = "api@internal";
|
|
middlewares = ["auth"];
|
|
entrypoints = ["websecure"];
|
|
tls = {
|
|
certResolver = "ionos";
|
|
domains = [
|
|
{
|
|
main = "l.az-gruppe.com";
|
|
sans = ["*.l.az-gruppe.com"];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
systemd.services.traefik.serviceConfig = {
|
|
EnvironmentFile = ["${config.age.secrets.traefik-env.path}"];
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [httpPort httpsPort];
|
|
}
|