Back to Omniroute

Browser-login container

docker/vnc-browser/README.md

3.8.493.9 KB
Original Source

Browser-login container

OmniRoute can open an isolated browser for provider connections that require an interactive web login. The operator signs in through the browser UI, then OmniRoute reads only the credential fields declared for that provider through the Chrome DevTools Protocol (CDP) and writes them to the selected provider_connections row.

The feature is exposed through the management-authenticated /api/vnc-session routes. Browser and CDP ports are published on 127.0.0.1 only; they are not intended to be exposed directly to a network.

Build the required image

The current implementation uses the Chromium image in this directory. Build it before starting a browser-login session:

bash
docker build -t omniroute-vnc-chromium:local docker/vnc-browser/chromium

omniroute-vnc-chromium:local is the default image. Set OMNIROUTE_VNC_IMAGE only when using a compatible image that provides:

  • a browser UI on the configured container VNC port;
  • a reachable CDP endpoint on the configured container CDP port;
  • support for the CHROME_CLI environment variable used to pass the provider login URL and Chromium arguments;
  • persistent browser data under the configured profile directory.

The container image includes a local bridge because modern Chromium binds its debugger to loopback inside the container.

Ports and access

Docker assigns ephemeral host ports and binds them to loopback:

PurposeDefault container portHost exposure
Browser web UI3000127.0.0.1:<ephemeral>
DevTools/CDP bridge9223127.0.0.1:<ephemeral>

Remote operators must access the browser UI through an authenticated application proxy or an SSH tunnel. Do not publish either port on 0.0.0.0.

Configuration

VariableDefaultPurpose
OMNIROUTE_VNC_IMAGEomniroute-vnc-chromium:localCompatible browser image
OMNIROUTE_VNC_CONTAINER_VNC_PORT3000Browser UI port inside the container
OMNIROUTE_VNC_CONTAINER_CDP_PORT9223CDP bridge port inside the container
OMNIROUTE_VNC_CONTAINER_PROFILE_DIR/configProfile mount point inside the container
OMNIROUTE_VNC_PROFILE_DIR$HOME/.omniroute/browser-login-profilesHost profile root
OMNIROUTE_VNC_PERSIST_PROFILESfalseReuse a connection profile across sessions
OMNIROUTE_VNC_IDLE_MS600000Idle-session timeout in milliseconds
OMNIROUTE_VNC_MAX_MS1800000Maximum session lifetime in milliseconds
OMNIROUTE_VNC_MAX_SESSIONS4Maximum concurrent sessions
OMNIROUTE_VNC_READY_MS45000Browser/CDP startup timeout in milliseconds
OMNIROUTE_VNC_HARVEST_MS20000Credential-harvest timeout in milliseconds
OMNIROUTE_VNC_CHROMIUM_ARGSsee manifest.tsChromium command-line arguments
OMNIROUTE_DOCKER_BINdockerDocker-compatible CLI executable

Security and lifecycle

  • Sessions are scoped to a specific provider connection and use random session IDs.
  • Container names and persistent-profile path segments are sanitized.
  • Only declared cookie or storage keys are retained; arbitrary local or session storage is not copied into the database.
  • Startup failures remove the in-memory session, container, and non-persistent profile.
  • Concurrent stop requests are idempotent, and shutdown removes managed containers.
  • Harvest and CDP commands have bounded timeouts.
  • API responses must sanitize internal Docker, filesystem, CDP, and database errors.

Basic verification

bash
npm test -- tests/unit/vnc-session.test.ts
npm run typecheck

For an end-to-end check, build the image, start OmniRoute, create or select a supported web-provider connection, start a browser-login session through the management API, complete login through the returned UI URL, harvest credentials, and verify that the selected connection—not another account for the same provider—was updated.