mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 16:03:43 +00:00
Gateway: add SecretRef support for gateway.auth.token with auth-mode guardrails (#35094)
This commit is contained in:
@@ -10,13 +10,13 @@ import {
|
||||
GATEWAY_DAEMON_RUNTIME_OPTIONS,
|
||||
type GatewayDaemonRuntime,
|
||||
} from "./daemon-runtime.js";
|
||||
import { resolveGatewayInstallToken } from "./gateway-install-token.js";
|
||||
import { guardCancel } from "./onboard-helpers.js";
|
||||
import { ensureSystemdUserLingerInteractive } from "./systemd-linger.js";
|
||||
|
||||
export async function maybeInstallDaemon(params: {
|
||||
runtime: RuntimeEnv;
|
||||
port: number;
|
||||
gatewayToken?: string;
|
||||
daemonRuntime?: GatewayDaemonRuntime;
|
||||
}) {
|
||||
const service = resolveGatewayService();
|
||||
@@ -88,10 +88,26 @@ export async function maybeInstallDaemon(params: {
|
||||
progress.setLabel("Preparing Gateway service…");
|
||||
|
||||
const cfg = loadConfig();
|
||||
const tokenResolution = await resolveGatewayInstallToken({
|
||||
config: cfg,
|
||||
env: process.env,
|
||||
});
|
||||
for (const warning of tokenResolution.warnings) {
|
||||
note(warning, "Gateway");
|
||||
}
|
||||
if (tokenResolution.unavailableReason) {
|
||||
installError = [
|
||||
"Gateway install blocked:",
|
||||
tokenResolution.unavailableReason,
|
||||
"Fix gateway auth config/token input and rerun configure.",
|
||||
].join(" ");
|
||||
progress.setLabel("Gateway service install blocked.");
|
||||
return;
|
||||
}
|
||||
const { programArguments, workingDirectory, environment } = await buildGatewayInstallPlan({
|
||||
env: process.env,
|
||||
port: params.port,
|
||||
token: params.gatewayToken,
|
||||
token: tokenResolution.token,
|
||||
runtime: daemonRuntime,
|
||||
warn: (message, title) => note(message, title),
|
||||
config: cfg,
|
||||
|
||||
Reference in New Issue
Block a user