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

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

Closed
jwheeler31 opened this issue Aug 31, 2024 · 4 comments
Closed

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

jwheeler31 opened this issue Aug 31, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jwheeler31
Copy link

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.

@jwheeler31 jwheeler31 added the bug Something isn't working label Aug 31, 2024
@DeclanChidlow
Copy link
Member

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

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

@jwheeler31
Copy link
Author

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.

@DeclanChidlow
Copy link
Member

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.

@jwheeler31
Copy link
Author

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants