mirror of
https://github.com/nightly-labs/openbot.git
synced 2026-12-03 20:26:58 +08:00
* Migrate remote transport to WebRTC * Limit hosts to one active remote session * Harden remote session resume and signaling * Preserve authorization and member identity across reconnects * Tighten remote session preparation * Close remote session lifecycle gaps * Finish remote lifecycle reliability * Complete remote session lifecycle * Harden remote reconnect recovery * Close remote transport lifecycle gaps * Revoke rotated host credentials * Harden reconnect state and transfer expiry * Serialize signaling and secure remote TLS keys * Complete remote renewal and transfer recovery * Bound WebRTC framing and recover event streams * Harden remote identity and shutdown * Serialize remote authorization epochs * Secure remote restart and registration * Isolate remote file transports * Renew remote host credentials safely * fix remote session recovery edge cases * secure remote peer authentication and recovery * Fix WebRTC authentication completion ordering * Complete remote-only WebRTC rollout path * Prepare encrypted remote production environment * Keep remote desktop runtime lock stable * Preserve sessions across Signal recovery * Distinguish Signal resume from client replacement * Close replaced WebRTC peer state * Stop replaced clients from reclaiming sessions * Fix fail-closed WebRTC edge cases * Close remote authorization lifecycle gaps * Preserve pinned WebRTC session identity * Preserve immutable runtime lock metadata * Disconnect revoked remote hosts during sync * Remove sidebar event test race * Configure remote ACME token * Harden remote session recovery * Complete WebRTC host administration * Resolve remote rollout review findings * Close remote authorization races * Make remote revocation atomic * Secure remote lifecycle concurrency * Recover remote event streams * Restore live WebRTC smoke coverage * Make remote logout and readiness fail closed
36 lines
1.6 KiB
TypeScript
36 lines
1.6 KiB
TypeScript
import { spawn } from "node:child_process";
|
|
import { resolve } from "node:path";
|
|
|
|
const root = resolve(import.meta.dir, "../..");
|
|
const compose = ["compose", "-f", "remote/compose.yaml"];
|
|
|
|
await run("docker", [...compose, "build", "remote-api", "coturn"], root);
|
|
await run("docker", [...compose, "up", "-d", "--no-build", "--no-deps", "remote-api"], root);
|
|
|
|
const coturnExists = (await capture("docker", ["inspect", "openbot-coturn"], root)).code === 0;
|
|
if (coturnExists) {
|
|
console.log("Draining coturn. The update waits until all relay allocations end.");
|
|
await run("docker", ["update", "--restart=no", "openbot-coturn"], root);
|
|
await run("docker", ["kill", "--signal=SIGUSR1", "openbot-coturn"], root);
|
|
await run("docker", ["wait", "openbot-coturn"], root);
|
|
}
|
|
await run("docker", [...compose, "up", "-d", "--no-build", "--no-deps", "--force-recreate", "coturn"], root);
|
|
await run("docker", [...compose, "ps"], root);
|
|
|
|
async function run(command: string, args: string[], cwd: string): Promise<void> {
|
|
const result = await execute(command, args, cwd, "inherit");
|
|
if (result !== 0) throw new Error(`${command} failed with exit code ${result}.`);
|
|
}
|
|
|
|
async function capture(command: string, args: string[], cwd: string): Promise<{ code: number }> {
|
|
return { code: await execute(command, args, cwd, "ignore") };
|
|
}
|
|
|
|
function execute(command: string, args: string[], cwd: string, stdio: "inherit" | "ignore"): Promise<number> {
|
|
return new Promise((resolveExit, reject) => {
|
|
const child = spawn(command, args, { cwd, stdio, shell: false });
|
|
child.once("error", reject);
|
|
child.once("exit", (code) => resolveExit(code ?? 1));
|
|
});
|
|
}
|