linuxserver / docker-kasm

Kasm Workspaces platform provides enterprise-class orchestration, data loss prevention, and web streaming technology to enable the delivery of containerized workloads to your browser.
GNU General Public License v3.0
299 stars 28 forks source link

[BUG] Running Kasm on any other port than 443 behind Cloudflare Tunnels does not allow opening sessions #27

Closed rursache closed 1 year ago

rursache commented 1 year ago

Is there an existing issue for this?

Current Behavior

Currently I have Kasm installed on port 18260 instead of the default 443.

https://LOCALIP:18260 works perfectly however my cloudflare tunnel https://kasm.domain.tld is not able to start any session

The Chrome console is full of errors because Kasm is trying to open https://kasm.domain.tld:18260 instead of https://kasm.domain.tld

Expected Behavior

The remote (cloudflare url) should work 1:1 as the local one

Steps To Reproduce

  1. Execute the docker run command below
  2. Map the cloudflare tunnel to your domain
  3. Test it

Environment

- OS: Ubuntu 22.04.2 LTS x86_64
- How docker service was installed: via the official install script

CPU architecture

x86-64

Docker creation

docker run -d \
  --name kasm \
  --restart unless-stopped \
  --privileged \
  -p 18260:18260 \
  -p 18261:3000 \
  -e KASM_PORT=18260 \
  -e DOCKER_HUB_USERNAME="EMAIL" \
  -e DOCKER_HUB_PASSWORD="PASS" \
  -v /home/radu/.kasm/data:/opt \
  -v /home/radu/.kasm/profiles:/profiles \
  -v /dev/input:/dev/input \
  -v /run/udev/data:/run/udev/data \
  lscr.io/linuxserver/kasm:latest

Container logs

https://pastebin.com/8kEZjYXS
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

rursache commented 1 year ago

Forgot to add, I'm not sure if this is a lsio issue or a Kasm issue, if it's not on you guys let me know and i'll move it to them. Thanks!

thelamer commented 1 year ago

This is a Kasm thing you need to set your proxy port to 0 in the guide here, then it absorbs it from whatever the current url scheme is https://www.kasmweb.com/docs/latest/how_to/reverse_proxy.html#update-zones

I need to whip up a swag reverse proxy conf and add this in the readme as you are not the first person to stumble on this, please don't close this issue so I remember.

rursache commented 1 year ago

Thank you @thelamer, setting Proxy Port to 0 in Kasm - Admin - Zones - default zone (edit) fixed it for me!

thelamer commented 1 year ago

This is now docced in the readme