diff --git a/server/cmd/server/main.go b/server/cmd/server/main.go index 0b91fe4..fd151a2 100644 --- a/server/cmd/server/main.go +++ b/server/cmd/server/main.go @@ -9,6 +9,7 @@ import ( "marketing-system-data-tool/server/internal/logging" "net/http" "time" + "os" ) func main() { @@ -51,3 +52,4 @@ func main() { } // buildDSN deprecated; use cfg.YMTDB.DSN()/cfg.MarketingDB.DSN() + if cfg.YMTKeyDecryptKeyB64 != "" { os.Setenv("YMT_KEY_DECRYPT_KEY_B64", cfg.YMTKeyDecryptKeyB64) } diff --git a/server/config_example.yaml b/server/config_example.yaml index 9526a29..7890205 100644 --- a/server/config_example.yaml +++ b/server/config_example.yaml @@ -12,3 +12,4 @@ app: user: "YOUR_YMT_DB_USER" password: "YOUR_YMT_DB_PASSWORD" name: "YOUR_YMT_DB_NAME" + ymt_key_decrypt_key_b64: "" diff --git a/server/internal/config/config.go b/server/internal/config/config.go index 19c4373..f328be9 100644 --- a/server/internal/config/config.go +++ b/server/internal/config/config.go @@ -18,9 +18,10 @@ type DB struct { } type App struct { - Port string `yaml:"port"` - MarketingDB DB `yaml:"marketing_db"` - YMTDB DB `yaml:"ymt_db"` + Port string `yaml:"port"` + MarketingDB DB `yaml:"marketing_db"` + YMTDB DB `yaml:"ymt_db"` + YMTKeyDecryptKeyB64 string `yaml:"ymt_key_decrypt_key_b64"` } type root struct {