mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-05-15 11:55:41 +00:00
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
// Copyright 2022 - 2024 Gnuxie <Gnuxie@protonmail.com>
|
|
// Copyright 2021 - 2022 The Matrix.org Foundation C.I.C.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
// SPDX-FileAttributionText: <text>
|
|
// This modified file incorporates work from mjolnir
|
|
// https://github.com/matrix-org/mjolnir
|
|
// </text>
|
|
|
|
/**
|
|
* This file is used to launch mjolnir for manual testing, creating a user and management room automatically if it doesn't already exist.
|
|
*/
|
|
|
|
import { draupnirClient, makeBotModeToggle } from "./mjolnirSetupUtils";
|
|
import { configRead } from "../../src/config";
|
|
import { SqliteRoomStateBackingStore } from "../../src/backingstore/better-sqlite3/SqliteRoomStateBackingStore";
|
|
import { DefaultEventDecoder } from "matrix-protection-suite";
|
|
|
|
void (async () => {
|
|
const config = configRead();
|
|
const toggle = await makeBotModeToggle(config, {
|
|
backingStore: SqliteRoomStateBackingStore.create(
|
|
config.dataPath,
|
|
DefaultEventDecoder
|
|
),
|
|
allowSafeMode: true,
|
|
});
|
|
await draupnirClient()?.start();
|
|
await toggle.encryptionInitialized();
|
|
})();
|