progon-agent 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +288 -29
- package/dist/supervisor/cli.js +315 -50
- package/extension-bundle.json +3 -3
- package/extension-dist/background/background.js +142 -119
- package/extension-dist/card/card.css +1 -1
- package/extension-dist/card/card.html +11 -10
- package/extension-dist/card/card.js +3 -3
- package/extension-dist/chunks/shared--PKAvBPy.js +1 -0
- package/extension-dist/chunks/shared-0jT00uC5.js +317 -0
- package/extension-dist/chunks/shared-8TdX8bnw.js +1 -0
- package/extension-dist/chunks/shared-BBwL-FWr.js +8 -0
- package/extension-dist/chunks/shared-BECVQaqd.js +1 -0
- package/extension-dist/chunks/shared-BGvIl9us.js +1 -0
- package/extension-dist/chunks/shared-BYkDbcM2.js +372 -0
- package/extension-dist/chunks/shared-BdaUsVif.css +1 -0
- package/extension-dist/chunks/shared-CDlAJRnF.js +117 -0
- package/extension-dist/chunks/shared-CQ5Ygj2p.js +1 -0
- package/extension-dist/chunks/shared-CnMBv8Ku.js +1 -0
- package/extension-dist/chunks/shared-CyNKhHOY.js +1 -0
- package/extension-dist/chunks/shared-D3X5MuUz.js +1 -0
- package/extension-dist/chunks/shared-D7GfVHk0.js +129 -0
- package/extension-dist/chunks/shared-QityJbuK.css +1 -0
- package/extension-dist/chunks/shared-U9lBnzuH.js +33 -0
- package/extension-dist/chunks/shared-VvEftNwZ.js +1 -0
- package/extension-dist/chunks/shared-XKyaHtl9.js +1 -0
- package/extension-dist/chunks/shared-fJPHxpB5.css +1 -0
- package/extension-dist/chunks/shared-o0-3vI--.js +193 -0
- package/extension-dist/chunks/shared-uKTblxo0.js +15 -0
- package/extension-dist/content/canvas-interceptor.js +1 -1
- package/extension-dist/content/canvas-mapbox-bridge-main.js +1 -1
- package/extension-dist/content/content.css +1 -1
- package/extension-dist/content/content.js +289 -336
- package/extension-dist/content/early-nonce-inject.js +1 -1
- package/extension-dist/content/frame.js +160 -0
- package/extension-dist/content/main-world-nav.js +1 -1
- package/extension-dist/manifest.json +36 -45
- package/extension-dist/offscreen/offscreen.html +2 -2
- package/extension-dist/offscreen/offscreen.js +1 -1
- package/extension-dist/popup/popup.html +9 -9
- package/extension-dist/popup/popup.js +3 -3
- package/extension-dist/sidepanel/sidepanel.css +1 -1
- package/extension-dist/sidepanel/sidepanel.html +13 -13
- package/extension-dist/sidepanel/sidepanel.js +1 -1
- package/extension-dist/workspace/workspace.css +1 -1
- package/extension-dist/workspace/workspace.html +13 -13
- package/extension-dist/workspace/workspace.js +121 -53
- package/npm-shrinkwrap.json +469 -0
- package/package.json +17 -12
- package/extension-dist/chunks/shared-B5u-B6Qn.css +0 -1
- package/extension-dist/chunks/shared-BLDboBjL.js +0 -348
- package/extension-dist/chunks/shared-BdUzhaBn.js +0 -39
- package/extension-dist/chunks/shared-Bl2B_Px5.js +0 -1
- package/extension-dist/chunks/shared-CD1T06ac.js +0 -98
- package/extension-dist/chunks/shared-CDXdhl3P.js +0 -8
- package/extension-dist/chunks/shared-CVlB4Tu3.js +0 -15
- package/extension-dist/chunks/shared-Cz00vYCW.js +0 -1
- package/extension-dist/chunks/shared-D8QWnY4m.css +0 -1
- package/extension-dist/chunks/shared-DDffpwXS.js +0 -134
- package/extension-dist/chunks/shared-D_QceNk9.js +0 -254
- package/extension-dist/chunks/shared-Dp2jkJ8R.js +0 -1
- package/extension-dist/chunks/shared-Jcq39euZ.js +0 -199
- package/extension-dist/chunks/shared-R5ipc0Sn.js +0 -1
- package/extension-dist/chunks/shared-eZL18n5t.css +0 -1
- package/extension-dist/chunks/shared-gwUGKre-.js +0 -1
- package/extension-dist/chunks/shared-hePW80VL.js +0 -1
- package/extension-dist/chunks/shared-kKZVALIt.js +0 -1
- package/extension-dist/chunks/shared-nJgqlX01.js +0 -1
- package/extension-dist/chunks/shared-q9EK7cIP.js +0 -1
- package/extension-dist/chunks/shared-tcQ7xPb-.js +0 -1
- package/extension-dist/content/canvas-mapbox-fiber-discovery.js +0 -1
package/README.md
CHANGED
|
@@ -50,6 +50,27 @@ and Node escape hatches apply to the download exactly as they later apply to the
|
|
|
50
50
|
| `PLAYWRIGHT_DOWNLOAD_HOST` | The Playwright CDN is blocked — point this at an internal mirror |
|
|
51
51
|
| `PLAYWRIGHT_BROWSERS_PATH` | The browser cache must live somewhere other than the per-user default |
|
|
52
52
|
|
|
53
|
+
### Browser sandbox
|
|
54
|
+
|
|
55
|
+
The agent runs Chromium with its sandbox, and `start` proves that this works before it does
|
|
56
|
+
anything else: it starts a throwaway browser and stops with exit `1` if the system refuses. The
|
|
57
|
+
refusal quotes Chromium's own output. The usual causes:
|
|
58
|
+
|
|
59
|
+
| Where | Cause | What to do |
|
|
60
|
+
| --------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| Ubuntu 23.10 or newer | AppArmor restricts unprivileged user namespaces | Give Chromium an AppArmor profile: [Chromium's instructions](https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md) |
|
|
62
|
+
| A container | Docker's default seccomp profile blocks the namespaces Chromium needs | Use a seccomp profile that allows them |
|
|
63
|
+
| Running as `root` | Chromium refuses to use its sandbox as root | Run the agent as an ordinary user |
|
|
64
|
+
|
|
65
|
+
Where none of these can be changed, you can turn the sandbox off on this machine. Without it, a
|
|
66
|
+
renderer exploit on any page a run opens gets the rights of the user the agent runs as: their
|
|
67
|
+
files, this agent's token and the browser profile. Only you can make this decision: nothing a
|
|
68
|
+
Progon user dispatches can turn the sandbox off on your machine.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
PROGON_AGENT_DISABLE_BROWSER_SANDBOX=true progon-agent start
|
|
72
|
+
```
|
|
73
|
+
|
|
53
74
|
### Self-signed stands
|
|
54
75
|
|
|
55
76
|
An internal stand behind a certificate this machine does not trust is refused by the run browser,
|
|
@@ -114,12 +135,22 @@ there, run the commands one at a time.
|
|
|
114
135
|
### Updating
|
|
115
136
|
|
|
116
137
|
```bash
|
|
117
|
-
|
|
138
|
+
progon-agent update # the latest release
|
|
139
|
+
progon-agent update --version 1.6.0 # one exact release
|
|
118
140
|
```
|
|
119
141
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
142
|
+
`update` stops the agent of the state directory and every running progon-agent service (they run
|
|
143
|
+
the code being replaced), installs the release with the npm that installed this package into the
|
|
144
|
+
same global prefix, reports the version now on disk, prepares Chromium for it, and starts the
|
|
145
|
+
services that were running again through the OS. Services that were stopped stay stopped. The
|
|
146
|
+
enrollment is kept. An agent you ran in a terminal is not started again for you — the command prints
|
|
147
|
+
the `progon-agent start` line to run. If the
|
|
148
|
+
installation is not a global npm install, `update` says so and changes nothing; update it the way
|
|
149
|
+
it was installed. `npm i -g progon-agent@latest` still works and does the same install without
|
|
150
|
+
stopping the agent.
|
|
151
|
+
|
|
152
|
+
If the update crosses a change in the local-agent wire protocol, the agent will also ask you to
|
|
153
|
+
re-enroll; see [Troubleshooting](#6-troubleshooting).
|
|
123
154
|
|
|
124
155
|
### `EACCES` on a global install
|
|
125
156
|
|
|
@@ -152,6 +183,13 @@ because a credential already exists.) The command redeems the code, persists the
|
|
|
152
183
|
server URL with it — and exits: it does not start the daemon, does not download Chromium and does
|
|
153
184
|
not need the extension dist.
|
|
154
185
|
|
|
186
|
+
At the end it asks **"Start the runner automatically in the background? (Y/n)"** — yes (the
|
|
187
|
+
default) runs `progon-agent service enable` ([Run in the background](#run-in-the-background)), no
|
|
188
|
+
runs `service disable`. `--autostart` / `--no-autostart` answer it without asking (both forms of
|
|
189
|
+
`enroll` take them; both at once is a command-line error). Without a terminal and without a flag
|
|
190
|
+
nothing is asked and the service registration stays as it was. If the service cannot be set up, the
|
|
191
|
+
enrollment is kept: the command prints why, the command that retries it, and exits `1`.
|
|
192
|
+
|
|
155
193
|
### Enroll without a code (browser approval)
|
|
156
194
|
|
|
157
195
|
If you would rather not carry a one-shot code to the machine — or you are asking an assistant to
|
|
@@ -280,10 +318,13 @@ The credential and the server URL live together in one state directory, so a sec
|
|
|
280
318
|
a second directory:
|
|
281
319
|
|
|
282
320
|
```bash
|
|
283
|
-
|
|
284
|
-
|
|
321
|
+
progon-agent enroll --server "https://staging.example" --state-dir ~/.progon-agent-staging
|
|
322
|
+
progon-agent start --state-dir ~/.progon-agent-staging
|
|
285
323
|
```
|
|
286
324
|
|
|
325
|
+
`--state-dir <path>` on `enroll`, `start`, `status`, `stop`, `reset`, `doctor` and `update` is the same as
|
|
326
|
+
setting `PROGON_RUNNER_STATE_DIR` for that one command.
|
|
327
|
+
|
|
287
328
|
Running `enroll` for a different deployment **without** a separate state directory is refused: the
|
|
288
329
|
command reports which deployment this machine is already enrolled against, exits `1`, and removes
|
|
289
330
|
nothing — a credential is only ever deleted by you.
|
|
@@ -304,6 +345,15 @@ variable. (Set `PROGON_SERVER_URL` and it must match the enrollment.) The daemon
|
|
|
304
345
|
extension dist → Chromium → gateway), then reconciles the backend's desired state and executes the
|
|
305
346
|
runs it is given, until you stop it.
|
|
306
347
|
|
|
348
|
+
One agent runs per state directory. A second `start` on the same directory starts nothing: it
|
|
349
|
+
says which process is already running (pid, version, since when) and exits `0`. The claim is held
|
|
350
|
+
by the running process itself (a socket in the state directory; a named pipe on Windows), so a
|
|
351
|
+
crashed or killed agent does not block the next `start`. The state directory is made private to
|
|
352
|
+
your user (`0700`) when the agent takes it, and the commands that talk to a running agent (`status`,
|
|
353
|
+
`stop`, `service …`) and the agent prove to each other that they know `control.key` in that
|
|
354
|
+
directory — so another user can neither ask nor stop your agent, nor pose as it by taking the
|
|
355
|
+
Windows pipe name first.
|
|
356
|
+
|
|
307
357
|
```bash
|
|
308
358
|
progon-agent install-browser
|
|
309
359
|
```
|
|
@@ -317,28 +367,89 @@ no-op.
|
|
|
317
367
|
progon-agent --help
|
|
318
368
|
```
|
|
319
369
|
|
|
370
|
+
### Run in the background
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
progon-agent service enable # register with the OS and start
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
The agent of a state directory runs as an OS service of your user — no administrator rights:
|
|
377
|
+
|
|
378
|
+
| OS | What is registered | Starts | Output |
|
|
379
|
+
| ------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
380
|
+
| Linux | systemd user unit `~/.config/systemd/user/progon-agent.service`, lingering on | at boot (at login if lingering cannot be turned on — the command prints the `sudo loginctl enable-linger` to run) | `journalctl --user -u progon-agent` |
|
|
381
|
+
| macOS | LaunchAgent `~/Library/LaunchAgents/io.progon.agent.plist` | at login | `service.log` in the state directory |
|
|
382
|
+
| Windows | Task Scheduler task `progon-agent` (logon trigger) | at login | `service.log` / `service-error.log` in the state directory |
|
|
383
|
+
|
|
384
|
+
The registration **is** the autostart setting: there is no other switch. A state directory other
|
|
385
|
+
than the standard one gets its own service, named with 8 hex characters of its path
|
|
386
|
+
(`progon-agent-1a2b3c4d`), so two directories are two independent services.
|
|
387
|
+
|
|
388
|
+
The settings the service runs with — `PROGON_SERVER_URL`, the proxy variables, `NODE_EXTRA_CA_CERTS`
|
|
389
|
+
and `PROGON_AGENT_EXTRA_CA_CERTS`, `PLAYWRIGHT_BROWSERS_PATH` and the other `PROGON_AGENT_*`
|
|
390
|
+
settings — are copied from the environment of the `service enable` command into the registration.
|
|
391
|
+
Run `service enable` again with other settings and it rewrites the registration and restarts the
|
|
392
|
+
service. `PROGON_AGENT_TOKEN` is never copied: the service uses the enrollment of its directory.
|
|
393
|
+
|
|
394
|
+
| Command | What it does |
|
|
395
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
396
|
+
| `progon-agent service enable` | Registers and starts the service. An agent started with `start` in a terminal is stopped gracefully and the service takes over. Repeating it changes nothing. Refuses a directory that is not enrolled. |
|
|
397
|
+
| `progon-agent service disable` | Stops the service and removes the registration. The enrollment and the package stay. |
|
|
398
|
+
| `progon-agent service start` | Starts the service (`enable` first if it is not registered), with the same hand-over from a terminal. |
|
|
399
|
+
| `progon-agent service stop` | Stops it. The registration stays, so it starts again at the next boot/login. |
|
|
400
|
+
| `progon-agent service restart` | `stop`, then `start`. |
|
|
401
|
+
| `progon-agent service status` | What the OS holds (loaded, running, last exit code), where the log is, and what runs now. |
|
|
402
|
+
|
|
403
|
+
All of them take `--state-dir <path>`. Success of `enable`/`start` is the service process
|
|
404
|
+
answering, not the OS command's exit code.
|
|
405
|
+
|
|
406
|
+
**When the service restarts.** After a crash or an exit `1`, the OS starts it again (systemd and
|
|
407
|
+
launchd after 10 s, Task Scheduler after a minute). It does **not** restart after a stop that no
|
|
408
|
+
restart cures — revoked, re-enrollment required, the version floor, a refused configuration: on
|
|
409
|
+
Linux that exit is `78`, excluded with `RestartPreventExitStatus=78`; launchd and Task Scheduler
|
|
410
|
+
cannot exclude one exit code, so under them the service exits `0` for these outcomes. The log line
|
|
411
|
+
before the exit says what to do. A graceful stop (`stop`, `service stop`) exits `0` and is not
|
|
412
|
+
restarted either.
|
|
413
|
+
|
|
414
|
+
### Managing the agent
|
|
415
|
+
|
|
416
|
+
| Command | What it does |
|
|
417
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
418
|
+
| `progon-agent --version` | Prints the package version. No network. |
|
|
419
|
+
| `progon-agent status` | The version, the state directory and where it came from, the enrollment (agent id, server), and whether an agent is running for it (pid, version, since when, the active run). No network; changes nothing. |
|
|
420
|
+
| `progon-agent stop` | Stops the agent of the state directory — started in a terminal or as the service — the same way Ctrl-C does: the browser is closed and the run is reported first. Works on every OS: the request goes over the control channel, which only this user's agent of this directory answers. Nothing running is not an error. Autostart stays on. |
|
|
421
|
+
| `progon-agent reset` | Disconnects this machine: stops the agent, removes its OS service (autostart off), deletes its credential and browser profiles, and asks the server to revoke this agent. The package and Chromium stay. If the server cannot be reached, the local part is still done and the command says that the record may remain in **Settings → Agents**. |
|
|
422
|
+
| `progon-agent doctor` | Checks the installation, the state directory, the proxy and certificate settings, what `start` would connect to and with which credential (local checks only — doctor sends nothing to the server), Chromium (downloads it if missing), its sandbox and the OS service. Exits `1` if any check failed. |
|
|
423
|
+
| `progon-agent uninstall` | `reset` for the standard state directory, `PROGON_RUNNER_STATE_DIR`, every `--state-dir` you pass and the directory of every OS service of this installation, then this installation's Chromium and the package. A service another npm installation registered — and its directory — is left to that installation. Files it did not write are kept, with their directory. What could not be removed is listed with the command that finishes it. |
|
|
424
|
+
|
|
320
425
|
### Exit codes
|
|
321
426
|
|
|
322
|
-
| Code | Meaning
|
|
323
|
-
| ---- |
|
|
324
|
-
| `0` | The command did what it was asked (including a clean signalled shutdown of `start`).
|
|
325
|
-
| `1` | The command failed —
|
|
326
|
-
| `2` | The command line itself was wrong. Nothing was attempted.
|
|
427
|
+
| Code | Meaning |
|
|
428
|
+
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
429
|
+
| `0` | The command did what it was asked (including a clean signalled shutdown of `start`, and a `start` that found its agent already running). |
|
|
430
|
+
| `1` | The command failed — or `start` stopped on something a restart may cure. |
|
|
431
|
+
| `2` | The command line itself was wrong. Nothing was attempted. |
|
|
432
|
+
| `78` | `start` stopped on something **no restart cures** (listed below) — a supervisor must not restart it. |
|
|
327
433
|
|
|
328
434
|
A bare `progon-agent` prints the usage and exits `0`; it never assumes `start`.
|
|
329
435
|
|
|
330
|
-
`start` stops
|
|
436
|
+
`start` stops with `78` for these outcomes, each logged with its remedy: this agent was
|
|
331
437
|
**revoked** (credential wiped — see [Revocation](#revocation)); its token was superseded and the
|
|
332
438
|
server no longer accepts it (credential wiped, re-enroll the same way); the `PROGON_AGENT_TOKEN`
|
|
333
|
-
it was given is no longer accepted (nothing wiped — set a current token or enroll);
|
|
334
|
-
|
|
335
|
-
|
|
439
|
+
it was given is no longer accepted (nothing wiped — set a current token or enroll); the server
|
|
440
|
+
no longer accepts this **version** of the agent (nothing wiped — [update](#updating) and start
|
|
441
|
+
again); or the configuration is refused before the daemon starts (the message says which setting).
|
|
442
|
+
It stops with `1` when the desired-state poll was refused definitively (the line before names the
|
|
443
|
+
reason) or on an unexpected failure. In every case the browser is disposed before the process exits.
|
|
444
|
+
|
|
445
|
+
`start` also exits `78` before it reaches the server when Chromium cannot start with its
|
|
446
|
+
[sandbox](#browser-sandbox).
|
|
336
447
|
|
|
337
448
|
### Revocation
|
|
338
449
|
|
|
339
450
|
If the agent is revoked in Progon, the next gateway call answers `403 agents.revoked` (or the
|
|
340
451
|
desired-state snapshot reports it). The daemon then **wipes the local credential** — both
|
|
341
|
-
`runner-state.json` and any leftover `runner-state.json.tmp` — and exits `
|
|
452
|
+
`runner-state.json` and any leftover `runner-state.json.tmp` — and exits `78`. Restarting changes
|
|
342
453
|
nothing: mint a new enrollment code in **Settings → Agents** and run `progon-agent enroll <code>`
|
|
343
454
|
again.
|
|
344
455
|
|
|
@@ -346,22 +457,159 @@ A `401` is _not_ revocation: it backs off and retries, and never wipes anything.
|
|
|
346
457
|
|
|
347
458
|
---
|
|
348
459
|
|
|
460
|
+
### In a CI pipeline
|
|
461
|
+
|
|
462
|
+
`progon-agent ci run` runs Progon scenarios as a step of a release pipeline (GitLab, GitHub,
|
|
463
|
+
Bitbucket and others): the job waits for the result, its log shows progress and the report with a
|
|
464
|
+
link, and the exit code tells the pipeline what happened. The scenarios run on a persistent CI
|
|
465
|
+
runner: a company admin creates it on the runners screen and enrolls it on a machine (see
|
|
466
|
+
[Enroll](#3-enroll-this-machine)); the job itself needs no browser.
|
|
467
|
+
|
|
468
|
+
```sh
|
|
469
|
+
PROGON_CI_KEY=$PROGON_CI_KEY progon-agent ci run --spec <id> --timeout 30m
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
`PROGON_CI_KEY` is the CI key of the project and has no flag, because a command line reaches the job
|
|
473
|
+
log. `PROGON_SERVER_URL` names the deployment; absent, the address built into the package is used.
|
|
474
|
+
`progon-agent ci run --help` lists every flag.
|
|
475
|
+
|
|
476
|
+
`--entry-url <url>` starts every scenario of the launch at this address instead of the address of the
|
|
477
|
+
environment. Any `http` or `https` address the browser of the runner can open is accepted — localhost,
|
|
478
|
+
an internal address, a new subdomain, the preview of a branch — with nothing to register in Progon
|
|
479
|
+
first. Without the flag, the addresses of the environment decide.
|
|
480
|
+
|
|
481
|
+
`--timeout <duration>` is the time limit of the launch, and Progon holds it. Once the deadline
|
|
482
|
+
passes Progon starts no new scenario; its next pass over the launch asks the runner to stop the one
|
|
483
|
+
that runs, and the scenarios that did not start say that the deadline passed. The launch ends when the
|
|
484
|
+
runner has run the cleanup hooks and reported, or when the lease of a runner that went silent
|
|
485
|
+
expires. The command follows the launch to that end and exits with its verdict, as without the flag;
|
|
486
|
+
a deadline that catches only the last cleanup hook, after every scenario passed, still gives `0`. A
|
|
487
|
+
launch not confirmed within `--timeout` (the runner of `--in-job`, repeats of a create Progon did not
|
|
488
|
+
take) gives `3`, unless the answer of the create arrives in the short wait after it: the command then
|
|
489
|
+
follows that launch to its verdict. Without the flag the launch has no deadline.
|
|
490
|
+
|
|
491
|
+
The launch keeps the commit, the branch or tag and the address of the CI run, from the variables that
|
|
492
|
+
GitHub Actions, GitLab CI and Bitbucket Pipelines set; its report shows them next to the CI key. In
|
|
493
|
+
GitHub's `pull_request` event the commit is the merge commit that the default checkout tests, and the
|
|
494
|
+
branch is the branch of the pull request. A variable that is missing leaves out only its own fact.
|
|
495
|
+
|
|
496
|
+
In GitHub Actions the command also writes its result to the job summary (`GITHUB_STEP_SUMMARY`): the
|
|
497
|
+
same lines as the end of the log, the report link included. A summary that would pass the 1 MiB of
|
|
498
|
+
the step keeps the result and the link and counts the lines left out; when even they do not fit, the
|
|
499
|
+
log says so in one line. The summary never changes the exit code.
|
|
500
|
+
|
|
501
|
+
| Code | Meaning |
|
|
502
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
503
|
+
| `0` | Every scenario passed. |
|
|
504
|
+
| `1` | At least one scenario failed. |
|
|
505
|
+
| `2` | No launch was created: fix the pipeline setup (command, key, environment variable, scenarios, runner). |
|
|
506
|
+
| `3` | No result: runner offline or queue full, Progon or network failure, `--timeout` expired before the launch was created, or a launch without a failed scenario that did not fully pass. GitLab can allow it with `allow_failure:exit_codes`. |
|
|
507
|
+
|
|
508
|
+
### The browser inside the job
|
|
509
|
+
|
|
510
|
+
A cloud CI has no machine of yours to enroll a runner on. `--in-job` runs the browser inside the job
|
|
511
|
+
itself, on a runner that lives only as long as the job. The image holds the agent, the bundled
|
|
512
|
+
extension, the Chromium this agent launches and its system packages: a job downloads nothing and
|
|
513
|
+
installs nothing. Pin the tag to one version, and upgrade it deliberately.
|
|
514
|
+
|
|
515
|
+
| CI system | The key | Limit of the job |
|
|
516
|
+
| --------- | ---------------------------------------------------------------------------------------------------------------- | ----------------- |
|
|
517
|
+
| GitLab | **Settings → CI/CD → Variables**, `PROGON_CI_KEY`, masked. A protected variable reaches protected branches only. | `timeout` |
|
|
518
|
+
| GitHub | **Settings → Secrets and variables → Actions**, `PROGON_CI_KEY`. Pull requests from forks get no secrets. | `timeout-minutes` |
|
|
519
|
+
| Bitbucket | **Repository settings → Repository variables**, `PROGON_CI_KEY`, secured. | `max-time` |
|
|
520
|
+
|
|
521
|
+
The exit code of the command decides the step: `0` lets the pipeline continue, and any other code
|
|
522
|
+
fails it. Keep `--timeout` below the limit of the job with a margin, as these do: after the deadline
|
|
523
|
+
the next pass of Progon asks the launch to stop, and the launch ends when the cleanup hooks have run
|
|
524
|
+
or the lease of a silent runner expires; the command waits for that end to report the verdict.
|
|
525
|
+
Progon stops the launch after its deadline even when the CI system kills the job first. A job without a key, or with a wrong one, exits `2`.
|
|
526
|
+
|
|
527
|
+
`.gitlab-ci.yml`:
|
|
528
|
+
|
|
529
|
+
```yaml
|
|
530
|
+
progon-tests:
|
|
531
|
+
image: ghcr.io/antvish/progon-agent:1.5.1
|
|
532
|
+
timeout: 40 minutes
|
|
533
|
+
script:
|
|
534
|
+
- progon-agent ci run --spec <spec-id> --in-job --timeout 30m
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
`.github/workflows/progon.yml`:
|
|
538
|
+
|
|
539
|
+
```yaml
|
|
540
|
+
name: Progon tests
|
|
541
|
+
on:
|
|
542
|
+
push:
|
|
543
|
+
branches: [main]
|
|
544
|
+
jobs:
|
|
545
|
+
progon-tests:
|
|
546
|
+
runs-on: ubuntu-latest
|
|
547
|
+
timeout-minutes: 40
|
|
548
|
+
container:
|
|
549
|
+
image: ghcr.io/antvish/progon-agent:1.5.1
|
|
550
|
+
# The user of the hosted runner: the job summary file belongs to it.
|
|
551
|
+
options: --user 1001
|
|
552
|
+
steps:
|
|
553
|
+
- name: Run Progon scenarios
|
|
554
|
+
env:
|
|
555
|
+
PROGON_CI_KEY: ${{ secrets.PROGON_CI_KEY }}
|
|
556
|
+
run: progon-agent ci run --spec <spec-id> --in-job --timeout 30m
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
`bitbucket-pipelines.yml`:
|
|
560
|
+
|
|
561
|
+
```yaml
|
|
562
|
+
pipelines:
|
|
563
|
+
branches:
|
|
564
|
+
main:
|
|
565
|
+
- step:
|
|
566
|
+
name: Progon tests
|
|
567
|
+
image: ghcr.io/antvish/progon-agent:1.5.1
|
|
568
|
+
max-time: 40
|
|
569
|
+
script:
|
|
570
|
+
- progon-agent ci run --spec <spec-id> --in-job --timeout 30m
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
A self-hosted Progon needs an image of its own, built from a package for that deployment
|
|
574
|
+
([DEVELOPMENT.md](./DEVELOPMENT.md) §6): the bundled extension is compiled against one address, the
|
|
575
|
+
same reason as for the package itself (see the top of this file).
|
|
576
|
+
|
|
577
|
+
**The site under test must be reachable from the job.** A site that the CI runner cannot reach
|
|
578
|
+
needs a persistent runner inside that network instead of `--in-job`.
|
|
579
|
+
|
|
580
|
+
#### Browser sandbox in the image
|
|
581
|
+
|
|
582
|
+
The hosted CI systems start a job's container with Docker's default seccomp profile and give the job
|
|
583
|
+
no way to change it. That profile refuses the namespaces of Chromium's sandbox, so the image sets
|
|
584
|
+
`PROGON_AGENT_DISABLE_BROWSER_SANDBOX=true` and **you set nothing**. The job log says so on every
|
|
585
|
+
run.
|
|
586
|
+
|
|
587
|
+
What that costs: a renderer exploit on a page that the run opens gets the rights of the job's user,
|
|
588
|
+
and that includes `PROGON_CI_KEY`. Run the scenarios against your own sites, and give the CI key the
|
|
589
|
+
narrowest project it needs.
|
|
590
|
+
|
|
591
|
+
A self-hosted CI runner that can change the profile can keep the sandbox: run the job as the image's
|
|
592
|
+
user (not root), allow the namespaces (for Docker, `--security-opt seccomp=unconfined` or a profile
|
|
593
|
+
of your own), and set `PROGON_AGENT_DISABLE_BROWSER_SANDBOX=false`. The agent checks the sandbox
|
|
594
|
+
before it creates anything on the server and refuses with exit `2` when it cannot start.
|
|
595
|
+
|
|
349
596
|
## 5. Environment variables
|
|
350
597
|
|
|
351
598
|
### Runtime
|
|
352
599
|
|
|
353
|
-
| Variable
|
|
354
|
-
|
|
|
355
|
-
| `PROGON_SERVER_URL`
|
|
356
|
-
| `PROGON_AGENT_TOKEN`
|
|
357
|
-
| `PROGON_AGENT_ENROLL_CODE`
|
|
358
|
-
| `PROGON_RUNNER_STATE_DIR`
|
|
359
|
-
| `PROGON_AGENT_EXTENSION_DIST`
|
|
360
|
-
| `PROGON_AGENT_HEADFUL`
|
|
361
|
-
| `PROGON_AGENT_ALLOW_INSECURE_HTTPS`
|
|
362
|
-
| `
|
|
363
|
-
| `
|
|
364
|
-
| `
|
|
600
|
+
| Variable | Required | Meaning |
|
|
601
|
+
| -------------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
602
|
+
| `PROGON_SERVER_URL` | no (source checkouts: yes) | Base URL of the Progon backend. `https://` only, except loopback hosts. Scheme + host + optional path prefix — **no** embedded credentials, **no** query string, **no** fragment (the agent-gateway routes are appended to it). An installed package does not need it: the URL comes from this machine's enrollment, else from the deployment the package was built for. Setting it to a deployment other than the enrollment makes `start` refuse. Required only on a build that carries no bundled deployment. See [Which server the daemon uses](#which-server-the-daemon-uses). |
|
|
603
|
+
| `PROGON_AGENT_TOKEN` | no | An existing `pgat_` credential. Takes precedence over the state file — this is the rotation mechanism. Must match the `pgat_` wire format; set-but-empty is rejected. |
|
|
604
|
+
| `PROGON_AGENT_ENROLL_CODE` | no | One-shot enrollment code, the env form of `progon-agent enroll <code>`. Must be at least 32 characters. |
|
|
605
|
+
| `PROGON_RUNNER_STATE_DIR` | no | Overrides the platform state directory. **Required** on platforms other than darwin/linux/win32, and when the user has no home directory. |
|
|
606
|
+
| `PROGON_AGENT_EXTENSION_DIST` | no | Absolute path of an already agent-mode qa-extension dist, replacing the bundled one (dev/E2E). Relative paths are rejected. |
|
|
607
|
+
| `PROGON_AGENT_HEADFUL` | no | `true`/`false`/`1`/`0`. Shows the browser window on this machine's desktop. Default `false`. It can only turn headful **on** — the server still decides per run. Any other value is rejected. |
|
|
608
|
+
| `PROGON_AGENT_ALLOW_INSECURE_HTTPS` | no | `true`/`false`/`1`/`0`. The run browser opens a stand whose certificate it cannot verify — a self-signed internal stand. Default `false`. Any other value is rejected. See [Self-signed stands](#self-signed-stands). |
|
|
609
|
+
| `PROGON_AGENT_DISABLE_BROWSER_SANDBOX` | no | `true`/`false`/`1`/`0`. Runs Chromium without its sandbox on this machine. Default `false`. Any other value is rejected. See [Browser sandbox](#browser-sandbox). |
|
|
610
|
+
| `PROGON_AGENT_EXTRA_CA_CERTS` | no | Absolute path to a readable PEM bundle whose authority the **agent's own** connections to the backend trust, on top of the public roots. Refused at startup if the path is relative or the file cannot be read. Does not reach the browser. |
|
|
611
|
+
| `PROGON_LOG_LEVEL` | no | pino log level. Default: `info` when `NODE_ENV=production`, `debug` otherwise. |
|
|
612
|
+
| `NODE_ENV` | no | Default `production`. Anything else additionally switches logging to human-readable `pino-pretty` output. |
|
|
365
613
|
|
|
366
614
|
### Inherited by the Chromium installer and launch
|
|
367
615
|
|
|
@@ -386,6 +634,14 @@ higher (an env token, or a state file). The code was **not** spent and stays val
|
|
|
386
634
|
new agent, unset `PROGON_AGENT_TOKEN`, remove the state file in the state directory, and run
|
|
387
635
|
`enroll` again.
|
|
388
636
|
|
|
637
|
+
**The agent stops with "no longer supported" (426).** The server has a minimum agent version and
|
|
638
|
+
this build is below it. The refusal names the minimum. Your enrollment stays valid, so update and
|
|
639
|
+
start again:
|
|
640
|
+
|
|
641
|
+
```bash
|
|
642
|
+
progon-agent update
|
|
643
|
+
```
|
|
644
|
+
|
|
389
645
|
**`enroll` fails with a protocol-version mismatch (409).** The agent and the server disagree on the
|
|
390
646
|
local-agent wire protocol; the error carries the expected and received versions. Update the agent:
|
|
391
647
|
|
|
@@ -438,7 +694,7 @@ identity — it is enough only alongside `PROGON_AGENT_TOKEN`.
|
|
|
438
694
|
(the deployment this package was built for), but the machine has never enrolled. Run
|
|
439
695
|
`progon-agent enroll` — no address needed.
|
|
440
696
|
|
|
441
|
-
**The daemon exits
|
|
697
|
+
**The daemon exits 78 mid-run reporting a revocation.** The agent was revoked server-side and its
|
|
442
698
|
local credential has been wiped. Mint a new code and re-enroll — see
|
|
443
699
|
[Revocation](#revocation).
|
|
444
700
|
|
|
@@ -459,5 +715,8 @@ Four outbound calls, all to `PROGON_SERVER_URL` + `/api/agent-gateway`:
|
|
|
459
715
|
| Claim a run | `POST /api/agent-gateway/runs/:id/claim` |
|
|
460
716
|
| Report a failed run | `POST /api/agent-gateway/runs/:id/fail` |
|
|
461
717
|
|
|
718
|
+
Every call carries `X-Progon-Client: agent/<version>`, so the server can refuse a build below its
|
|
719
|
+
minimum version.
|
|
720
|
+
|
|
462
721
|
Everything else — the credential, the browser, the extension, the run itself — stays on this
|
|
463
722
|
machine. The `pgat_` token never reaches the browser, and it is never logged.
|