Skip to content

CLI

The browserbay command is what the Docker images run. From a checkout, run it as node dist/cli.js <command> after pnpm build.

start and node launch Chromium, and the images include one. Anywhere else, set BROWSERBAY_CHROMIUM_EXECUTABLE to a Chromium, such as the one Playwright installs (pnpm exec playwright install chromium). Without one they exit with Chromium was not found. secret and key need no browser.

CommandDoes
browserbay startThe relay and a browser node in one process. The simplest box, and the default in the browserbay image.
browserbay relayThe relay alone. Clients and remote nodes connect to it. The default in the browserbay-relay image.
browserbay nodeA browser node alone. It dials out to a relay.
browserbay secret [name]Makes an enrollment secret for a node, and the entry the relay needs for it. The name defaults to node.
browserbay key [name [--namespace ns] [--quota n]]Prints a new API key. With a name it also prints the BROWSERBAY_API_KEYS entry the relay needs, optionally confined to a namespace with a quota of slots. See Several API keys.
browserbay web-bot-authMakes the Ed25519 key a box signs its browsers’ requests with (Web Bot Auth), and prints the settings that use it.

Settings are environment variables. See Configuration.

Terminal window
docker run --rm ghcr.io/degoke/browserbay secret laptop
Give the node: BROWSERBAY_ENROLLMENT_SECRET=<secret>
Give the relay: BROWSERBAY_ENROLLMENT_SECRETS=laptop:<sha256> (comma-separate several)

The name may contain letters, digits, _, . and -. It is what the relay calls the node in its logs. The relay stores only the hash.

Terminal window
docker run --rm ghcr.io/degoke/browserbay key # a bare key, for BROWSERBAY_API_KEY
docker run --rm ghcr.io/degoke/browserbay key billing --namespace billing --quota 5
Give the service: BROWSERBAY_API_KEY=<key> (as the client's apiKey)
Give the relay: BROWSERBAY_API_KEYS=billing:<sha256>:billing:5 (comma-separate several)
The service must create its browsers with namespace "billing".

A name and a namespace may contain letters, digits, _, . and -. --quota needs --namespace.

key always makes a new key. To use one you already have, hash it yourself: see A key you already have.

Terminal window
docker run --rm ghcr.io/degoke/browserbay web-bot-auth
Give the relay and every node that signs: BROWSERBAY_WEB_BOT_AUTH_KEY='{"kty":"OKP","crv":"Ed25519","d":"...","x":"...","kid":"..."}'
Its id, which is what a site looks the key up by: <thumbprint>
On each node that signs, say how and where the box says it is:
BROWSERBAY_WEB_BOT_AUTH=optional (or "always": sign every slot, and not only the ones that ask)
BROWSERBAY_WEB_BOT_AUTH_AGENT=https://<the address your relay is served at>
The relay then publishes the public key at https://<your relay>/.well-known/http-message-signatures-directory

The key is private: keep it like a password, and give it to the relay and to the nodes that sign, as a secret. It is shown once. The id is the JWK thumbprint of the public key, the same on every machine. See Identify your box to sites.

A bad setting prints a sentence, not a stack trace, and exits with status 2. An unknown command also exits 2. Other failures exit 1. When Chromium dies, a node exits with status 1 so the platform restarts it.