Unverified Commit 7ef47ead authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

nixos/sing-box: apply migrations in tests (#422625)

parents e58f6bed 05a9ddb0
Loading
Loading
Loading
Loading
+25 −22
Original line number Diff line number Diff line
@@ -57,8 +57,6 @@ let
      "${hosts."${server_host}"}/32"
    ];
    strict_route = false;
    sniff = true;
    sniff_override_destination = false;
  };

  tproxyPort = 1081;
@@ -219,6 +217,9 @@ in
                tag = "outbound:direct";
              }
            ];
            route = {
              default_interface = "eth1";
            };
          };
        };
      };
@@ -267,6 +268,7 @@ in
              vmessOutbound
            ];
            route = {
              default_interface = "eth1";
              final = "outbound:block";
              rules = [
                {
@@ -315,25 +317,28 @@ in
                type = "block";
                tag = "outbound:block";
              }
            ];
            endpoints = [
              {
                type = "direct";
                tag = "outbound:direct";
              }
              {
                detour = "outbound:direct";
                type = "wireguard";
                tag = "outbound:wireguard";
                interface_name = "wg0";
                local_address = [ "10.23.42.2/32" ];
                name = "wg0";
                address = [ "10.23.42.2/32" ];
                mtu = 1280;
                private_key = wg-keys.peer1.privateKey;
                peer_public_key = wg-keys.peer0.publicKey;
                server = server_host;
                server_port = 2408;
                system_interface = true;
                peers = [
                  {
                    address = server_host;
                    port = 2408;
                    public_key = wg-keys.peer0.publicKey;
                    allowed_ips = [ "0.0.0.0/0" ];
                  }
                ];
                system = true;
              }
            ];
            route = {
              default_interface = "eth1";
              final = "outbound:block";
            };
          };
@@ -377,8 +382,6 @@ in
                listen = "0.0.0.0";
                listen_port = tproxyPort;
                udp_fragment = true;
                sniff = true;
                sniff_override_destination = false;
              }
            ];
            outbounds = [
@@ -393,6 +396,7 @@ in
              vmessOutbound
            ];
            route = {
              default_interface = "eth1";
              final = "outbound:block";
              rules = [
                {
@@ -434,7 +438,7 @@ in
              independent_cache = true;
              fakeip = {
                enabled = true;
                "inet4_range" = "198.18.0.0/16";
                inet4_range = "198.18.0.0/16";
              };
              servers = [
                {
@@ -458,7 +462,6 @@ in
                    "AAAA"
                  ];
                  server = "dns:fakeip";

                }
              ];
            };
@@ -474,17 +477,17 @@ in
                type = "direct";
                tag = "outbound:direct";
              }
              {
                type = "dns";
                tag = "outbound:dns";
              }
            ];
            route = {
              default_interface = "eth1";
              final = "outbound:direct";
              rules = [
                {
                  action = "sniff";
                }
                {
                  protocol = "dns";
                  outbound = "outbound:dns";
                  action = "hijack-dns";
                }
              ];
            };