feat: 添加YMT密钥解密密钥配置项

在配置文件中新增ymt_key_decrypt_key_b64字段,用于设置YMT密钥解密密钥
当配置项不为空时,自动将其设置为环境变量YMT_KEY_DECRYPT_KEY_B64
This commit is contained in:
zhouyonggao 2025-11-28 14:47:30 +08:00
parent 7170991166
commit e24b42fe4d
3 changed files with 7 additions and 3 deletions

View File

@ -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) }

View File

@ -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: ""

View File

@ -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 {