This commit is contained in:
+5
-14
@@ -16,13 +16,8 @@ import (
|
||||
"github.com/mrhid6/vantage/sitesvc/internal/store"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func main() {
|
||||
|
||||
|
||||
godotenv.Load()
|
||||
|
||||
mongoURI := getEnv("MONGO_URI", "mongodb://localhost:27017/vantage")
|
||||
@@ -33,26 +28,22 @@ func main() {
|
||||
}
|
||||
log.Printf("connected to MongoDB (database %q)", store.DatabaseName())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if err := store.EnsureIndexes(); err != nil {
|
||||
log.Fatalf("failed to ensure indexes: %v", err)
|
||||
}
|
||||
|
||||
mailCfg := mail.FromEnv()
|
||||
if mailCfg.Enabled() {
|
||||
log.Printf("smtp enabled (%s) — contact form delivers to %s", mailCfg.Host, mailCfg.To)
|
||||
log.Printf("smtp enabled (%s) contact form delivers to %s", mailCfg.Host, mailCfg.To)
|
||||
} else {
|
||||
log.Println("warning: SMTP_HOST/SMTP_FROM not set — the contact and signup forms will refuse submissions")
|
||||
log.Println("warning: SMTP_HOST/SMTP_FROM not set the contact and signup forms will refuse submissions")
|
||||
}
|
||||
|
||||
if os.Getenv("PUBLIC_URL") == "" {
|
||||
log.Println("warning: PUBLIC_URL is unset — verification links will be relative and will not work")
|
||||
log.Println("warning: PUBLIC_URL is unset verification links will be relative and will not work")
|
||||
}
|
||||
if os.Getenv("SITE_ORIGIN") == "" {
|
||||
log.Println("warning: SITE_ORIGIN is unset — cross-origin browser requests will be refused")
|
||||
log.Println("warning: SITE_ORIGIN is unset cross-origin browser requests will be refused")
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
|
||||
Reference in New Issue
Block a user