Commit Graph

990 Commits

Author SHA1 Message Date
gnuxie 88bf45b404 Update to MPS 1.5.0 for PersistentConfigData features. 2024-10-02 11:32:04 +01:00
gnuxie 05f662214c Add WatchedLists and EnabledProtections to config recovery test. 2024-10-01 13:12:37 +01:00
gnuxie 756d9c8491 Update DraupnirProtectedRoomsSet for more recoverable configs.
Added policy list config and protection settings.
2024-10-01 11:54:28 +01:00
gnuxie 72020e8ad6 Integration tests for recoring from protected rooms failure. 2024-09-30 12:14:00 +01:00
gnuxie 6b0e252e2a Make StandardDraupnirManager boot into safe mode too.
Appservice bots won't boot into safe mode otherwise.
2024-09-30 12:14:00 +01:00
gnuxie 2c8c2892ba Allow safe mode to be configured in appservice mode. 2024-09-30 12:14:00 +01:00
gnuxie 3c1cb07aa6 Create a fresh safe mode instance when restarting Draupnir.
Specifically, when restart Draupnir fails, and safe mode is already
running, we will want to create a fresh safe mode instance that
contains the relevant recovery options, from the new cause of failure.
2024-09-30 12:14:00 +01:00
gnuxie b9c05fbb6b Update interface-manager for better infrence on arbritrary renderers. 2024-09-30 12:14:00 +01:00
gnuxie 9ff0f54ff8 Automatically complete prompts from partial commands.
Fixes https://github.com/the-draupnir-project/Draupnir/issues/585.
2024-09-30 12:14:00 +01:00
gnuxie 8c74023374 Allow DraupnirSafeMode to respond to prompts. 2024-09-30 12:14:00 +01:00
gnuxie d4598d9c02 Add recover prompts to the safe mode status info. 2024-09-27 16:31:49 +01:00
gnuxie f9ff3ffdb3 Allow recover options to be used.
Now we just need to anotate the status information/command with
a partial command that calls the recover command.
2024-09-27 14:51:49 +01:00
gnuxie c556b21ac5 Display recovery options in safe mode status information. 2024-09-27 12:25:33 +01:00
Gnuxie 56cdc480f1 Update the README now that we're moving. (#575)
* Update the README now that we're moving.

* Elaborate on refactoring.
2024-09-20 20:14:48 +01:00
gnuxie fbdd146106 Harden MentionLimitProtection after Mjolnir's introduction of the protection.
From https://github.com/matrix-org/mjolnir/pull/524.

