mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 02:28:37 +00:00
Matrix: replace legacy plugin with new implementation
This commit is contained in:
28
extensions/matrix/scripts/live-e2ee-bootstrap.ts
Normal file
28
extensions/matrix/scripts/live-e2ee-bootstrap.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { bootstrapMatrixVerification } from "../src/matrix/actions/verification.js";
|
||||
import { installLiveHarnessRuntime, resolveLiveHarnessConfig } from "./live-common.js";
|
||||
|
||||
async function main() {
|
||||
const recoveryKeyArg = process.argv[2];
|
||||
const forceResetCrossSigning = process.argv.includes("--force-reset-cross-signing");
|
||||
|
||||
const base = resolveLiveHarnessConfig();
|
||||
const pluginCfg = installLiveHarnessRuntime(base);
|
||||
(pluginCfg.channels["matrix"] as { encryption: boolean }).encryption = true;
|
||||
|
||||
const result = await bootstrapMatrixVerification({
|
||||
recoveryKey: recoveryKeyArg?.trim() || undefined,
|
||||
forceResetCrossSigning,
|
||||
});
|
||||
|
||||
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
||||
if (!result.success) {
|
||||
process.exitCode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
process.stderr.write(
|
||||
`E2EE_BOOTSTRAP_ERROR: ${err instanceof Error ? err.message : String(err)}\n`,
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user