add store ssl port to db

This commit is contained in:
nikk gitanes
2023-11-13 03:21:06 +03:00
parent a736d08701
commit b81b10dede

View File

@@ -18,12 +18,17 @@ func Start(port, sslport, sslCert, sslKey string, sslEnabled, roSets, searchWA b
// set settings ssl enabled // set settings ssl enabled
settings.Ssl = sslEnabled settings.Ssl = sslEnabled
if sslport == "" { if sslport == "" {
userSSlPort := strconv.Itoa(settings.BTsets.SslPort) dbSSlPort := strconv.Itoa(settings.BTsets.SslPort)
if userSSlPort != "0" { if dbSSlPort != "0" {
sslport = userSSlPort sslport = dbSSlPort
} else { } else {
sslport = "8091" sslport = "8091"
} }
} else { // store ssl port from params to DB
dbSSlPort, err := strconv.Atoi(sslport)
if err == nil {
settings.BTsets.SslPort = dbSSlPort
}
} }
// check if ssl cert and key files exist // check if ssl cert and key files exist
if sslCert != "" && sslKey != "" { if sslCert != "" && sslKey != "" {