mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 21:31:26 +00:00
refactor: centralize bootstrap profile handling
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
pickMatchingExternalInterfaceAddress,
|
||||
safeNetworkInterfaces,
|
||||
} from "../infra/network-interfaces.js";
|
||||
import { PAIRING_SETUP_BOOTSTRAP_PROFILE } from "../shared/device-bootstrap-profile.js";
|
||||
import { resolveGatewayBindUrl } from "../shared/gateway-bind-url.js";
|
||||
import { isCarrierGradeNatIpv4Address, isRfc1918Ipv4Address } from "../shared/net/ip.js";
|
||||
import { resolveTailnetHostWithRunner } from "../shared/tailscale-status.js";
|
||||
@@ -22,9 +23,6 @@ export type PairingSetupPayload = {
|
||||
bootstrapToken: string;
|
||||
};
|
||||
|
||||
const PAIRING_SETUP_BOOTSTRAP_ROLES = ["node"] as const;
|
||||
const PAIRING_SETUP_BOOTSTRAP_SCOPES: string[] = [];
|
||||
|
||||
export type PairingSetupCommandResult = {
|
||||
code: number | null;
|
||||
stdout: string;
|
||||
@@ -387,8 +385,7 @@ export async function resolvePairingSetupFromConfig(
|
||||
bootstrapToken: (
|
||||
await issueDeviceBootstrapToken({
|
||||
baseDir: options.pairingBaseDir,
|
||||
roles: PAIRING_SETUP_BOOTSTRAP_ROLES,
|
||||
scopes: PAIRING_SETUP_BOOTSTRAP_SCOPES,
|
||||
profile: PAIRING_SETUP_BOOTSTRAP_PROFILE,
|
||||
})
|
||||
).token,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user