-
Notifications
You must be signed in to change notification settings - Fork 139
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
A comprehensive guide to self host revolt #25
Comments
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 |
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 What do logs look like when you run |
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 |
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 ( 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 iOS<https://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)
@sigaloid<https://github.com/sigaloid> My server is on Fedora 34.
—
Reply to this email directly, view it on GitHub<#25 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMTS6CBQWIJZU6JMPCP6HF3UZ3VPHANCNFSM5K2TFC4Q>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'm on Ubuntu. |
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;
}
} |
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!! |
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 |
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? |
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. |
@markiemm first of all I followed your guide and it was very helpful. The main takeaway is that if you are using a reverse proxy you must set your hostname to :80, I'm using traefik, and using :433 did not work unfortunately. Since everything goes through Caddy anyways, you only need to have it in the reverse proxy network. I have a similar config but with traefik, and only Caddy is in the |
I'm interested about pure minimal config without Cloudfare and using certificate from Letsencrypt and nginx as a reverse proxy. I'm using no-ip.com DDNS as a domain. Managed to get rid of NETWORKERROR message, when registering an account - now it's working, but now I have UNKNOWNERROR when logging in with existing account. Console showing problems while connecting to wss Websocket endpoint. I have very similar config to : #25 (comment) Nginx location points to: http://localhost:1234 I assume, the problem is very obvious, but I can't figure out. Trying to guess the solution for 2 days already. |
Despite the readme stating how to do it correctly I removed the caddy entry from docker-compose and exposed the ports again. docker-compose.ymlversion: "3.8"
services:
# MongoDB database
database:
image: mongo
restart: always
volumes:
- ./data/db:/data/db
# Redis server
redis:
image: eqalpha/keydb
restart: always
# S3-compatible storage server
minio:
image: minio/minio
command: server /data
env_file: .env
volumes:
- ./data/minio:/data
restart: always
ports:
- "10000:9000"
# API server (delta)
api:
image: ghcr.io/revoltchat/server:20230421-3
env_file: .env
depends_on:
- database
- redis
restart: always
ports:
- "8000:8000"
# Events service (quark)
events:
image: ghcr.io/revoltchat/bonfire:20230421-3
env_file: .env
depends_on:
- database
- redis
restart: always
ports:
- "9000:9000"
# Web App (revite)
web:
image: ghcr.io/revoltchat/client:master
env_file: .env
restart: always
ports:
- "5000:5000"
# File server (autumn)
autumn:
image: ghcr.io/revoltchat/autumn:1.1.8
env_file: .env
depends_on:
- database
- createbuckets
environment:
- AUTUMN_MONGO_URI=mongodb://database
restart: always
ports:
- "3000:3000"
# Metadata and image proxy (january)
january:
image: ghcr.io/revoltchat/january:master
restart: always
ports:
- "7000:7000"
# Create buckets for minio.
createbuckets:
image: minio/mc
depends_on:
- minio
env_file: .env
entrypoint: >
/bin/sh -c "
while ! curl -s --output /dev/null --connect-timeout 1 http://minio:9000; do echo 'Waiting minio...' && sleep 0.1; done;
/usr/bin/mc alias set minio http://minio:9000 $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD;
/usr/bin/mc mb minio/attachments;
/usr/bin/mc mb minio/avatars;
/usr/bin/mc mb minio/backgrounds;
/usr/bin/mc mb minio/icons;
/usr/bin/mc mb minio/banners;
/usr/bin/mc mb minio/emojis;
exit 0;
" .envREVOLT_APP_URL=https://revolt.YOUR.DOMAIN
REVOLT_PUBLIC_URL=https://api.revolt.YOUR.DOMAIN
VITE_API_URL=https://api.revolt.YOUR.DOMAIN
REVOLT_EXTERNAL_WS_URL=wss://ws.revolt.YOUR.DOMAIN
AUTUMN_PUBLIC_URL=https://autumn.revolt.YOUR.DOMAIN
JANUARY_PUBLIC_URL=https://january.revolt.YOUR.DOMAIN nginxmap $http_host $revolt_upstream {
revolt.YOUR.DOMAIN http://127.0.0.1:5000;
api.revolt.YOUR.DOMAIN http://127.0.0.1:8000;
ws.revolt.YOUR.DOMAIN http://127.0.0.1:9000;
autumn.revolt.YOUR.DOMAIN http://127.0.0.1:3000;
january.revolt.YOUR.DOMAIN http://127.0.0.1:7000;
}
server {
server_name revolt.YOUR.DOMAIN api.revolt.YOUR.DOMAIN ws.revolt.YOUR.DOMAIN autumn.revolt.YOUR.DOMAIN january.revolt.YOUR.DOMAIN;
listen 80;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
client_max_body_size 10G;
client_body_timeout 6000m;
fastcgi_buffers 64 4K;
client_header_timeout 6000m;
proxy_connect_timeout 6000m;
proxy_read_timeout 6000m;
proxy_send_timeout 6000m;
if ($http_upgrade) {
rewrite ^(.*)$ /ws_78dd759593f041bc970fd7eef8b0c4af$1;
}
location / {
proxy_pass $revolt_upstream;
proxy_set_header Host $host;
}
location /ws_78dd759593f041bc970fd7eef8b0c4af/ {
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;
}
}
|
Thanks a lot for your config. After 1 more hour I've managed to launch the instance without Cloudfare, additional domain mappings, using Letsencrypt cert and no-ip secondary level domain. In docker-compose.yml I've changed only these lines for caddy initially (removed https): ports:
- "1234:80"
#- "443:443" My .env file header: HOSTNAME=:80
REVOLT_APP_URL=https://mynoipdomain.org
REVOLT_PUBLIC_URL=https://mynoipdomain.org/api
VITE_API_URL=https://mynoipdomain.org/api
REVOLT_EXTERNAL_WS_URL=wss://mynoipdomain.org/ws
AUTUMN_PUBLIC_URL=https://mynoipdomain.org/autumn
JANUARY_PUBLIC_URL=https://mynoipdomain.org/january But, the problem was in Nginx (location part) actually (I guess). location / {
proxy_pass http://localhost:1234/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_http_version 1.1;
} I still have some errors in console, but those are really minor comparing to that challenge I had. Thanks! |
Also, I would like to document all the steps for beginners (and myself too for the future purpose) to configure secured self-hosted instance in a very detailed way (including domain, VPS registration and especially Nginx part) |
I'm trying to make an invite-only server. Got the .env editing done, I proceed to the next step:
Something tells me I haven't installed Mongo to the app's satisfaction, but I'm not sure how that's done. This is on a VPS running Debian 11. |
Try running |
That worked perfectly, thank you. |
I've been struggling to self-host Revolt in docker with my NGINX reverse proxy for days now. I can't get it working via https. No matter what I change I get some variant of this error. Replacing mydomain.com with my actual domain...
All URLs that I can find have been adjusted for HTTPS, so what gives? I tried changing all my environment variables to HTTPS instead of HTTP. Changed WS to WSS. I'm using a reverse proxy, so I set HOSTNAME to :80. Maybe I need to do some work in NGINX proxy manager, but I can't figure out what's going on... Any tips? |
@Fifthdread I fixed that by moving each service to its own subdomain |
It's pain! Well documented! Im outside docker network with nginx. Must work too. Basicly the same . No Errors in Network / console, till i try to start voice chat........ i get:
|
somone got voice running? must be possible...i asked in the official supoprt channel from revolt and got the answer that voice is not running at the moment. but i tried it on the official webapp, not self hosted, it is working...so it must work selfhosted too. maybe without docker? I already tried it directly with port 80 and 443, no chance. |
Cant generate api keys, cause gitlab.insrt.uk timed out. A Nightmare. Took this, seems to work but smaller generated keys: |
@markiemm What is that second picture of? Is it a network device that you named nginx-proxy-manager_default? |
Using this has helped immensely, and I have now been able to get past the initial error on registering, but when I try to sign in after onboarding, I get the following error: Trying to connect to the websocket locally results in it dropping the connection immediately Any help would be greatly appreciated! Edit: I missed the trailing the slash in |
Guide updated and improved with #97 |
Seems like vortex is missing from this configuration, which makes voice calls broken (400 VosoUnavailable). I've been logging my experience here revoltchat/revite#989 (sorry if its in unrelated repo) UPD: Sorry. Read the whole conversation. Seems like vortex is not recommended for selfhosting and thus voice is not deployable at this time |
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!
The text was updated successfully, but these errors were encountered: