1320 Commits

Author SHA1 Message Date
Catalan Lover
b4d105f915 Implement Branch in Status Command (#1057)
Some checks failed
GHCR - Development Branches / ghcr-publish (push) Failing after 32s
Docker Hub - Develop / docker-latest (push) Failing after 34s
Tests / Application Service Integration tests (push) Failing after 13m52s
Tests / Integration tests (push) Failing after 13m54s
Tests / Unit tests (push) Failing after 13m57s
Tests / Build & Lint (push) Failing after 13m59s
* Implement Branch in Status Command

So now that we have dev branch containers and Cat checked Gnuxies Bot ye Huston we have a problem ala #1056.
2026-03-25 20:49:01 +00:00
Catalan Lover
9902993b6c Implement Caching for the CI (#1055)
Some checks failed
GHCR - Development Branches / ghcr-publish (push) Failing after 39s
Docker Hub - Develop / docker-latest (push) Failing after 40s
Tests / Application Service Integration tests (push) Failing after 13m52s
Tests / Integration tests (push) Failing after 13m54s
Tests / Unit tests (push) Failing after 13m57s
Tests / Build & Lint (push) Failing after 13m59s
* Update Dockerignore

Updates dockerignore to protect against cache contamination so we can more effectively utilise the full potential of our Cache system.

* Implement Caching strategy support in dockerfile

* Implement Caching for CI to massively speed up warm builds

* Fix Wildcard funkyness breaking docker builds.

* Fix FROM AS style guideline violations

There's a style guideline that says you shouldn't mix the case of FROM and AS in a FROM AS statement. So we fix this violation in this commit.

You can also force it all to lowercase but considering all our other keywords are uppercase why not go uppercase only for consistency.
2026-03-25 16:18:18 +00:00
Gnuxie
dcb2659ba8 Throw if --draupnir-config option not provided. (#1054)
Some checks failed
Docker Hub - Develop / docker-latest (push) Failing after 33s
GHCR - Development Branches / ghcr-publish (push) Failing after 33s
Tests / Application Service Integration tests (push) Failing after 12s
Tests / Build & Lint (push) Failing after 6m5s
Tests / Integration tests (push) Failing after 24s
Tests / Unit tests (push) Successful in 7m15s
We still support --mjolnir-config.

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

This functionality was deprecated in
https://github.com/the-draupnir-project/Draupnir/releases/tag/v2.0.0-beta.8.

https://github.com/the-draupnir-project/planning/issues/105
2026-03-20 16:30:57 +00:00
Gnuxie
82fe093ef3 Upgrade matrix-apservice-bridge base stack to node24. (#1052)
https://github.com/the-draupnir-project/planning/issues/104

I don't know what the fuck they are doing with the typings in the
vector bot-sdk repository but whatever.

https://github.com/the-draupnir-project/Draupnir/issues/1053
2026-03-20 15:54:21 +00:00
Gnuxie
1fa5a1ed97 Add changesets to manage changes. (#1051)
Some checks failed
Tests / Build & Lint (push) Failing after 5m44s
GHCR - Development Branches / ghcr-publish (push) Failing after 1m2s
Tests / Integration tests (push) Failing after 20s
Tests / Application Service Integration tests (push) Failing after 13s
Tests / Unit tests (push) Successful in 6m48s
Docker Hub - Develop / docker-latest (push) Failing after 1m4s
We're going to try using https://github.com/changesets/changesets to manage our apps/packages changelogs. This won't effect the CHANGELOG.md in the project root, which we will probably still write manually.

The main reason we want this is because it becomes a pain in the ass tracking what sorts of changes have been made over time between package releases. And as package releases will no longer happen for changes to merge onto main (like they had to before), unreleased changes are going to be a lot more common.
2026-03-19 17:44:20 +00:00
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
renovate[bot]
1372c17db9 Update docker/setup-qemu-action action to v4 (#1038)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 12:34:04 +01:00
Catalan Lover
f88a3ad504 Update CI Depenency Versions (#1035)
* Update actions/checkout action to v6

* Update actions/github-script action to v8

* Update actions/setup-node action to v6

* Update docker/build-push-action action to v7

* Update docker/login-action action to v4

* Update docker/metadata-action action to v6

* Update docker/setup-buildx-action action to v4

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 12:28:14 +01:00
Catalan Lover
470e00b178 Update Precommit hooks. (#1034)
* Update pre-commit hook editorconfig-checker/editorconfig-checker.python to v3.6.1

* Update pre-commit hook python-jsonschema/check-jsonschema to v0.37.0

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-14 12:28:00 +01:00
Catalan Lover
fc09fb2904 Finish Attested Docker Images Ambitions (#1029) 2026-03-13 20:38:05 +01:00
Catalan Lover
4344be93e8 Upgrade CI to publish to ghcr.io and Dockerhub (#901)
* GHCR Separate Workflows

* GHCR Standalone Publishing Refinements

* Docker Hub Publishing Refinements

* Add Development Build Artefact Generation and Publishing

This only runs against non Excluded branches as to be practical.

* Fix GHCR Deployment due to Uppercase Names and Main Branch Exclusion

* Fix Github ignoring Branch filters for Develop Workflow

* Harmonise Development Artifact Workflows

* Improve Docker Hub Development Artefact Metadata
2026-03-13 15:25:21 +01:00
gnuxie
7ef871d3c7 v2.9.0 v2.9.0 2025-12-18 12:57:34 +00:00
Gnuxie
1221eb2eed Enable the capability set provider migration for ServerBanSync (#1016) 2025-12-16 13:00:12 +00:00
Gnuxie
e39642a19d Use the capability name and not the interface name in capability provider set. (#1015)
The keys on the capability provider set are arbritrary property names
set by the protection, not the interface names as there can be
multiple capabilities that share the same interface.
2025-12-12 14:14:25 +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 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
renovate[bot]
e64c43698d Update dependency js-yaml to v4.1.1 [SECURITY] (#1005)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-15 17:50:20 +00:00
Gnuxie
492f6816ed Add value proposition to readme. (#996)
https://docs.oscollective.org/resources/resources/companies-and-trust
2025-11-13 13:29:20 +00:00
Gnuxie
8def00c2ed fix spurious error log line regarding room takedowns when the room ha… (#995)
* fix spurious error log line regarding room takedowns when the room has already been taken down.

This is normal, and while generally the bot shouldn't attempt to take down the same rooms which succeeded in the past, there's no way of knowing that the room hasn't
been unblocked by the synapse admin API while draupnir was offline.
Because there's no endpoint to get only the blocked rooms, we have to attempt to block them all again, but what we can do is lower that from critical severity to debug, since it's not actually a fatal error at all.

* prettier

---------

Co-authored-by: esoteric_programmer <nomail@no.email>
2025-11-07 12:28:28 +00:00
Gnuxie
0c448ab85e Announce the first cycle review and second cycle selection. (#984)
What the notice looks like:

<img width="760" height="228" alt="image" src="https://github.com/user-attachments/assets/3c1df304-24f4-40cc-9109-4d3398d58fc3" />

Element web was used to send the message

raw markdown:

```
#### 📰 Draupnir Assembly: Call for Participation

The Longhouse Assembly is discussing the next direction of the project.

If you value what the Draupnir project does for your community, then we really want to hear from you:

- ➡️ [Read about the current longhouse cycle](https://the-draupnir-project.github.io/draupnir-documentation/governance/reports/2510A-cycle-review)
- ➡️ [Read about the pathways going forward](https://the-draupnir-project.github.io/draupnir-documentation/governance/reports/2510A-selection)
- ➡️ [Cast your vote](https://cryptpad.fr/form/#/2/form/view/ewtgdO-YIwCjLhfJpwsj87m7RU7v6hJKHbu3BWqa1kg/)
- ➡️ [Join the Assembly Discussion](https://matrix.to/#/!UMROhYUQcvtGuoIIka:matrix.org/%247C2Sv-B-6HJ7fVMlCRd3R9jlZqe2rUxlPliEaB-M4yE?via=matrix.org&via=feline.support&via=asgard.chat)
```
2025-10-28 14:36:37 +00:00
Gnuxie
9ceab2a2fc Merge pull request #988 from the-draupnir-project/gnuxie/tests-being-weird
Fix test failures on main innit

Closes https://github.com/the-draupnir-project/Draupnir/issues/985.
We're solving this problem structurally by introducing a `Lifetime` primitive for resource management. https://github.com/the-draupnir-project/planning/issues/79.
2025-10-28 13:16:10 +00:00
gnuxie
3945cf8b51 Fix ancient racey code in shutdown command test. 2025-10-28 13:09:49 +00:00
gnuxie
61d5884c44 Update to MPS 5.0.0 for lifetimes. 2025-10-28 12:57:50 +00:00
gnuxie
6272da337b Plumb lifetimes into all protections.
https://github.com/the-draupnir-project/planning/issues/80

Lifetimes make it impossible to forget to link up various
destructor/finalizer methods, and makes it impossible to forget to run
them. It's a good structural solution to the problem we keep having.

We haven't updated protections to use them properly yet, ie allocate
things against the lifetime, but for now the protections themeselves
are allocated against the lifetime.
2025-10-28 12:46:08 +00:00
gnuxie
cb86d6d0cd v2.7.1 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
b240282651 Re-add the alias add command to Draupnir. (#980)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/970.
2025-10-13 14:09:12 +01:00
gnuxie
61a0210cd1 v2.7.0 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
b16f238e5c Merge pull request #973 from the-draupnir-project/gnuxie/draupnir-news-cleanup
1. Enable news by default
2. Make sure we copy the news json file into the build output (fixes https://github.com/the-draupnir-project/Draupnir/issues/972)

https://github.com/the-draupnir-project/planning/issues/60
2025-10-10 12:17:03 +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
b365ac9244 Make sure that we only store seen news when there is unseen news.
https://github.com/the-draupnir-project/planning/issues/60
2025-10-10 11:47:14 +01:00
gnuxie
da78010afb Enable DraupnirNews by default.
https://github.com/the-draupnir-project/planning/issues/60.
2025-10-10 10:22:06 +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
dependabot[bot]
fb14cea361 Bump tar-fs from 2.1.3 to 2.1.4 (#950)
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.3 to 2.1.4.
- [Commits](https://github.com/mafintosh/tar-fs/compare/v2.1.3...v2.1.4)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-29 23:01:52 +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
3e246ecdb6 Fix rooms command integration test. (#958)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/957.
2025-09-29 20:13:12 +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 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
b05e24e78d Add seperate room for policy change notification protection. (#933)
This reverts commit 3d138d96df but we
also modified it to make it stil work.
2025-08-13 11:26:59 +01:00
gnuxie
d77f494a65 v2.6.0 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
837a0d4fa7 Protect replacement rooms on tombstone. (#925)
Part of https://github.com/the-draupnir-project/planning/issues/46.
2025-08-12 15:42:40 +01:00
Gnuxie
44a6684e28 Fix flakey BlockInvitationsOnServer test case. (#931)
Wait for the new takedown policy to come down `/sync` before testing
the protection can block the takendown user.

There doesn't seem to be a way conceptually to avoid this. I would not
be comfortable with injecting a fake event into the model and we'd
probably have a nightmare creating that concept.

See https://github.com/the-draupnir-project/Draupnir/pull/930#issuecomment-3179386744.
2025-08-12 15:36:02 +01:00
Gnuxie
613059d789 Make room discovery a synchronous part of the takedown command. (#930)
Discovery was happening asynchronously in the takedown command as a
background task that was triggered by the command.  When a room is
used in the takedown command, we do inform Draupnir's room discovery,
but it happens as a background task.  Maybe it should not be a
background task though, not to fail the command when the informing
fails, but to make sure the command is blocked on all side effects
happening and then we don't have to write timeouts in tests,
which are probably still flakey.
2025-08-12 14:31:57 +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