feat: 添加YMT密钥解密密钥配置项
在配置文件中新增ymt_key_decrypt_key_b64字段,用于设置YMT密钥解密密钥 当配置项不为空时,自动将其设置为环境变量YMT_KEY_DECRYPT_KEY_B64
This commit is contained in:
parent
7170991166
commit
e24b42fe4d
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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: ""
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue