mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Revert "refactor: fix check for empty string"
This reverts commit 949198d09e
.
This commit is contained in:
parent
dcb675a343
commit
9684d34ad0
1 changed files with 7 additions and 7 deletions
|
@ -32,20 +32,20 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
sslKey := os.Getenv("UPTIME_KUMA_SSL_KEY")
|
sslKey := os.Getenv("UPTIME_KUMA_SSL_KEY")
|
||||||
if sslKey == "" {
|
if len(sslKey) == 0 {
|
||||||
sslKey = os.Getenv("SSL_KEY")
|
sslKey = os.Getenv("SSL_KEY")
|
||||||
}
|
}
|
||||||
|
|
||||||
sslCert := os.Getenv("UPTIME_KUMA_SSL_CERT")
|
sslCert := os.Getenv("UPTIME_KUMA_SSL_CERT")
|
||||||
if sslCert == "" {
|
if len(sslCert) == 0 {
|
||||||
sslCert = os.Getenv("SSL_CERT")
|
sslCert = os.Getenv("SSL_CERT")
|
||||||
}
|
}
|
||||||
|
|
||||||
hostname := os.Getenv("UPTIME_KUMA_HOST")
|
hostname := os.Getenv("UPTIME_KUMA_HOST")
|
||||||
if hostname == "" && !isFreeBSD {
|
if len(hostname) == 0 && !isFreeBSD {
|
||||||
hostname = os.Getenv("HOST")
|
hostname = os.Getenv("HOST")
|
||||||
}
|
}
|
||||||
if hostname == "" {
|
if len(hostname) == 0 {
|
||||||
hostname = "127.0.0.1"
|
hostname = "127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,15 +54,15 @@ func main() {
|
||||||
if !isK8s {
|
if !isK8s {
|
||||||
port = os.Getenv("UPTIME_KUMA_PORT")
|
port = os.Getenv("UPTIME_KUMA_PORT")
|
||||||
}
|
}
|
||||||
if port == "" {
|
if len(port) == 0 {
|
||||||
port = os.Getenv("PORT")
|
port = os.Getenv("PORT")
|
||||||
}
|
}
|
||||||
if port == "" {
|
if len(port) == 0 {
|
||||||
port = "3001"
|
port = "3001"
|
||||||
}
|
}
|
||||||
|
|
||||||
protocol := ""
|
protocol := ""
|
||||||
if sslKey != "" && sslCert != "" {
|
if len(sslKey) != 0 && len(sslCert) != 0 {
|
||||||
protocol = "https"
|
protocol = "https"
|
||||||
} else {
|
} else {
|
||||||
protocol = "http"
|
protocol = "http"
|
||||||
|
|
Loading…
Reference in a new issue