chore: parametrize db path #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 48s

This commit is contained in:
2024-09-27 23:21:37 +02:00
parent a53ad627fc
commit bddcfc6778
3 changed files with 19 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import (
type ServerSettings struct {
BaseUrl string
Environment string
DbPath string
Smtp *SmtpSettings
}
@@ -21,6 +22,12 @@ type SmtpSettings struct {
}
func NewServerSettingsFromEnv(env func(string) string) *ServerSettings {
dbPath := env("DB_PATH")
if dbPath == "" {
dbPath = "./data.db"
}
var smtp *SmtpSettings
if env("SMTP_ENABLED") == "true" {
smtp = &SmtpSettings{