self-hosted
self-hosted copied to clipboard
A comprehensive guide to self host revolt
Hello, i tried self hosting revolt through docker, sure enough the guide provided on readme worked. The problem is when creating an account on localhost i always get an error, furthermore, trying to proxying through nginx (using my own knowledge, which isn't really this advanced) made things worse as i didn't even knew what to proxy and what not. Would it be possible to write an actual complete guide to self host revolt? This defenitely would help people decentralize the service!
I would love this as well. The current Docker setup does not work. Trying to create an account results in an unhelpful network error. Either the app needs to be fixed or the documentation needs to be updated.
Unable to deploy it either. Stuck at nondescript "Network Error" when trying to log in remotely. Locally works just fine, however.
@maxwelljens : You need to edit the .env config file. Otherwise it defaults to
Which resolves to localhost. When you're using it locally, of course it resolves to localhost which is the server; outside of that network, though, would load to their localhost which the server is not hosted at. I'm not quite sure why it can't use relative URL's but it does mention that the default config only works for localhost in the readme
@sigaloid Thanks for your reply.
I am aware of the .env
file configuration. I changed every address accordingly, and port forwarded every relevant port. It doesn't work in spite of that.
Try pressing F12 when logging in. That will let you see which network address it's going to. If it's still "local.revolt.chat:8000" then it's an issue with the config not being loaded correctly somehow. Otherwise it could be a bug in your web proxy
Oops. I just tried deploying it and hit the same problem :p it seems my .env config is not being picked up in the docker-compose.
@sigaloid Interesting. Good to know I am not the only one with this problem. Do let everyone know in this issue if you find a solution or workaround. Thanks.
Okay so. Basic setup, just cloned the repo, edited .env to have different URL's for the API, but it still sends requests to http://local.revolt.chat:8000/auth/account/create. This seems to me like a problem with the environment variables because there's no configuration changes that are actually going through to the Delta server.
Basically, changing the API server in the .env has zero effect on the resulting containers. Did this on a fresh install. Looking like a bug in the docker compose setup to me at this point, maybe the env variables in the docker-compose.yml are not being properly retrieved?
Or maybe the ones in revoltchat/delta/docker-compose.yml supercede it... That would make sense because the ones there are the ones being used.
Anyway I am yet to find a solution. Unfortunately this is blocking me from deploying this awesome software ;(
I just cloned the repo and am able to get a local version up and running just using docker compose up
.
I did have to adjust some of the port binding for my host machine due to conflicts but that was obvious in the logs.
i.e. I changed 5000 to 42069 for the web app 5000:5000
became 42069:5000
and I can access Revolt using 127.0.0.1:42069
or local.revolt.chat:42069
.
What do logs look like when you run docker compose up
?
For example, try changing REVOLT_APP_URL in the .env to some random domain and see if that's where the network requests go when you restart it. (Press F12 and try registering)
This is the scenario I had trouble with
@sigaloid Thanks for your reply.
I am aware of the
.env
file configuration. I changed every address accordingly, and port forwarded every relevant port. It doesn't work in spite of that.
Same issue over here, nothing I do is working. Tried adding URLs in the docker-compose.yml environment but to no avail
https://asciinema.org/a/fqCutcwDYY2jK4mMcI6ewj1W8
Okay, so I re-pulled the docker container on my local PC rather than my VPS (sudo docker pull revoltchat/server:master
) and did this to the .env file (even though it's gibberish). Oddly enough, when I attempted to register, it successfully sent it to the new domain I entered in the .env file. This means that I did succeed in making my config changes save.
I don't even know what I did differently (i did basically everything the same). And I still cannot make it work on the server.
I've been trying to fix this and running against a wall about this for days now. It's gotta be something really basic I'm overlooking.
Starting from a fresh Docker install, my Fedora box can follow the directuions and persist config changes, but my Debian box cannot. Side by side, completely brand new environment... What OS are you on, @Razorback360 @mirkoRainer @maxwelljens ?
@sigaloid My server is on Fedora 34.
MacOS Apple Silicone
Get Outlook for iOShttps://aka.ms/o0ukef
From: maxwelljens @.> Sent: Sunday, February 6, 2022 5:00:19 PM To: revoltchat/self-hosted @.> Cc: Mirko Rainer @.>; Mention @.> Subject: Re: [revoltchat/self-hosted] A comprehensive guide to self host revolt (Issue #25)
@sigaloidhttps://github.com/sigaloid My server is on Fedora 34.
— Reply to this email directly, view it on GitHubhttps://github.com/revoltchat/self-hosted/issues/25#issuecomment-1030923198, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMTS6CBQWIJZU6JMPCP6HF3UZ3VPHANCNFSM5K2TFC4Q. You are receiving this because you were mentioned.Message ID: @.***>
Starting from a fresh Docker install, my Fedora box can follow the directuions and persist config changes, but my Debian box cannot. Side by side, completely brand new environment... What OS are you on, @Razorback360 @mirkoRainer @maxwelljens ?
I'm on Ubuntu.
https://asciinema.org/a/fqCutcwDYY2jK4mMcI6ewj1W8
Okay, so I re-pulled the docker container on my local PC rather than my VPS (
sudo docker pull revoltchat/server:master
) and did this to the .env file (even though it's gibberish). Oddly enough, when I attempted to register, it successfully sent it to the new domain I entered in the .env file. This means that I did succeed in making my config changes save.I don't even know what I did differently (i did basically everything the same). And I still cannot make it work on the server.
I've been trying to fix this and running against a wall about this for days now. It's gotta be something really basic I'm overlooking.
I think you need to refresh the cache. I tried to open the website in the browser's traceless mode, and the problem was successfully solved.
Here is an example of nginx.
map $http_host $revolt_upstream {
example.com http://127.0.0.1:5000;
api.example.com http://127.0.0.1:8000;
ws.example.com http://127.0.0.1:9000;
autumn.example.com http://127.0.0.1:3000;
january.example.com http://127.0.0.1:7000;
vortex.example.com http://127.0.0.1:8080;
}
server {
listen 80;
listen 443 ssl http2;
server_name example.com *.example.com;
# SSL
if ($http_upgrade) {
# Here, the path is used to reverse the generation of ws. Just roll the keyboard to prevent conflicts with other services.
rewrite ^(.*)$ /ws_78dd759593f041bc970fd7eef8b0c4af$1;
}
location / {
proxy_pass $revolt_upstream;
proxy_set_header Host $host;
}
location /ws_78dd759593f041bc970fd7eef8b0c4af/ {
# Note that here is the trailing slash.
proxy_pass $revolt_upstream/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
# Important, to prevent ws from sending data for a long time and causing timeout disconnection.
proxy_read_timeout 24h;
}
}
asciinema.org/a/fqCutcwDYY2jK4mMcI6ewj1W8 Okay, so I re-pulled the docker container on my local PC rather than my VPS (
sudo docker pull revoltchat/server:master
) and did this to the .env file (even though it's gibberish). Oddly enough, when I attempted to register, it successfully sent it to the new domain I entered in the .env file. This means that I did succeed in making my config changes save. I don't even know what I did differently (i did basically everything the same). And I still cannot make it work on the server. I've been trying to fix this and running against a wall about this for days now. It's gotta be something really basic I'm overlooking.I think you need to refresh the cache. I tried to open the website in the browser's traceless mode, and the problem was successfully solved.
Wow. My goodness. Is this some sort of caching issue? I disabled cache, refreshed, rebooted, etc and nothing fixed the issue. Are these resources aggressively cached?
Regardless, the fix is to NOT START THE DOCKER CONTAINER until you've set up the env file. I started the docker container to make sure the images were downloaded, then I stopped it to configure it. Thank you so much @SurpriseLon that saved me from a few more days of confusion!!
Regardless, the fix is to NOT START THE DOCKER CONTAINER until you've set up the env file. I started the docker container to make sure the images were downloaded, then I stopped it to configure it. Thank you so much @SurpriseLon that saved me from a few more days of confusion!!
Solution mentioned here does not work for me. I have completely deleted the docker compose, removed all containers and their data, configured the .env, then deployed the compose and yet it is still the same issue. I am running on Ubuntu 20.04.3 LTS
A few things I can think of: Are you editing the .env.example? Make sure you cp .env.example .env
and change the config in .env. Then, try in incognito mode or in a fresh browser - the javascript containing the server is heavily cached and the filename isn't dynamically changed based on its hash, so it will never re-request it. I even did F12 - disable cache and it didn't help. Only trying in incognito + Ctrl+F5'ing helped.
Here is an example of nginx.
map $http_host $revolt_upstream { example.com http://127.0.0.1:5000; api.example.com http://127.0.0.1:8000; ws.example.com http://127.0.0.1:9000; autumn.example.com http://127.0.0.1:3000; january.example.com http://127.0.0.1:7000; vortex.example.com http://127.0.0.1:8080; } server { listen 80; listen 443 ssl http2; server_name example.com *.example.com; # SSL if ($http_upgrade) { # Here, the path is used to reverse the generation of ws. Just roll the keyboard to prevent conflicts with other services. rewrite ^(.*)$ /ws_78dd759593f041bc970fd7eef8b0c4af$1; } location / { proxy_pass $revolt_upstream; proxy_set_header Host $host; } location /ws_78dd759593f041bc970fd7eef8b0c4af/ { # Note that here is the trailing slash. proxy_pass $revolt_upstream/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header Connection $http_connection; proxy_set_header Upgrade $http_upgrade; # Important, to prevent ws from sending data for a long time and causing timeout disconnection. proxy_read_timeout 24h; } }
On this nginx config, would i need to make all those domains? As well as, can i not just reverse proxy those domains to the ports that they are on?
Here is an example of nginx.
map $http_host $revolt_upstream { example.com http://127.0.0.1:5000; api.example.com http://127.0.0.1:8000; ws.example.com http://127.0.0.1:9000; autumn.example.com http://127.0.0.1:3000; january.example.com http://127.0.0.1:7000; vortex.example.com http://127.0.0.1:8080; } server { listen 80; listen 443 ssl http2; server_name example.com *.example.com; # SSL if ($http_upgrade) { # Here, the path is used to reverse the generation of ws. Just roll the keyboard to prevent conflicts with other services. rewrite ^(.*)$ /ws_78dd759593f041bc970fd7eef8b0c4af$1; } location / { proxy_pass $revolt_upstream; proxy_set_header Host $host; } location /ws_78dd759593f041bc970fd7eef8b0c4af/ { # Note that here is the trailing slash. proxy_pass $revolt_upstream/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header Connection $http_connection; proxy_set_header Upgrade $http_upgrade; # Important, to prevent ws from sending data for a long time and causing timeout disconnection. proxy_read_timeout 24h; } }
On this nginx config, would i need to make all those domains? As well as, can i not just reverse proxy those domains to the ports that they are on?
Yes,you can
Here is an example of nginx.
map $http_host $revolt_upstream { example.com http://127.0.0.1:5000; api.example.com http://127.0.0.1:8000; ws.example.com http://127.0.0.1:9000; autumn.example.com http://127.0.0.1:3000; january.example.com http://127.0.0.1:7000; vortex.example.com http://127.0.0.1:8080; } server { listen 80; listen 443 ssl http2; server_name example.com *.example.com; # SSL if ($http_upgrade) { # Here, the path is used to reverse the generation of ws. Just roll the keyboard to prevent conflicts with other services. rewrite ^(.*)$ /ws_78dd759593f041bc970fd7eef8b0c4af$1; } location / { proxy_pass $revolt_upstream; proxy_set_header Host $host; } location /ws_78dd759593f041bc970fd7eef8b0c4af/ { # Note that here is the trailing slash. proxy_pass $revolt_upstream/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header Connection $http_connection; proxy_set_header Upgrade $http_upgrade; # Important, to prevent ws from sending data for a long time and causing timeout disconnection. proxy_read_timeout 24h; } }
On this nginx config, would i need to make all those domains? As well as, can i not just reverse proxy those domains to the ports that they are on?
Yes,you can
So this doesn't exactly answer my question, there was 2 in the sentence, just a yes doesn't help. Sorry for any confusion or etc.
Hello everyone.
Sorry for the inactivity I had here (I had no pc). But I put HTTPS on my server. Problem, now it's giving me "network error". Could my other site (also in https) cause this problem?
Hello everyone.
Sorry for the inactivity I had here (I had no pc). But I put HTTPS on my server. Problem, now it's giving me "network error". Could my other site (also in https) cause this problem?
I'm also running into a myriad of issues when trying to convert a insecure instance of Revolt to https. I'm using the nginx config detailed in this same thread. Other than that, I've made no changes to my .env or docker-compose.yml beyond those that were required to get the insecure http-hosted version of my Revolt chat running. Any ideas? There seems to be an issue with an HTTP GET and a "Blocked loading mixed active content “http://[domain]:[port]/” error in the web dev console I cannot resolve.
@maxwelljens : You need to edit the .env config file. Otherwise it defaults to
Which resolves to localhost. When you're using it locally, of course it resolves to localhost which is the server; outside of that network, though, would load to their localhost which the server is not hosted at. I'm not quite sure why it can't use relative URL's but it does mention that the default config only works for localhost in the readme
I can see this screen, but I get this error message even before entering the password.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://local.revolt.chat:8000/.
That's on Firefox. On Chrome I don't exactly the same error messages
Failed to load resource: net::ERR_SOCKET_NOT_CONNECTED :8000/1:
Uncaught (in promise) Error: Network Error createError.js:16
at Np (vendor.aeef7222.js:12)
at XMLHttpRequest.u.onerror (vendor.aeef7222.js:13)
I use Ubuntu 20.04.2 LTS
I tried to do a complete Docker reset, but the containers still didn't work
Let that sink in
Not even docker system prune -a
fixed the problem of .env not applying
Just dropping in to mention that I'm consolidating all issues regarding self-hosting into this issue. I'll probably eventually be able to get around to writing something up but I currently don't have any time.
HE RESPONDS, finally this will actually be fixed