Skip to content
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

[BUG] Webtop not working under reverse proxy (undefined is not an object evaluating UI.rfb.lastActiveAt #242

Open
1 task done
lamousis opened this issue May 7, 2024 · 5 comments

Comments

@lamousis
Copy link

lamousis commented May 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have installed webtop container (arm64 with alpine-mate tag) and it works fine on lan. Nut if I use it under my nginx reverse proxy I get this error KASMVNC encountered an error TypeError: undefined is not an object (evaluating UI.rfb.lastActiveAt)
In the same nginx reverse proxy I also have filebrowser and jdowloader containers along with webtop and they are working fine. They are all in the same machine. The only problem comes with webtop, no matter what version I install
This is my nginx.conf

`map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

upstream docker-jdownloader2 {
    # If the reverse proxy server is not running on the same machine as the
    # Docker container, use the IP of the Docker host here.
    # Make sure to adjust the port according to how port 5800 of the
    # container has been mapped on the host.
    server 172.17.0.4:5800;
}


upstream docker-webtop {
    server 172.17.0.5:3000;
}

server {
listen 8443 ssl;
# server_name localhost;
server_name examplr.duckdns.org;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
ssl_certificate /etc/letsencrypt/live/example.duckdns.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.duckdns.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

    location / {
        root   html;
        index  index.html index.htm;
    }
    
    location /app1 {
        proxy_buffers 8 32k;
        proxy_buffer_size 64k;
        client_max_body_size 75M;
        proxy_pass http://172.17.0.3;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        #proxy_set_header X-NginX-Proxy true;

        # enables WS support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forward-Proto $scheme;
        proxy_redirect off;
        proxy_read_timeout 999999999;
    }

    location = /jdownloader2 {return 301 $scheme://$http_host/jdownloader2/;}
    location /jdownloader2/ {
            proxy_pass http://docker-jdownloader2/;
            location /jdownloader2/websockify {
                    proxy_pass http://docker-jdownloader2/websockify/;
                    proxy_http_version 1.1;
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection $connection_upgrade;
                    proxy_read_timeout 86400;
            }
    }

location = /webtop {return 301 $scheme://$http_host/webtop/;}
location ^~ /webtop/ {
proxy_pass http://docker-webtop/;
location /webtop/websockify {
proxy_pass http://docker-webtop/websockify;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}`

Expected Behavior

It should load the webtop without any problem just like it does on lan

Steps To Reproduce

  1. Install arm64 alpine-mate container with docker-cli and run it through nginx reverse proxy
  2. With the above config of nginx I see the error mentioned

Environment

- OS:Ubuntu 22.04
- How docker service was installed:docker-cli following the instructions on linuxserver/webtop docker hub

CPU architecture

arm64

Docker creation

Using the instructions on linuxserver/webtop in docker hub

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

Xvnc KasmVNC 1.2.0 - built Nov 25 2023 18:45:15
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.2.0 - built Nov 25 2023 18:45:15
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.2.0 - built Nov 25 2023 18:45:15
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.2.0 - built Nov 25 2023 18:45:15
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.2.0 - built Nov 25 2023 18:45:15
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.2.0 - built Nov 25 2023 18:45:15
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
Copy link

github-actions bot commented May 7, 2024

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

@j0nnymoe
Copy link
Member

j0nnymoe commented May 7, 2024

Webtop works fine behind a reverse proxy, you need to make sure you're handling websockets correctly.
We provide a proxy conf with our swag container you can use for reference: https://github.com/linuxserver/reverse-proxy-confs/blob/master/webtop.subdomain.conf.sample

@lamousis
Copy link
Author

lamousis commented May 7, 2024

I got it working. Apparently it doesn't work with a subfolder (example.duckdns.org/webtop) but with the reverse proxy root itself (example.duckdns.org). Is the a way to work with subfolder? Every time in the location directive if I use location /webtop I get the ui.rfb.lastActiveAt error.
Also in the nginx error log I get this
2024/05/06 20:16:33 [error] 2889#0: *523 open() "/usr/local/nginx/html/websockify" failed (2: No such file or directory), client: x.x.x.x, server: example.duckdns.org, request: "GET /websockify HTTP/1.1", host: "example.duckdns.org:8443"

@j0nnymoe
Copy link
Member

j0nnymoe commented May 7, 2024

Should work fine with subfolders, we provide a config for that too. Your error looks like it's having issues with web sockets.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Issues
Development

No branches or pull requests

3 participants