diff --git a/config/arachnide/configuration.nix b/config/arachnide/configuration.nix index 91212ac..a0c1fad 100644 --- a/config/arachnide/configuration.nix +++ b/config/arachnide/configuration.nix @@ -5,6 +5,7 @@ [ ./hardware-configuration.nix ./network-configuration.nix + ./proxy-configuration.nix /var/src/modules/nixin-base.nix /var/src/modules/users.nix /var/src/modules/wireguard-client.nix diff --git a/config/arachnide/proxy-configuration.nix b/config/arachnide/proxy-configuration.nix new file mode 100644 index 0000000..5d9d5d0 --- /dev/null +++ b/config/arachnide/proxy-configuration.nix @@ -0,0 +1,52 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, ... }: + +{ + + # proxy for nixin-web on arachnide + services.traefik.dynamicConfigOptions.http.services."service-nixin-web-lab12" = { + loadBalancer.servers = [ + { url = "http://localhost:8081"; } + ]; + }; + services.traefik.dynamicConfigOptions.http.routers."router-nixin-web-lab12" = { + rule = "Host(`nixin.lab12.fr`)"; + service = "service-nixin-web-lab12"; + }; + + # proxy for nixin-web on sanji + services.traefik.dynamicConfigOptions.http.services."service-nixin-web-mrflos" = { + loadBalancer.servers = [ + { url = "http://192.168.12.5:8081"; } + ]; + }; + services.traefik.dynamicConfigOptions.http.routers."router-nixin-web-mrflos" = { + rule = "Host(`nixin.sanji.mrflos.pw`)"; + service = "service-nixin-web-mrflos"; + }; + + # proxy for nextcloud on arachnide + services.traefik.dynamicConfigOptions.http.services."service-nextcloud-lab12" = { + loadBalancer.servers = [ + { url = "http://10.10.2.2:80"; } + ]; + }; + services.traefik.dynamicConfigOptions.http.routers."router-nextcloud_lab12" = { + rule = "Host(`nuage.lab12.fr`)"; + service = "service-nextcloud_lab12"; + }; + + # proxy for forgejo on arachnide + services.traefik.dynamicConfigOptions.http.services."service-forgejo-lab12" = { + loadBalancer.servers = [ + { url = "http://localhost:8082"; } + ]; + }; + services.traefik.dynamicConfigOptions.http.routers."router-forgejo-lab12" = { + rule = "Host(`forge.lab12.fr`)"; + service = "service-forgejo_lab12"; + }; + +} diff --git a/modules/forgejo.nix b/modules/forgejo.nix index ff0f82a..9ed4a94 100644 --- a/modules/forgejo.nix +++ b/modules/forgejo.nix @@ -86,15 +86,5 @@ in # ${adminCmd} change-password --username ${config.nixin.forgejo.admin-user} --password "${config.nixin.forgejo.admin-pwd}" || true ''; - - services.traefik.dynamicConfigOptions.http.services."service-forgejo" = { - loadBalancer.servers = [ - { url = "http://localhost:${toString config.nixin.forgejo.http-port}"; } - ]; - }; - services.traefik.dynamicConfigOptions.http.routers."router-forgejo" = { - rule = "Host(`${config.nixin.forgejo.domain}`)"; - service = "service-forgejo"; - }; }; } diff --git a/modules/nextcloud.nix b/modules/nextcloud.nix index 005e005..9442369 100644 --- a/modules/nextcloud.nix +++ b/modules/nextcloud.nix @@ -71,14 +71,5 @@ in iptables -w -t nat -A POSTROUTING -s ${config.containers.nextcloud.localAddress} -j MASQUERADE ''; - services.traefik.dynamicConfigOptions.http.services."service-nextcloud" = { - loadBalancer.servers = [ - { url = "http://${config.nixin.nextcloud.container-address}:80"; } - ]; - }; - services.traefik.dynamicConfigOptions.http.routers."router-nextcloud" = { - rule = "Host(`${config.nixin.nextcloud.domain}`)"; - service = "service-nextcloud"; - }; }; } diff --git a/modules/nixin-web.nix b/modules/nixin-web.nix index 07cbe13..8fb2ad7 100644 --- a/modules/nixin-web.nix +++ b/modules/nixin-web.nix @@ -48,14 +48,5 @@ in locations."/".index = "index.html"; }; - services.traefik.dynamicConfigOptions.http.services."service-nixin-web" = { - loadBalancer.servers = [ - { url = "http://localhost:${toString config.nixin.web.http-port}"; } - ]; - }; - services.traefik.dynamicConfigOptions.http.routers."router-nixin-web" = { - rule = "Host(`${config.nixin.web.domain}`)"; - service = "service-nixin-web"; - }; }; }