Skip to content

Commit 8e73df2

Browse files
committed
Remove Test URL, Proxy Auth, and curl from e2e pipeline
E2e now uses Noise handshake only — no curl needed. Removed: - Test URL and Proxy Auth fields from TUI and CLI flags - curl binary check from TUI pre-flight - curl-based waitAndTestSOCKS/testSOCKS functions - testURL/proxyAuth params from all Check function signatures
1 parent ba84f61 commit 8e73df2

12 files changed

Lines changed: 29 additions & 229 deletions

File tree

cmd/chain.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,7 @@ func buildStep(cfg stepConfig, defaultTimeout, defaultCount int, ports chan int,
108108
return scanner.Step{}, fmt.Errorf("step %q: missing required param 'domain'", cfg.name)
109109
}
110110
cert := cfg.params["cert"]
111-
testURL := "http://httpbin.org/ip"
112-
if v, ok := cfg.params["test-url"]; ok {
113-
testURL = v
114-
}
115-
proxyAuth := cfg.params["proxy-auth"]
116-
return scanner.Step{Name: "e2e/slipstream", Timeout: dur, Check: scanner.SlipstreamCheckBin(binPaths["slipstream-client"], domain, cert, testURL, proxyAuth, ports), SortBy: "e2e_ms"}, nil
111+
return scanner.Step{Name: "e2e/slipstream", Timeout: dur, Check: scanner.SlipstreamCheckBin(binPaths["slipstream-client"], domain, cert, ports), SortBy: "e2e_ms"}, nil
117112

