diff --git a/cmd/main.go b/cmd/main.go index 6e1fef5..6d5d8f4 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -9,13 +9,18 @@ import ( "gorm.io/driver/postgres" "gorm.io/gorm" "log" + "os" ) func main() { log.Println("Launching sky-meter") sentry.SentryInit() + dbconnect := os.Getenv("dbconnect") + if opsgenieSecret == "" { + log.Fatal("Please specify the opsgeniesecret as environment variable, e.g. sooraj@sky:~/go/src/sky-meter$ export dbconnect=host=localhost user=postgres password=postgres dbname=postgres port=5433 sslmode=disable") + } db, err := gorm.Open(postgres.New(postgres.Config{ - DSN: "host=localhost user=postgres password=postgres dbname=postgres port=5433 sslmode=disable", + DSN: dbconnect, PreferSimpleProtocol: true, // disables implicit prepared statement usage }), &gorm.Config{}) diff --git a/templates/error.html b/templates/error.html index 2e52e75..3baaa26 100644 --- a/templates/error.html +++ b/templates/error.html @@ -188,7 +188,7 @@ display: none !important; } -
Mute videos until you’re ready
+