feat(postgres): add postgres backend support and migration docs

This commit is contained in:
sagit
2026-02-12 06:38:25 +00:00
parent 69f62188cf
commit cedcaebd1f
16 changed files with 819 additions and 53 deletions
+12 -8
View File
@@ -3,18 +3,22 @@ package config
import "os"
type Config struct {
Addr string
DBPath string
JWTSecret string
LogDir string
Addr string
DBType string
DBPath string
DatabaseURL string
JWTSecret string
LogDir string
}
func FromEnv() Config {
cfg := Config{
Addr: getEnv("SERVER_ADDR", ":6365"),
DBPath: getEnv("DB_PATH", "/app/data/gost.db"),
JWTSecret: getEnv("JWT_SECRET", ""),
LogDir: getEnv("LOG_DIR", "/app/logs"),
Addr: getEnv("SERVER_ADDR", ":6365"),
DBType: getEnv("DB_TYPE", "sqlite"),
DBPath: getEnv("DB_PATH", "/app/data/gost.db"),
DatabaseURL: getEnv("DATABASE_URL", ""),
JWTSecret: getEnv("JWT_SECRET", ""),
LogDir: getEnv("LOG_DIR", "/app/logs"),
}
return cfg