소스 검색

change variable name

非法操作 6 달 전
부모
커밋
07a53a4fd7

+ 3 - 3
.env.example

@@ -69,6 +69,6 @@ PPROF_ENABLED=false
 # if want to install plugin without verifying signature, set this to false
 FORCE_VERIFYING_SIGNATURE=true
 
-# proxy settings, example: PROXY_HTTP=http://host.docker.internal:7890
-PROXY_HTTP=
-PROXY_HTTPS=
+# proxy settings, example: HTTP_PROXY=http://host.docker.internal:7890
+HTTP_PROXY=
+HTTPS_PROXY=

+ 1 - 1
internal/core/plugin_manager/launcher.go

@@ -129,7 +129,7 @@ func (p *PluginManager) launchLocal(pluginUniqueIdentifier plugin_entities.Plugi
 		return nil, nil, nil, failed(err.Error())
 	}
 
-	localPluginRuntime := local_runtime.NewLocalPluginRuntime(p.pythonInterpreterPath, p.pythonEnvInitTimeout, p.proxyHttp, p.proxyHttps)
+	localPluginRuntime := local_runtime.NewLocalPluginRuntime(p.pythonInterpreterPath, p.pythonEnvInitTimeout, p.HttpProxy, p.HttpsProxy)
 	localPluginRuntime.PluginRuntime = plugin.runtime
 	localPluginRuntime.BasicChecksum = basic_runtime.BasicChecksum{
 		MediaTransport: basic_runtime.NewMediaTransport(p.mediaBucket),

+ 4 - 4
internal/core/plugin_manager/local_runtime/run.go

@@ -36,11 +36,11 @@ func (r *LocalPluginRuntime) getCmd() (*exec.Cmd, error) {
 	if r.Config.Meta.Runner.Language == constants.Python {
 		cmd := exec.Command(r.pythonInterpreterPath, "-m", r.Config.Meta.Runner.Entrypoint)
 		cmd.Dir = r.State.WorkingPath
-		if r.proxyHttps != "" {
-			cmd.Env = append(cmd.Env, fmt.Sprintf("HTTPS_PROXY=%s", r.proxyHttps))
+		if r.HttpsProxy != "" {
+			cmd.Env = append(cmd.Env, fmt.Sprintf("HTTPS_PROXY=%s", r.HttpsProxy))
 		}
-		if r.proxyHttp != "" {
-			cmd.Env = append(cmd.Env, fmt.Sprintf("HTTP_PROXY=%s", r.proxyHttp))
+		if r.HttpProxy != "" {
+			cmd.Env = append(cmd.Env, fmt.Sprintf("HTTP_PROXY=%s", r.HttpProxy))
 		}
 		return cmd, nil
 	}

+ 6 - 6
internal/core/plugin_manager/local_runtime/type.go

@@ -25,8 +25,8 @@ type LocalPluginRuntime struct {
 	defaultPythonInterpreterPath string
 
 	// proxy settings
-	proxyHttp  string
-	proxyHttps string
+	HttpProxy  string
+	HttpsProxy string
 
 	waitChanLock    sync.Mutex
 	waitStartedChan []chan bool
@@ -38,13 +38,13 @@ type LocalPluginRuntime struct {
 func NewLocalPluginRuntime(
 	pythonInterpreterPath string,
 	pythonEnvInitTimeout int,
-	proxyHttp string,
-	proxyHttps string,
+	HttpProxy string,
+	HttpsProxy string,
 ) *LocalPluginRuntime {
 	return &LocalPluginRuntime{
 		defaultPythonInterpreterPath: pythonInterpreterPath,
 		pythonEnvInitTimeout:         pythonEnvInitTimeout,
-		proxyHttp:                    proxyHttp,
-		proxyHttps:                   proxyHttps,
+		HttpProxy:                    HttpProxy,
+		HttpsProxy:                   HttpsProxy,
 	}
 }

+ 4 - 4
internal/core/plugin_manager/manager.go

@@ -60,8 +60,8 @@ type PluginManager struct {
 	pythonEnvInitTimeout int
 
 	// proxy settings
-	proxyHttp  string
-	proxyHttps string
+	HttpProxy  string
+	HttpsProxy string
 
 	// remote plugin server
 	remotePluginServer debugging_runtime.RemotePluginServerInterface
@@ -100,8 +100,8 @@ func InitGlobalManager(oss oss.OSS, configuration *app.Config) *PluginManager {
 		pythonInterpreterPath:    configuration.PythonInterpreterPath,
 		pythonEnvInitTimeout:     configuration.PythonEnvInitTimeout,
 		platform:                 configuration.Platform,
-		proxyHttp:                configuration.ProxyHttp,
-		proxyHttps:               configuration.ProxyHttps,
+		HttpProxy:                configuration.HttpProxy,
+		HttpsProxy:               configuration.HttpsProxy,
 	}
 
 	return manager

+ 2 - 2
internal/types/app/config.go

@@ -96,8 +96,8 @@ type Config struct {
 	SentrySampleRate       float64 `envconfig:"SENTRY_SAMPLE_RATE"`
 
 	// proxy settings
-	ProxyHttp  string `envconfig:"PROXY_HTTP"`
-	ProxyHttps string `envconfig:"PROXY_HTTPS"`
+	HttpProxy  string `envconfig:"HTTP_PROXY"`
+	HttpsProxy string `envconfig:"HTTPS_PROXY"`
 }
 
 func (c *Config) Validate() error {