feat: Caddy reverse proxy

chore: clean up README
pull/63/head
Paul Makles 2 years ago
parent 0e751b3d7e
commit 4dcde911e9
No known key found for this signature in database
GPG Key ID: 5059F398521BB0F6

@ -9,23 +9,20 @@ MONGODB=mongodb://database
REDIS_URI=redis://redis/ REDIS_URI=redis://redis/
# URL to where the Revolt app is publicly accessible # URL to where the Revolt app is publicly accessible
REVOLT_APP_URL=http://local.revolt.chat:5000 REVOLT_APP_URL=http://local.revolt.chat
# URL to where the API is publicly accessible # URL to where the API is publicly accessible
REVOLT_PUBLIC_URL=http://local.revolt.chat:8000 REVOLT_PUBLIC_URL=http://local.revolt.chat/api
VITE_API_URL=http://local.revolt.chat:8000 VITE_API_URL=http://local.revolt.chat/api
# URL to where the WebSocket server is publicly accessible # URL to where the WebSocket server is publicly accessible
REVOLT_EXTERNAL_WS_URL=ws://local.revolt.chat:9000 REVOLT_EXTERNAL_WS_URL=ws://local.revolt.chat/ws
# URL to where Autumn is publicly available # URL to where Autumn is publicly available
AUTUMN_PUBLIC_URL=http://local.revolt.chat:3000 AUTUMN_PUBLIC_URL=http://local.revolt.chat/autumn
# URL to where January is publicly available # URL to where January is publicly available
JANUARY_PUBLIC_URL=http://local.revolt.chat:7000 JANUARY_PUBLIC_URL=http://local.revolt.chat/january
# URL to where Vortex is publicly available
# VOSO_PUBLIC_URL=https://voso.revolt.chat
## ##
@ -100,10 +97,3 @@ AWS_ACCESS_KEY_ID=minioautumn
# AWS Secret Key # AWS Secret Key
AWS_SECRET_ACCESS_KEY=minioautumn AWS_SECRET_ACCESS_KEY=minioautumn
##
## Vortex configuration
##
# VOSO_MANAGE_TOKEN=CHANGEME

@ -0,0 +1,28 @@
{$REVOLT_APP_URL} {
route /api* {
uri strip_prefix /api
reverse_proxy http://api:8000
}
route /ws {
@upgrade {
header Connection *Upgrade*
header Upgrade websocket
}
uri strip_prefix /ws
reverse_proxy @upgrade http://events:9000
}
route /autumn* {
uri strip_prefix /autumn
reverse_proxy http://autumn:3000
}
route /january* {
uri strip_prefix /january
reverse_proxy http://january:7000
}
reverse_proxy http://web:5000
}

