This commit is contained in:
lbenedar
2026-03-24 14:20:29 +03:00
parent 4ff2f16110
commit 974e7f151f
4 changed files with 74 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import (
"database/sql"
"flag"
"os"
"strings"
"sync"
"time"
@@ -45,6 +46,9 @@ type config struct {
password string
sender string
}
cors struct {
trustedOrigins []string
}
}
func openDB(cfg config) (*sql.DB, error) {
@@ -93,6 +97,11 @@ func main() {
flag.StringVar(&cfg.smtp.password, "smtp-password", "d8672aa2264bb5", "SMTP password")
flag.StringVar(&cfg.smtp.sender, "smtp-sender", "Greenlight <no-reply@greenlight.net", "SMTP sender")
flag.Func("cors-trusted-origins", "Trusted CORS origins (space separated)", func(s string) error {
cfg.cors.trustedOrigins = strings.Fields(s)
return nil
})
flag.Parse()
logger := jsonlog.New(os.Stdout, jsonlog.LevelInfo)