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] SWAG and VSCode from linux server working together #34

Closed
1 task done
moskovskiy82 opened this issue Jan 13, 2025 · 4 comments
Closed
1 task done

[BUG] SWAG and VSCode from linux server working together #34

moskovskiy82 opened this issue Jan 13, 2025 · 4 comments

Comments

@moskovskiy82
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Trying tp get two images from linuxserver for remote access. With no luck getting the
"An unexpected error occurred that requires a reload of this page.
The workbench failed to connect to the server (Error: WebSocket close with status code 1006)"

Below left the comments in config files to see what i've tried

Expected Behavior

No response

Steps To Reproduce

Docker compose SWAG

services:
  swag:
    container_name: nginx
    image: linuxserver/swag
    cap_add:
    - NET_ADMIN
    environment:
    - PUID=1000
    - PGID=1000
    - URL=domain.com
    - SUBDOMAINS=wildcard
    - VALIDATION=dns
    - DNSPLUGIN=cloudflare
    - EMAIL=my email #optional
    volumes:
    - ./config:/config
    ports:
    - 443:443
    - 80:80 #optional
    restart: unless-stopped

docker compose VSCODE

services:
  vscode:
    container_name: vscode
    image: linuxserver/code-server:latest
    volumes:
      - /Hass/config:/config:/home/coder/project
      - /Hass/config/cs:/home/coder/.local/share/code-server
    ports:
      - "8443:8443"
    environment:
      - PUID=116
      - PGID=812
      - HOMEASSISTANT_URL=https://xxx
      - HOMEASSISTANT_TOKEN=xxx
      - DEFAULT_WORKSPACE=/home/coder/project
      - PROXY_DOMAIN=vsc.domain.com
    restart: unless-stopped

Site config Nginx

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

server
{
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name vsc.domain.com

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location /
    {
        auth_basic "Restricted";
        auth_basic_user_file /config/nginx/.htpasswd;

        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
#       proxy_set_header Accept-Encoding gzip;
#       proxy_set_header Origin https://$host;
#       proxy_set_header Host $host;
#       proxy_set_header X-Forwarded-For $remote_addr;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app vscode internal ip;
        set $upstream_port 8443;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

Mentioned above

Container logs

Applicable

File not found: /app/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js

File not found: /app/code-server/lib/vscode/extensions/git-base/dist/browser/extension.js

File not found: /app/code-server/lib/vscode/extensions/merge-conflict/dist/browser/mergeConflictMain.js

File not found: /app/code-server/lib/vscode/node_modules/vsda/rust/web/vsda_bg.wasm

File not found: /app/code-server/lib/vscode/node_modules/vsda/rust/web/vsda.js
Copy link

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

@aptalca
Copy link
Member

aptalca commented Jan 13, 2025

The default SWAG config works. Don't customize it with your own websocket or header stuff.

@aptalca aptalca closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2025
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Jan 13, 2025
@moskovskiy82
Copy link
Author

moskovskiy82 commented Jan 13, 2025

Do i need to have them on the same docker compose on stack so the swag will catch the container name? Not that strong at regex expression so left as is

server_name code-server.* "~^[0-9]{1,10}\.code-server\..*$";

Created a domain name for code-server.domain.com

Changed docker env for vs code to

  - PROXY_DOMAIN=code-server.domain.com

Still not much luck as connection is refused

ERR_CONNECTION_REFUSED

Couldn't find any tutorial online for such a setup

@aptalca
Copy link
Member

aptalca commented Jan 13, 2025

That's a different error than before. If you need help with figuring stuff out, you can ask on our discord or forum. This is for bug reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants