Traefik v3 defaults to a 60s readTimeout on entrypoints, which aborts docker pushes of large layers over slow uplinks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
84 lines
2.2 KiB
Nix
84 lines
2.2 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";};
|
|
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}";
|
|
# Traefik default readTimeout is 60s, which aborts large uploads
|
|
# (e.g. docker push of a 1.2 GB layer over 15 Mbit ≈ 11 min).
|
|
transport.respondingTimeouts = {
|
|
readTimeout = "1h";
|
|
idleTimeout = "10m";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
dynamicConfigOptions = {
|
|
http = {
|
|
services = {
|
|
dummy = {
|
|
loadBalancer.servers = [
|
|
{url = "http://192.168.0.1";} # Diese URL wird nie verwendet
|
|
];
|
|
};
|
|
};
|
|
middlewares = {
|
|
auth = {
|
|
basicAuth = {
|
|
users = ["sascha.koenig:$apr1$1xqdta2b$DIVNvvp5iTUGNccJjguKh."];
|
|
};
|
|
};
|
|
};
|
|
|
|
routers = {
|
|
api = {
|
|
rule = "Host(`r.az-gruppe.com`)";
|
|
service = "api@internal";
|
|
middlewares = ["auth"];
|
|
entrypoints = ["websecure"];
|
|
tls = {
|
|
certResolver = "ionos";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
systemd.services.traefik.serviceConfig = {
|
|
EnvironmentFile = ["${config.age.secrets.traefik-env.path}"];
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [httpPort httpsPort];
|
|
}
|