mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
refactor: remove redundant gateway configure conversions
This commit is contained in:
@@ -42,7 +42,7 @@ export async function promptGatewayConfig(
|
||||
}),
|
||||
runtime,
|
||||
);
|
||||
const port = Number.parseInt(String(portRaw), 10);
|
||||
const port = Number.parseInt(portRaw, 10);
|
||||
|
||||
let bind = guardCancel(
|
||||
await select({
|
||||
@@ -129,14 +129,12 @@ export async function promptGatewayConfig(
|
||||
let tailscaleResetOnExit = false;
|
||||
if (tailscaleMode !== "off") {
|
||||
note(TAILSCALE_DOCS_LINES.join("\n"), "Tailscale");
|
||||
tailscaleResetOnExit = Boolean(
|
||||
guardCancel(
|
||||
await confirm({
|
||||
message: "Reset Tailscale serve/funnel on exit?",
|
||||
initialValue: false,
|
||||
}),
|
||||
runtime,
|
||||
),
|
||||
tailscaleResetOnExit = guardCancel(
|
||||
await confirm({
|
||||
message: "Reset Tailscale serve/funnel on exit?",
|
||||
initialValue: false,
|
||||
}),
|
||||
runtime,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -274,7 +272,7 @@ export async function promptGatewayConfig(
|
||||
runtime,
|
||||
);
|
||||
const requiredHeaders = requiredHeadersRaw
|
||||
? normalizeStringEntries(String(requiredHeadersRaw).split(","))
|
||||
? normalizeStringEntries(requiredHeadersRaw.split(","))
|
||||
: [];
|
||||
|
||||
const allowUsersRaw = guardCancel(
|
||||
@@ -284,9 +282,7 @@ export async function promptGatewayConfig(
|
||||
}),
|
||||
runtime,
|
||||
);
|
||||
const allowUsers = allowUsersRaw
|
||||
? normalizeStringEntries(String(allowUsersRaw).split(","))
|
||||
: [];
|
||||
const allowUsers = allowUsersRaw ? normalizeStringEntries(allowUsersRaw.split(",")) : [];
|
||||
|
||||
const trustedProxiesRaw = guardCancel(
|
||||
await text({
|
||||
@@ -301,7 +297,7 @@ export async function promptGatewayConfig(
|
||||
}),
|
||||
runtime,
|
||||
);
|
||||
trustedProxies = normalizeStringEntries(String(trustedProxiesRaw).split(","));
|
||||
trustedProxies = normalizeStringEntries(trustedProxiesRaw.split(","));
|
||||
|
||||
trustedProxyConfig = {
|
||||
userHeader: normalizeOptionalString(userHeader) ?? "",
|
||||
|
||||
Reference in New Issue
Block a user