Co-authored-by: Half-Shot <will@half-shot.uk>
2024-09-20 16:09:31 +01:00
Gnuxie 6a6e24a7b6 Verify that commands have renderers and renderers have commands (#571)
* Upgrade to interface-manager@2.4.0.

* Verify that commands have renderers and renderers have commands.

https://github.com/the-draupnir-project/Draupnir/issues/566

* Fix appservice bot's missing renderers.
2024-09-20 12:55:16 +01:00
Marcel 4658ba2e60 Add a welcome flow to Draupnir4All (#568)
* Add a welcome flow to Draupnir4All

* Fix english

Co-authored-by: Gnuxie <50846879+Gnuxie@users.noreply.github.com>

* Use invitations instead of invites

---------

Co-authored-by: Gnuxie <50846879+Gnuxie@users.noreply.github.com>
2024-09-20 09:45:26 +02:00
Marcel ee1fad567c Start draupnir bots in batches when running in appservice mode (#569)
* Start draupnir bots in batches when running in appservice mode

* Simplify and add clarity.

---------

Co-authored-by: gnuxie <Gnuxie@protonmail.com>
2024-09-20 09:44:44 +02:00
Gnuxie 5ab32f9467 Merge pull request #567 from the-draupnir-project/gnuxie/safe-mode-appservice-integration-test
appservice provisioned draupnir safe mode test

https://github.com/the-draupnir-project/planning/issues/26
2024-09-19 20:18:39 +01:00
gnuxie 4c0e093c77 Fix draupnir manager for safe mode. 2024-09-19 20:12:07 +01:00
gnuxie 8f95c987ad Create a test for turning provisioned Draupnir to safe mode and back
Currently failing because the appservice draupnir manager is broken.
2024-09-19 17:52:53 +01:00
gnuxie f1f1440316 Add ProvisionTestHelper for testing appservice draupnir commands. 2024-09-19 15:26:35 +01:00
Gnuxie 4c5221237f Merge pull request #565 from the-draupnir-project/gnuxie/safe-mode-part-1
Initial safe mode (without editor or recovery options)

https://github.com/the-draupnir-project/planning/issues/26
2024-09-19 15:00:55 +01:00
gnuxie f1a6c8cfbf Change Draupnir['start'] to be synchronous. 2024-09-19 12:46:57 +01:00
gnuxie b52948b353 Forgot to start Draupnir listening in appservice.
We need to look at Draupnir's .start method and make it `void`.
The report poller should just throw if it fails without being
caught by `Task`.

We also need to test the `toggle` in appservice in integration
tests.
2024-09-19 12:27:39 +01:00
gnuxie 334aaa7233 Give safe mode config option a better name. 2024-09-18 19:53:58 +01:00
gnuxie 0895c58882 Allow manual launch script to use safe mode. 2024-09-18 18:47:13 +01:00
gnuxie 35ccf94794 Make integration test harness use the BotModeToggle. 2024-09-18 18:29:49 +01:00
gnuxie a92c95a0dd Make src/index.ts use the BotModeToggle to manage the bot.
Now we need to change the integration test's makeMjolnir do the same.
2024-09-18 18:08:36 +01:00
gnuxie d82a0b0731 Print status information when booting from and to safe mode. 2024-09-18 16:19:47 +01:00
gnuxie 4db7ce3872 Find a way to print draupnir status on startup from the toggle.
without disrupting e2ee.
2024-09-18 16:04:49 +01:00
gnuxie bd209848a3 Fix integration test fixtures now safe mode toggle controls draupnir. 2024-09-18 15:37:45 +01:00
gnuxie de6e4d7416 Add restart command to safe mode.
Currently integration tests will be broken because we took control
over "who starts Draupnir?" away and gave it to the `SafeModeToggle`.

So we need to fix that.
2024-09-18 15:28:05 +01:00
gnuxie 4f1b789501 Add a status command to safe mode. 2024-09-18 12:45:52 +01:00
gnuxie ed7b976404 Allow safe mode bot to respond to commands. 2024-09-17 19:15:39 +01:00
gnuxie 28718ca89b Remember to start the safe mode bot. 2024-09-17 19:13:34 +01:00
gnuxie 6b1b44259c Add draupnir command to switch to safe mode.
Works, but safe mode isn't hooked up to respond to any events.
2024-09-17 18:31:02 +01:00
gnuxie 9959431da8 Pass the SafeModeToggle to Draupnir.
Something that is going to be broken for sure are the guages on the
appservice manager, since toggling is controlled by the base manager.

I have no idea what these guages are even for except the legacy
draupnir4all work.
2024-09-17 18:18:13 +01:00
gnuxie c9a0d60eaf Migrate bot mode to use the safe mode toggle, but only for draupnir. 2024-09-17 17:27:08 +01:00
gnuxie 47468e1155 SafeModeDraupnir (not plugged in). 2024-09-17 15:27:45 +01:00
gnuxie be1c2903fb Simplify Draupnir manager by always listening. 2024-09-17 14:50:47 +01:00
gnuxie fd7114fd7d Skip calling /join for rooms we arleady know we are joined to.
https://github.com/Gnuxie/matrix-protection-suite/issues/61
https://github.com/the-draupnir-project/Draupnir/issues/561
2024-09-17 12:16:17 +01:00
gnuxie 86b7a51992 Fix broken link in readme and references to default command.
thanks again Sky.
2024-09-14 13:56:26 +01:00
gnuxie 7c9d817270 WordListProtection had a typo in it.
This is going to require the protection to be restarted for
those who have already enabled it, so rememeber to warn in the release.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/557.
2024-09-14 13:56:26 +01:00
Gnuxie d0e3cbe324 Remember to intern Draupnir protections command. (#556)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/555.
2024-09-13 13:51:16 +01:00
gnuxie d3fe508db3 v2.0.0-beta.6 v2.0.0-beta.6 2024-09-11 18:08:23 +01:00
Gnuxie a978618b9d Merge pull request #553 from the-draupnir-project/gnuxie/kick-command-wtf
disbelief, but basically Mocha is an asshole and was suppressing uncaught promise rejections, and then the throttling queue was catching errors in kick command unit test. So between them the test for glob kicks looked like it was passing, when it was actually causing an assertion failure that we couldn't see. And this meant that we couldn't tell that glob kicks were always banning everyone and everything no matter what. This seems to effect all `v2.0.0-beta.*` releases, but I don't think there is a release where the kick command will actually run without some other error happening first.
2024-09-11 17:19:44 +01:00
gnuxie 8482df6f1b Stop --glob on kick command kicking everyone. 2024-09-11 17:09:55 +01:00
gnuxie 6c23c747de ThrottlingQueue was supressing errors in unit tests. 2024-09-11 17:08:00 +01:00
Gnuxie 56e0c56eeb Use @gnuxie/typescript-result's expect where applicable instead of throwing garbage. (#552)
Part of https://github.com/the-draupnir-project/Draupnir/issues/547

* Update for MPS v1.3.0.

* Use @gnuxie/typescript-result's `expect` method where applicable.

* Update to @the-draupnir-project/interface-manager@2.3.0.
2024-09-11 14:57:37 +01:00