Files
Draupnir/config/harness.yaml
T
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

198 lines
7.9 KiB
YAML

# This configuration file is for the integration tests run by yarn:integration.
# Unless you're working on the test suite, you should probably rather check
# default.yaml!
# Where the homeserver is located (client-server URL). This should point at
# pantalaimon if you're using that.
homeserverUrl: "http://localhost:8081"
# Where the homeserver is located (client-server URL). NOT pantalaimon.
rawHomeserverUrl: "http://localhost:8081"
# README: We use the Pantalaimon client WITHOUT Pantalaimon itself in tests (and the manual test)
# as an easy way to login with passwords from the config without having
# to resolve a chicken-vs-egg problem in regards to access tokens.
# Pantalaimon options (https://github.com/matrix-org/pantalaimon)
pantalaimon:
# If true, accessToken above is ignored and the username/password below will be
# used instead. The access token of the bot will be stored in the dataPath.
use: true
# The username to login with.
username: mjolnir
# The password to login with. Can be removed after the bot has logged in once and
# stored the access token.
password: mjolnir
# The directory the bot should store various bits of information in
dataPath: "./test/harness/mjolnir-data/"
# If true (the default), only users in the `managementRoom` can invite the bot
# to new rooms.
autojoinOnlyIfManager: true
# If `autojoinOnlyIfManager` is false, only the members in this space can invite
# the bot to new rooms.
acceptInvitesFromSpace: "!example:example.org"
# If the bot is invited to a room and it won't accept the invite (due to the
# conditions above), report it to the management room. Defaults to disabled (no
# reporting).
recordIgnoredInvites: false
# The room ID where people can use the bot. The bot has no access controls, so
# anyone in this room can use the bot - secure your room!
# This should be a room alias or room ID - not a matrix.to URL.
# Note: Mjolnir is fairly verbose - expect a lot of messages from it.
managementRoom: "#moderators:localhost:9999"
# Deprecated and will be removed in a future version.
# Running with verboseLogging is unsupported.
# Whether Draupnir should log a lot more messages in the room,
# mainly involves "all-OK" messages, and debugging messages for when draupnir checks bans in a room.
verboseLogging: false
# The log level for the logs themselves. One of DEBUG, INFO, WARN, and ERROR.
# This should be at INFO or DEBUG in order to get support for Mjolnir problems.
logLevel: "DEBUG"
# Set to false to prevent Mjolnir from checking its permissions on startup. This
# is recommended to be left as "true" to catch room permission problems (state
# resets, etc) before Mjolnir is needed.
verifyPermissionsOnStartup: true
# If true, Mjolnir won't actually ban users or apply server ACLs, but will
# think it has. This is useful to see what it does in a scenario where the
# bot might not be trusted fully, yet. Default false (do bans/ACLs).
noop: false
# A case-insensitive list of ban reasons to automatically redact a user's
# messages for. Typically this is useful to avoid having to type two commands
# to the bot. Use asterisks to represent globs (ie: "spam*testing" would match
# "spam for testing" as well as "spamtesting").
automaticallyRedactForReasons:
- "spam"
- "advertising"
# Set this option to true to protect every room the bot is joined to. Note that
# this effectively makes the protectedRooms and associated commands useless because
# the bot by nature must be joined to the room to protect it.
#
# Note: the management room is *excluded* from this condition. Add it to the
# protected rooms to protect it.
#
# Note: ban list rooms the bot is watching but didn't create will not be protected.
# Manually add these rooms to the protected rooms list if you want them protected.
protectAllJoinedRooms: false
# Server administration commands, these commands will only work if Mjolnir is
# a global server administrator
admin:
# The `make admin` upgrades the powerlevel of a specified user (or the bot itself)
# of a room to make them admin of the room (powerlevel 100).
#
# This only works if the room has at least one admin on the local homeserver
# (the homeserver specified in `homeserverUrl` in this file).
enableMakeRoomAdminCommand: true
# Misc options for command handling and commands
commands:
# If true, Mjolnir will respond to commands like !help and !ban instead of
# requiring a prefix. This is useful if Mjolnir is the only bot running in
# your management room.
# In addition to the bot's display name, !mjolnir, and optionally no prefix
# above, the bot will respond to these names. The items here can be used either
# as display names or prefixed with exclamation points.
symbolPrefixes:
- "!"
additionalPrefixes:
- "mjolnir_bot"
# Configuration specific to certain toggleable protections
protections:
# Configuration for the wordlist plugin, which can ban users based if they say certain
# blocked words shortly after joining.
wordlist:
# A list of words which should be monitored by the bot. These will match if any part
# of the word is present in the message in any case. e.g. "hello" also matches
# "HEllO". Additionally, regular expressions can be used.
words:
- "CaSe"
- "InSeNsAtIve"
- "WoRd"
- "LiSt"
# How long after a user joins the server should the bot monitor their messages. After
# this time, users can say words from the wordlist without being banned automatically.
# Set to zero to disable (users will always be banned if they say a bad word)
minutesBeforeTrusting: 20
# The room state backing store writes a copy of the room state for all protected
# rooms to the data directory.
# It is recommended to enable this option unless you deploy Draupnir close to the
# homeserver and know that Draupnir is starting up quickly. If your homeserver can
# respond quickly to Draupnir's requests for `/state` then you might not need this option.
roomStateBackingStore:
enabled: false
draupnirNewsURL: http://127.0.0.1:8081/draupnir_news.json
# Options for monitoring the health of the bot
health:
# healthz options. These options are best for use in container environments
# like Kubernetes to detect how healthy the service is. The bot will report
# that it is unhealthy until it is able to process user requests. Typically
# this means that it'll flag itself as unhealthy for a number of minutes
# before saying "Now monitoring rooms" and flagging itself healthy.
#
# Health is flagged through HTTP status codes, defined below.
healthz:
# Whether the healthz integration should be enabled (default false)
enabled: false
# The port to expose the webserver on. Defaults to 8080.
port: 8080
# The address to listen for requests on. Defaults to all addresses.
address: "0.0.0.0"
# The path to expose the monitoring endpoint at. Defaults to `/healthz`
endpoint: "/healthz"
# The HTTP status code which reports that the bot is healthy/ready to
# process requests. Typically this should not be changed. Defaults to
# 200.
healthyStatus: 200
# The HTTP status code which reports that the bot is not healthy/ready.
# Defaults to 418.
unhealthyStatus: 418
# Options for exposing web APIs.
web:
# Whether to enable web APIs.
enabled: true
# The port to expose the webserver on. Defaults to 8080.
port: 8082
# The address to listen for requests on. Defaults to all addresses.
# Be careful with this setting, as opening to the wide web will increase
# your security perimeter.
# We listen on all in harness because we might be getting requests through the docker gateway.
address: "0.0.0.0"
# A web API designed to intercept Matrix API
# POST /_matrix/client/r0/rooms/{roomId}/report/{eventId}
# and display readable abuse reports in the moderation room.
abuseReporting:
# Whether to enable this feature.
enabled: true
synapseHTTPAntispam:
enabled: true
authorization: DEFAULT