Switch to modernc.org/sqlite and update dockerfile
This commit is contained in:
+4
-6
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user