Commit Graph

273 Commits

Author SHA1 Message Date
Gnuxie 879e822332 Monoreponir (#1046)
* Move src to apps/draupnir/src

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

* Move package.json

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

* Add matrix-basic-types to monorepo.

Get everything working including linting and prettier :3

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

* Add interface-manager to monorepo.

This was a bitch because apparently we forgot to delete node_modules
before creating the workspace package.json. So it had linked a bunch
of local stuff like was in node_modules for Draupnir...

Anyways i think we're still on track.

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

* idk why there are prettier changes in apps but there are.

* Add matrix-protection-suite to monorepo.

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

* Add matrix-protection-suite-for-matrix-bot-sdk

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

We will need to add the real upstreams and versions and remove the
file links as we publish the packages.

* Move mps-interface-adaptor into monorepo

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

Wohoo, i think only draupnir is left now?

* Move Draupnir test files to draupnir directory smh smh smh.

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

* Fix typescript config for tests and eslint.

Now we get proper linting and type checking of tests.

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

* WIP Integrating draupnir into monorepo tooling...

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

We need to stop aliasing bot-sdk but we should first check that
upstream is using a consistent name too.

* Remove matrix-bot-sdk alias for vector fork.

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

* Add top command description type and weave through API.

A more recent version of typescript meant that the exectutor's
contravariance got checked which destroyed the API so we had to make a
top type for command descriptions and parametrise some of the API.

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

* Fix typescript errors related to class property initialisation changes.

https://www.typescriptlang.org/tsconfig/#useDefineForClassFields

Seems like they were using defineProperty before which meant
properites were initialised after the constructor ran.

Honestly i like that more but we're going to stick with what they
intend to be the default.

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

* Fix tests lacking fixtures context.

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

* Fix typescript errors related to error destructuring in tests.

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

* Pin postgres package to workaround upstream issue

https://github.com/porsager/postgres/issues/1150
Documented in DEPENDENCIES.md

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

* Fix contravariance issue in hash store helper.

Part of the TS 5.9 upgrade fallout.
https://github.com/the-draupnir-project/planning/issues/100

* Fix minor typescript 5.9 migration issuess

All typescript errors finished, yay.

* Fix REUSE missing headers.

* Fix assets script in draupnir app.

* Add Draupnir to eslint scope

* Remove the appservice web API.

There are too many eslint errors here to do with unsafe parsing of
properties from the body etc. And there's actually no consumers to
this API. It's also a widget API, and all it does is provision the bot
and nothing more.

* Fix eslint config for DeadDocumentJSX.

It wasn't working well with the jsx templates.
We should probably delete the tsconfig.eslint.json shite now.

* Update src/utils.ts for eslint.

This shit is legacy i hate it.

* Fix eslint errors in config.

Really this is paint over rot since the config doesn't have a schema,
and we can't really make one either.

* Fix eslint issues in ReportManager.

This code is diabolical. It hasn't really been fixed that will take
refactoring and making sure people don't write this sorts of bad code
ever again. Which thankfully we have process in place for.

* Fix clientHelper eslint issues.

* Fix eslint for ImportCommand.

* Grinding eslint fml.

* Fix miscellaneous eslint issues.

* allow no-deprecate for logMessage.

shit's being annoying.

* Fix remaining eslint issues...

We also deleted one of the scripts used to evaluate the performance of
various endpoints, which we were not using.

* Give bot toggle asyncDispose for code consistency.

* Fix package.json access issues.

* Adjust Docker and CI for new app location in monorepo.

* Fix broken integration tests.

* Remove prepare script from matrix-protection-suite package.

Isn't needed anymore


* Fix build:all script missing base files.

* Remove test script from matrix-protection-suite-for-matrix-bot-sdk

It doesn't have any tests :/

* Order of setup is wrong in integration test workflows.

* Fix mps interface adaptor doesn't have any tests.

* Fix appservice registration for test harness.

* Fix matrix-basic-types jest configuration

* Fix no build step in mjolnir.yaml

* Transfer common dev dependencies to the workspace root.


They were just wrong.
2026-03-19 16:13:14 +00:00
gnuxie 7ef871d3c7 v2.9.0 2025-12-18 12:57:34 +00:00
Gnuxie 785f4df264 Improve ServerBanSyrnchronisationProtection (#1014)
* Update ServerBanSynchronisationCapabilityRenderer.

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

* Add migration for old server ban sync capabilities.

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

* Test migration of serverConsequences capability provider set.

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

* Update MPS for new ServerBanSychrnosation protection.

- Only render results of changes when the ACL capability when the `m.room.server_acl` failed to send.
- Only apply ACL once every 15seconds
- Migrate `serverConsequences` from MPS to server ban synchronisation specific capability provider.
2025-12-12 13:21:17 +00:00
gnuxie 81301f2188 v2.8.0 2025-11-23 12:45:44 +00:00
Gnuxie 5b134493a8 Add preview to watch command. (#1007)
https://github.com/the-draupnir-project/planning/issues/2
2025-11-22 21:52:16 +00:00
gnuxie 61d5884c44 Update to MPS 5.0.0 for lifetimes. 2025-10-28 12:57:50 +00:00
gnuxie cb86d6d0cd v2.7.1 2025-10-13 15:24:34 +01:00
Gnuxie a3f9f1af8d Dependency updates for bug fixes (#981)
* Update to MPS4BotSDK v4.0.2

- Marks v12 policy rooms as editable.
- Ensures paginators for /messages and /relations are returning ResultError.

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

* Update mps-interface-adaptor.

This should improve logging for
https://github.com/the-draupnir-project/Draupnir/issues/976.  Done
under https://github.com/the-draupnir-project/planning/issues/64.
2025-10-13 14:13:44 +01:00
gnuxie 61a0210cd1 v2.7.0 2025-10-10 13:07:24 +01:00
Gnuxie 80c3570bce Update to MPS4BotSDK 4.0. (#975)
Fixes a bug with messages pagination.
2025-10-10 12:28:24 +01:00
gnuxie 2cd0d24b6b Update to MPS v4.1.0 to fix protections looping on self changes.
https://github.com/the-draupnir-project/Draupnir/issues/963
https://github.com/the-draupnir-project/planning/issues/60
2025-10-10 12:11:07 +01:00
gnuxie ba4ca1479d Copy json news file to build output x3
https://github.com/the-draupnir-project/Draupnir/issues/972.

Sorry everypony. We didn't want to use JSON Modules because that
sounds weird and this seems like a safer bet for now.
2025-10-10 10:15:31 +01:00
Gnuxie b73cfd7907 Draupnir news system (#965)
* Add infrastructure for testing Draupnir news.

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

* Update protections for new PermalinkSchema.

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

* Add a way to announce Draupnir longhouse assemblies.

This is kind of stupid though we should have just made a generic news
system that deals with actual events pulled from the static blog
and just sent into the room...

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

* Update news to just use a blob in the repository.

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

* Simplify seen news mechanism.

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

* Cut some dependencies out of DraupnirNews for unit testing.

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

* Rename the longhouse assembly thing to be a generic news reader.

It was already changed to be generic we just forogt the name.
https://github.com/the-draupnir-project/planning/issues/58.

* Improve code quality of DraupnirNews.

No way is this being tested without being a lot neater.  The problem
is that any test was going to be too coupled to implementation due to
the shared responsibilities of the old class.

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

* Add DraupnirNews unit test.

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

* Allow filesystem news to show when remote news fails to fetch.

Discovery from https://github.com/the-draupnir-project/planning/issues/58.

* Add a comment about how news gets cleaned up.
2025-10-09 16:49:53 +01:00
Gnuxie 2f6f945876 Prompt to watch policy rooms on replacement (#955)
Part of https://github.com/the-draupnir-project/planning/issues/48

* Wire up prompt listener to prompt meow!

* Show differences in powered users and creators between rooms.

Upgraded policy rooms.

* Scan for replaced policy rooms on protection enable.

* Report errors with replacement process to management room.

* Comment clarity.

* Update MPS and MPS-for-interface-adaptor to support PR.

* Note about why we want to prompt on upgrade.
2025-09-29 20:19:24 +01:00
Gnuxie 8326d7fe0f Add TimelineRedactionQueue. (#949)
This just batches the redactions going on within a single room to the
same `/messages` request. And blocks the next request for that room
from happening until the current request has completed.

This is necessary because `/messages` pagination is really heavy on
homeservers as it can force them to backfill.

There is also some really strange bug in Synapse that is triggered by
Draupnir's behaviour
https://github.com/element-hq/synapse/issues/18829.
2025-09-25 15:56:35 +01:00
gnuxie f1dad52288 v2.6.1 2025-08-14 19:20:06 +01:00
Gnuxie 73c2bc72e4 Conceputalise prividlidged creators and update MPS with changes to permissions calculation. (#937)
https://github.com/the-draupnir-project/planning/issues/44
* Use `RoomVersionMirror` to determine prividlidged creators.

On policy room creation.

* Update MPS for prividlidged creators conception.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/935.
Fixes https://github.com/the-draupnir-project/Draupnir/issues/934.
2025-08-14 18:07:28 +01:00
Gnuxie 53947214c2 Fix policy room creation in V12 rooms. (#936)
It turns out that we got confused and thought we'd fixed policy room creation when we fixed management room creation.
Even though the PR description never claimed that. In any case it looks like we were not in a very present state of mind while making the change and managed to somehow rely on string comparison for room versions...

Follow up from: https://github.com/the-draupnir-project/Draupnir/pull/924

* Fix subtle bug with management room creation.

I don't really understand why I did this in the first place it was
stupid.  I think morbid curiosity won.

* Update MPS4bot-sdk for V12 policy room creation.

It turns out last time we fixed management room creation but not
policy room creation... and we didn't even do that properly.
2025-08-14 14:03:35 +01:00
gnuxie d77f494a65 v2.6.0 2025-08-12 19:37:21 +01:00
Gnuxie ead830cb79 Update interface-manager for V12 Room ID support in command parsing. (#932)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/928.
2025-08-12 18:19:59 +01:00
Gnuxie 69f21a11e7 fix Room Discovery protection cleanup (#929)
We have identified that the `RoomDiscovery` component of the `RoomTakedownProtection` and `BlockServersOnInviteProtection` doesn't cleanup properly once disabled. Because a deferred background task used to batch discovered rooms together wasn't being cancelled. We believe this is the cause for the issues described in #927 . Although it remains unclear why this violates the integrity of the hash store in subsequent test runs...

* Update to MPS 3.10.0 for cancellable batches.

* Cancel room discovery batch when protections are disabled.

Possible fix for https://github.com/the-draupnir-project/Draupnir/issues/927.
2025-08-12 14:02:49 +01:00
gnuxie 283a50d5e3 v2.5.1 2025-08-06 17:26:38 +01:00
Gnuxie dccb0e39b9 Fix appservice management room creation for room V12 (#924)
* Update MPS for client capability negotiation.

* Update appservice room creation for V12.
2025-08-06 17:17:05 +01:00
Gnuxie 1f8da29799 Attempt to allow Draupnir to use room V12. (#918)
- Updated to matrix-basic-types 1.4.0 which changes
  the regex validating room ids.

- Changed the package override so that all dependencies
  use matrix-basic-types 1.4.0, including the matrix-protection-suite.

- Removed code that tries to store details about discovered rooms in
  the room takdedown protection. These were unreliable for so many
  reasons and also are now broken given the room origin cannot be
  extracted from the room id. Details for why this is can be found in
  the reviews of
  matrix-org/matrix-spec-proposals#4291.
2025-07-16 20:35:22 +01:00
gnuxie 0618eee59b v2.5.0 2025-07-08 12:52:27 +01:00
gnuxie d1f8f445ae Update to MPS 3.7.1 for new mixin extraction API. 2025-06-24 11:46:25 +01:00
gnuxie e42ef157ff v2.4.1 2025-06-23 21:19:08 +01:00
Gnuxie e0f6050029 Fix compatibility of PersistentConfigData and PersistentConfigBackend. (#912)
This led to protections not instantiating with their defaults when
their config was requested. Infact, it meant that their configs were
not validated at all.

Fixes https://github.com/the-draupnir-project/Draupnir/issues/911.
2025-06-23 21:15:05 +01:00
gnuxie 548d304ba1 v2.4.0 2025-06-23 12:43:15 +01:00
Gnuxie 296bce0c8f Update MPS4bot-sdk again for room details schema. (#909)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/908.
2025-06-23 11:56:12 +01:00
Gnuxie 1cc6a9162b Consolidate Synpase admin room details schema. (#907)
Change comes from mps-for-bot-sdk. We're not trusting the room list
or the room details endpoint anymore.
2025-06-19 18:14:00 +01:00
Gnuxie f72c7fc0c8 Fix synapse room list parse errors. (#906)
Wasn't decoding join rules properly.
2025-06-18 11:15:31 +01:00
Gnuxie 026de3b9cb Account for creators missing in synapse room table. (#905)
This really and deeply sucks
https://github.com/element-hq/synapse/issues/18563.
2025-06-17 17:13:41 +01:00
gnuxie bb8baaa473 Rigidity wrt disposing stores and protections. 2025-06-17 12:27:03 +01:00
gnuxie c703dbb000 Update MPS for synapse admin room list and other goodies. 2025-06-17 12:27:03 +01:00
gnuxie 375d7ad916 Update to MPS 3.5.0 AND mps-interface-adaptor 0.4.1.
These are basically the dependencies to complete the make
mps-interface-adaptor extraction.
2025-06-03 18:25:29 +01:00
gnuxie ee76799ec9 v2.3.1 2025-05-29 20:07:03 +01:00
gnuxie 05d388da57 v2.3.0 2025-05-29 18:49:21 +01:00
gnuxie f25b1f1361 Update to MPS 3.4.0 for room senders / creators. 2025-05-29 15:11:51 +01:00
gnuxie 0d00380c50 Update MPS for async protection factories. 2025-05-26 23:29:49 +01:00
Catalan Lover ce926ed18f YEEET synapse_antispam (#866) 2025-05-23 01:24:21 +02:00
Gnuxie 5ad37c9b3c Update to MPS 3.1.2 for better ACL handling. (#856)
* Update to MPS 3.1.2 to help with ACL.

* Update ServerACLConsequencesRenderer for MPS update.
2025-05-20 15:17:36 +01:00
Gnuxie 3d9d8abc43 update to interface-manager 4.1.0 (#847)
Fixes a tonne of shite mare.
Importantly https://github.com/the-draupnir-project/Draupnir/issues/845.
And something @ll-SKY-ll mentioned in the draupnir room regarding the new MentionLimitProtection.

Added

- Quote syntax to quote strings.
- Boolean presentation type and translator to string.

Fixed

- Added a pathway to create negative integers.
2025-05-14 23:51:19 +01:00
gnuxie 656b8decb8 v2.3.0-beta.2 2025-04-14 18:36:42 +01:00
gnuxie 70a00e82e1 Update MPS4BotSDK to fix bugs in user redaction API. 2025-04-14 18:33:40 +01:00
gnuxie 720d703ca8 v2.3.0-beta.1 2025-04-14 16:30:44 +01:00
gnuxie 3e705c775f Update MPS. 2025-04-13 20:06:36 +01:00
gnuxie 44c93c3766 Update matrix-protection-suite-for-matrix-bot-sdk v3.1.1. 2025-03-29 20:15:30 +00:00
Gnuxie ff4f78ee65 RedactionSynchronisationProtection invite retraction (#788)
- The _Redaction Synchronisation Protection_ has been improved in a few ways:
  - Invitations in protected rooms will be rejected as part of the redaction
    process when they are sent from users being redacted (e.g. as a brigading
    tactic).
  - User redaction will now be triggered on bans and the reason will be scanned
    for `automaticallyRedactForReasons` from Draupnir's config.

* Update RedactionSynchronisation for new protection apis.

* Rerwrite redaction synchronisation protection

* Reject invitations on ban.

* Add renderer and simulated redaction synchornisation capability.

* Reduce dependencies of redaction synchronisation protection.

* Allow RedactionSynchronisation to be unit tested.

* Update to MPS 3.1.0.

---------

Signed-off-by: Rory& <root@rory.gay>
Co-authored-by: Rory& <root@rory.gay>
2025-03-28 17:48:57 +00:00
gnuxie d7df58101c v2.3.0-beta.0 2025-03-28 11:31:54 +00:00