Переглянути джерело

doctor: add --skip-native-check flag

pull/488/head
dolonet 6 дні тому
джерело
коміт
49ac70066f
1 змінених файлів з 7 додано та 2 видалено
  1. 7
    2
      internal/cli/doctor.go

+ 7
- 2
internal/cli/doctor.go Переглянути файл

@@ -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))

Завантаження…
Відмінити
Зберегти