revoltchat / self-hosted

Deploy Revolt using Docker.
851 stars 106 forks source link

bug: Not reading from REVOLT_EXTERNAL_WS_URL #81

Closed roboriaan closed 2 months ago

roboriaan commented 2 months ago

What happened?

Hi,

I have my external WS URL set to :

# URL to where the WebSocket server is publicly accessible
REVOLT_EXTERNAL_WS_URL=wss://myexampledomain.com/ws

I get passed the registration process and upon login when the socket connection is made I get a console error:

Session.tsx:157 Mixed Content: The page at 'https://myexampledomain.com/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://local.revolt.chat/ws'. This request has been blocked; this endpoint must be available over WSS.

It seems that the REVOLT_EXTERNAL_WS_URL variable doesn't get pulled in and still points to : ws://local.revolt.chat/ws I couldn't find any other setting pointing to it within the configuration. I have re-cloned the repo, re-created the images and containers.

Any ideas? Thanks

NoahMoyer commented 2 months ago

Hello, I want to add that I am seeing the same issue. I have the URL where the WebSocket server is publicly accessible set in the same way as mentioned and am seeing the same exact error in the console when trying to register/log in. Almost as if the variable has not been used the way I set it.

FunNoober commented 2 months ago

I was having this issue. In the readme of this project it says.

❗ Important: configuration strategy has changed but this guide is out of date TL;DR mount Revolt.toml at /Revolt.toml for both api and events. Proper documentation will follow in due time.

So, to actually do this follow the steps below.

  1. Download the Revolt.toml file and place it into the same folder where your docker-compose.yml file is.

  2. Configure the Revolt.toml file the same way your .env file is configured

  3. In the docker-compose.yml file, add the following lines underneath the api: section and the events: section

    volumes:
     - type: bind
       source: ./Revolt.toml
       target: /Revolt.toml

    (replace the spaces with indentation)

  4. Start your container back up using Docker Compose

NoahMoyer commented 2 months ago

@FunNoober Thank you for pointing this out, I'll give this a try.

That was it, that resolved the issue I was seeing and I am able to log in now. Thank you!

roboriaan commented 2 months ago

Perfect! Thank you @FunNoober

ImVexed commented 2 months ago

@FunNoober this didn't fully work for me, events wasn't reading the redis url properly from the toml and I had to manually add back the REDIS_URI=redis://redis/ environment variable

mojoaar commented 3 weeks ago

@FunNoober Thank you for the guidance.

Note to self: remember to correct ws:// to wss:/ when loading secure :P