mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-25 23:47:20 +00:00
fix(gateway): warn on non-loopback bind at startup (land #25397, thanks @let5sne)
Co-authored-by: let5sne <let5sne@users.noreply.github.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import type { ResolvedGatewayAuth } from "./auth.js";
|
||||
import type { ChatAbortControllerEntry } from "./chat-abort.js";
|
||||
import type { ControlUiRootState } from "./control-ui.js";
|
||||
import type { HooksConfigResolved } from "./hooks.js";
|
||||
import { resolveGatewayListenHosts } from "./net.js";
|
||||
import { isLoopbackHost, resolveGatewayListenHosts } from "./net.js";
|
||||
import {
|
||||
createGatewayBroadcaster,
|
||||
type GatewayBroadcastFn,
|
||||
@@ -117,6 +117,12 @@ export async function createGatewayRuntimeState(params: {
|
||||
});
|
||||
|
||||
const bindHosts = await resolveGatewayListenHosts(params.bindHost);
|
||||
if (!isLoopbackHost(params.bindHost)) {
|
||||
params.log.warn(
|
||||
"⚠️ Gateway is binding to a non-loopback address. " +
|
||||
"Ensure authentication is configured before exposing to public networks.",
|
||||
);
|
||||
}
|
||||
const httpServers: HttpServer[] = [];
|
||||
const httpBindHosts: string[] = [];
|
||||
for (const host of bindHosts) {
|
||||
|
||||
Reference in New Issue
Block a user