feat(config-api): 添加 TLS Sidecar 配置支持

在配置更新处理中新增对 TLS_SIDECAR_ENABLED 和 TLS_SIDECAR_PORT 两个配置项的支持,使系统能够通过 API 动态管理 TLS Sidecar 的启用状态和端口设置。
This commit is contained in:
hex2077 2026-02-28 00:23:16 +08:00
parent afedccf934
commit f8de8aad67

View file

@ -99,6 +99,10 @@ export async function handleUpdateConfig(req, res, currentConfig) {
if (newConfig.PROXY_URL !== undefined) currentConfig.PROXY_URL = newConfig.PROXY_URL;
if (newConfig.PROXY_ENABLED_PROVIDERS !== undefined) currentConfig.PROXY_ENABLED_PROVIDERS = newConfig.PROXY_ENABLED_PROVIDERS;
// TLS Sidecar settings
if (newConfig.TLS_SIDECAR_ENABLED !== undefined) currentConfig.TLS_SIDECAR_ENABLED = newConfig.TLS_SIDECAR_ENABLED;
if (newConfig.TLS_SIDECAR_PORT !== undefined) currentConfig.TLS_SIDECAR_PORT = newConfig.TLS_SIDECAR_PORT;
// Log settings
if (newConfig.LOG_ENABLED !== undefined) currentConfig.LOG_ENABLED = newConfig.LOG_ENABLED;
if (newConfig.LOG_OUTPUT_MODE !== undefined) currentConfig.LOG_OUTPUT_MODE = newConfig.LOG_OUTPUT_MODE;
@ -165,7 +169,9 @@ export async function handleUpdateConfig(req, res, currentConfig) {
LOG_INCLUDE_REQUEST_ID: currentConfig.LOG_INCLUDE_REQUEST_ID,
LOG_INCLUDE_TIMESTAMP: currentConfig.LOG_INCLUDE_TIMESTAMP,
LOG_MAX_FILE_SIZE: currentConfig.LOG_MAX_FILE_SIZE,
LOG_MAX_FILES: currentConfig.LOG_MAX_FILES
LOG_MAX_FILES: currentConfig.LOG_MAX_FILES,
TLS_SIDECAR_ENABLED: currentConfig.TLS_SIDECAR_ENABLED,
TLS_SIDECAR_PORT: currentConfig.TLS_SIDECAR_PORT
};
writeFileSync(configPath, JSON.stringify(configToSave, null, 2), 'utf-8');