Commit Graph
5 Commits
Author SHA1 Message Date
Ilker ManapandClaude Opus 5.5 0569ecf1cc Review fixes before v0.4.0: NetBox on its own origin, pinned root refresh
CI / agent (push) Successful in 3s
CI / site (push) Successful in 2s
CI / go (push) Successful in 49s
From a review of everything since v0.3.0:

- NetBox's UI was served on Rollcall's origin, so a script in a NetBox
  page (stored XSS, a custom link) could read the Rollcall UI's stored
  admin token and call Rollcall's API with the admin certificate. It now
  has a listener of its own (ipam.ui_listen, default :8444): another
  origin. The Rollcall UI builds its NetBox links from that port.
- The proxy dropped X-Rollcall-User but not X-Rollcall_User, which a
  WSGI server reads as the same HTTP_X_ROLLCALL_USER; every spelling is
  dropped now.
- Deployed machines fetched the root bundle over TLS checked against the
  system's trust store: a public CA's certificate for the rack's name
  would have done. The refresh is pinned to the Rollcall roots installed
  on the machine and takes only CA certificates (tried on node001 and
  node002).
- A NetBox device type NetBox will not resize (0U while its devices have
  positions) no longer stops those machines' device sync; it is logged.
- A NetBox cable on a device whose machine is gone here rolled back all
  cable and switch sync; such cables are skipped.
- Switch names are looked up in NetBox 50 at a time (a large site would
  outgrow one URL).
- rack_units: "vendor model" wins over the bare model when both are set
  (map order chose before); cable precedence comments match the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:35:45 +01:00
Ilker ManapandClaude Opus 5.5 44ac453bde NetBox through Rollcall: the admin certificate signs in to NetBox
CI / agent (push) Successful in 3s
CI / site (push) Successful in 2s
CI / go (push) Successful in 43s
With ipam.ui_login_secret_file, the proxy tells NetBox who the admin is
(X-Rollcall-User: the certificate's admin name) together with a shared
secret (X-Rollcall-Proxy-Secret). NetBox takes the user from that header
(REMOTE_AUTH) and creates it on first use; the web server in front of
NetBox drops the header from any request that lacks the secret or does
not come from the region, so reaching NetBox directly claims no one.
Both headers coming from a browser are always dropped by Rollcall; an
admin signed in with a token instead of a certificate logs in to NetBox
by hand. A secret under 16 characters or an unreadable file leaves the
proxy off, with a log line.

The lab NetBox install sets it up: REMOTE_AUTH settings, a guarded
Caddyfile (readable by caddy only: the secret is in it), the secret in
secrets.env, and a rollcall-admins group that may do everything. Rollcall's
NetBox user may now view cables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:19:10 +01:00
Ilker ManapandClaude Opus 5.5 d2624b2fc2 NetBox proxy: one route per method, beside the UI's "GET /"
CI / agent (push) Successful in 3s
CI / site (push) Successful in 3s
CI / go (push) Successful in 43s
A bare "/netbox/" pattern conflicts with "GET /" in ServeMux (neither is
more specific), and the region panicked at start once ipam.url carried a
path. The proxy is registered per method now, and a test builds the
routes with it. The lab install script's own API calls use the new
/netbox/ base.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:29:13 +01:00
Ilker ManapandClaude Opus 5.5 cc1245da1e NetBox's web UI through Rollcall, and links to it from the web UI
CI / agent (push) Successful in 3s
CI / site (push) Successful in 3s
CI / go (push) Successful in 42s
With NetBox as the IPAM under a path (its BASE_PATH) and ipam.url
carrying it, Rollcall serves NetBox's UI at that same path, for admins
only (the admin certificate, as for the API); NetBox keeps its own
login. Redirects that name NetBox's own address are turned back to
Rollcall's, Rollcall's credentials are not passed on. NetBox opens
wherever Rollcall does: a lab NetBox on a segment the browser cannot
reach, say.

The web UI links to NetBox: the sidebar, sites, rooms, racks, switches
and a machine's device (by its rollcall_machine field). ipam.ui_url
points the links at NetBox directly instead.

NetBox paging under a BASE_PATH doubled the path on the next page
(the next link carries it already); fixed. The lab NetBox moves under
/netbox/ and trusts the region's addresses for its forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:21:22 +01:00
Ilker ManapandClaude Opus 5.5 133b5f38d9 NetBox device sync; lab NetBox container
CI / go (push) Successful in 43s
CI / agent (push) Successful in 3s
CI / site (push) Successful in 3s
ipam.device_sync mirrors commissioned machines as dcim devices: serial,
device type and role (created when missing), status, interfaces with MAC
objects, Rollcall's addresses assigned to them and the management address
as primary IP. Site, location and rack are matched by name from the
machine's location and never created. Ownership by tag and
rollcall_machine; a foreign device of the same name is a conflict.

lab/netbox/install.sh sets up a NetBox on the lab segment so the drivers
are tested without writing to a real NetBox.

Refs #10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:00:43 +01:00