fix(tls): correct redirect

This commit is contained in:
Denis Gukov 2024-12-21 00:08:46 +05:00
parent c59f2cb584
commit 25bbbcae3a
No known key found for this signature in database
GPG Key ID: 044381366A5D4731
3 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
gin-bin
build/
/certs/
web/public/js/bundle.js
web/public/css/*.*
web/public/html/**/*.*

View File

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

View File

@ -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"`
}