Skip to content

Commit

Permalink
check STORAGE_URL format on start
Browse files Browse the repository at this point in the history
fixes #310
  • Loading branch information
ddvk committed Nov 16, 2024
1 parent a135574 commit 9ea8815
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"crypto/tls"
"fmt"
"net/mail"
"net/url"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -166,6 +167,11 @@ func FromEnv() *Config {
uploadURL = "https://" + DefaultHost
}

u, err := url.Parse(uploadURL)
if err != nil || (u.Scheme != "http" && u.Scheme != "https") || u.Host == "" {
log.Fatalf("%s '%s' cannot be parsed, or missing scheme (http|https) %v", EnvStorageURL, uploadURL, err)
}

// smtp
var smtpCfg *email.SMTPConfig
servername := os.Getenv(envSMTPServer)
Expand Down

0 comments on commit 9ea8815

Please sign in to comment.