fix(config): viper 加 /etc/pay-v2 config 搜索路径(pangolin1 部署)
systemd WorkingDirectory=/var/lib/pay-v2,但约定 config 落 /etc/pay-v2/config.yaml; 不加此路径 pay 读不到 config 会退默认值(accounts 空→渠道不注册)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
@@ -150,6 +150,7 @@ func Load() {
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".")
|
||||
viper.AddConfigPath("./config")
|
||||
viper.AddConfigPath("/etc/pay-v2") // 生产部署(pangolin1)config 落 /etc/pay-v2/config.yaml;systemd WorkingDirectory 在 /var/lib/pay-v2,故显式加此搜索路径
|
||||
|
||||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
viper.AutomaticEnv()
|
||||
|
||||
Reference in New Issue
Block a user