Switch to modernc.org/sqlite and update dockerfile

This commit is contained in:
2026-05-06 19:00:28 +02:00
parent b28b9b127b
commit e5fd59f3ed
16 changed files with 162 additions and 127 deletions
+4 -6
View File
@@ -3,9 +3,9 @@ package main
import (
"database/sql"
"log"
"os"
"path/filepath"
"quay/app/routes"
"quay/internal/config"
"quay/internal/database"
"quay/internal/envconfig"
"quay/internal/fiberconfig"
@@ -37,10 +37,8 @@ func main() {
envCfg := envconfig.Load()
configFilePath := filepath.Join(envCfg.ConfigDir, "config.yaml")
cfg, err := config.Load(configFilePath)
if err != nil {
panic("Failed to load config: " + err.Error())
if os.Getenv("JWT_SECRET") == "" || os.Getenv("JWT_SECRET") == "CHANGE_ME" {
log.Fatal("JWT_SECRET environment variable is not set or is set to the default value. Please set it to a secure random string before running the application.")
}
dbPath := filepath.Join(envCfg.ConfigDir, "db.sqlite")
@@ -64,7 +62,7 @@ func main() {
app := fiber.New()
fiberconfig.Setup(app)
routes.Register(app, cfg, &envCfg, db)
routes.Register(app, &envCfg, db)
log.Fatal(app.Listen(":" + envCfg.Port))
}