chore: parametrize db path #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 48s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 48s
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user