mirror of
https://github.com/cgzirim/seek-tune.git
synced 2025-12-17 17:04:22 +00:00
Add defaults to cert env variables
This commit is contained in:
parent
55a4b47d11
commit
b1096eea4d
1 changed files with 6 additions and 3 deletions
9
main.go
9
main.go
|
|
@ -314,7 +314,7 @@ func main() {
|
|||
}()
|
||||
defer server.Close()
|
||||
|
||||
SERVE_HTTPS := strings.ToLower(utils.GetEnv("SERVE_HTTPS"))
|
||||
SERVE_HTTPS := strings.ToLower(utils.GetEnv("SERVE_HTTPS", "true"))
|
||||
serveHTTPS := SERVE_HTTPS == "true"
|
||||
|
||||
serveHTTP(server, serveHTTPS)
|
||||
|
|
@ -333,8 +333,11 @@ func serveHTTP(socketServer *socketio.Server, serveHTTPS bool) {
|
|||
Handler: socketServer,
|
||||
}
|
||||
|
||||
cert_key := utils.GetEnv("CERT_KEY")
|
||||
cert_file := utils.GetEnv("CERT_FILE")
|
||||
cert_key_default := "/etc/letsencrypt/live/localport.online/fullchain.pem"
|
||||
cert_file_default := "/etc/letsencrypt/live/localport.online/privkey.pem"
|
||||
|
||||
cert_key := utils.GetEnv("CERT_KEY", cert_key_default)
|
||||
cert_file := utils.GetEnv("CERT_FILE", cert_file_default)
|
||||
if cert_key == "" || cert_file == "" {
|
||||
log.Fatal("Missing cert")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue