feat(webui): source trustProxy from runtime config (env still overrides)

Move the trust-proxy/client-ip resolver from a module-level direct read of
SNOWLUMA_WEBUI_TRUST_PROXY into initWebUI, fed by runtime.json's trustProxy
(loadRuntimeConfig already merges the env override on top). Default '' parses
identically to the old undefined (trust socket peer only), so behavior is
unchanged when unset.
This commit is contained in:
DrSmoothl committed 2026-06-18 14:26:32 +08:00
1 parent 64c10e2856
commit ad21e19dc8
2 files changed
+9 -9

No files matched your search

+1
View File
@@ -51,6 +51,7 @@ async function main() {
await initWebUI(runtimeConfig.webuiPort || 5099, oneBotManager, hookManager, notificationManager, {
host: runtimeConfig.webuiHost,
tlsEnabled: runtimeConfig.webuiTls?.enabled,
trustProxy: runtimeConfig.trustProxy,
});
} catch (err) {
log.error('Failed to start WebUI: ', err);