migrate to postgres

This commit is contained in:
m
2026-07-12 23:49:25 +02:00
parent e7b418b004
commit e59fde6a48
15 changed files with 151 additions and 125 deletions
+12 -12
View File
@@ -3,22 +3,22 @@ package config
import "os"
type Config struct {
Port string
DBPath string
OCREndpoint string
UploadDir string
HMACSecret string
ServerHost string
Port string
DatabaseURL string
OCREndpoint string
UploadDir string
HMACSecret string
ServerHost string
}
func Load() *Config {
return &Config{
Port: envOr("PORT", "8080"),
DBPath: envOr("DB_PATH", "vaultdrop.db"),
OCREndpoint: envOr("OCR_ENDPOINT", "http://localhost:9090"),
UploadDir: envOr("UPLOAD_DIR", "./uploads"),
HMACSecret: envOr("HMAC_SECRET", "thisismyrandomstring"),
ServerHost: envOr("SERVER_HOST", "http://192.168.1.17:8080"),
Port: envOr("PORT", "8080"),
DatabaseURL: envOr("DATABASE_URL", "postgres://localhost:5432/vaultdrop?sslmode=disable"),
OCREndpoint: envOr("OCR_ENDPOINT", "http://localhost:9090"),
UploadDir: envOr("UPLOAD_DIR", "./uploads"),
HMACSecret: envOr("HMAC_SECRET", "thisismyrandomstring"),
ServerHost: envOr("SERVER_HOST", "http://192.168.1.17:8080"),
}
}