Don't turn SSL into lowercase (#114)

This commit is contained in:
TacticalCatto
2022-01-18 11:22:13 +08:00
committed by GitHub
parent 1892b270b1
commit 521cc2aef2
2 changed files with 5 additions and 3 deletions

View File

@@ -103,15 +103,17 @@ func postUpdateConfiguration(c *gin.Context) {
if err := c.BindJSON(&cfg); err != nil {
return
}
// Keep the SSL certificates the same since the Panel will send through Lets Encrypt
// default locations. However, if we picked a different location manually we don't
// want to override that.
//
// If you pass through manual locations in the API call this logic will be skipped.
if strings.HasPrefix(cfg.Api.Ssl.KeyFile, "/etc/letsencrypt/live/") {
cfg.Api.Ssl.KeyFile = strings.ToLower(config.Get().Api.Ssl.KeyFile)
cfg.Api.Ssl.CertificateFile = strings.ToLower(config.Get().Api.Ssl.CertificateFile)
cfg.Api.Ssl.KeyFile = config.Get().Api.Ssl.KeyFile
cfg.Api.Ssl.CertificateFile = config.Get().Api.Ssl.CertificateFile
}
// Try to write this new configuration to the disk before updating our global
// state with it.
if err := config.WriteToDisk(cfg); err != nil {