40 Commits

Author SHA1 Message Date
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
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
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
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
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
gnuxie
bdf0ed0bcc Re-add the unit test CI step.
This reverts commit 0854aec780.
But also we edit it so that the command is correct again.
2024-09-09 13:28:16 +01:00
gnuxie
0854aec780 Temporarily disable unit tests because...
We moved these tests to @the-draupnir-project/interface-manager.

We will get some more unit tests shortly...
2024-09-06 17:18:53 +01:00
Gnuxie
337a6a3b76 Add reuse.software (#486)
We have a lot of verbose headers, and i think now is the best opportunity we have to become reuse compliant given that we just did two other similar maintenance changes (prettier, typescirpt5 & eslint9 & typescript-eslint).

* synapse_antispam resuse headers.

* delete old unused tslint.json.

* Add REUSE to pre-commit config.

* reuse info for config directory.
2024-07-25 10:58:40 +01:00
Marcel
87222588f9 Remove the attest step until we figure out how it is meant to work (#479)
* Remove the attest step until we figure out how it is meant to work

* Fix end of files
2024-07-19 09:53:56 +01:00
Marcel
d334912706 Ensure that we use the correct docker registry (#478)
This is stated at 456d685447/README.md (L187-L188) but I missed it.
2024-07-18 10:01:46 +01:00
Marcel
337d7c72a6 Add SBOM and Attestation to the Docker release process (#477)
* feat: Add SBOM and Attestation to the Docker release process. Also ensure we only deploy platforms on the qemu action as needed and update versions.

This also limits the permissions used

* fix: Make sure there is an empty line at the end of the file

* Fix the qemu platforms
2024-07-18 09:44:56 +01:00
Aminda Suomalainen ⚧
8587280cdc [Yarn Classic] Enable corepack & fix pre-commit run --all-files (#472)
* Setup Yarn Classic through Corepack

* pre-commit: use corepack and silence warnings, add .eslintignore's

* .github/workflows/mjolnir.yml: use yarn through corepack

* mx-tester.yml: use corepack

* mx-tester.yml & package.json: replace references to npx and call corepack more

At least yarn build didn't break locally for me, so I think it's supported here too

* rm & gitignore .yarnrc

* mx-tester.yml & package.json: return to npx since yarn dlx doesn't exist in classic
2024-07-04 11:22:33 +01:00
dependabot[bot]
27e058711e Bump actions/github-script from 6 to 7 in the github-actions group (#398)
Bumps the github-actions group with 1 update: [actions/github-script](https://github.com/actions/github-script).


Updates `actions/github-script` from 6 to 7
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  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-05-29 14:56:23 +01:00
gnuxie
7d4009cf1a Update documentation links for new base url.
Context is that we had `docs` as part of the base URL, fixed in https://github.com/the-draupnir-project/draupnir-documentation/pull/13.
2024-05-24 15:40:16 +01:00
Catalan Lover
bbea4155ea Add Signoff CI to Enforce Signoff requirement. (#395)
* Add Signoff CI to Enforce Signoff requirement.

* Integrate Changes to Signoff CI from Docs Repo Version
2024-05-05 14:49:56 +01:00
Gnuxie
198b65e96e Protect latest from pre-releases (#336)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/318
2024-04-12 19:18:42 +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
dependabot[bot]
4f806dbd95 Bump the github-actions group with 1 update (#162)
Bumps the github-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).

- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  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-01-15 14:56:44 +00:00
dependabot[bot]
9f04502774 Bump the github-actions group with 4 updates (#125)
Bumps the github-actions group with 4 updates: [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/login-action](https://github.com/docker/login-action) and [docker/build-push-action](https://github.com/docker/build-push-action).


Updates `docker/setup-qemu-action` from 2.2.0 to 3.0.0
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2.2.0...v3.0.0)

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

Updates `docker/login-action` from 2 to 3
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

Updates `docker/build-push-action` from 4 to 5
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: docker/build-push-action
  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>
2023-09-19 14:29:18 +01:00
dependabot[bot]
2330ddc719 Bump the everything group with 4 updates (#115)
Bumps the everything group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/login-action](https://github.com/docker/login-action) and [baptiste0928/cargo-install](https://github.com/baptiste0928/cargo-install).


Updates `actions/checkout` from 2 to 4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

Updates `docker/setup-buildx-action` from 2.6.0 to 2.10.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.6.0...v2.10.0)

Updates `docker/login-action` from 1 to 2
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

Updates `baptiste0928/cargo-install` from 1 to 2
- [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/v1...v2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 14:44:16 +01:00
Marcel
8894e29606 Multiarch CI fixes (#59)
* Also build arm images

* Increase docker timeout for qemu and install missing parts in CI for multiplatform building
2023-06-12 23:34:38 +01:00
Marcel
b3f0c6e222 Also build arm images (#58)
Based on https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/
https://github.com/docker/build-push-action and https://docs.docker.com/engine/reference/commandline/buildx_build/#platform
2023-06-12 15:09:00 +01:00
gnuxie
c14fbeb183 Update github actions workflows to use node 18. 2023-05-10 20:10:13 +01:00
gnuxie
a0ffb0d315 Github release action won't sync tags with remote. 2023-03-14 12:53:04 +00:00
gnuxie
0620bb1db7 Tag information missing when creating version.txt in CI. 2023-02-20 20:10:54 +00:00
gnuxie
acc7b59a33 Github actions should generate version.txt. 2023-02-11 15:59:50 +00:00
gnuxie
b7139b398c Move version.txt to project top level. 2023-02-11 14:20:46 +00:00
gnuxie
cbddf71ebe Include version information in !draupnir status. 2023-02-11 14:20:46 +00:00
Gnuxie
bb125b3828 Dockerhub gnuxie/draupnir (#2)
Change old matrix.org/mjolnir references in github actions.
2023-01-14 22:43:39 +00:00
David Teller
38c5714027 CI: Scheduling daily builds (#426) 2022-11-29 15:02:58 +01:00
Jess Porter
50f80f2392 manymjolnir appservice (#364)
Mjolnir can now be run as an application service,
meaning it will host multiple independent mjolnirs that can be requested by users.
If the user is on the same homeserver as the appservice is deployed on,
then they can provision a mjolnir via a widget https://github.com/matrix-org/mjolnir-widget.
Otherwise they can invite the appservice bot to a room they want to protect.
This will create them a mjolnir, a management room and a policy list.

The appservice shares the same docker image as the bot,
but is started slightly differently by specifying "appservice"
as the first argument to docker run (this s managed by `mjolnir-entrypoint.sh`. 
We could have used another Dockerfile for the appservice,
extending the existing one but we decided not to because there
would have been lots of fiddling around the entrypoint
and logistics involved around adding a tag for it via github actions.
Not to mention that this would be duplicating the image
just to run it with a different binary.

A list of followup issues can be found here https://github.com/issues?q=is%3Aopen+is%3Aissue+author%3AGnuxie+archived%3Afalse+label%3AA-Appservice.

Somewhat relevant and squashed commit messages(regrettably squashing because frankly these won't make sense in isolation): 

* draft widget backend

* add `managementRoomId` to `provisionNewMjolnir`

* remove ratelimits from appservice mjolnirs

* add /join endpoint to api backend


* tighter guard around room type in PolicyList

matrix-bot-sdk imporved the types for this

* enable esModuleInterop

* launch and use postgres in a container whilst using mx-tester


* limited access control

policy list used for access control

* Redesign initialization API of many mjolnir.

It's much harder to forget to initialize the components now that you have to in order to construct them in the first place.


* Ammend config not to clash with existing CI

this means that the appsrvice bot is now called 'mjolnir-bot' by default
which was easier than going through old code base and renaming


* Change entrypoint in Dockerfile so that we can start the appservice.

We could have used another Dockerfile for the appservice,
extending the exising one but we decided not to because there
would have been lots of fiddling around the entrypoint
and logistics involved around adding a tag for it via github actions.
Not to mention that this would be duplicating the image
just to run it with a different binary.

This solution is much simpler, backwards compatible, and conscious about the future.


Co-authored-by: gnuxie <gnuxie@element.io>
2022-11-15 18:03:06 +00:00
David Teller
28265cec2e CI: Let's try and cache mx-tester installs (#383) 2022-10-10 17:17:22 +02:00
Gnuxie
84ffb36494 Bump minimum node version to 16. (#316)
* Bump minimum node version to 16.

We already made the mistake of using features from 16 without realising
Previously: https://github.com/matrix-org/mjolnir/pull/192

* Make sure CI uses specific version of node and we also lint.

https://github.com/matrix-org/pipelines/blob/master/mjolnir/pipeline.yml#L13
2022-07-06 14:50:33 +01:00
Gnuxie
65f52fef3a Timeout integration tests CI after 1 hour. (#317) 2022-07-06 14:21:33 +01:00
Gnuxie
fb7167773b Use github workflows to push dockerhub images+tags. (#265) 2022-03-28 15:25:31 +01:00
David Teller
a21415a04c Give the ability to moderators to react quickly to /report abuse reports. (#137) 2021-11-09 13:15:49 +01:00