From df4814dc38a89b9fde8b6a1bb9098130a32fd86f Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 28 Nov 2024 23:17:58 -0800 Subject: [PATCH] feat: 0.8 release (pushd) (#115) * feat: pushd and version 0.8 * feat: add important note to top of file * fix: actually put the date in * fix: fixed default keys in the default backend config --- README.md | 17 ++++++++++++ compose.yml | 65 ++++++++++++++++++++++++++++++++++++++-------- generate_config.sh | 4 +-- 3 files changed, 73 insertions(+), 13 deletions(-) mode change 100755 => 100644 generate_config.sh diff --git a/README.md b/README.md index 57c4aa0..883e34a 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ Self-hosting Revolt using Docker This repository contains configurations and instructions that can be used for deploying Revolt. +> [!IMPORTANT] +> If you are updating an instance from before November 28 2024, please see the changes at the bottom of this readme! + > [!NOTE] > Please consult _[What can I do with Revolt and how do I self-host?](https://developers.revolt.chat/faq.html#admonition-what-can-i-do-with-revolt-and-how-do-i-self-host)_ on our developer site for information about licensing and brand use. @@ -132,6 +135,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 +364,16 @@ db.invites.insertOne({ _id: "enter_an_invite_code_here" }) > npm i mongodb > node ./20240929-autumn-rewrite.mjs > ``` + +> [!IMPORTANT] +> As of November 28 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` +> +> 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..6beb91e 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,20 +72,26 @@ services: # API server (delta) api: - image: ghcr.io/revoltchat/server:20241024-1 + image: ghcr.io/revoltchat/server:20241128-3 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-3 depends_on: - - database - - redis + database: + condition: service_healthy + redis: + condition: service_started volumes: - ./Revolt.toml:/Revolt.toml restart: always @@ -77,17 +104,33 @@ services: # File server (autumn) autumn: - image: ghcr.io/revoltchat/autumn:20241024-1 + image: ghcr.io/revoltchat/autumn:20241128-3 depends_on: - - database - - createbuckets + database: + condition: service_healthy + createbuckets: + condition: service_started volumes: - ./Revolt.toml:/Revolt.toml restart: always # Metadata and image proxy (january) january: - image: ghcr.io/revoltchat/january:20241024-1 + image: ghcr.io/revoltchat/january:20241128-3 + volumes: + - ./Revolt.toml:/Revolt.toml + restart: always + + # Push notification daemon (pushd) + pushd: + image: ghcr.io/revoltchat/pushd:20241128-3 + depends_on: + database: + condition: service_healthy + redis: + condition: service_started + rabbit: + condition: service_healthy volumes: - ./Revolt.toml:/Revolt.toml restart: always diff --git a/generate_config.sh b/generate_config.sh old mode 100755 new mode 100644 index c4476e4..f448abb --- a/generate_config.sh +++ b/generate_config.sh @@ -14,9 +14,9 @@ echo "january = \"https://$1/january\"" >> 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