Selaa lähdekoodia

Add --skip-native-check flag to mtg doctor

When proxy chaining is configured, the native network connectivity
check times out for every Telegram DC (~10s × 6 DCs = ~60s) because
direct egress is intentionally not used. This flag lets users skip
that section of the doctor output.

Refs #482
pull/484/head
dolonet 1 viikko sitten
vanhempi
commit
e897a5f22a
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 7
    2
      internal/cli/doctor.go

+ 7
- 2
internal/cli/doctor.go Näytä tiedosto

@@ -69,7 +69,8 @@ var (
69 69
 type Doctor struct {
70 70
 	conf *config.Config
71 71
 
72
-	ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` //nolint: lll
72
+	ConfigPath      string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` //nolint: lll
73
+	SkipNativeCheck bool   `kong:"help='Skip the native network connectivity check (useful when proxy chaining is configured and direct egress is not expected to work).',name='skip-native-check'"` //nolint: lll
73 74
 }
74 75
 
75 76
 func (d *Doctor) Run(cli *CLI, version string) error {
@@ -106,7 +107,11 @@ func (d *Doctor) Run(cli *CLI, version string) error {
106 107
 	)
107 108
 
108 109
 	fmt.Println("Validate native network connectivity")
109
-	everythingOK = d.checkNetwork(base) && everythingOK
110
+	if d.SkipNativeCheck {
111
+		fmt.Println("  ⏭ Skipped (--skip-native-check)")
112
+	} else {
113
+		everythingOK = d.checkNetwork(base) && everythingOK
114
+	}
110 115
 
111 116
 	for _, url := range conf.Network.Proxies {
112 117
 		value, err := network.NewProxyNetwork(base, url.Get(nil))

Loading…
Peruuta
Tallenna