@ -1,16 +1,10 @@
# Before you get started # Before you get started
This is still a work-in-progress and some things may not work but for the most part everything has been tested without issue!
**Note**: the Revolt team is primarily focused on other components of the app, don't expect any immediate support, some issues may also be seen as out of scope for what this repo is trying to achieve so they may be marked as WONTFIX.
Please [read the FAQ before running your own server](https://developers.revolt.chat/faq/usage#guidelines-for-third-party-instances) and you may want to read about [additional notes relating to third-party instances](https://developers.revolt.chat/faq/instances). Please [read the FAQ before running your own server](https://developers.revolt.chat/faq/usage#guidelines-for-third-party-instances) and you may want to read about [additional notes relating to third-party instances](https://developers.revolt.chat/faq/instances).
## Errata Notice ## Errata Notice
amd64 builds are currently unavailable. amd64 builds are currently unavailable ([#116](https://github.com/revoltchat/delta/issues/116)).
Related issue: https://github.com/revoltchat/delta/issues/116
## Quick Start ## Quick Start
@ -26,9 +20,15 @@ cp .env.example .env
docker-compose up -d docker-compose up -d
``` ```
Then simply go to http://local.revolt.chat:5000 Then simply go to http://local.revolt.chat
## Setup # Setup
Prerequisites before continuing:
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)
- [Git](https://git-scm.com/)
Clone this repository. Clone this repository.
@ -39,7 +39,7 @@ cd revolt
Copy the `.env` file and edit according to your needs. Copy the `.env` file and edit according to your needs.
> **Warning**: The default configuration is intended for testing and only works on your local machine. If you want to deploy to a remote server, you need to edit the URLs in the `.env` file. \ > **Warning**: The default configuration is intended for testing and only works on your local machine. If you want to deploy to a remote server, you need to edit the URLs in the `.env` file, please see the section below on [configuring a custom domain](#custom-domain). \
> If you get a network error when trying to log in, **double check your configuration before opening an issue.** > If you get a network error when trying to log in, **double check your configuration before opening an issue.**
```bash ```bash
@ -56,24 +56,45 @@ docker-compose up -d
To update Revolt, first pull the latest copy of this repository to ensure you have the latest tags: To update Revolt, first pull the latest copy of this repository to ensure you have the latest tags:
``` ```bash
git pull git pull
``` ```
Then pull all the latest images: Then pull all the latest images:
``` ```bash
docker-compose pull docker-compose pull
``` ```
Now you can restart your services: Now you can restart your services:
``` ```bash
docker-compose up -d docker-compose up -d
``` ```
## Additional Notes ## Additional Notes
### Custom domain
To configure a custom domain, you should be able to do a search and replace on `local.revolt.chat` in the `.env` file, like so:
```diff
# .env
- REVOLT_APP_URL=http://local.revolt.chat
+ REVOLT_APP_URL=http://my.domain
```
You will also want to change the protocols to enable HTTPS:
```diff
# .env
- REVOLT_APP_URL=http://my.domain
+ REVOLT_APP_URL=https://my.domain
- REVOLT_EXTERNAL_WS_URL=ws://my.domain/ws
+ REVOLT_EXTERNAL_WS_URL=wss://my.domain/ws
```
### Expose database ### Expose database
You can insecurely expose the database by adding a port definition: You can insecurely expose the database by adding a port definition:
@ -101,9 +122,13 @@ services:
Enable invite-only mode by setting `REVOLT_INVITE_ONLY` in `.env` to `1` Enable invite-only mode by setting `REVOLT_INVITE_ONLY` in `.env` to `1`
Create an invite (Replace "YOUR INVITE HERE" with what you want the invite code to be) Create an invite:
```bash ```bash
# drop into mongo shell
docker-compose exec database mongosh docker-compose exec database mongosh
# create the invite
use revolt use revolt
db.invites.insertOne({ _id: "YOUR INVITE HERE" }) db.invites.insertOne({ _id: "enter_an_invite_code_here" })
``` ```

@ -1,4 +1,4 @@
version: '3.8' version: "3.8"
services: services:
# MongoDB database # MongoDB database
@ -13,6 +13,28 @@ services:
image: eqalpha/keydb image: eqalpha/keydb
restart: always restart: always
# S3-compatible storage server
minio:
image: minio/minio
command: server /data
env_file: .env
volumes:
- ./data/minio:/data
restart: always
# Caddy web server
caddy:
image: caddy
restart: always
env_file: .env
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./data/caddy-data:/data
- ./data/caddy-config:/config
# API server (delta) # API server (delta)
api: api:
image: ghcr.io/revoltchat/server:20220715-1 image: ghcr.io/revoltchat/server:20220715-1
@ -20,10 +42,9 @@ services:
depends_on: depends_on:
- database - database
- redis - redis
ports: - caddy
- "8000:8000"
restart: always restart: always
# Events service (quark) # Events service (quark)
events: events:
image: ghcr.io/revoltchat/bonfire:20220715-1 image: ghcr.io/revoltchat/bonfire:20220715-1
@ -31,27 +52,34 @@ services:
depends_on: depends_on:
- database - database
- redis - redis
ports: - caddy
- "9000:9000"
restart: always restart: always
# Web App (revite) # Web App (revite)
web: web:
image: ghcr.io/revoltchat/client:master image: ghcr.io/revoltchat/client:master
env_file: .env env_file: .env
ports: depends_on:
- "5000:5000" - caddy
restart: always restart: always
# S3-compatible storage server # File server (autumn)
minio: autumn:
image: minio/minio image: ghcr.io/revoltchat/autumn:1.1.5
command: server /data
env_file: .env env_file: .env
volumes: depends_on:
- ./data/minio:/data - database
ports: - createbuckets
- "10000:9000" - caddy
environment:
- AUTUMN_MONGO_URI=mongodb://database
restart: always
# Metadata and image proxy (january)
january:
image: ghcr.io/revoltchat/january:master
depends_on:
- caddy
restart: always restart: always
# Create buckets for minio. # Create buckets for minio.
@ -72,23 +100,3 @@ services:
/usr/bin/mc mb minio/emojis; /usr/bin/mc mb minio/emojis;
exit 0; exit 0;
" "
# File server (autumn)
autumn:
image: ghcr.io/revoltchat/autumn:1.1.5
env_file: .env
depends_on:
- database
- createbuckets
environment:
- AUTUMN_MONGO_URI=mongodb://database
ports:
- "3000:3000"
restart: always
# Metadata and image proxy (january)
january:
image: ghcr.io/revoltchat/january:master
ports:
- "7000:7000"
restart: always

Loading…
Cancel
Save