Commit Graph

76 Commits

Author SHA1 Message Date
Catalan Lover 2a39b21d62 Prefer the initialManager option in default.yaml over managementRoom (#1122)
Docker Hub - Develop / docker-latest (push) Failing after 26s
GHCR - Development Branches / ghcr-publish (push) Failing after 25s
Tests / Build & Lint (push) Failing after 2m34s
Tests / Unit tests (push) Successful in 3m9s
Tests / Integration tests (push) Failing after 15s
Tests / Application Service Integration tests (push) Failing after 11s
* Move to use initial manager as default

* Add Changeset Entry

* Move mangement room options up in the default config

They are more important than the other bullshit

* Improve clarity of management room options in default.yaml

---------

Co-authored-by: gnuxie <Gnuxie@protonmail.com>
2026-05-07 14:56:13 +01:00
Catalan Lover e8e4696517 Update Configuration file wording for protected rooms and symbol prefix. (#1121)
Today i got reminded about that our config still thinks various wrong things like that the management room is excluded from protect all rooms when the management room is always protected.

So this PR fixes a few of these config errors.

* Update Configuration file wording.

* Add Changeset Entry
2026-05-07 11:09:16 +01:00
Catalan Lover 781d55db8b Zero Touch Provisioning Support Stage 1 (#1070)
Tests / Build & Lint (push) Failing after 2m41s
Tests / Unit tests (push) Successful in 2m58s
Tests / Integration tests (push) Failing after 21s
Tests / Application Service Integration tests (push) Failing after 11s
GHCR - Development Branches / ghcr-publish (push) Failing after 12m54s
Docker Hub - Develop / docker-latest (push) Failing after 13m51s
Starts us down the path of fixing https://github.com/the-draupnir-project/Draupnir/issues/1023

This PR gets us Zero Touch Provisioning support for AS mode and Bot mode. If your env can take usr and pswd and turn it into access tokens or however you want to do that then well we dont need to do PSWD Auth at all.

If you dont PSWD auth is useful for this and is probably what i will resort to in mdad for Zero Touch Provisioning.

Draft as this PR is very much not even mx-tested because mx-tester decided to say nope cat.

* Zero Touch Provisioning Support

* Update Account data keys to Gnuxie Suggested Values

Co-authored-by: Gnuxie <50846879+Gnuxie@users.noreply.github.com>

* Refine ZTD

Co-authored-by: Gnuxie <Gnuxie@users.noreply.github.com>

* Refine Config validation

* Run Prettier

* Fix Test Linting

* Refine ZTD Branch by removing leftover config values.

* Remove fallback management room value as it breaks ZTP

* Fix config validation having Truthy problems

* Fix dangling import.

* Fix config validation error.

* Revert "Fix config validation error."

This reverts commit c313dcbb52.

* Remove fake cast on config.initialManager

* note only available in develop while we fix shit

* Stop tests from accessing config.managementRoom directly.

---------

Co-authored-by: Gnuxie <50846879+Gnuxie@users.noreply.github.com>
Co-authored-by: Gnuxie <Gnuxie@users.noreply.github.com>
Co-authored-by: gnuxie <Gnuxie@protonmail.com>
2026-05-05 11:51:50 +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
Catalan Lover ec388467e4 Add the ability to customise the primary prefix for commands. (#899)
* Add the ability to customise the primary prefix for commands.

* Fix data structure error in config.yaml / harness.yaml

* Apply suggestions from code review

---------

Co-authored-by: Gnuxie <50846879+Gnuxie@users.noreply.github.com>
2025-06-16 20:39:01 +01:00
Gnuxie 986eba55d4 Update documentation & README for server admin features. (#778) 2025-03-26 17:22:51 +00:00
ll-SKY-ll d6f06c1c61 Update default.yaml (#763)
Remove deprecated "verboseLogging" property
2025-03-21 14:46:59 +00:00
gnuxie 9a9547feb5 Add configuration for synapse-http-antispam. 2025-03-14 17:29:17 +00:00
Gnuxie 711b9b7413 tidy config properties (#724)
* Remove `syncOnStartup` option since it no longer does anything.

We always 'sync' on startup, not that we have a concept of syncing
anymore. https://github.com/the-draupnir-project/Draupnir/issues/504.

* remove `verboseLogging`.

yeah, cya later pal. https://github.com/the-draupnir-project/Draupnir/issues/504.
2025-02-06 13:43:00 +00:00
Catalan Lover 0d42cd30f4 Cleanup Integration Test Config. (#675) 2025-01-15 19:01:21 +00:00
Catalan Lover 69b666e56d Make Room state backing store be default enabled. (#673)
* Make Room state backing store be default enabled.

* Disable Room State Backing Store for Integration Tests
2025-01-15 19:01:06 +00:00
Catalan Lover c3552d0c59 Remove confirmWildcardBan config option (#672)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/671
2025-01-15 17:58:11 +00:00
Catalan Lover 731a944a90 Remove Faster membership checks config entry. (#670)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/669
2025-01-15 17:57:41 +00:00
Catalan Lover b9c12b74d7 Remove Protected Rooms config option (#674) 2025-01-15 17:50:07 +00:00
Catalan Lover 54dd85daf5 Remove References to Regex in Config Example as they are false (#600)
* Remove References to Regex in Config Example as they are false

* Add note that Regex is not supported and state historical error.
2024-10-09 17:01:32 +01:00
gnuxie d817810be9 Add more detail about safe mode to the config file. 2024-10-02 17:23:34 +01:00
gnuxie 98c1822013 Give some flexibility for when to enter safe mode. 2024-10-02 11:32:04 +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
gnuxie 80ccb64330 Implement RoomStateBackingStore with BetterSqlite. 2024-04-06 20:03:38 +01:00
gnuxie 6d28ac81b0 Remove the RuleServer.
It was never used and we don't test it.
We can't really support it.
2024-04-06 20:03:32 +01:00
Gnuxie 945c737df6 Add secret management command line options to documentation. (#247) 2024-02-09 18:39:24 +00:00
Marcel 5738d764d4 Add support for bot-sdk crypto as an experimental flag (#145)
* Add support for bot-sdk crypto as an experimental flag

* Import and use StoreType enum

* Fail hard instead of continuing in case of having pantalaimon and bot-sdk set up

* Document Option in default.yaml

* Remove obsolete comment
2023-10-21 12:18:10 +01:00
Gnuxie 4b656306ed Deprecate config.verboseLogging (#98)
Shouldn't change what is being logged to the log file,
but it does change what gets sent to the management room.
I've been meaning to disable this for some time as it generally
confuses new users and it makes the bot feel very confusing and
low quality. It also means you are likely to miss more important
messages in the magement room.

Another problem it causes is an inconsistent view when testing
the software and it's an unreasonable burden to test for both
settings.

It's not clear what the value of this setting is apart from
providing comfort to some users who want to see the ACL readout.
But even then it's a very inefficient way of doing that,
so i'd rather another feature be requested by users that want to see that.
2023-09-07 15:27:00 +01:00
gnuxie e8847a2524 Allow Draupnir to ignore m.room.server_acl
https://github.com/Gnuxie/Draupnir/pull/85
2023-09-04 15:25:35 +01:00
Aminda Suomalainen e4c02b96cd Add pre-commit configuration (#34)
* add .pre-commit-config.yaml

Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>

* .editorconfig: decrease indent size for text

* .pre-commit-config.yaml: remove prettier

Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>

* .editorconfig consistency.

* .pre-commit-config.yaml: restore sample hooks

* .editorconfig: disable indent_size for LICENSE & NOTICE

* pre-commit run --all-files

* tsconfig.json: tabs to spaces

* .pre-commit-config.yaml: update editorconfig-checker to 2.7.2

* .editorconfig: disable indent_size for markdown

* mjolnir-entrypoint.sh: retab

* .editorconfig: also exclude json from indent checking

* test/nginx.conf: retab

* test/integration/commands/redactCommandTest.ts: remove leading space

* retab or remove leading whitespaces for the rest of the files

* src/appservice/datastore.ts remove newlines

* test/integration/commands/roomTest.ts: remove leading space.

---------

Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>
Co-authored-by: gnuxie <Gnuxie@protonmail.com>
2023-08-29 13:38:00 +01:00
Catalan Lover e3c33743fc Change all instances of Mjolnir/mjolnir with Draupnir/draupnir. (#35)
Also changes Mjölnir instances to Draupnir.
2023-02-21 21:03:12 +00:00
gnuxie 4f1781e31b Rename the bot from Mjolnir to Draupnir in the documentation
Following through with this everywhere will take a lot of time.
2023-02-08 15:04:42 +00:00
Gnuxie c936332442 Ban/Unban rework + Prompts for missing arguments (#12)
* basic ban conversion, but i have better ideas

* Still very WIP on CLIM prompt-for-accept semantics.

* Introduce promotable streams.

This allows parameters to specify details to prompt for missing
arguments
and allow for interactive commands.

* Changes that were made before PolicyListManager that no longer make sense

We don't want the default list anymore since we're just going to prompt
with the lists that they can choose from.

* Fix semantics of TagDynamicEnvironment.

Bind and write were wrong and bind was binding to the node name
instead of the variable name.

* The JSX factory can render presentation types to DocumentNodes, unsure if this is the right
move yet but it works

* Attributes for anchor nodes now render properly

* Ban command prompts are working!!!!

* Stub AppserviceBotEmitter.

There isn't much we can do right now until there is time to work on
https://github.com/Gnuxie/Draupnir/issues/13.

* Combine ban/unban syntax.

* Remove old UnbanBanCommands.

WARNING: There is a major difference in that the ban command no longer supports
globs, I don't think?

* Activate new unban command.

* The presentation type boolean will have to be just a string for now.

I don't think it makes sense to read them into actual booleans.

* configurable defaults for ban reason.
2023-02-08 12:50:23 +00:00
David Teller 2915757b7d Very basic support for Sentry. (#398)
The Sentry package is very useful for monitoring runtime errors. With this PR,
we simply add the necessary mechanism to:

- log to sentry any uncaught error that reaches the toplevel, including startup errors.
2022-11-30 16:06:02 +01:00
Gnuxie 9bcb0b7a59 Replace acceptInvitesFromGroup with acceptInvitesFromSpace. (#338)
Replace acceptInvitesFromGroup with acceptInvitesFromSpace.

https://github.com/matrix-org/mjolnir/issues/125
https://github.com/matrix-org/mjolnir/issues/99

acceptInvitesFromGroup was implemented with an experimental api
that was a precursor to spaces which was refereed to
as either communities or groups.
Support for communities/groups ended in Synapse 1.61.0
https://github.com/matrix-org/synapse/releases/tag/v1.61.0.

To test we just edit the config dynamically which changes how the join room listener functions
though idk, shouldn't we have just made a new mjolnir instance
for this test, or changed the config before the test started somehow?


Co-authored-by: jesopo <github@lolnerd.net>
2022-08-17 10:05:23 +01:00
Jess Porter b03d81dcc4 ability to disable displaying new reports in moderation room (#320) 2022-07-07 12:55:03 +01:00
Jess Porter ed68e02c4e implement polling reports in synapse (#259) 2022-07-04 15:06:36 +01:00
David Teller 0eea04bd69 A background queue for kicking (#296)
A background queue for kicking
2022-06-08 11:49:43 +02:00
Jonathan de Jong bf7f1318af Improve documentation (#277)
* improve documentation

* incorperate documentation of configuration into sample file
2022-05-20 12:19:26 +01:00
Marco Cirillo 97df4d5f61 Add command to elevate a user (or the bot) as room administrator (#219) 2022-03-07 10:14:06 +01:00
Graham Christensen d364d9879a default.yaml: expand on fasterMembershipChecks (#163)
It isn't clear what it means to have the server "struggle" with state requests.

This change is trying to make the configuration more actionable to end users.
2022-02-07 12:41:26 +00:00
gnuxie afb0fd5a23 Skip policy consumption test when the rule server is not enabled 2022-01-21 12:28:59 +00:00
gnuxie 1a65122b0d Initial Ruleserver prototype.
This is an experimental ruleserver that will serve the combined rules from
the active policy lists to a Synapse module over a web api.
This makes it easier to communicate changes in policy lists to Synapse workers
that do not have an immediate view over all of the policy rooms at
the same time.
This also allows us to express moderation actions to the homeserver
beyond what is currently expressible via MSC2313 policy
lists.
2022-01-21 12:13:04 +00:00
gnuxie 9048322709 Improvements to manual testing with the test:manual script.
- Use the configured username & password when registering the test user to run Mjolnir with (was hardcoded).
- Remove bogus imports from the helper that have accidentally been introduced with VSCode.
- Keep `enable_registration: true` in the homeserver config to save time.
2022-01-21 10:11:01 +00:00
David Teller 06e5f00b2d Intercept /report and display human-readable abuse reports in the moderation room - Resolves #38 (#135)
* Intercept /report and display human-readable abuse reports in the moderation room - Resolves #38
2021-10-07 14:42:08 +02:00
gnuxie 4d46d4dd34 Move integration test config file
it now lives in config/ because it was being loaded there by the tests before it could be copied to there from the test directory
2021-09-30 16:02:58 +01:00
J. Ryan Stinnett 46192ac6f7 Add confirmation for wildcard bans
This adds a default enabled option to require confirmation for wildcard bans
(e.g. those containing `*` or `?`). Users will need to also add `--force` for
the commands to be accepted.
2021-02-05 16:09:11 +00:00
Travis Ralston afe1c8f5a2 Update config/default.yaml 2020-11-04 12:19:32 -07:00
Travis Ralston 44a15f7851 Corrected whitespace in config.yml 2020-10-31 09:32:49 -04:00
Emi Tatsuo 4c0bbd845d Removed default words from word list in favor of more neutral words 2020-10-31 09:23:18 -04:00
Emi Simpson c2fbf0934a Added configuration for wordlist protection 2020-06-21 15:18:34 -04:00
Travis Ralston 4751b093a5 Add Healthz support 2020-06-12 08:03:08 -06:00
Travis Ralston 7fa025f678 Remove ban list server support
This will take the shape of something else eventually.
2020-05-11 21:11:24 -06:00
Travis Ralston 6dd59120a7 Revert "Disable ban list server for release"
This reverts commit 1a8edd54f7.
2020-04-15 08:14:24 -06:00
Travis Ralston 1a8edd54f7 Disable ban list server for release 2020-04-15 08:13:57 -06:00