mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:01:24 +00:00
CLI: restore and harden qr --remote pairing behavior (#18166)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: a79fc2a3c6
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
This commit is contained in:
@@ -95,6 +95,17 @@ export function registerQrCli(program: Command) {
|
||||
cfg.gateway.auth.token = undefined;
|
||||
}
|
||||
}
|
||||
if (wantsRemote && !opts.url && !opts.publicUrl) {
|
||||
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
||||
const remoteUrl = cfg.gateway?.remote?.url;
|
||||
const hasRemoteUrl = typeof remoteUrl === "string" && remoteUrl.trim().length > 0;
|
||||
const hasTailscaleServe = tailscaleMode === "serve" || tailscaleMode === "funnel";
|
||||
if (!hasRemoteUrl && !hasTailscaleServe) {
|
||||
throw new Error(
|
||||
"qr --remote requires gateway.remote.url (or gateway.tailscale.mode=serve/funnel).",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const explicitUrl =
|
||||
typeof opts.url === "string" && opts.url.trim()
|
||||
|
||||
Reference in New Issue
Block a user