mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-06 13:39:07 +02:00
Validate upload server config at startup
This commit is contained in:
@@ -33,10 +33,13 @@ func configureLocalHandlers(mux *http.ServeMux, limiter *middleware.APIRateLimit
|
||||
if !ok {
|
||||
return fmt.Errorf("SERVER_URL environment variable is required")
|
||||
}
|
||||
_, err := url.Parse(envURL)
|
||||
parsedURL, err := url.Parse(envURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("SERVER_URL environment variable is invalid: %w", err)
|
||||
}
|
||||
if parsedURL.Scheme != "https" {
|
||||
return fmt.Errorf("SERVER_URL environment variable must use https, got %q", parsedURL.Scheme)
|
||||
}
|
||||
|
||||
dir := defaultDir
|
||||
envDir, ok := os.LookupEnv("STORE_DIR")
|
||||
|
||||
Reference in New Issue
Block a user