118113
case "nxdomain":
119114
return scanner.Step{Name: "nxdomain", Timeout: dur, Check: scanner.NXDomainCheck(stepCount), SortBy: "hijack"}, nil
@@ -148,12 +143,7 @@ func buildStep(cfg stepConfig, defaultTimeout, defaultCount int, ports chan int,
148143
if !ok || pubkey == "" {
149144
return scanner.Step{}, fmt.Errorf("step %q: missing required param 'pubkey'", cfg.name)
150145
}
151-
testURL := "http://httpbin.org/ip"
152-
if v, ok := cfg.params["test-url"]; ok {
153-
testURL = v
154-
}
155-
proxyAuth := cfg.params["proxy-auth"]
156-
return scanner.Step{Name: "doh/e2e", Timeout: dur, Check: scanner.DoHDnsttCheckBin(binPaths["dnstt-client"], domain, pubkey, testURL, proxyAuth, ports), SortBy: "e2e_ms"}, nil
146+
return scanner.Step{Name: "doh/e2e", Timeout: dur, Check: scanner.DoHDnsttCheckBin(binPaths["dnstt-client"], domain, pubkey, ports), SortBy: "e2e_ms"}, nil
157147

158148
default:
159149
return scanner.Step{}, fmt.Errorf("unknown step type %q", cfg.name)

cmd/doh_e2e.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ var dohE2ECmd = &cobra.Command{
2020
func init() {
2121
dohE2ECmd.Flags().String("domain", "", "DNSTT tunnel domain")
2222
dohE2ECmd.Flags().String("pubkey", "", "DNSTT server public key")
23-
dohE2ECmd.Flags().String("test-url", "http://httpbin.org/ip", "URL to fetch through tunnel")
24-
dohE2ECmd.Flags().String("proxy-auth", "", "SOCKS proxy auth as user:pass")
2523
dohE2ECmd.MarkFlagRequired("domain")
2624
dohE2ECmd.MarkFlagRequired("pubkey")
2725
dohCmd.AddCommand(dohE2ECmd)
@@ -30,9 +28,6 @@ func init() {
3028
func runDoHE2E(cmd *cobra.Command, args []string) error {
3129
domain, _ := cmd.Flags().GetString("domain")
3230
pubkey, _ := cmd.Flags().GetString("pubkey")
33-
testURL, _ := cmd.Flags().GetString("test-url")
34-
proxyAuth, _ := cmd.Flags().GetString("proxy-auth")
35-
3631
bin, err := findBinary("dnstt-client")
3732
if err != nil {
3833
return err
@@ -45,7 +40,7 @@ func runDoHE2E(cmd *cobra.Command, args []string) error {
4540

4641
dur := time.Duration(e2eTimeout) * time.Second
4742
ports := scanner.PortPool(30000, workers)
48-
check := scanner.DoHDnsttCheckBin(bin, domain, pubkey, testURL, proxyAuth, ports)
43+
check := scanner.DoHDnsttCheckBin(bin, domain, pubkey, ports)
4944

5045
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
5146
defer stop()

cmd/e2e_dnstt.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ var e2eDnsttCmd = &cobra.Command{
2020
func init() {
2121
e2eDnsttCmd.Flags().String("domain", "", "DNSTT tunnel domain")
2222
e2eDnsttCmd.Flags().String("pubkey", "", "DNSTT server public key")
23-
e2eDnsttCmd.Flags().String("test-url", "http://httpbin.org/ip", "URL to fetch through tunnel")
24-
e2eDnsttCmd.Flags().String("proxy-auth", "", "SOCKS proxy auth as user:pass")
2523
e2eDnsttCmd.MarkFlagRequired("domain")
2624
e2eDnsttCmd.MarkFlagRequired("pubkey")
2725
e2eCmd.AddCommand(e2eDnsttCmd)
@@ -30,9 +28,6 @@ func init() {
3028
func runE2EDnstt(cmd *cobra.Command, args []string) error {
3129
domain, _ := cmd.Flags().GetString("domain")
3230
pubkey, _ := cmd.Flags().GetString("pubkey")
33-
testURL, _ := cmd.Flags().GetString("test-url")
34-
proxyAuth, _ := cmd.Flags().GetString("proxy-auth")
35-
3631
bin, err := findBinary("dnstt-client")
3732
if err != nil {
3833
return err
@@ -45,7 +40,7 @@ func runE2EDnstt(cmd *cobra.Command, args []string) error {
4540

4641
dur := time.Duration(e2eTimeout) * time.Second
4742
ports := scanner.PortPool(30000, workers)
48-
check := scanner.DnsttCheckBin(bin, domain, pubkey, testURL, proxyAuth, ports)
43+
check := scanner.DnsttCheckBin(bin, domain, pubkey, ports)
4944

5045
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
5146
defer stop()

cmd/e2e_slipstream.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,13 @@ var e2eSlipstreamCmd = &cobra.Command{
2020
func init() {
2121
e2eSlipstreamCmd.Flags().String("domain", "", "Slipstream tunnel domain")
2222
e2eSlipstreamCmd.Flags().String("cert", "", "path to Slipstream certificate for cert pinning (optional)")
23-
e2eSlipstreamCmd.Flags().String("test-url", "http://httpbin.org/ip", "URL to fetch through tunnel")
24-
e2eSlipstreamCmd.Flags().String("proxy-auth", "", "SOCKS proxy auth as user:pass")
2523
e2eSlipstreamCmd.MarkFlagRequired("domain")
2624
e2eCmd.AddCommand(e2eSlipstreamCmd)
2725
}
2826

2927
func runE2ESlipstream(cmd *cobra.Command, args []string) error {
3028
domain, _ := cmd.Flags().GetString("domain")
3129
certPath, _ := cmd.Flags().GetString("cert")
32-
testURL, _ := cmd.Flags().GetString("test-url")
33-
proxyAuth, _ := cmd.Flags().GetString("proxy-auth")
34-
3530
bin, err := findBinary("slipstream-client")
3631
if err != nil {
3732
return err
@@ -44,7 +39,7 @@ func runE2ESlipstream(cmd *cobra.Command, args []string) error {
4439

4540
dur := time.Duration(e2eTimeout) * time.Second
4641
ports := scanner.PortPool(30000, workers)
47-
check := scanner.SlipstreamCheckBin(bin, domain, certPath, testURL, proxyAuth, ports)
42+
check := scanner.SlipstreamCheckBin(bin, domain, certPath, ports)
4843

4944
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
5045
defer stop()

cmd/scan.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ func init() {
5959
scanCmd.Flags().String("domain", "", "tunnel domain (required for tunnel/edns/e2e steps)")
6060
scanCmd.Flags().String("pubkey", "", "DNSTT public key (enables e2e test)")
6161
scanCmd.Flags().String("cert", "", "Slipstream cert path (enables slipstream e2e test)")
62-
scanCmd.Flags().String("test-url", "http://httpbin.org/ip", "URL to test through tunnel")
63-
scanCmd.Flags().String("proxy-auth", "", "SOCKS proxy auth as user:pass (for e2e tests)")
6462
scanCmd.Flags().Bool("doh", false, "scan DoH resolvers instead of UDP")
6563
scanCmd.Flags().Bool("skip-ping", false, "skip ICMP ping step")
6664
scanCmd.Flags().Bool("skip-nxdomain", false, "skip NXDOMAIN hijack check")
@@ -78,8 +76,6 @@ func runScan(cmd *cobra.Command, args []string) error {
7876
domain, _ := cmd.Flags().GetString("domain")
7977
pubkey, _ := cmd.Flags().GetString("pubkey")
8078
certPath, _ := cmd.Flags().GetString("cert")
81-
testURL, _ := cmd.Flags().GetString("test-url")
82-
proxyAuth, _ := cmd.Flags().GetString("proxy-auth")
8379
dohMode, _ := cmd.Flags().GetBool("doh")
8480
skipPing, _ := cmd.Flags().GetBool("skip-ping")
8581
skipNXD, _ := cmd.Flags().GetBool("skip-nxdomain")
@@ -176,12 +172,6 @@ outputIPs, _ := cmd.Flags().GetString("output-ips")
176172
}
177173
slipstreamBin = bin
178174
}
179-
if pubkey != "" || certPath != "" {
180-
if _, err := findBinary("curl"); err != nil {
181-
return fmt.Errorf("e2e tests require curl in PATH (not found)")
182-
}
183-
}
184-
185175
dur := time.Duration(timeout) * time.Second
186176
needE2E := pubkey != "" || certPath != ""
187177
var ports chan int
@@ -210,7 +200,7 @@ outputIPs, _ := cmd.Flags().GetString("output-ips")
210200
if domain != "" && pubkey != "" {
211201
steps = append(steps, scanner.Step{
212202
Name: "doh/e2e", Timeout: time.Duration(e2eTimeout) * time.Second,
213-
Check: scanner.DoHDnsttCheckBin(dnsttBin, domain, pubkey, testURL, proxyAuth, ports), SortBy: "e2e_ms",
203+
Check: scanner.DoHDnsttCheckBin(dnsttBin, domain, pubkey, ports), SortBy: "e2e_ms",
214204
})
215205
}
216206
} else {
@@ -259,7 +249,7 @@ outputIPs, _ := cmd.Flags().GetString("output-ips")
259249
if domain != "" && certPath != "" {
260250
steps = append(steps, scanner.Step{
261251
Name: "e2e/slipstream", Timeout: time.Duration(e2eTimeout) * time.Second,
262-
Check: scanner.SlipstreamCheckBin(slipstreamBin, domain, certPath, testURL, proxyAuth, ports), SortBy: "e2e_ms",
252+
Check: scanner.SlipstreamCheckBin(slipstreamBin, domain, certPath, ports), SortBy: "e2e_ms",
263253
})
264254
}
265255
}

cmd/tui.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ func init() {
2727
f.String("domain", "", "tunnel domain (e.g. t.example.com)")
2828
f.String("pubkey", "", "hex public key for dnstt e2e test")
2929
f.String("cert", "", "TLS cert path for slipstream e2e test")
30-
f.String("test-url", "", "URL to fetch through tunnel (default: httpbin.org/ip)")
31-
f.String("proxy-auth", "", "SOCKS proxy credentials (user:pass)")
3230
f.Bool("skip-ping", false, "skip ICMP ping step")
3331
f.Bool("skip-nxdomain", false, "skip NXDOMAIN hijack detection")
3432
f.Bool("edns", false, "enable EDNS0 payload size check")
@@ -47,8 +45,6 @@ func buildTUIConfig(cmd *cobra.Command) tui.ScanConfig {
4745
cfg.Domain, _ = cmd.Flags().GetString("domain")
4846
cfg.Pubkey, _ = cmd.Flags().GetString("pubkey")
4947
cfg.Cert, _ = cmd.Flags().GetString("cert")
50-
cfg.TestURL, _ = cmd.Flags().GetString("test-url")
51-
cfg.ProxyAuth, _ = cmd.Flags().GetString("proxy-auth")
5248
cfg.SkipPing, _ = cmd.Flags().GetBool("skip-ping")
5349
cfg.SkipNXDomain, _ = cmd.Flags().GetBool("skip-nxdomain")
5450
cfg.EDNS, _ = cmd.Flags().GetBool("edns")

internal/scanner/doh.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,16 @@ func DoHTunnelCheck(domain string, count int) CheckFunc {
176176
}
177177

178178
// DoHDnsttCheckBin is like DoHDnsttCheck but uses an explicit binary path.
179-
func DoHDnsttCheckBin(bin, domain, pubkey, testURL, proxyAuth string, ports chan int) CheckFunc {
180-
return dohDnsttCheck(bin, domain, pubkey, testURL, proxyAuth, ports)
179+
func DoHDnsttCheckBin(bin, domain, pubkey string, ports chan int) CheckFunc {
180+
return dohDnsttCheck(bin, domain, pubkey, ports)
181181
}
182182

183183
// DoHDnsttCheck runs an e2e test using dnstt-client in DoH mode.
184-
func DoHDnsttCheck(domain, pubkey, testURL string, ports chan int) CheckFunc {
185-
return dohDnsttCheck("dnstt-client", domain, pubkey, testURL, "", ports)
184+
func DoHDnsttCheck(domain, pubkey string, ports chan int) CheckFunc {
185+
return dohDnsttCheck("dnstt-client", domain, pubkey, ports)
186186
}
187187

188-
func dohDnsttCheck(bin, domain, pubkey, testURL, proxyAuth string, ports chan int) CheckFunc {
189-
testURL = effectiveTestURL(testURL)
188+
func dohDnsttCheck(bin, domain, pubkey string, ports chan int) CheckFunc {
190189
var diagOnce atomic.Bool
191190

192191
return func(url string, timeout time.Duration) (bool, Metrics) {
@@ -238,7 +237,7 @@ func dohDnsttCheck(bin, domain, pubkey, testURL, proxyAuth string, ports chan in
238237
ports <- port
239238
}()
240239

241-
if !waitAndTestSOCKS(ctx, port, testURL, proxyAuth, exited, timeout) {
240+
if !waitAndTestSOCKS5Auth(ctx, port, exited) {
242241
if diagOnce.CompareAndSwap(false, true) {
243242
processExitedEarly := false
244243
select {
@@ -257,7 +256,7 @@ func dohDnsttCheck(bin, domain, pubkey, testURL, proxyAuth string, ports chan in
257256
} else if processExitedEarly {
258257
setDiag("doh/e2e first failure (url=%s): dnstt-client exited early with no stderr", url)
259258
} else {
260-
setDiag("doh/e2e first failure (url=%s): curl could not get HTTP 200 through SOCKS within %v", url, timeout)
259+
setDiag("doh/e2e first failure (url=%s): SOCKS5 handshake through tunnel timed out within %v", url, timeout)
261260
}
262261
}
263262
return false, nil

0 commit comments

Comments
 (0)