From 0703bc7d442c0db42d894f13db7d1c3fe7280a2b Mon Sep 17 00:00:00 2001 From: tulg Date: Sat, 25 Apr 2026 19:25:18 +0300 Subject: [PATCH] traefik --- hosts/kittykat/traefik.nix | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 hosts/kittykat/traefik.nix diff --git a/hosts/kittykat/traefik.nix b/hosts/kittykat/traefik.nix new file mode 100644 index 0000000..54d38d6 --- /dev/null +++ b/hosts/kittykat/traefik.nix @@ -0,0 +1,43 @@ + services.traefik = { + enable = true; + + staticConfigOptions = { + entryPoints = { + web = { + address = ":80"; + asDefault = true; + http.redirections.entrypoint = { + to = "websecure"; + scheme = "https"; + }; + }; + + websecure = { + address = ":443"; + asDefault = true; + http.tls.certResolver = "letsencrypt"; + }; + }; + + log = { + level = "INFO"; + filePath = "${config.services.traefik.dataDir}/traefik.log"; + format = "json"; + }; + + certificatesResolvers.letsencrypt.acme = { + email = "tulg@protonmail.ch"; + storage = "${config.services.traefik.dataDir}/acme.json"; + httpChallenge.entryPoint = "web"; + }; + + api.dashboard = true; + # Access the Traefik dashboard on :8080 of your server + # api.insecure = true; + }; + + dynamicConfigOptions = { + http.routers = {}; + http.services = {}; + }; + }; \ No newline at end of file