Compare commits
10 Commits
bb044eb6d9
...
340484159e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
340484159e | ||
|
|
31ff9e81c0 | ||
|
|
1a426356b5 | ||
|
|
8ffc55b96a | ||
|
|
21ef05770c | ||
|
|
db51161530 | ||
|
|
d8d9721a16 | ||
|
|
196900a6dd | ||
|
|
8e889598f5 | ||
|
|
99b0d743af |
20
.github/workflows/validate-pr-title.yml
vendored
Normal file
20
.github/workflows/validate-pr-title.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: "Lint PR"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
- synchronize
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
name: Validate PR title
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
steps:
|
||||||
|
- uses: amannn/action-semantic-pull-request@v6
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
23
Caddyfile
23
Caddyfile
@@ -1,22 +1,37 @@
|
|||||||
{$HOSTNAME} {
|
{$HOSTNAME} {
|
||||||
route /api* {
|
route /api* {
|
||||||
uri strip_prefix /api
|
uri strip_prefix /api
|
||||||
reverse_proxy http://api:14702
|
reverse_proxy http://api:14702 {
|
||||||
|
header_down Location "^/" "/api/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
route /ws {
|
route /ws {
|
||||||
uri strip_prefix /ws
|
uri strip_prefix /ws
|
||||||
reverse_proxy http://events:14703
|
reverse_proxy http://events:14703 {
|
||||||
|
header_down Location "^/" "/ws/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
route /autumn* {
|
route /autumn* {
|
||||||
uri strip_prefix /autumn
|
uri strip_prefix /autumn
|
||||||
reverse_proxy http://autumn:14704
|
reverse_proxy http://autumn:14704 {
|
||||||
|
header_down Location "^/" "/autumn/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
route /january* {
|
route /january* {
|
||||||
uri strip_prefix /january
|
uri strip_prefix /january
|
||||||
reverse_proxy http://january:14705
|
reverse_proxy http://january:14705 {
|
||||||
|
header_down Location "^/" "/january/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
route /gifbox* {
|
||||||
|
uri strip_prefix /gifbox
|
||||||
|
reverse_proxy http://gifbox:14706 {
|
||||||
|
header_down Location "^/" "/gifbox/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reverse_proxy http://web:5000
|
reverse_proxy http://web:5000
|
||||||
|
|||||||
62
README.md
62
README.md
@@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>
|
<h1>
|
||||||
Revolt Self-Hosted
|
Stoat Self-Hosted
|
||||||
|
|
||||||
[](https://github.com/revoltchat/self-hosted/stargazers)
|
[](https://github.com/revoltchat/self-hosted/stargazers)
|
||||||
[](https://github.com/revoltchat/self-hosted/network/members)
|
[](https://github.com/revoltchat/self-hosted/network/members)
|
||||||
@@ -9,20 +9,20 @@
|
|||||||
[](https://github.com/revoltchat/self-hosted/graphs/contributors)
|
[](https://github.com/revoltchat/self-hosted/graphs/contributors)
|
||||||
[](https://github.com/revoltchat/self-hosted/blob/main/LICENSE)
|
[](https://github.com/revoltchat/self-hosted/blob/main/LICENSE)
|
||||||
</h1>
|
</h1>
|
||||||
Self-hosting Revolt using Docker
|
Self-hosting Stoat using Docker
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
This repository contains configurations and instructions that can be used for deploying Revolt.
|
This repository contains configurations and instructions that can be used for deploying a full instance of Stoat, including the back-end, web front-end, file server, and metadata and image proxy.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> If you are updating an instance from before November 28, 2024, please see the [notices section](#notices) at the bottom of this README!
|
> If you are updating an instance from before November 28, 2024, please consult the [notices section](#notices) at the bottom.
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> A list of security advisories is [provided at the bottom](#security-advisories).
|
> A list of security advisories is [provided at the bottom](#security-advisories).
|
||||||
|
|
||||||
> [!NOTE]
|
> [!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.
|
> Please consult _[What can I do with Stoat, 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.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> amd64 builds are not currently available for the web client.
|
> amd64 builds are not currently available for the web client.
|
||||||
@@ -31,6 +31,7 @@ This repository contains configurations and instructions that can be used for de
|
|||||||
> This guide does not include working voice channels ([#138](https://github.com/revoltchat/self-hosted/pull/138#issuecomment-2762682655)). A [rework](https://github.com/revoltchat/backend/issues/313) is currently in progress.
|
> This guide does not include working voice channels ([#138](https://github.com/revoltchat/self-hosted/pull/138#issuecomment-2762682655)). A [rework](https://github.com/revoltchat/backend/issues/313) is currently in progress.
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Deployment](#deployment)
|
- [Deployment](#deployment)
|
||||||
- [Updating](#updating)
|
- [Updating](#updating)
|
||||||
- [Advanced Deployment](#advanced-deployment)
|
- [Advanced Deployment](#advanced-deployment)
|
||||||
@@ -137,11 +138,11 @@ apt-get update
|
|||||||
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, we can pull in the configuration for Revolt:
|
Now, we can pull in the configuration for Stoat:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/revoltchat/self-hosted revolt
|
git clone https://github.com/revoltchat/self-hosted stoat
|
||||||
cd revolt
|
cd stoat
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate a configuration file by running:
|
Generate a configuration file by running:
|
||||||
@@ -151,7 +152,7 @@ chmod +x ./generate_config.sh
|
|||||||
./generate_config.sh your.domain
|
./generate_config.sh your.domain
|
||||||
```
|
```
|
||||||
|
|
||||||
You can find [more options here](https://github.com/revoltchat/backend/blob/df074260196f5ed246e6360d8e81ece84d8d9549/crates/core/config/Revolt.toml), some noteworthy configuration options:
|
You can find [more options here](https://github.com/revoltchat/backend/blob/stable/crates/core/config/Revolt.toml), some noteworthy configuration options:
|
||||||
|
|
||||||
- Email verification
|
- Email verification
|
||||||
- Captcha
|
- Captcha
|
||||||
@@ -164,7 +165,7 @@ If you'd like to edit the configuration, just run:
|
|||||||
micro Revolt.toml
|
micro Revolt.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, we can start up Revolt. First, run it in the foreground with:
|
Finally, we can start up Stoat. First, run it in the foreground with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up
|
docker compose up
|
||||||
@@ -212,8 +213,8 @@ Prerequisites before continuing:
|
|||||||
Clone this repository.
|
Clone this repository.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/revoltchat/self-hosted revolt
|
git clone https://github.com/revoltchat/self-hosted stoat
|
||||||
cd revolt
|
cd stoat
|
||||||
```
|
```
|
||||||
|
|
||||||
Create `.env.web` and download `Revolt.toml`, then modify them according to your requirements.
|
Create `.env.web` and download `Revolt.toml`, then modify them according to your requirements.
|
||||||
@@ -222,12 +223,12 @@ Create `.env.web` and download `Revolt.toml`, then modify them according to your
|
|||||||
> The default configurations are intended exclusively for testing and will only work locally. If you wish to deploy to a remote server, you **must** edit the URLs in `.env.web` and `Revolt.toml`. Please reference the section below on [configuring a custom domain](#custom-domain).
|
> The default configurations are intended exclusively for testing and will only work locally. If you wish to deploy to a remote server, you **must** edit the URLs in `.env.web` and `Revolt.toml`. Please reference the section below on [configuring a custom domain](#custom-domain).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo "HOSTNAME=http://local.revolt.chat" > .env.web
|
echo "HOSTNAME=http://local.stoat.chat" > .env.web
|
||||||
echo "REVOLT_PUBLIC_URL=http://local.revolt.chat/api" >> .env.web
|
echo "REVOLT_PUBLIC_URL=http://local.stoat.chat/api" >> .env.web
|
||||||
wget -O Revolt.toml https://raw.githubusercontent.com/revoltchat/backend/main/crates/core/config/Revolt.toml
|
wget -O Revolt.toml https://raw.githubusercontent.com/revoltchat/backend/main/crates/core/config/Revolt.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
Then start Revolt:
|
Then start Stoat:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
@@ -237,21 +238,29 @@ docker compose up -d
|
|||||||
|
|
||||||
### Custom Domain
|
### Custom Domain
|
||||||
|
|
||||||
To configure a custom domain, you will need to replace *all* instances of `local.revolt.chat` in `Revolt.toml` and `.env.web` to your chosen domain (here represented as `example.com`), like so:
|
To configure a custom domain, you can either generate a config for https by running:
|
||||||
|
|
||||||
|
```
|
||||||
|
chmod +x ./generate_config.sh
|
||||||
|
./generate_config.sh your.domain
|
||||||
|
```
|
||||||
|
|
||||||
|
Or alternatively do it manually, you will need to replace _all_ instances of `local.stoat.chat` in `Revolt.toml` and `.env.web` to your chosen domain (here represented as `example.com`), like so:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
# .env.web
|
# .env.web
|
||||||
- REVOLT_PUBLIC_URL=http://local.revolt.chat/api
|
- REVOLT_PUBLIC_URL=http://local.stoat.chat/api
|
||||||
+ REVOLT_PUBLIC_URL=http://example.com
|
+ REVOLT_PUBLIC_URL=http://example.com/api
|
||||||
```
|
```
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
# Revolt.toml
|
# Revolt.toml
|
||||||
- app = "http://local.revolt.chat"
|
- app = "http://local.stoat.chat"
|
||||||
+ app = "http://example.com"
|
+ app = "http://example.com"
|
||||||
```
|
```
|
||||||
|
|
||||||
In the case of `HOSTNAME`, you must strip the protocol prefix:
|
In the case of `HOSTNAME`, you must strip the protocol prefix:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
# .env.web
|
# .env.web
|
||||||
- HOSTNAME=http://example.com
|
- HOSTNAME=http://example.com
|
||||||
@@ -262,8 +271,8 @@ You will likely also want to change the protocols to enable HTTPS:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
# .env.web
|
# .env.web
|
||||||
- REVOLT_PUBLIC_URL=http://example.com
|
- REVOLT_PUBLIC_URL=http://example.com/api
|
||||||
+ REVOLT_PUBLIC_URL=https://example.com
|
+ REVOLT_PUBLIC_URL=https://example.com/api
|
||||||
```
|
```
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
@@ -277,7 +286,7 @@ You will likely also want to change the protocols to enable HTTPS:
|
|||||||
|
|
||||||
### Placing Behind Another Reverse-Proxy or Another Port
|
### Placing Behind Another Reverse-Proxy or Another Port
|
||||||
|
|
||||||
If you'd like to place Revolt behind another reverse proxy or on a non-standard port, you'll need to edit `compose.yml`.
|
If you'd like to place Stoat behind another reverse proxy or on a non-standard port, you'll need to edit `compose.yml`.
|
||||||
|
|
||||||
Override the port definitions on `caddy`:
|
Override the port definitions on `caddy`:
|
||||||
|
|
||||||
@@ -345,14 +354,14 @@ db.invites.insertOne({ _id: "enter_an_invite_code_here" })
|
|||||||
## Notices
|
## Notices
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> If you deployed Revolt before [2022-10-29](https://github.com/minio/docs/issues/624#issuecomment-1296608406), you may have to tag the `minio` image release if it's configured in "fs" mode.
|
> If you deployed Stoat before [2022-10-29](https://github.com/minio/docs/issues/624#issuecomment-1296608406), you may have to tag the `minio` image release if it's configured in "fs" mode.
|
||||||
>
|
>
|
||||||
> ```yml
|
> ```yml
|
||||||
> image: minio/minio:RELEASE.2022-10-24T18-35-07Z
|
> image: minio/minio:RELEASE.2022-10-24T18-35-07Z
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> If you deployed Revolt before [2023-04-21](https://github.com/revoltchat/backend/commit/32542a822e3de0fc8cc7b29af46c54a9284ee2de), you may have to flush your Redis database.
|
> If you deployed Stoat before [2023-04-21](https://github.com/revoltchat/backend/commit/32542a822e3de0fc8cc7b29af46c54a9284ee2de), you may have to flush your Redis database.
|
||||||
>
|
>
|
||||||
> ```bash
|
> ```bash
|
||||||
> # for stock Redis and older KeyDB images:
|
> # for stock Redis and older KeyDB images:
|
||||||
@@ -396,15 +405,16 @@ db.invites.insertOne({ _id: "enter_an_invite_code_here" })
|
|||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> As of November 28, 2024, the following breaking changes have been applied:
|
> As of November 28, 2024, the following breaking changes have been applied:
|
||||||
|
>
|
||||||
> - Rename config section `api.vapid` -> `pushd.vapid`
|
> - Rename config section `api.vapid` -> `pushd.vapid`
|
||||||
> - Rename config section `api.fcm` -> `pushd.fcm`
|
> - Rename config section `api.fcm` -> `pushd.fcm`
|
||||||
> - Rename config section `api.apn` -> `pushd.apn`
|
> - Rename config section `api.apn` -> `pushd.apn`
|
||||||
>
|
>
|
||||||
> These will NOT automatically be applied to your config and must be changed/added manually.
|
> 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:
|
> The following components have been added to the compose file:
|
||||||
> - Added `rabbit` (RabbitMQ) and `pushd` (Revolt push daemon)
|
>
|
||||||
|
> - Added `rabbit` (RabbitMQ) and `pushd` (Stoat push daemon)
|
||||||
|
|
||||||
## Security Advisories
|
## Security Advisories
|
||||||
|
|
||||||
|
|||||||
25
compose.yml
25
compose.yml
@@ -1,4 +1,4 @@
|
|||||||
name: revolt
|
name: stoat
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# MongoDB: Database
|
# MongoDB: Database
|
||||||
@@ -73,7 +73,7 @@ services:
|
|||||||
|
|
||||||
# API server
|
# API server
|
||||||
api:
|
api:
|
||||||
image: ghcr.io/revoltchat/server:20250210-1
|
image: ghcr.io/revoltchat/server:20250930-2
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -89,7 +89,7 @@ services:
|
|||||||
|
|
||||||
# Events service
|
# Events service
|
||||||
events:
|
events:
|
||||||
image: ghcr.io/revoltchat/bonfire:20250210-1
|
image: ghcr.io/revoltchat/bonfire:20250930-2
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -109,7 +109,7 @@ services:
|
|||||||
|
|
||||||
# File server
|
# File server
|
||||||
autumn:
|
autumn:
|
||||||
image: ghcr.io/revoltchat/autumn:20250210-1
|
image: ghcr.io/revoltchat/autumn:20250930-2
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -123,7 +123,16 @@ services:
|
|||||||
|
|
||||||
# Metadata and image proxy
|
# Metadata and image proxy
|
||||||
january:
|
january:
|
||||||
image: ghcr.io/revoltchat/january:20250210-1
|
image: ghcr.io/revoltchat/january:20250930-2
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: ./Revolt.toml
|
||||||
|
target: /Revolt.toml
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
# Tenor proxy
|
||||||
|
gifbox:
|
||||||
|
image: ghcr.io/revoltchat/gifbox:20250930-2
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: ./Revolt.toml
|
source: ./Revolt.toml
|
||||||
@@ -132,7 +141,7 @@ services:
|
|||||||
|
|
||||||
# Regular task daemon
|
# Regular task daemon
|
||||||
crond:
|
crond:
|
||||||
image: ghcr.io/revoltchat/crond:20250210-1-debug
|
image: ghcr.io/revoltchat/crond:20250930-2
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -146,7 +155,7 @@ services:
|
|||||||
|
|
||||||
# Push notification daemon
|
# Push notification daemon
|
||||||
pushd:
|
pushd:
|
||||||
image: ghcr.io/revoltchat/pushd:20250210-1
|
image: ghcr.io/revoltchat/pushd:20250930-2
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -168,7 +177,7 @@ services:
|
|||||||
entrypoint: >
|
entrypoint: >
|
||||||
/bin/sh -c "
|
/bin/sh -c "
|
||||||
while ! /usr/bin/mc ready minio; do
|
while ! /usr/bin/mc ready minio; do
|
||||||
/usr/bin/mc config host add minio http://minio:9000 minioautumn minioautumn;
|
/usr/bin/mc alias set minio http://minio:9000 minioautumn minioautumn;
|
||||||
echo 'Waiting minio...' && sleep 1;
|
echo 'Waiting minio...' && sleep 1;
|
||||||
done;
|
done;
|
||||||
/usr/bin/mc mb minio/revolt-uploads;
|
/usr/bin/mc mb minio/revolt-uploads;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ echo "" >> Revolt.toml
|
|||||||
echo "[pushd.vapid]" >> Revolt.toml
|
echo "[pushd.vapid]" >> Revolt.toml
|
||||||
openssl ecparam -name prime256v1 -genkey -noout -out vapid_private.pem
|
openssl ecparam -name prime256v1 -genkey -noout -out vapid_private.pem
|
||||||
echo "private_key = \"$(base64 -i vapid_private.pem | tr -d '\n' | tr -d '=')\"" >> Revolt.toml
|
echo "private_key = \"$(base64 -i vapid_private.pem | tr -d '\n' | tr -d '=')\"" >> Revolt.toml
|
||||||
echo "public_key = \"$(openssl ec -in vapid_private.pem -outform DER|tail -c 65|base64|tr '/+' '_-'|tr -d '\n'|tr -d '=')\"" >> Revolt.toml
|
echo "public_key = \"$(openssl ec -in vapid_private.pem -outform DER|tail --bytes 65|base64|tr '/+' '_-'|tr -d '\n'|tr -d '=')\"" >> Revolt.toml
|
||||||
rm vapid_private.pem
|
rm vapid_private.pem
|
||||||
|
|
||||||
# encryption key for files
|
# encryption key for files
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const BUCKET_MAP = {
|
|||||||
*/
|
*/
|
||||||
const CONNECTION_URL = "mongodb://database";
|
const CONNECTION_URL = "mongodb://database";
|
||||||
|
|
||||||
|
const objectLookup = {};
|
||||||
const mongo = new MongoClient(CONNECTION_URL);
|
const mongo = new MongoClient(CONNECTION_URL);
|
||||||
await mongo.connect();
|
await mongo.connect();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user