diff --git a/.gitignore b/.gitignore index c2b9288f..b7725c35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ gin-bin build/ +/certs/ web/public/js/bundle.js web/public/css/*.* web/public/html/**/*.* diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 9417761c..4ca79e3a 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -126,7 +126,7 @@ func runService() { } else { hostParts := strings.Split(r.Host, ":") host := hostParts[0] - target += host + port[1:] + r.URL.Path + target += host + port + r.URL.Path } if len(r.URL.RawQuery) > 0 { @@ -146,7 +146,7 @@ func runService() { }() } - err = http.ListenAndServeTLS(util.Config.Interface+port, util.Config.TLS.TLSCertFile, util.Config.TLS.TLSKeyFile, cropTrailingSlashMiddleware(router)) + err = http.ListenAndServeTLS(util.Config.Interface+port, util.Config.TLS.CertFile, util.Config.TLS.KeyFile, cropTrailingSlashMiddleware(router)) if err != nil { log.Panic(err) diff --git a/util/config.go b/util/config.go index 87e9142f..c7ea77b9 100644 --- a/util/config.go +++ b/util/config.go @@ -113,8 +113,8 @@ type RunnerConfig struct { } type TLSConfig struct { - TLSCertFile string `json:"tls_cert_file,omitempty" env:"SEMAPHORE_TLS_CERT_FILE"` - TLSKeyFile string `json:"tls_key_file,omitempty" env:"SEMAPHORE_TLS_KEY_FILE"` + CertFile string `json:"cert_file,omitempty" env:"SEMAPHORE_TLS_CERT_FILE"` + KeyFile string `json:"key_file,omitempty" env:"SEMAPHORE_TLS_KEY_FILE"` HTTPRedirectPort *int `json:"http_redirect_port,omitempty" env:"SEMAPHORE_TLS_HTTP_PORT"` }