nixos/kelder: Independent nginx config
This commit is contained in:
		@@ -15,10 +15,11 @@ in
 | 
			
		||||
          define OWNAS = 211024;
 | 
			
		||||
 | 
			
		||||
          define CCVIP1 = ${lib.my.colony.prefixes.vip1};
 | 
			
		||||
          define CCVIP2 = ${lib.my.colony.prefixes.vip2};
 | 
			
		||||
 | 
			
		||||
          define OWNIP4 = ${assignments.internal.ipv4.address};
 | 
			
		||||
          define OWNNETSET4 = [ ${assignments.internal.ipv4.address}/32 ];
 | 
			
		||||
          define CCNETSET4 = [ ${lib.my.colony.prefixes.vip1} ];
 | 
			
		||||
          define CCNETSET4 = [ ${lib.my.colony.prefixes.vip1}, ${lib.my.colony.prefixes.vip2} ];
 | 
			
		||||
 | 
			
		||||
          define INTNET6 = ${intnet6};
 | 
			
		||||
          define AMSNET6 = ${amsnet6};
 | 
			
		||||
@@ -53,6 +54,7 @@ in
 | 
			
		||||
          }
 | 
			
		||||
          protocol static static4 {
 | 
			
		||||
            route CCVIP1 via "base";
 | 
			
		||||
            route CCVIP2 via "base";
 | 
			
		||||
 | 
			
		||||
            ipv4 {
 | 
			
		||||
              import all;
 | 
			
		||||
 
 | 
			
		||||
@@ -188,7 +188,7 @@ in
 | 
			
		||||
                      {
 | 
			
		||||
                        wireguardPeerConfig = {
 | 
			
		||||
                          PublicKey = "7N9YdQaCMWWIwAnW37vrthm9ZpbnG4Lx3gheHeRYz2E=";
 | 
			
		||||
                          AllowedIPs = [ "${lib.my.kelder.start.vpn.v4}2" ];
 | 
			
		||||
                          AllowedIPs = [ allAssignments.kelder.estuary.ipv4.address ];
 | 
			
		||||
                          PersistentKeepalive = 25;
 | 
			
		||||
                        };
 | 
			
		||||
                      }
 | 
			
		||||
@@ -339,7 +339,14 @@ in
 | 
			
		||||
                };
 | 
			
		||||
                "95-kelder" = {
 | 
			
		||||
                  matchConfig.Name = "kelder";
 | 
			
		||||
                  address = [ "${lib.my.kelder.start.vpn.v4}1/30" ];
 | 
			
		||||
                  routes = [
 | 
			
		||||
                    {
 | 
			
		||||
                      routeConfig = {
 | 
			
		||||
                        Destination = allAssignments.kelder.estuary.ipv4.address;
 | 
			
		||||
                        Scope = "link";
 | 
			
		||||
                      };
 | 
			
		||||
                    }
 | 
			
		||||
                  ];
 | 
			
		||||
                };
 | 
			
		||||
              } ];
 | 
			
		||||
            };
 | 
			
		||||
@@ -388,12 +395,6 @@ in
 | 
			
		||||
                      dst = allAssignments.valheim-oci.internal.ipv4.address;
 | 
			
		||||
                      proto = "udp";
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    {
 | 
			
		||||
                      port = 6922;
 | 
			
		||||
                      dst = "${lib.my.kelder.start.vpn.v4}2";
 | 
			
		||||
                      dstPort = "ssh";
 | 
			
		||||
                    }
 | 
			
		||||
                  ];
 | 
			
		||||
                };
 | 
			
		||||
                extraRules =
 | 
			
		||||
@@ -433,7 +434,7 @@ in
 | 
			
		||||
                    chain forward {
 | 
			
		||||
                      iifname { wan, $ixps } oifname base jump filter-routing
 | 
			
		||||
                      oifname $ixps jump ixp
 | 
			
		||||
                      oifname as211024 accept
 | 
			
		||||
                      oifname { as211024, kelder } accept
 | 
			
		||||
                    }
 | 
			
		||||
                    chain output {
 | 
			
		||||
                      oifname ifog ether type != vlan reject
 | 
			
		||||
 
 | 
			
		||||
@@ -214,6 +214,8 @@ in
 | 
			
		||||
            valheim IN A ${assignments.internal.ipv4.address}
 | 
			
		||||
            valheim IN AAAA ${allAssignments.valheim-oci.internal.ipv6.address}
 | 
			
		||||
 | 
			
		||||
            andrey-cust IN A ${allAssignments.kelder.estuary.ipv4.address}
 | 
			
		||||
 | 
			
		||||
            $TTL 3
 | 
			
		||||
            _acme-challenge IN LUA TXT @@FILE@@
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -172,14 +172,6 @@ in
 | 
			
		||||
                  dnsProvider = "cloudflare";
 | 
			
		||||
                  credentialsFile = config.age.secrets."middleman/cloudflare-credentials.conf".path;
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                "${lib.my.kelder.domain}" = {
 | 
			
		||||
                  extraDomainNames = [
 | 
			
		||||
                    "*.${lib.my.kelder.domain}"
 | 
			
		||||
                  ];
 | 
			
		||||
                  dnsProvider = "cloudflare";
 | 
			
		||||
                  credentialsFile = config.age.secrets."middleman/cloudflare-credentials.conf".path;
 | 
			
		||||
                };
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
 
 | 
			
		||||
@@ -45,8 +45,6 @@ let
 | 
			
		||||
    };
 | 
			
		||||
    "/.well-known/webfinger".return = "301 https://toot.nul.ie$request_uri";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  kelderUpstream = "http://${lib.my.kelder.start.vpn.v4}2:80";
 | 
			
		||||
in
 | 
			
		||||
{
 | 
			
		||||
  my = {
 | 
			
		||||
@@ -370,39 +368,6 @@ in
 | 
			
		||||
        };
 | 
			
		||||
        useACMEHost = lib.my.pubDomain;
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      "torrents.${lib.my.kelder.domain}" = {
 | 
			
		||||
        locations."/".proxyPass = kelderUpstream;
 | 
			
		||||
        useACMEHost = lib.my.kelder.domain;
 | 
			
		||||
      };
 | 
			
		||||
      "jackett.${lib.my.kelder.domain}" = {
 | 
			
		||||
        locations."/".proxyPass = kelderUpstream;
 | 
			
		||||
        useACMEHost = lib.my.kelder.domain;
 | 
			
		||||
      };
 | 
			
		||||
      "radarr.${lib.my.kelder.domain}" = {
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = kelderUpstream;
 | 
			
		||||
          proxyWebsockets = true;
 | 
			
		||||
          extraConfig = lib.my.nginx.proxyHeaders;
 | 
			
		||||
        };
 | 
			
		||||
        useACMEHost = lib.my.kelder.domain;
 | 
			
		||||
      };
 | 
			
		||||
      "sonarr.${lib.my.kelder.domain}" = {
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = kelderUpstream;
 | 
			
		||||
          proxyWebsockets = true;
 | 
			
		||||
          extraConfig = lib.my.nginx.proxyHeaders;
 | 
			
		||||
        };
 | 
			
		||||
        useACMEHost = lib.my.kelder.domain;
 | 
			
		||||
      };
 | 
			
		||||
      "media.${lib.my.kelder.domain}" = {
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = kelderUpstream;
 | 
			
		||||
          proxyWebsockets = true;
 | 
			
		||||
          extraConfig = lib.my.nginx.proxyHeaders;
 | 
			
		||||
        };
 | 
			
		||||
        useACMEHost = lib.my.kelder.domain;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    minio =
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user