Commit Graph

1024 Commits

Author SHA1 Message Date
Gnuxie 08abad87fd Make reference to show command in the protections list command. (#628)
https://github.com/the-draupnir-project/planning/issues/35
2024-11-28 13:40:36 +00:00
Gnuxie 0b531efb83 Make sure we use exact same version of bot-sdk as matrix-appservice-bridge. (#627)
I don't think this has been a problem but it messes up the dev environment
if you want to link all of draupnir's dependencies like matrix-protection-suite,
interface-manager and so on.
2024-11-28 13:30:28 +00:00
Gnuxie 47c2d5a2fc Merge pull request #626 from the-draupnir-project/gnuxie/config-messing-about
Remove old protection settings config from all protections. This is a change in matrix-protection-suite 2.0 where replace protection settings have been replaced by the new `ConfigDescription`.

We've also added a protections show command which will show a summary of the protection's config and configured capability providers. 

https://github.com/the-draupnir-project/planning/issues/35

![Screenshot_20241126_135802](https://github.com/user-attachments/assets/b856f190-6c84-4a11-a28f-48edc39afa3d)
2024-11-28 12:45:27 +00:00
gnuxie e53d178ecd update for MPS. 2024-11-28 12:35:23 +00:00
gnuxie 9a62254c36 Basic protections show command.
We need to show what the documentation and structure of the protection
settings even when no config is persisted for it.
2024-11-28 12:35:23 +00:00
gnuxie 0238a76612 Update protections command for new protections config. 2024-11-27 19:34:12 +00:00
gnuxie 0ad2f0d3f2 Update draupnir factory for new protection config backends. 2024-11-27 19:34:12 +00:00
gnuxie 29e610cbee Update protections for ConfigSchema protection settings. 2024-11-27 19:34:12 +00:00
renovate[bot] c2786e2c48 chore(deps): update development dependencies (#527)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-26 12:47:04 +01:00
renovate[bot] 477ac53cf9 fix(deps): update production dependencies (#528)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-26 12:41:09 +01:00
gnuxie e36fefb4ce v2.0.0-beta.8 v2.0.0-beta.8 2024-10-22 19:33:56 +01:00
Gnuxie 57071b9369 Merge pull request #612 from the-draupnir-project/gnuxie/no-confirm
Confirmation prompt for recovery options

Fixes https://github.com/the-draupnir-project/Draupnir/issues/602.
2024-10-11 11:29:48 +01:00
gnuxie d6b3f2e854 Always show help commands.
The interface-manager is still a little bit fragile if you give
keywords to the help command.
2024-10-11 11:24:39 +01:00
gnuxie 164434d528 Prompt for confirmation of the recover command.
Update interface-manager for `--no-confirm` handling.
Update tests for recovery confirmation.
2024-10-11 11:23:48 +01:00
Gnuxie 039f1a8ef0 Improve the information we have about the management room. (#610)
We introduce a new interface `ManagementRoomDetail`, and our implementation of this has immediate access to the room members and room state. 

Immediately, this allows us to warn when the management room is public.

In the future, it gives us a nice place to decide things like decide whether membership of the management room is enough to be considered a moderator, introduce more redundancy in access control, and give capabilities a way to determine who is a moderator (and avoid enacting consequences against them).  

* Move management room to its own folder so we can start introspecting on it.

* Add ManagementRoomDetail.ts

This is just used to track who is a moderator and whether the
management room is public.

* Update ManagementRoomOutput to depend on ManagementRoomDetail.

This should allow us to implement the feature that warns when
the management room is public.

* Send a warning if the management room is public.

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

* Update to MPS 1.7.0 so we can get the join rule event.
2024-10-10 13:37:42 +01:00
Marcel 8b03d6448e Update matrix-appservice-bridge and use our own alias for matrix-bot-sdk (#609)
* Update matrix-appservice-bridge and use our own alias for matrix-bot-sdk

* Bump node version to support matrix-appservice-bridge

* Bump node version in CI

* Fix comments

* Add changelog entry
2024-10-10 12:11:26 +02:00
Gnuxie b13b6150e5 Use multi-stage build in Dockerfile (#595)
* Use multi-stage build in Dockerfile

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

* Move git describe and build into one stage.

Probably won't be a good idea to download an alpine image just to install git.

* Remove git describe step from CI.

* whoopsie, copy version from the build stage not the deleted stamp.
2024-10-10 09:35:23 +01:00
Catalan Lover 54dd85daf5 Remove References to Regex in Config Example as they are false (#600)
* Remove References to Regex in Config Example as they are false

* Add note that Regex is not supported and state historical error.
2024-10-09 17:01:32 +01:00
Gnuxie cb2ad995ec Suppress 'config' package's warnings when config file is missing. (#606)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/480.

It's confusing people and we don't really use this package properly
or rely on it for this anyways.
2024-10-09 12:57:04 +01:00
Gnuxie 4015543f66 Filesystem config improvements (#604)
* 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.
2024-10-09 11:38:24 +01:00
Aminda Suomalainen f9a7bb8c03 prettier: enable prose wrapping
Squashed commit of the following:

commit 0af76a8670
Author: Aminda Suomalainen <suomalainen@aminda.eu>
Date:   Tue Oct 8 16:30:17 2024 +0300

    mx-tester.yml: run prettier to fix warning

commit 0eb6901797
Author: Aminda Suomalainen <suomalainen@aminda.eu>
Date:   Tue Oct 8 16:29:05 2024 +0300

    *.md: run prettier

commit d18ebd52fe
Author: Aminda Suomalainen <suomalainen@aminda.eu>
Date:   Tue Oct 8 16:25:27 2024 +0300

    .prettierrc.yaml: add proseWrap: always
2024-10-08 16:43:52 +03:00
Gnuxie 2f9f05256c Improve recovery status message spacing (#603)
* Improve safe mode status rendering.

Feedback from @jimmackenzie.

* Update interface-manager.
2024-10-07 19:25:45 +01:00
Gnuxie 3f103cc8fa Make recovery UX clearer. (#601)
First, we make it clear how to use the recovery options in the safe mode status command:

![Screenshot_20241007_100220](https://github.com/user-attachments/assets/07f49233-6bb1-4320-80c5-ac3aa22c1ef9)


Then a recovery option is used, we show the status of the persistent config again to reinforce to the moderator that the recovery option changed something and fixed it:

![Screenshot_20241007_102045](https://github.com/user-attachments/assets/58156a56-fe17-49e1-a93a-2591dd80aaef)

https://github.com/the-draupnir-project/planning/issues/29


* Tell people how to use recovery options in safe mode status.

* Display persistent config status when a recovery option is used.
2024-10-07 10:30:53 +01:00
Aminda Suomalainen ⚧ 7e27b057fc Fix pre-commit run --all-files, add check for executables and shebangs (#599)
* pre-commit autoupdate

* pre-commit: check executables have shebangs and shebang files are executable

* .pre-commit-config.yaml: also add check for illegal windows names

* {package.json,.pre-commit-config.yaml}: fix yarn-lint

* prettier --write for yarn-lint pre-commit hook to pass

* package.json: unquiet eslint
2024-10-06 13:22:14 +01:00
Catalan Lover 311beff587 Fix Entrypoint Perms. (#596) 2024-10-04 21:00:08 +02:00
Catalan Lover 9cc64074e1 Rename to Draupnir in Appropriate Places (#591)
* Rename to Draupnir in Appropriate Places

* Integrate Code review feedback on CHANGELOG.md
2024-10-04 20:32:10 +02:00
Gnuxie 39eb2984c5 Display persistent configs in safe mode (#592)
* Initial attempt at this, but I don't like it.

We've managed to cnofuse rendering/command layer again just because
we started with the rendering rather than the command lol.

* Remove side effects from config renderers.

* Improve rendering of persistent configs in safe mode.

We should really also expand by default, and array properties in
details instead. Otherwise a new user might not expand by default and
might not know what's wrong.

* Remove <details> from configs themselves.

* Color blind indicators for config status.

* When config are bodged just render their reasons on the same line.

* Hide stack trace behind details.

* Update for MPS 1.6.0.
2024-10-04 17:30:05 +01:00
gnuxie cb88aa52a1 v2.0.0-beta.7 v2.0.0-beta.7 2024-10-02 19:43:32 +01:00
Gnuxie 56627a417e Make sure config recovery handles vaild but unjoinable rooms. (#590)
* Make sure config recovery handles valid but unjoinable rooms.

Pretty sure that we missed this.

* Update to MPS 1.5.2 for more recovery options.
2024-10-02 19:12:26 +01:00
Gnuxie 890f004d3b Merge pull request #588 from the-draupnir-project/gnuxie/config-editor safe mode recovery
Safe Mode account data config recovery.
2024-10-02 17:30:39 +01:00
gnuxie d817810be9 Add more detail about safe mode to the config file. 2024-10-02 17:23:34 +01:00
gnuxie 98c1822013 Give some flexibility for when to enter safe mode. 2024-10-02 11:32:04 +01:00
gnuxie bd6c3c4455 WebAPIs.stop/start method was accidentally and implicitly async, fixed.
This was leading to integration test failures on CI, when the webserver
hadn't been stopped before it was started again in tests.
2024-10-02 11:32:04 +01:00
gnuxie ba6ec9bb9a Enter safe mode by default.
However, we still need to consider whether all errors should enter
safe mode or only errors that we know are recoverable.
2024-10-02 11:32:04 +01:00
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