coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
32.68k stars 1.73k forks source link

[Bug]: Terminal function doesn't seem to use the Websocket domain #3649

Open davidpp opened 1 week ago

davidpp commented 1 week ago

Error Message and Logs

I'm not able to use the Terminal feature.

Looking at my console, I'm seeing an attempt to connect to my "non websocket" url:

CleanShot 2024-09-30 at 22 50 41@2x

Where other features correctly use my websocket domain:

CleanShot 2024-09-30 at 22 51 43@2x

Steps to Reproduce

  1. Have a separate domain configured for WS connection
  2. Try to open a terminal session on a service

Example Repository URL

No response

Coolify Version

v4.0.0-beta.347

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04

Additional Information

No response

LEstradioto commented 1 week ago

How did you setup a different WS domain ?

djsisson commented 1 week ago

Traefik will send wss to the real-time container as long as you are accessing via the instance domain.

There is no need to change anything here

davidpp commented 1 week ago

Looking back at my note, the ws. subdomain is the pusher server.

The reason I had to configure a separate domain is because of Cloudflare Access since pusher is running on another port.

Knowing that this particular traffic is instead going through Traefik, it make sense that it's using the main domain then.

The issue is probably on the Cloudflare tunnel/access side then, I'll need to figure out why the error is happening

djsisson commented 6 days ago

@davidpp if youre using a tunnel, and the coolify domain isnt covered by a wildcard entry, then you just set the coolify suibdomain to be localhost 80, traefik will then route all traffic (http and wss) to the correct containers

CallMeSlinky commented 6 days ago

@davidpp I'm currently facing the same issue, please update if you find a resolution, thanks. 👍

CallMeSlinky commented 6 days ago

@davidpp I figured it out. My coolify is based at https://coolify.example.com I set this in Cloudflare tunnels for the terminal

image image

VipinGoyal commented 5 days ago

I tried this @CallMeSlinky , but I'm still getting same problem as per OP shared screenshot.

djsisson commented 5 days ago

if youre still running traefik, then from the above example, all you need to do is set coolify.example.com to be localhost 80

VipinGoyal commented 5 days ago

I just refreshed, what I found is that original error as per OP is gone after making changes as suggested by @CallMeSlinky , but terminal is not working. @djsisson Yes Im using default proxy coming from Coolify, no change in that, Im facing weird issue, after changing port number from 8000 to 80, Im getting this error in browser i.e.

coolify.example.com redirected you too many times. Try deleting your cookies. ERR_TOO_MANY_REDIRECTS

Am I missing something ?

djsisson commented 5 days ago

you need to set it as http in instancedomain in coolify

VipinGoyal commented 5 days ago

image

Do you mean value of IP address / Domain in server settings ? Currently its set as host.docker.internal, since Im not using wildcard domain. When I tried updating value of IP address / Domain to coolify.example.com, I got an alert like this, so before doing this thought of checking with you just to make sure that its not going to break existing setup

image

djsisson commented 5 days ago

no on settings page - > instance domain

VipinGoyal commented 5 days ago

Wao, it worked thanks a lot :) 🙏 So, coolify.example.com is mapped with localhost:80 instead of 8000, is it okay, If I remove other mappings in cloudflare ( public hostname ) like 6001 for realtime and 6002 for terminal/ws path, Im about to delete those, but just confirming with you once.

djsisson commented 5 days ago

if you are running a proxy like traefik,

then in tunnels you only need to point to http localhost : 80 and the proxy will take care of it or https localhost : 443 if you have setup certificates and require https in your containers

VipinGoyal commented 5 days ago

Sure, thanks for confirmation, its really helpful. 🙏

CallMeSlinky commented 5 days ago

Wao, it worked thanks a lot :) 🙏 So, coolify.example.com is mapped with localhost:80 instead of 8000, is it okay, If I remove other mappings in cloudflare ( public hostname ) like 6001 for realtime and 6002 for terminal/ws path, Im about to delete those, but just confirming with you once.

Nice, this worked for me too, a lot more simple. I was receiving ERR_TOO_MANY_REDIRECTS beforehand, but I believe it's because my instance domain was set to https. 👍