Commit Graph

837 Commits

Author SHA1 Message Date
Gnuxie 4c775742be Post MPS Allow use of shortcodes to refer to policy rooms (#331)
* Update to MPS 0.15.0.

This adds support for mjolnir shortcodes.

* Add shortcode support back post MPS.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/316.
2024-04-10 21:14:48 +01:00
pre-commit-ci[bot] be907a6f45 [pre-commit.ci] pre-commit autoupdate (#327)
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-09 22:37:10 +01:00
dependabot[bot] fa9525c4f5 Bump the github-actions group with 2 updates (#326)
Bumps the github-actions group with 2 updates: [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) and [baptiste0928/cargo-install](https://github.com/baptiste0928/cargo-install).


Updates `docker/setup-buildx-action` from 3.0.0 to 3.3.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3.0.0...v3.3.0)

Updates `baptiste0928/cargo-install` from 2 to 3
- [Release notes](https://github.com/baptiste0928/cargo-install/releases)
- [Changelog](https://github.com/baptiste0928/cargo-install/blob/main/CHANGELOG.md)
- [Commits](https://github.com/baptiste0928/cargo-install/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: baptiste0928/cargo-install
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 18:06:56 +01:00
gnuxie 8e9009b4bc Update to MPS 0.14.0.
Fixes https://github.com/the-draupnir-project/Draupnir/issues/324
Fixes https://github.com/the-draupnir-project/Draupnir/issues/325
2024-04-08 23:34:43 +01:00
gnuxie ab8b3786df Update to MPS v0.13.0
This fixes a bug where we use the wrong schema for `org.matrix.mjolnir.protected_rooms`.
2024-04-06 23:22:34 +01:00
gnuxie 97b3a2389d update readme and contributing. 2024-04-06 21:13:22 +01:00
Gnuxie 6949364ca8 Merge pull request #221 from the-draupnir-project/gnuxie/matrix-protection-suite-raw
#### This is a rewrite of the core functionality of Draupnir

This has been done with a library called the [matrix-protection-suite](https://github.com/Gnuxie/matrix-protection-suite) that Draupnir now depends upon. The protection suite provides a plugin system that allows all of Draupnir's functionality to be implemented as protections, that can be disabled/enabled and configured individually as distinct modules. The protection suite also introduces capability interfaces and capability providers which allow the user to modify what each individual protection can do without needing to change modify the protection's code.

https://github.com/the-draupnir-project/Draupnir/pull/221
2024-04-06 20:20:01 +01:00
gnuxie 971b4edf38 Update for MPS v0.12.1
This fixes a race condition causing a nasty bug in the room state revision issuer
that was also causing an intermitent test failure.
2024-04-06 20:03:38 +01:00
gnuxie 1ff59481be Catch all bans in BanPropagationProtection so we can detect edits. 2024-04-06 20:03:38 +01:00
gnuxie 21e640e9bf Improve readability of redaction synchronisation protection. 2024-04-06 20:03:38 +01:00
gnuxie 80ccb64330 Implement RoomStateBackingStore with BetterSqlite. 2024-04-06 20:03:38 +01:00
gnuxie 4d50b1be15 Add better-sqlite3 so we can use the room state backing store. 2024-04-06 20:03:38 +01:00
gnuxie c23b284821 Update for MPS 0.12.0 2024-04-06 20:03:38 +01:00
gnuxie 2392791444 Add RedactionSynchronisation protection. 2024-04-06 20:03:38 +01:00
gnuxie 45a2429eac Update MPS dependencies to fix banpropagation bugs. 2024-04-06 20:03:37 +01:00
gnuxie 6957b3e404 Fix eslint (i don't think this was ever working :/) 2024-04-06 20:03:37 +01:00
gnuxie 326d95df67 fix listUnstarted appservice integration test. 2024-04-06 20:03:37 +01:00
gnuxie 4a8962b371 Fix draupnirMXID creation from mjolnir record. 2024-04-06 20:03:37 +01:00
gnuxie ad01b09773 Fix appservice provisioning. 2024-04-06 20:03:37 +01:00
gnuxie 0b658fb5d0 fix roomsTests.ts 2024-04-06 20:03:37 +01:00
gnuxie 9a47ec3204 fix redactCommandTest. 2024-04-06 20:03:37 +01:00
gnuxie 02d9712e12 remove standardConsequenceTest
superseded with capability providers in MPS.
We forgot to remove the test.
2024-04-06 20:03:37 +01:00
gnuxie 704e9b94c3 remove roomMembersTest
this is superseded by `SetMembership` from MPS.
we forgot to remove the test.
2024-04-06 20:03:37 +01:00
gnuxie ae93e9c8d4 remove protectionSettingsTest
they now belong in MPS.
2024-04-06 20:03:37 +01:00
gnuxie 0613447e07 Remove banListTest
farewell old friend.
2024-04-06 20:03:37 +01:00
gnuxie 565df8b362 Delete protectedRoomsConfigTest.ts
We just don't have a way to test this right now without changing
a bunch of code. Which we would basically want to do to rewrite
the testing harness anyhow, so it's not worth it right now.
2024-04-06 20:03:37 +01:00
gnuxie c438eca08c Fix commandUtils
Alright, they're not using the safe emitter, but neither are the
consumers.
2024-04-06 20:03:37 +01:00
gnuxie 1d0c57cea8 fix throttleQueueTest 2024-04-06 20:03:37 +01:00
gnuxie c9db033043 fix utilsTest.ts 2024-04-06 20:03:37 +01:00
gnuxie 979bef6013 Revert "Attempt make draupnirFactory accessible to integration tests"
This reverts commit 68ca69882bd7627414951aef11985408fd29dec8.
2024-04-06 20:03:37 +01:00
gnuxie 6d52137501 Attempt make draupnirFactory accessible to integration tests
But this won't work as we'd have to mess about a lot with
the clientsinroommap
2024-04-06 20:03:37 +01:00
gnuxie 6ff8c52aca Remove detectFederationLagTest
idk this one might come back some time but we don't have the protection
and associated command anymore.
2024-04-06 20:03:37 +01:00
gnuxie c3cfad93e7 Fix shutdown room command test. 2024-04-06 20:03:37 +01:00
gnuxie 40ffa2a114 Fix hijack room command test. 2024-04-06 20:03:37 +01:00
gnuxie 692bc298e1 Add 'done' from mocha test context to draupnir test context. 2024-04-06 20:03:37 +01:00
gnuxie 0cb0beecb0 Tidy up helloTest slightly. 2024-04-06 20:03:37 +01:00
gnuxie 96428d617d Fix CommandReaderTest.ts. 2024-04-06 20:03:37 +01:00
gnuxie 7a10ec4a1d Use NPM for MPS depeendencies rather than git. 2024-04-06 20:03:36 +01:00
gnuxie 14e6dc8457 Remove suprious method from DraupnirManager
The ClientsInRoomsMap is updated in the appservice event handler anyhow.
2024-04-06 20:03:36 +01:00
gnuxie d1c13d63dd MPS updates.
See https://github.com/Gnuxie/matrix-protection-suite-for-matrix-bot-sdk/commit/058f3a07f3ed07ea75b048368c11c7a92e3c248a
2024-04-06 20:03:36 +01:00
gnuxie 16b8b5b07a Remove displayname from command handler prefixes.
It's unclear to me how to reliably implement this, so i have
removed it for now.
The problem is setting up code to watch for changes to the
displyname in the management room.
2024-04-06 20:03:36 +01:00
gnuxie 7c6c0bf189 Introduce MPS RoomSetResult to capability renderers. 2024-04-06 20:03:36 +01:00
gnuxie b145790b16 Add capabilityMessageRender to Draupnir class. 2024-04-06 20:03:36 +01:00
gnuxie fcc22dac5c capablity renderer stuff that didn't get committed 2024-04-06 20:03:36 +01:00
gnuxie 6b9162bc9d Capability renderers and glue. 2024-04-06 20:03:36 +01:00
gnuxie c1bfcf610e Begin moving from ConsequenceProvider to CapabilityProviderSet.
We gotta sort out the glue and the renderering yet.
2024-04-06 20:03:36 +01:00
gnuxie 41db3392df Stop throwing in Draupnir['makeDraupnirBot'] 2024-04-06 20:03:36 +01:00
gnuxie 8044a78fa6 Fix reportPollerTest (it works!) 2024-04-06 20:03:36 +01:00
gnuxie 2198c34b55 Chore: please typescript in abuseReportTest. 2024-04-06 20:03:36 +01:00
gnuxie 28d220142e Chore: Delete random crap that was accidentally comitted sometime 2024-04-06 20:03:36 +01:00