diff --git a/README.md b/README.md index 57c4aa0..0df1a0c 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ You can find [more options here](https://github.com/revoltchat/backend/blob/df07 - Email verification - Captcha - A custom S3 server +- iOS & Android notifications (Requires Apple/Google developer accounts) If you'd like to edit the configuration, just run: @@ -360,3 +361,23 @@ db.invites.insertOne({ _id: "enter_an_invite_code_here" }) > npm i mongodb > node ./20240929-autumn-rewrite.mjs > ``` + +> [!IMPORTANT] +> As of day November 2024, the following breaking changes have been applied: +> - Rename config section `api.vapid` -> `pushd.vapid` +> - Rename config section `api.fcm` -> `pushd.fcm` +> - Rename config section `api.apn` -> `pushd.apn` +> - The following fields are needed when using the provided docker compose: +> ```toml +> [rabbit] +> host = "rabbit" +> username = "rabbituser" +> password = "rabbitpass" +> ``` +> +> These will NOT automatically be applied to your config, and must be changed/added manually. +> +> +> The following components have been added to the compose file: +> - Added `rabbit` (RabbitMQ) and `pushd` (Revolt push daemon) +> \ No newline at end of file diff --git a/compose.yml b/compose.yml index 7f9a785..16a6a90 100644 --- a/compose.yml +++ b/compose.yml @@ -7,11 +7,32 @@ services: restart: always volumes: - ./data/db:/data/db + healthcheck: + test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet + interval: 10s + timeout: 10s + retries: 5 + start_period: 10s # Redis server redis: - image: eqalpha/keydb + image: eqalpha/keydb restart: always + + rabbit: + image: rabbitmq:4 + restart: always + environment: + RABBITMQ_DEFAULT_USER: rabbituser + RABBITMQ_DEFAULT_PASS: rabbitpass + volumes: + - ./data/rabbit:/var/lib/rabbitmq + healthcheck: + test: rabbitmq-diagnostics -q ping + interval: 10s + timeout: 10s + retries: 3 + start_period: 20s # S3-compatible storage server minio: @@ -51,17 +72,21 @@ services: # API server (delta) api: - image: ghcr.io/revoltchat/server:20241024-1 + image: ghcr.io/revoltchat/server:20241128-2 depends_on: - - database - - redis + database: + condition: service_healthy + redis: + condition: service_started + rabbit: + condition: service_healthy volumes: - ./Revolt.toml:/Revolt.toml restart: always # Events service (quark) events: - image: ghcr.io/revoltchat/bonfire:20241024-1 + image: ghcr.io/revoltchat/bonfire:20241128-2 depends_on: - database - redis @@ -77,7 +102,7 @@ services: # File server (autumn) autumn: - image: ghcr.io/revoltchat/autumn:20241024-1 + image: ghcr.io/revoltchat/autumn:20241128-2 depends_on: - database - createbuckets @@ -91,6 +116,20 @@ services: volumes: - ./Revolt.toml:/Revolt.toml restart: always + + # Push notification daemon (pushd) + pushd: + image: ghcr.io/revoltchat/pushd:20241128-2 + depends_on: + database: + condition: service_healthy + redis: + condition: service_started + rabbit: + condition: service_healthy + volumes: + - ./Revolt.toml:/Revolt.toml + restart: always # Create buckets for minio. createbuckets: diff --git a/generate_config.sh b/generate_config.sh old mode 100755 new mode 100644 index c4476e4..4326e4d --- a/generate_config.sh +++ b/generate_config.sh @@ -12,11 +12,18 @@ echo "events = \"wss://$1/ws\"" >> Revolt.toml echo "autumn = \"https://$1/autumn\"" >> Revolt.toml echo "january = \"https://$1/january\"" >> Revolt.toml +# Rabbit target, since rabbit isn't set up for docker by default +echo "" >> Revolt.toml +echo "[rabbit]" >> Revolt.toml +echo "host = \"rabbit\"" >> Revolt.toml +echo "user = \"rabbituser\"" >> Revolt.toml +echo "password = \"rabbitpass\"" >> Revolt.toml + # VAPID keys echo "" >> Revolt.toml -echo "[api.vapid]" >> Revolt.toml +echo "[pushd.vapid]" >> Revolt.toml openssl ecparam -name prime256v1 -genkey -noout -out vapid_private.pem -echo "private_key = \"$(base64 vapid_private.pem | tr -d '\n')\"" >> Revolt.toml +echo "private_key = \"$(base64 -i vapid_private.pem | tr -d '\n')\"" >> Revolt.toml echo "public_key = \"$(openssl ec -in vapid_private.pem -outform DER|tail -c 65|base64|tr '/+' '_-'|tr -d '\n')\"" >> Revolt.toml rm vapid_private.pem