Skip to content

Commit 1794ffa

Browse files
authored
Remove Mjolnir-for-all appservice (#703)
1 parent 6e198ec commit 1794ffa

23 files changed

Lines changed: 19 additions & 1987 deletions

.github/workflows/mjolnir.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,3 @@ jobs:
6565
run: RUST_LOG=debug,hyper=info,rusttls=info mx-tester run
6666
- name: Cleanup
6767
run: mx-tester down
68-
appservice-integration:
69-
name: Application Service Integration tests
70-
runs-on: ubuntu-latest
71-
timeout-minutes: 30
72-
steps:
73-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
74-
with:
75-
persist-credentials: false
76-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
77-
with:
78-
node-version: '22'
79-
- name: Fetch and build mx-tester (cached across runs)
80-
uses: baptiste0928/cargo-install@f204293d9709061b7bc1756fec3ec4e2cd57dec0
81-
with:
82-
crate: mx-tester
83-
version: "0.3.3"
84-
- name: Setup image
85-
run: RUST_LOG=debug,hyper=info,rusttls=info mx-tester build up
86-
- name: Setup dependencies
87-
run: yarn install
88-
- name: Run tests
89-
run: yarn test:appservice:integration
90-
- name: Cleanup
91-
run: mx-tester down

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
/.github
88
/config
99
/docs
10-
/src/appservice/config
1110

1211
/*.log
1312
package-lock.json

docs/appservice.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

mjolnir-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/bin/sh
22

33
# This is used as the entrypoint in the mjolnir Dockerfile.
4-
# We want to transition away form people running the image without specifying `bot` or `appservice`.
5-
# So if eventually cli arguments are provided for the bot version, we want this to be the opportunity to move to `bot`.
6-
# Therefore using arguments without specifying `bot` (or appservice) is unsupported.
7-
# We maintain the behaviour where if it looks like someone is providing an executable to `docker run`, then we will execute that instead.
8-
# This aids configuration and debugging of the image if for example node needed to be started via another method.
4+
# If it looks like someone is providing an executable to `docker run` instead of `bot`, then we
5+
# will execute that instead. This aids configuration and debugging of the image, for example if
6+
# node needed to be started via another method.
97
case "$1" in
108
bot) shift; set -- node /mjolnir/index.js "$@";;
11-
appservice) shift; set -- node /mjolnir/appservice/cli.js "$@";;
9+
appservice)
10+
echo "appservice mode has been removed from Mjolnir. Use \`bot\` instead." >&2
11+
exit 1
12+
;;
1213
esac
1314

1415
exec "$@";

mx-tester.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ name: mjolnir
22

33
up:
44
before:
5-
- 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
6-
# Wait until postgresql is ready
7-
- until psql postgres://mjolnir-tester:mjolnir-test@localhost:8083/mjolnir-test-db -c ""; do echo "Waiting for psql..."; sleep 1s; done
8-
# Make table in postgres
9-
- psql postgres://mjolnir-tester:mjolnir-test@localhost:8083/mjolnir-test-db -c "CREATE TABLE mjolnir (local_part VARCHAR(255), owner VARCHAR(255), management_room TEXT)"
105
# Launch the reverse proxy, listening for connections *only* on the local host.
116
- 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 -d nginx
127
- yarn install
13-
- npx ts-node src/appservice/cli.ts -r -u "http://host.docker.internal:9000"
14-
- cp mjolnir-registration.yaml $MX_TEST_SYNAPSE_DIR/data/
158
after:
169
# Wait until Synapse is ready
1710
- until curl localhost:9999 --stderr /dev/null > /dev/null; do echo "Waiting for Synapse..."; sleep 1s; done
@@ -22,7 +15,6 @@ run:
2215

2316
down:
2417
finally:
25-
- docker stop mjolnir-test-postgres || true
2618
- docker stop mjolnir-test-reverse-proxy || true
2719

2820
modules:
@@ -44,9 +36,6 @@ homeserver:
4436
enable_registration: true
4537
enable_registration_without_verification: true
4638

47-
app_service_config_files:
48-
- "/data/mjolnir-registration.yaml"
49-
5039
# We remove rc_message so we can test rate limiting,
5140
# but we keep the others because of https://github.com/matrix-org/synapse/issues/11785
5241
# and we don't want to slow integration tests down.
@@ -81,18 +70,7 @@ homeserver:
8170
msc3823_account_suspension: true
8271

8372

84-
# Creating a few users simplifies testing.
73+
# Creating an admin user simplifies testing.
8574
users:
8675
- localname: admin
8776
admin: true
88-
rooms:
89-
- public: true
90-
name: "List of users"
91-
alias: access-control-list
92-
members:
93-
- admin
94-
- user_in_mjolnir_for_all
95-
# This user can use Mjölnir-for-all
96-
- localname: user_in_mjolnir_for_all
97-
# This user cannot
98-
- localname: user_regular

package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
"test": "ts-mocha --project ./tsconfig.json test/commands/**/*.ts",
1616
"test:integration": "NODE_ENV=harness ts-mocha --async-stack-traces --require test/integration/fixtures.ts --timeout 300000 --project ./tsconfig.json \"test/integration/**/*Test.ts\"",
1717
"test:integration:single": "NODE_ENV=harness npx ts-mocha --require test/integration/fixtures.ts --timeout 300000 --project ./tsconfig.json",
18-
"test:appservice:integration": "NODE_ENV=harness ts-mocha --async-stack-traces --timeout 300000 --project ./tsconfig.json \"test/appservice/integration/**/*Test.ts\"",
19-
"test:appservice:integration:single": "NODE_ENV=harness npx ts-mocha --timeout 300000 --project ./tsconfig.json",
2018
"test:manual": "NODE_ENV=harness ts-node test/integration/manualLaunchScript.ts",
2119
"version": "sed -i '/# version automated/s/[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*/'$npm_package_version'/' synapse_antispam/setup.py && git add synapse_antispam/setup.py && cat synapse_antispam/setup.py"
2220
},
@@ -29,9 +27,7 @@
2927
"@types/js-yaml": "^4.0.5",
3028
"@types/jsdom": "^16.2.11",
3129
"@types/mocha": "^9.0.0",
32-
"@types/nedb": "^1.8.12",
3330
"@types/node": "^22.0.0",
34-
"@types/pg": "^8.6.5",
3531
"@types/request": "^2.48.13",
3632
"@types/shell-quote": "1.7.1",
3733
"@types/simple-oauth2": "^5.0.7",
@@ -51,18 +47,15 @@
5147
"@vector-im/matrix-bot-sdk": "^0.8.0-element.2",
5248
"await-lock": "^2.2.2",
5349
"axios": "^1.15.2",
54-
"body-parser": "^1.20.1",
5550
"config": "^3.3.8",
5651
"express": "^4.20",
5752
"html-to-text": "^8.0.0",
5853
"humanize-duration": "^3.27.1",
5954
"humanize-duration-ts": "^2.1.1",
6055
"js-yaml": "^4.3.0",
6156
"jsdom": "^16.6.0",
62-
"matrix-appservice-bridge": "^11.2.0",
6357
"nsfwjs": "^4.1.0",
6458
"parse-duration": "^2.1.3",
65-
"pg": "^8.8.0",
6659
"prom-client": "^14.1.0",
6760
"shell-quote": "^1.9.0",
6861
"simple-oauth2": "^5.1.0",

src/MatrixEmitter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ import { MatrixClient } from "@vector-im/matrix-bot-sdk";
2020
/**
2121
* This is an interface created in order to keep the event listener
2222
* Mjolnir uses for new events generic.
23-
* Used to provide a unified API for messages received from matrix-bot-sdk (using GET /sync)
24-
* when we're in single bot mode and messages received from matrix-appservice-bridge (using pushed /transaction)
25-
* when we're in appservice mode.
23+
* Currently the only implementation is the matrix-bot-sdk's `MatrixClient`,
24+
* which sources messages from GET /sync.
2625
*/
2726
export declare interface MatrixEmitter extends EventEmitter {
2827
on(event: "room.event", listener: (roomId: string, mxEvent: any) => void): this;

src/appservice/AccessControl.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)