Skip to content

feat(ui): show the layers each earner got, and choose gVisor per earner from the Fleet page - #930

Closed
Amigadelasmigas wants to merge 11 commits into
GeiserX:mainfrom
Amigadelasmigas:feat/sec-l1-layers-ui-v3
Closed

Amigadelasmigas wants to merge 11 commits into
GeiserX:mainfrom
Amigadelasmigas:feat/sec-l1-layers-ui-v3

Conversation

@Amigadelasmigas

@Amigadelasmigas Amigadelasmigas commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

The owner should decide how many layers protect the computer, and see which layers each earner really got. Today the page shows neither. Turning gVisor on means editing env variables on the worker, with no way to tell from the UI whether it took.

This PR adds a Security layers row per worker on the Fleet page:

  • Chips for the socket proxy, the LAN fence, gVisor (installed, missing, unsupported or unknown) and the Secure VM. A host shows whether it has KVM. A worker inside a Secure VM shows its fence, and shows ok only for a fresh ok from the host's guard.
  • Per earner: fenced or not, Standard (runc) or gVisor, inside the Secure VM when it is, and a button that switches the runtime. A running earner is redeployed after a confirm that says so.
  • A worker default for earners deployed from now on. Setting it records the current runtime of the earners already there, so they do not move. If gVisor goes away while the default says gVisor, a new earner is refused with the reason, not deployed without it.
  • A locked choice with the reason when the catalog requires runc (Mysterium, the GPU miners, through the new runtime_reason field), when an env variable pins it, or when gVisor is not installed.
  • The pinned install and undo commands for cashpilot-gvisor. Each one downloads from the release tag and checks the sha256 before sudo. A dev build shows why it has no command.
  • Check gVisor, which runs the worker's red/green probe.

The dashboard row gets a small "fenced · gVisor" badge per copy. Every new string goes through t(), and the English keys are in en.json. The new runtime_reason is a catalog string the page shows, so it is in I18N_FIELDS, in services/_i18n/en.yml and translated into all 19 locales. The page shows it in the owner's language.

Stack: 3 of 4. #892, #885 and #900 are merged. This PR replaces #916 and #894, rebased on main.

Desktop: the deploy route now sends runtime_choice, but never to a Desktop or Android worker, so the Desktop deploy form needs nothing. The catalog gains runtime_reason on three services, so Desktop must read the new field: GeiserX/CashPilot-Desktop#388.

Tests: tests/test_layers_ui.py has 50 tests, and tests/test_route_at_deploy.py gains one. Each of these mutations made a test fail: dropping the body injection, faking the fence, lifting the bridge-only env lock, treating a stale Secure VM fence as fresh, calling a fence on before it is applied, sending a stored choice that an env pin now overrules, dropping the lock around the stored choices, losing the choice in a restore, offering gVisor to Bitping without the --net-raw runtime, letting an external container pin the default, removing a routed copy before the runtime choice is checked, deploying a stored gVisor choice or a gVisor default on a worker without gVisor, reading a stored value that is not an object, calling a fence check stamped in the future fresh, and showing the English reason to a Spanish owner. The fleet staleness check now also renders the Security layers row. It passes with 88 assertions, and each new check fails when its fix is removed: an offline worker shows no green chip, no installed gVisor and no fence for its earners, a failed redeploy keeps a retry button, a stopped earner gets no retry, and a second default change while one saves sends nothing. Full suite on the rebased branch: 13434 passed. None of the 5 failures comes from this PR. Three need .git in the test copy. One hits the 256 open-file limit of the test shell and passes with a higher limit. One is main's ProxyRack translations, which #923 adds.

Real browser (dark, headless Chromium), against UI + worker + proxy built from this branch on a throwaway Ubuntu 24.04 box:

  • Check gVisor went green for both runtimes.
  • Run under gVisor showed both confirms. Honeygain was redeployed as runsc-hostnet on cashpilot-isolated, and the row and the dashboard badge said "fenced · gVisor".
  • Run under Standard took it back to runc.
  • The page threw no errors.

The Security layers row after Check gVisor went green, on a throwaway Ubuntu 24.04 box. Look at the per-earner lines and the check result:

sec-l1-fleet-layers

The dashboard badge per copy, after Honeygain moved to gVisor:

sec-l1-dashboard-badge

…er from the Fleet page

The Fleet page gets a Security layers row per worker: the socket proxy, the
LAN fence, gVisor and KVM for the Secure VM, then per earner whether it is
fenced and whether it runs under Standard (runc) or gVisor. The owner picks
the runtime per earner or as the worker's default for new earners. A choice
the catalog, an env pin or the worker cannot honour is locked with the
reason. A running earner is redeployed after a confirm.

The row also shows the pinned install and undo commands for cashpilot-gvisor
and runs the worker's red/green gVisor check. The dashboard row carries a
compact fenced/runtime badge per copy.
…eep its runtime through a restore or a later env pin
…d never leave an earner stopped for a choice

- Bitping declares NET_RAW. gVisor is offered to it only when the worker has
  the runtime registered with --net-raw. Before, the choice was saved and the
  worker refused every deploy afterwards.
- Setting the worker default skips external containers, as the view does, so
  an external copy no longer pins the managed earner to runc.
- A direct deploy that leaves a route checks the runtime choice before it
  removes the routed copy, so a refusal stops nothing.
- An offline worker shows its proxy, fence and gVisor chips as unknown, not
  as on from its last report.
- A choice whose redeploy failed gets a button to try it again.
… and bring the catalog's English file up to date
…oute is left, and show an offline worker's earners as unknown
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a7d3905 and eba02f1.

Files selected for processing: 41

  • .dockerignore
  • Dockerfile
  • app/catalog.py
  • app/i18n/en.json
  • app/layer_scripts.py
  • app/layers_ui.py
  • app/main.py
  • app/routers/layers.py
  • app/static/css/style.css
  • app/static/js/app.js
  • app/templates/fleet.html
  • pyproject.toml
  • scripts/dashboard_row_check.mjs
  • scripts/fleet_staleness_check.mjs
  • services/_i18n/ar.yml
  • services/_i18n/de.yml
  • services/_i18n/en.yml
  • services/_i18n/es.yml
  • services/_i18n/fil.yml
  • services/_i18n/fr.yml
  • services/_i18n/hi.yml
  • services/_i18n/id.yml
  • services/_i18n/it.yml
  • services/_i18n/ja.yml
  • services/_i18n/ko.yml
  • services/_i18n/nl.yml
  • services/_i18n/pl.yml
  • services/_i18n/pt-BR.yml
  • services/_i18n/ru.yml
  • services/_i18n/th.yml
  • services/_i18n/tr.yml
  • services/_i18n/uk.yml
  • services/_i18n/vi.yml
  • services/_i18n/zh-Hans.yml
  • services/_schema.yml
  • services/bandwidth/mysterium.yml
  • services/mining/kryptex-pearl.yml
  • services/mining/srbminer-multi.yml
  • tests/conftest.py
  • tests/test_layers_ui.py
  • tests/test_route_at_deploy.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…st, and show an offline worker's gVisor as unknown
@Amigadelasmigas

Copy link
Copy Markdown
Collaborator Author

Replaced by #939: the same commits rebased on main after #923, plus one test commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants