功能:完善 API 卡密发货与自动化日志
This commit is contained in:
1 parent
d92fb0f4cc
commit
f5064254dc
106 files changed
+4302
-600
No files matched your search
@@ -26,6 +26,7 @@ import (
|
||||
"xianyu-go/internal/db"
|
||||
"xianyu-go/internal/logging"
|
||||
"xianyu-go/internal/logsafe"
|
||||
"xianyu-go/internal/netguard"
|
||||
appversion "xianyu-go/internal/version"
|
||||
)
|
||||
|
||||
@@ -352,6 +353,13 @@ func openServerInfrastructure(ctx context.Context, startup serverStartupConfig,
|
||||
closeLog()
|
||||
return serverInfrastructure{}, fmt.Errorf("校验或升级数据库敏感字段失败: %w", err)
|
||||
}
|
||||
// outboundPublicOnly 保存用户可配置 HTTP 请求的启动期公网限制快照。
|
||||
if raw, settingErr := store.Settings.Get(ctx, "outbound_http_public_only"); settingErr == nil {
|
||||
netguard.SetDefaultPublicOnly(strings.EqualFold(strings.TrimSpace(raw), "true"))
|
||||
} else {
|
||||
logger.Warn("读取统一 HTTP 出站策略失败,按默认关闭处理", "err", settingErr)
|
||||
netguard.SetDefaultPublicOnly(false)
|
||||
}
|
||||
if !startup.explicitLogLevel {
|
||||
// level、levelErr 分别是数据库保存的日志等级及其读取错误;读取失败时保留进程默认值。
|
||||
if level, levelErr := store.Settings.Get(ctx, "log_level"); levelErr == nil && strings.TrimSpace(level) != "" {
|
||||
|
||||
Reference in new issue
Block a user