balena-io-experimental / browser

A drop-in web browser block
96 stars 70 forks source link

remote debug session not working #165

Open basz opened 7 months ago

basz commented 7 months ago

Hi

I'm am trying to get a remote debug session working and can only get it to work with network_mode: host. Unfortunatly that is not an option as the running SPA clients needs to resolve other services via the internal docker DNS service names.

What does work with network_mode: host

tunnel directly into the device with

ssh -i /Users/bas/.ssh/special-identity-rsa -L 0.0.0.0:9222:127.0.0.1:9222 root@192.168.178.222 -p 22222

or with a balena tunnel (for real remote devices) and then a tunnel trhough that tunnel

balena tunnel e41e86a041857b8db2c75cb4956a32f3 -p 22222:127.0.0.1:4321
// other session
ssh -i /Users/bas/.ssh/special-identity-rsa -L 9222:127.0.0.1:9222 root@127.0.0.1 -p 4321

The debug session shows up at chrome://inspect/devices#devices but the SPA is not loaded or not working correctly.

So this seems a configuration issue. What coudl it be...

My docker-compose.yaml


  browser:
    image: bh.cr/balenalabs/browser-aarch64/2.5.1
    depends_on:
      - controller
    restart: always
    # we can *not* use `network_mode: host` as the browser container needs to be able resolve hosts running
    # inside the docker compose context. In addition we *must* also use an explicit LAUNCH_URL as automatic
    # discovery of an exposed http service requires 'work_mode: host'.
    # network_mode: host
    ports:
      # - '5011' # management API (optional)
      - "9222:9222" # Chromium debugging port (optional) http://192.168.178.222:9222/
    environment:
      - LAUNCH_URL=http://controller:5051
      - REMOTE_DEBUG_PORT=9222
      - KIOSK=1
      - LOCAL_HTTP_DELAY=0
      - SHOW_CURSOR=0
      - PERSISTENT=0
      - ENABLE_GPU=1
ignore-gpu-blocklist --enable-gpu-rasterization)
      - FLAGS=--disable-extensions --no-sandbox --password-store=detect --kiosk --incognito --disable-translate --disable-ipv6 --bwsi --auto-launch-at-startup --console --disable-sync --enable-accelerated-2d-canvas --noerrdialogs --no-message-box --no-first-run --start-fullscreen --disable-hang-monitor --disable-infobars --disable-logging --disable-sync --disable-settings-window --disable-pinch --overscroll-history-navigation=0 --disable-session-crashed-bubble --content-shell-hide-toolbar --touchscreen-usable-while-screen-off --disable-features="OverscollHistoryNavigation" --ignore-gpu-blocklist --enable-gpu-rasterization --user-data-dir=remote-profile
phil-d-wilson commented 7 months ago

Hey @basz

Thanks for the report. I'll try and look into it, but up front I don't know when. I'll set myself a reminder for the first week of 2024, and see what I can figure out.

Phil

basz commented 7 months ago

Hi Phil,

That's more than I dare to ask. Would be great if you could figure this oh it. I'm sure it's a configuration detail but no luck here.

Also asked Omar various places (discord docker and balena forums)

Have a great holiday!

Bas

basz commented 6 months ago

Hello Phil, just a gentle reminder to this ticket.

basz commented 5 months ago

Hai Phil. Did you ever managed to have a look at this? I would love to be able to do remote debugging as a support capability.