From 140d305a76786ed2aa8b4490d9a072ca093e87a9 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Fri, 6 Feb 2026 15:53:58 +0100 Subject: [PATCH] Make Traefik and Forgejo communicate with each other! --- .../forgejo/forgejo-localconfig.nix | 4 ++-- nix-system-configs/traefik/traefik-config.nix | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/nix-system-configs/forgejo/forgejo-localconfig.nix b/nix-system-configs/forgejo/forgejo-localconfig.nix index 82c1864..a13d382 100644 --- a/nix-system-configs/forgejo/forgejo-localconfig.nix +++ b/nix-system-configs/forgejo/forgejo-localconfig.nix @@ -163,8 +163,8 @@ in { settings = { server = { - DOMAIN = "git.prg.local"; - ROOT_URL = "http://${srv.DOMAIN}/"; + DOMAIN = "git.prg-radio.org"; + ROOT_URL = "https://git.prg-radio.org/"; HTTP_PORT = 3000; # SSH integration SSH_PORT = lib.head config.services.openssh.ports; diff --git a/nix-system-configs/traefik/traefik-config.nix b/nix-system-configs/traefik/traefik-config.nix index 057af39..300153d 100644 --- a/nix-system-configs/traefik/traefik-config.nix +++ b/nix-system-configs/traefik/traefik-config.nix @@ -186,8 +186,24 @@ in { } ]; - http.routers = {}; - http.services = {}; + # HTTP Routers + http.routers = { + forgejo = { + rule = "Host(`git.prg-radio.org`)"; + service = "forgejo"; + entryPoints = ["websecure"]; + tls = {}; + }; + }; + + # HTTP Services + http.services = { + forgejo.loadBalancer = { + servers = [ + { url = "http://10.1.1.4:3000"; } + ]; + }; + }; }; }; @@ -351,8 +367,8 @@ in { ''; # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 443 ]; - networking.firewall.allowedUDPPorts = [ 443 ]; + networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedUDPPorts = [ 80 443 ]; # Or disable the firewall altogether. # networking.firewall.enable = false;