Files
Draupnir/mx-tester.yml
Gnuxie b73cfd7907
Some checks failed
Docker Hub - Develop / docker-latest (push) Has been cancelled
Tests / Build & Lint (push) Has been cancelled
Tests / Unit tests (push) Has been cancelled
Tests / Integration tests (push) Has been cancelled
Tests / Application Service Integration tests (push) Has been cancelled
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

102 lines
3.0 KiB
YAML

# SPDX-FileCopyrightText: 2022 The Matrix.org Foundation C.I.C.
#
# SPDX-License-Identifier: Apache-2.0
name: mjolnir
up:
before:
- docker run --rm --network $MX_TEST_NETWORK_NAME --name
mjolnir-test-postgres --domainname mjolnir-test-postgres -e
POSTGRES_PASSWORD=mjolnir-test -e POSTGRES_USER=mjolnir-tester -e
POSTGRES_DB=mjolnir-test-db -d -p 127.0.0.1:8083:5432 postgres
# Wait until postgresql is ready
- until psql
postgres://mjolnir-tester:mjolnir-test@127.0.0.1:8083/mjolnir-test-db -c
""; do echo "Waiting for psql..."; sleep 1s; done
# Launch the reverse proxy, listening for connections *only* on the local host.
- docker run --rm --network host --name mjolnir-test-reverse-proxy -p
127.0.0.1:8081:80 -v $MX_TEST_CWD/test/nginx.conf:/etc/nginx/nginx.conf:ro
-v
$MX_TEST_CWD/test/draupnir_news.json:/var/www/test/draupnir_news.json:ro
-d nginx
- corepack yarn install
- corepack yarn ts-node src/appservice/cli.ts -r -u
"http://host.docker.internal:9000"
- cp draupnir-registration.yaml $MX_TEST_SYNAPSE_DIR/data/
after:
# Wait until Synapse is ready
- until curl localhost:9999 --stderr /dev/null > /dev/null; do echo "Waiting
for Synapse..."; sleep 1s; done
- echo "Synapse is ready"
run:
- corepack yarn test:integration
down:
finally:
- docker stop mjolnir-test-postgres || true
- docker stop mjolnir-test-reverse-proxy || true
modules:
- name: HTTPAntispam
build:
- git clone https://github.com/maunium/synapse-http-antispam.git
$MX_TEST_MODULE_DIR/
config:
module: synapse_http_antispam.HTTPAntispam
config:
base_url: http://host.docker.internal:8082/api/1/spam_check
authorization: DEFAULT
do_ping: true
enabled_callbacks:
- user_may_invite
- user_may_join_room
- check_event_for_spam
fail_open:
user_may_invite: true
user_may_join_room: true
check_event_for_spam: true
homeserver:
# Basic configuration.
server_name: localhost:9999
public_baseurl: http://localhost:9999
registration_shared_secret: REGISTRATION_SHARED_SECRET
# Make manual testing easier
enable_registration: true
enable_registration_without_verification: true
app_service_config_files:
- "/data/draupnir-registration.yaml"
# We remove rc_message so we can test rate limiting,
# but we keep the others because of https://github.com/matrix-org/synapse/issues/11785
# and we don't want to slow integration tests down.
rc_registration:
per_second: 10000
burst_count: 10000
rc_login:
address:
per_second: 10000
burst_count: 10000
account:
per_second: 10000
burst_count: 10000
failed_attempts:
per_second: 10000
burst_count: 10000
rc_admin_redaction:
per_second: 10000
burst_count: 10000
rc_joins:
local:
per_second: 10000
burst_count: 10000
remote:
per_second: 10000
burst_count: 10000