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

Strange difference between pio home and automatic start via platformio command with code-server in Docker #4035

Open
pandel opened this issue Apr 27, 2024 · 0 comments

Comments

@pandel
Copy link

pandel commented Apr 27, 2024

Hi!

I am currently running the latest release of PlatformIO under Docker.

  • code-server is reverse proxied via an SSL-secured NGINX proxy forwarded on port 8443
  • PlatformIO is configured to use 127.0.0.1 with port 8008.

I noticed some strange behaviour:

  • I am able to open the PlatformIO home page if i start pio home in a code-server terminal via https://docker.home.server:8443/proxy/8008/
  • I am not able to open it if code-server automatically starts PlatformIO process via
    /config/.platformio/penv/bin/python -m platformio -c vscode home --port 8008 --host 127.0.0.1 --session-id 73169f810b382f2316f52618e2d777b4b6efbfda --shutdown-timeout 3600 --no-open
    -> Resulting error message in browser window: Protected PlatformIO Home session

Why is that? What is pio home doing differently here?

I attach my main configuration files for reference:

compose.yaml

services:
  code-server:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - HASHED_PASSWORD=$HASHPW
      - SUDO_PASSWORD=sudopw
      - DOCKER_MODS=linuxserver/mods:code-server-python3|linuxserver/mods:universal-package-install
      - INSTALL_PACKAGES=mc
      - 'EXTENSIONS_GALLERY={"serviceUrl":"https://marketplace.visualstudio.com/_apis/public/gallery","itemUrl":"https://marketplace.visualstudio.com/items"}'
      - PATH=/config/.platformio/penv/bin:$PATH
    volumes:
      - ./config:/config
      - ./projects:/projects
        # - ./certs:/certs # not using because of PlatformIO
    expose:
      - 8443
      - 8008
    restart: unless-stopped

  nginx:
    image: nginx:latest
    container_name: nginx-proxy
    ports:
      - "8443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./certs:/etc/nginx/certs
    depends_on:
      - code-server
    restart: unless-stopped

networks: {}

nginx.conf

server {
  listen 443 ssl http2;
  server_name docker.home.server;
  ssl_certificate     /etc/nginx/certs/server.crt;
  ssl_certificate_key /etc/nginx/certs/server.key;

  location / {
    proxy_pass http://code-server:8443/;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Accept-Encoding gzip;
  }

}

Regards,
Holger

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

No branches or pull requests

1 participant