Make ADLIN_COLLECTOR_SECRET optional

This commit is contained in:
nemunaire 2022-03-26 17:42:42 +01:00
parent 8cc03e7ef8
commit 54a3fe9192

View File

@ -77,7 +77,7 @@ func main() {
adlin.SharedSecret = v adlin.SharedSecret = v
} }
if v, exists := os.LookupEnv("ADLIN_COLLECTOR_SECRET"); !exists { if v, exists := os.LookupEnv("ADLIN_COLLECTOR_SECRET"); !exists {
log.Fatal("Please define ADLIN_COLLECTOR_SECRET environment variable") log.Println("Warning: Please define ADLIN_COLLECTOR_SECRET environment variable")
} else if t, err := base64.StdEncoding.DecodeString(v); err != nil { } else if t, err := base64.StdEncoding.DecodeString(v); err != nil {
log.Fatal("Error reading ADLIN_COLLECTOR_SECRET variable:", err) log.Fatal("Error reading ADLIN_COLLECTOR_SECRET variable:", err)
} else { } else {