bug: Changes to API endpoints .env not being respected #68

Closed
opened 2026-02-16 12:51:19 -05:00 by yindo · 4 comments
Owner

Originally created by @jwheeler31 on GitHub (Aug 31, 2024).

What happened?

Working on deploying a proof of concept. Experiencing an issue when attempting to assign a username, post sign up. Turns out that the UI is attempting to communicate via ws://local.revolt.chat/ws. Confirmed via the /api endpoint that none of the configured values are being returned.

Expected behavior is for the application to continue into the typical application operation.

Originally created by @jwheeler31 on GitHub (Aug 31, 2024). ### What happened? Working on deploying a proof of concept. Experiencing an issue when attempting to assign a username, post sign up. Turns out that the UI is attempting to communicate via `ws://local.revolt.chat/ws`. Confirmed via the `/api` endpoint that none of the configured values are being returned. Expected behavior is for the application to continue into the typical application operation.
yindo added the bug label 2026-02-16 12:51:19 -05:00
yindo closed this issue 2026-02-16 12:51:19 -05:00
Author
Owner

@DeclanChidlow commented on GitHub (Aug 31, 2024):

Hi,
Currently working on updating the guide. Does this version work for you?

https://github.com/DeclanChidlow/self-hosted

@DeclanChidlow commented on GitHub (Aug 31, 2024): Hi, Currently working on updating the guide. Does this version work for you? https://github.com/DeclanChidlow/self-hosted
Author
Owner

@jwheeler31 commented on GitHub (Aug 31, 2024):

Thank you for the quick response. So, yes, it solved the original issue. I'd recommend modifying the wget to:

wget -O Revolt.toml https://raw.githubusercontent.com/revoltchat/backend/main/crates/core/config/Revolt.toml

as, for some odd reason, it was attempting to create a Revolt.toml directory.

This new problem is most likely out of scope of this issue. I'm dealing with:

ClientController.tsx:47 Mixed Content: The page at 'https://revolt.mydomain.tld/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://revolt.mydomain.tld/api/'. This request has been blocked; the content must be served over HTTPS.

I tried changing the all the entries in the .env and Revolt.toml, to no avail. Following the stack trace, it seems that import.meta.env.VITE_API_URL is returning http://revolt.mydomain.tld/api (that's the value assigned to the apiClient.api.baseURL object).

If you have any suggestions, they'd be much appreciated. Otherwise, feel free to close this issue.

@jwheeler31 commented on GitHub (Aug 31, 2024): Thank you for the quick response. So, yes, it solved the original issue. I'd recommend modifying the `wget` to: ``` wget -O Revolt.toml https://raw.githubusercontent.com/revoltchat/backend/main/crates/core/config/Revolt.toml ``` as, for some odd reason, it was attempting to create a `Revolt.toml` directory. This new problem is most likely out of scope of this issue. I'm dealing with: ``` ClientController.tsx:47 Mixed Content: The page at 'https://revolt.mydomain.tld/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://revolt.mydomain.tld/api/'. This request has been blocked; the content must be served over HTTPS. ``` I tried changing the all the entries in the `.env` and `Revolt.toml`, to no avail. Following the stack trace, it seems that `import.meta.env.VITE_API_URL` is returning `http://revolt.mydomain.tld/api` (that's the value assigned to the `apiClient.api.baseURL` object). If you have any suggestions, they'd be much appreciated. Otherwise, feel free to close this issue.
Author
Owner

@DeclanChidlow commented on GitHub (Aug 31, 2024):

Thanks for notifying me about the Revolt.toml issue. Hadn't encountered that in my testing and I'll be sure to update it.

As for the http error, I'd suggest disabling HTTPS-Only mode in your browser. In Firefox it's done like this:
https://support.mozilla.org/en-US/kb/https-only-prefs

Hopefully that fixes your issue.

@DeclanChidlow commented on GitHub (Aug 31, 2024): Thanks for notifying me about the Revolt.toml issue. Hadn't encountered that in my testing and I'll be sure to update it. As for the http error, I'd suggest disabling HTTPS-Only mode in your browser. In Firefox it's done like this: https://support.mozilla.org/en-US/kb/https-only-prefs Hopefully that fixes your issue.
Author
Owner

@jwheeler31 commented on GitHub (Aug 31, 2024):

It'd be nice if it were that simple, but I expect to have a large group of individuals playing with this (20 or so). I'm not sure how the VITE_API_URL value is being reinterpreted from the value in .env. Maybe testing a merge with the latest will make a difference.

Thanks again!

@jwheeler31 commented on GitHub (Aug 31, 2024): It'd be nice if it were that simple, but I expect to have a large group of individuals playing with this (20 or so). I'm not sure how the `VITE_API_URL` value is being reinterpreted from the value in `.env`. Maybe testing a merge with the latest will make a difference. Thanks again!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/self-hosted#68