fix(shared): require compatible cloudflared for Connect #13968
Closedvoltcrash(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/13968/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- packages/shared/src/relayClient.ts line 221OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -207,3 +209,13 @@207209 return platform === "win32" || (info.value.mode & 0o111) !== 0;208210 });209211212+ const compatibleExternalVersion = (executablePath: string) =>213+ Effect.gen(function* () {214+ const child = yield* spawner.spawn(215+ ChildProcess.make(executablePath, ["version"], {216+ shell: false,217+ stdout: "pipe",218+ stderr: "ignore",219+ }),220+ );221+ const output = yield* child.stdout.pipe(Stream.decodeText(), Stream.mkString);
- @@ -207,3 +209,20 @@207209 return platform === "win32" || (info.value.mode & 0o111) !== 0;208210 });209211212+ const compatibleExternalVersion = (executablePath: string) =>213+ Effect.gen(function* () {214+ const child = yield* spawner.spawn(215+ ChildProcess.make(executablePath, ["version"], {216+ shell: false,217+ stdout: "pipe",218+ stderr: "ignore",219+ }),220+ );221+ const output = yield* child.stdout.pipe(222+ Stream.take(16),223+ Stream.map((chunk) => chunk.subarray(0, 64)),224+ Stream.decodeText(),225+ Stream.mkString,226+ );227+ if (Number(yield* child.exitCode) !== 0) return null;228+ const match = /^cloudflared version (\d+)\.(\d+)\.(\d+)\b/mu.exec(output);
juliusmarminge added labelsmacroscope-review
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed