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.
| Command | Does |
|---|---|
browserbay start | The relay and a browser node in one process. The simplest box, and the default in the browserbay image. |
browserbay relay | The relay alone. Clients and remote nodes connect to it. The default in the browserbay-relay image. |
browserbay node | A 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-auth | Makes 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.
secret
Section titled “secret”docker run --rm ghcr.io/degoke/browserbay secret laptopGive 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.
docker run --rm ghcr.io/degoke/browserbay key # a bare key, for BROWSERBAY_API_KEYdocker run --rm ghcr.io/degoke/browserbay key billing --namespace billing --quota 5Give 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.
web-bot-auth
Section titled “web-bot-auth”docker run --rm ghcr.io/degoke/browserbay web-bot-authGive 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-directoryThe 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.
Exit codes
Section titled “Exit codes”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.