Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vortex voice server #114

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ data*

.env
.env.web
.env.vortex
Revolt.toml

compose.override.yml
11 changes: 11 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
reverse_proxy http://january:14705
}

route /vortex* {
@upgrade {
header Connection *Upgrade*
header Upgrade websocket
}

uri strip_prefix /vortex
reverse_proxy http://vortex:8080
reverse_proxy @upgrade http://vortex:8080
}

reverse_proxy http://web:5000
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ apt-get update && apt-get upgrade -y
ufw allow ssh
ufw allow http
ufw allow https
ufw allow 10000:10100/tcp
ufw allow 10000:10100/udp
ufw default deny
ufw enable

Expand Down Expand Up @@ -124,9 +126,11 @@ cd revolt
Generate a configuration file by running:

```bash
./generate_config.sh your.domain
./generate_config.sh <your.domain> <vortex rtc ips>
```

For `<vortex rtc ips>`, you will likely want to specify `0.0.0.0,your.external.ip.address`; For more information, see the [vortex's readme](https://github.com/revoltchat/vortex).

You can find [more options here](https://github.com/revoltchat/backend/blob/df074260196f5ed246e6360d8e81ece84d8d9549/crates/core/config/Revolt.toml), some noteworthy configuration options:

- Email verification
Expand Down
13 changes: 13 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,16 @@ services:
/usr/bin/mc mb minio/revolt-uploads;
exit 0;
"

# Voice server (vortex)
vortex:
image: ghcr.io/revoltchat/vortex:0.3.0-alpha.1
restart: always
env_file: .env.vortex
# NOTE: default range is 10000-11000 which seems like too much for a small
# self hosted instance
environment:
- RTC_MIN_PORT=10000
- RTC_MAX_PORT=10100
ports:
- "10000-10100:10000-10100"
11 changes: 11 additions & 0 deletions generate_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ echo "api = \"https://$1/api\"" >> Revolt.toml
echo "events = \"wss://$1/ws\"" >> Revolt.toml
echo "autumn = \"https://$1/autumn\"" >> Revolt.toml
echo "january = \"https://$1/january\"" >> Revolt.toml
echo "voso_legacy = \"https://$1/vortex\"" >> Revolt.toml
echo "voso_legacy_ws = \"wss://$1/vortex\"" >> Revolt.toml

# VAPID keys
echo "" >> Revolt.toml
Expand All @@ -24,3 +26,12 @@ rm vapid_private.pem
echo "" >> Revolt.toml
echo "[files]" >> Revolt.toml
echo "encryption_key = \"$(openssl rand -base64 32)\"" >> Revolt.toml

# configure vortex
vortex_manage_token=$(openssl rand -base64 32)
echo "WS_URL=wss://$1/vortex" > .env.vortex
echo "MANAGE_TOKEN=$vortex_manage_token" >> .env.vortex
echo "RTC_IPS=$2" >> .env.vortex
echo "" >> Revolt.toml
echo "[api.security]" >> Revolt.toml
echo "voso_legacy_token = \"$vortex_manage_token\"" >> Revolt.toml