* 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.
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.
* 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.
* 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
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.
* 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>
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.
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.
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.
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.
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.
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.
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.