self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Update Caddyfile to fix the Web Socket and event

Open amitshuklabag opened this issue 1 year ago • 7 comments

Please make sure to check the following tasks before opening and submitting a PR

  • [x] I understand and have followed the contribution guide
  • [x] I have tested my changes locally and they are working as intended

amitshuklabag avatar Oct 11 '24 09:10 amitshuklabag

Not sure why you changed the 9000->14703 WEBSocket event. Since if you look at the docker ps:

revolt_api_1 ./revolt-delta Up 8000/tcp
revolt_autumn_1 ./autumn Up 3000/tcp
revolt_caddy_1 caddy run --config /etc/ca ...   Up 2019/tcp, 0.0.0.0:443->443/tcp,:::443->443/tcp, 443/udp, 0.0.0.0:80->80/tcp,:::80->80/tcp
revolt_createbuckets_1 /bin/sh -c /usr/bin/mc co ...   Up
revolt_database_1 docker-entrypoint.sh mongod Up 27017/tcp
revolt_events_1 ./revolt-bonfire Up 9000/tcp
revolt_january_1 ./january Up 7000/tcp
revolt_minio_1 /usr/bin/docker-entrypoint ...   Up 9000/tcp
revolt_redis_1 docker-entrypoint.sh keydb ...   Up 6379/tcp
revolt_web_1 docker-entrypoint.sh yarn ...   Up 5000/tcp

MarioninD avatar Oct 11 '24 11:10 MarioninD

You can see the docker logs of the event container it was running on 14703 and also WS failed if you used the 9000.

I see the error in the Frontend console for WS failed but after changing the port in the file it works fine.

amitshuklabag avatar Oct 11 '24 11:10 amitshuklabag

Maybe I'm looking in the wrong place?

root@srv:/opt/revolt# docker-compose logs events
Attaching to revolt_events_1
events_1         |  INFO  revolt_config > Starting [email protected]
events_1         |  ERROR os_info::architecture > Cannot invoke 'uname` to get architecture type: Os { code: 2, kind: NotFound, message: "No such file or directory" }
events_1         |  INFO  revolt_bonfire        > Listening on host 0.0.0.0:9000
root@srv:/opt/revolt# docker-compose logs caddy
Attaching to revolt_caddy_1
caddy_1          | {"level":"info","ts":1728648584.9283273,"msg":"using config from file","file":"/etc/caddy/Caddyfile"}
caddy_1          | {"level":"info","ts":1728648584.9417162,"msg":"adapted config to JSON","adapter":"caddyfile"}
caddy_1          | {"level":"info","ts":1728648584.964457,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
caddy_1          | {"level":"info","ts":1728648584.964795,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
caddy_1          | {"level":"info","ts":1728648584.9648235,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
caddy_1          | {"level":"info","ts":1728648584.9786484,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
caddy_1          | {"level":"info","ts":1728648584.9788485,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
caddy_1          | {"level":"info","ts":1728648584.9791305,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
caddy_1          | {"level":"info","ts":1728648584.9792416,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
caddy_1          | {"level":"info","ts":1728648584.9792528,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["chat.sohocom.ru"]}
caddy_1          | {"level":"info","ts":1728648584.9808626,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00021a500"}
caddy_1          | {"level":"info","ts":1728648584.9810252,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"50a09397-dd12-40d3-9257-034cca6af7f2","try_again":1728734984.9810236,"try_again_in":86399.999999572}
caddy_1          | {"level":"info","ts":1728648584.9811287,"logger":"tls","msg":"finished cleaning storage units"}
caddy_1          | {"level":"info","ts":1728648584.9811795,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
caddy_1          | {"level":"info","ts":1728648584.9811926,"msg":"serving initial configuration"}

MarioninD avatar Oct 11 '24 12:10 MarioninD

Not sure, why your and my was different.

As I'm using the same https://github.com/revoltchat/self-hosted/blob/master/compose.yml#L50C12-L50C32 with latest tag. and here are my logs:

docker-compose logs events
app-events-1  |  INFO  revolt_config > Starting [email protected]
app-events-1  |  ERROR os_info::architecture > Cannot invoke 'uname` to get architecture type: Os { code: 2, kind: NotFound, message: "No such file or directory" }
app-events-1  |  INFO  revolt_bonfire        > Listening on host 0.0.0.0:14703
app-events-1  |  INFO  revolt_bonfire        > User connected from 172.21.0.5:45426
app-events-1  |  INFO  revolt_bonfire::websocket > User 172.21.0.5:45426 provided protocol configuration (version = 1, format = Json)
app-events-1  |  INFO  revolt_bonfire::websocket > User 172.21.0.5:45426 authenticated as @TheBoss

amitshuklabag avatar Oct 11 '24 12:10 amitshuklabag

I got it, I'm sorry. 🐱‍👤

MarioninD avatar Oct 11 '24 12:10 MarioninD

with latest tag

Then you should probably have specified the tag too, otherwise it will cause problems as the specified version is still running on the old port.

JoCat avatar Oct 15 '24 13:10 JoCat

I got it, I'm sorry. 🐱‍👤

What was the issue?

amitshuklabag avatar Oct 21 '24 14:10 amitshuklabag