revoltchat / self-hosted

Deploy Revolt using Docker.
854 stars 108 forks source link

Unable to join voice channel #29

Closed spoctoss closed 2 years ago

spoctoss commented 2 years ago

Managed to get revolt running using docker swarm with traefik as the reverse proxy. However I am still facing an issue with being unable to join voice channels. The API server seems to be getting the request to join and says the request is successful but the browser is showing a 400 error for a request to the API server.

[2022-01-10T21:34:16Z INFO  rocket::server] POST /channels/01FQF3P68N2CNBP1QAH7TZ0P4W/join_call:
[2022-01-10T21:34:16Z INFO  rocket::server] Matched: (req) POST /channels/<target>/join_call
[2022-01-10T21:34:16Z INFO  rocket::server] Outcome: Success
[2022-01-10T21:34:16Z INFO  rocket::server] Response succeeded.
xhr.js:187 POST https://<removed real URL>/channels/01FQF3P68N2CNBP1QAH7TZ0P4W/join_call 400
Error: Request failed with status code 400
    at mp (createError.js:16)
    at T2 (settle.js:17)
    at XMLHttpRequest.f (xhr.js:54)
Zomatree commented 2 years ago

Are you running vortex which is required for voice channels? its not included in the docker compose file by default yet so you there is a possibility you are not running it.

spoctoss commented 2 years ago

That's probably it as I am not running it currently. I will tinker with that for a bit and see how far I get. Is there any documentation on running it selfhosted yet?

Thanks for the response

spoctoss commented 2 years ago

I got vortex going and configured, restarted everything, checked vortex is responding via http. Still getting the same 400 error from the api server when trying to join a voice channel. No logs in the vortex container. Any ideas?

FrostiiZ commented 2 years ago

I've got Vortex setup and running on my own server and I've faced a similar error 400 in the console. Mine was related to a wrong websocket address.

First thing I always do with Revolt is check the json response on Delta's port 8000. This lists all the routes that are declared to the back-end from the .env file. You can easily see if any route is wrong. On my side, the websocket route of vortex was wrong.

While I was trying to deploy Vortex, I saw the client was using ws://example.com instead of my configuration, but the key "WS_URL" was already set. Check that you've setup the env variables called "VOSO_PUBLIC_URL" and "VOSO_WS_HOST" along with "WS_URL". VOSO_WS_HOST was the missing key in my configuration, but the back-end was watching for this value for Vortex's websocket.

Also, I've seen that the front-end uses the browser's local storage and cookies to store different informations, including routes. When changing your .env file, make sure you've refreshed your containers to use the updated values, and also try to clear all data of the front-end on your browser. This should refresh all the routes.

After this, Vortex is running on my own server and I can connect to a voice channel.

For your interest, I have also deployed the revolt stack behind a reverse-proxy, I'm using the swag container from LinuxServer.io.

Sorry if this comment is a bit weird to read, English is not my primary language. :) I hope I've been somehow helpful, or to someone else facing a smilliar issue as I did.

josealonso commented 2 years ago

@kylesmith63, @FrostiiZ, what did you do to make the Network Error on the login page go away ? I'm using the .env file shown in the docs. Did you change it ?

josealonso commented 2 years ago

@FrostiiZ, I visited the linuxserver.io web page and I didn't see the revolt chat used anywhere.

FrostiiZ commented 2 years ago

@kylesmith63, @FrostiiZ, what did you do to make the Network Error on the login page go away ? I'm using the .env file shown in the docs. Did you change it ?

Yes, the .env file have been changed. The env variables that have been modified on my side are explained in my last comment. Take a closer look at "VOSO_PUBLIC_URL" "VOSO_WS_HOST" "WS_URL" To fix my network error, I had to add the missing key "VOSO_WS_HOST" in my .env file with the correct address.

@FrostiiZ, I visited the linuxserver.io web page and I didn't see the revolt chat used anywhere.

Swag is just a very robust web server and reverse-proxy container that uses nginx behind the hood. This is to state that Revolt and Vortex can run behind such a setup for those wondering if it's possible or not. Swag is not shipped with a default config for Revolt, I had to create my own proxy configuration to make it work.

insertish commented 2 years ago

In an effort to clean up the global issue tracker, I'm currently consolidating all issues regarding self-hosting Vortex into https://github.com/revoltchat/vortex/issues/23#issuecomment-1113594595.

cjeje84 commented 2 years ago

Hello, I have some errors, can you help me please?

Here is a screenshot and my config file

image

Vortex config: HTTP_HOST=0.0.0.0:6080 WS_URL=ws://newdream.ml:9000 VOSO_WS_HOST=ws://newdream.ml:9000 MANAGE_TOKEN=moi84 RTC_MIN_PORT=10000 RTC_MAX_PORT=11000 DISABLE_RTP=0 RTC_IPS=0.0.0.0,62.210.205.219

Revolt chat config:

##
## Quark configuration
##

# MongoDB
MONGODB=mongodb://database

# Redis
REDIS_URI=redis://redis/

# URL to where the Revolt app is publicly accessible
REVOLT_APP_URL=http://newdream.ml:5000

# URL to where the API is publicly accessible
REVOLT_PUBLIC_URL=http://newdream.ml:8000
VITE_API_URL=http://newdream.ml:8000

# URL to where the WebSocket server is publicly accessible
REVOLT_EXTERNAL_WS_URL=ws://newdream.ml:9000

# URL to where Autumn is publicly available
AUTUMN_PUBLIC_URL=http://newdream.ml:3000

# URL to where January is publicly available
JANUARY_PUBLIC_URL=http://newdream.ml:7000

# URL to where Vortex is publicly available
VOSO_PUBLIC_URL=http://newdream.ml:6080
VOSO_WS_HOST=ws://newdream.ml:9000

##
## hCaptcha Settings
##

# If you are sure that you don't want to use hCaptcha, set to 1.
REVOLT_UNSAFE_NO_CAPTCHA=1

# hCaptcha API key
# REVOLT_HCAPTCHA_KEY=0x0000000000000000000000000000000000000000

# hCaptcha site key
# REVOLT_HCAPTCHA_SITEKEY=10000000-ffff-ffff-ffff-000000000001

##
## Email Settings
##

# If you are sure that you don't want to use email verification, set to 1.
REVOLT_UNSAFE_NO_EMAIL=1

# SMTP host
# REVOLT_SMTP_HOST=smtp.example.com

# SMTP username
# REVOLT_SMTP_USERNAME=noreply@example.com

# SMTP password
# REVOLT_SMTP_PASSWORD=CHANGEME

# SMTP From header
# REVOLT_SMTP_FROM=Revolt <noreply@example.com>

##
## Application Settings
##

# Whether to only allow users to sign up if they have an invite code
REVOLT_INVITE_ONLY=0

# Maximum number of people that can be in a group chat
REVOLT_MAX_GROUP_SIZE=150

# VAPID keys for push notifications
# Generate using this guide: http://gitlab.insrt.uk/revolt/delta/-/wikis/vapid
# --> Please replace these keys before going into production! <--
REVOLT_VAPID_PRIVATE_KEY=LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUpEYXJlY1FWQXdxM0hyQlhYZjk2ZUs2YUNuenBteWxpTW1iSm9tYkRRbHFvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFZE4vU0FMVXJQeTliRmNvdGdMK1NQN3k4R0JHOTdBbmUrRWU3bXBCZ2x6VTAza3NKRTVSdgpiM3MzVHIwaWdJU2Z3VEVOSmtkUkVZeEp2clJzb0d6MUV3PT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=
REVOLT_VAPID_PUBLIC_KEY=BHTf0gC1Kz8vWxXKLYC_kj-8vBgRvewJ3vhHu5qQYJc1NN5LCROUb297N069IoCEn8ExDSZHURGMSb60bKBs9RM=

##
## Autumn configuration
##

# S3 Region
AUTUMN_S3_REGION=minio

# S3 Endpoint
AUTUMN_S3_ENDPOINT=http://minio:9000

# MinIO Root User
MINIO_ROOT_USER=minioautumn

# MinIO Root Password
MINIO_ROOT_PASSWORD=minioautumn

# AWS Access Key ID
AWS_ACCESS_KEY_ID=minioautumn

# AWS Secret Key
AWS_SECRET_ACCESS_KEY=minioautumn

##
## Vortex configuration
##

VOSO_MANAGE_TOKEN=moi84
MANAGE_TOKEN=moi84
RTC_IPS=0.0.0.0,62.210.205.219
RTC_MIN_PORT=10000
RTC_MAX_PORT=11000
WS_URL=ws://newdream.ml:9000

Thanks for your help