mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-04-02 20:35:41 +00:00
* Rename read to configRead as it should have always been. * Got a way to extract non-default values. Now let's try unknown configuration values. * Show unknown property paths with a warning. Now we just need to make this scrap available in commands. * Remove the old Mjolnir horrible RUNTIME client. * Make the path that is used to load the config available. * Warn when `--draupnir-config` isn't used. * Introduce configMeta so that we can log meta on process.exit later. * Only show non-default config values when draupnir is exiting. to reduce noise. * Get consistent with logging. So it turns out that mps4bot-sdk is using a different instance of the bot-sdk module than Draupnir, i think. Since we used to tell MPS's logger to use the bot-sdk's `LogService`, but the `setLogger` that was used was obviously inconsistent with Draupnir's. Obviously the bot-sdk should be a peer dependency in the bot-sdk to prevent this happening in future.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 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 path from "path";
|
|
import { DefaultEventDecoder } from "matrix-protection-suite";
|
|
|
|
void (async () => {
|
|
const config = configRead();
|
|
const toggle = await makeBotModeToggle(config, {
|
|
backingStore: new SqliteRoomStateBackingStore(
|
|
path.join(config.dataPath, "room-state-backing-store.db"),
|
|
DefaultEventDecoder
|
|
),
|
|
allowSafeMode: true,
|
|
});
|
|
await draupnirClient()?.start();
|
|
await toggle.encryptionInitialized();
|
|
})();
|