Skip to content

Add local admin UI with live iSCSI metrics and target controls - #6

Merged
msdmazvoid merged 4 commits into
mainfrom
feature/admin-ui
Nov 7, 2026
Merged

msdmazvoid merged 4 commits into
mainfrom
feature/admin-ui

Conversation

@msdmazvoid

@msdmazvoid msdmazvoid commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an optional local admin UI embedded in kouja-agent, plus live iSCSI traffic and connection metrics.

Admin UI

  • Loopback-only listener at 127.0.0.1:9444, disabled by default, no authentication.
  • Raw YAML configuration editor with validation, atomic writes, backups, and last-good tracking.
  • TLS server certificate DNS/IP SAN display and client certificate/CA downloads.
  • Live VG registration/deregistration and storage-class mapping changes through shared agent services.
  • Status view for agent, VGs, volumes, sessions, observations, and problem operations.
  • Embedded Preact/TypeScript/Vite UI built by the Makefile.

Live iSCSI metrics

  • Per-target, per-initiator, and per-LUN traffic counters.
  • Read/write bytes and sampled read/write/command rates.
  • Login, session, digest, timeout, abort, and reset error counters.
  • Client source IP and port connections from /proc/net/tcp(6), mapped to the target and initiator where unambiguous.
  • Metrics are best-effort and do not fail /api/status.

iSCSI target control

  • A per-target Disable action force-unexports the live LIO target and drops active sessions.
  • The volume and export definition remain in SQLite in the existing available/unexported state.
  • Disabled exports remain visible in the volume table with an Enable target action that recreates the target from the stored definition and generates a new credential when needed.
  • The actions use the shared operation manager for locking, journaling, credentials, and forced teardown, with a unique operation per admin action.

Setup and release

  • Interactive deploy/kouja-init.sh TLS/config initializer.
  • make all produces release binaries plus bin/config.example.yaml and bin/kouja-init.sh.
  • Node-free make build-go fallback.
  • CI builds the embedded UI and verifies the fallback build.
  • Design documentation in docs/designs/admin-ui.md.

Security notes

  • The admin listener has no authentication and is root-equivalent for any local process that can reach it. It is disabled by default and rejects non-loopback bind addresses.
  • Client private keys are download-only by explicit operator action; the CA private key and server private key are never served.
  • Live connection data is read from the host network namespace and may be unavailable or ambiguous when targets share an initiator address.

Validation

  • make all
  • make test
  • make test-bdd
  • make coverage-check (80.2%)
  • make lint (0 issues)
  • Race tests for internal/adminui and internal/target
  • Live iSCSI target/configfs and /proc/net/tcp probe

voidstarit added 2 commits November 7, 2026 15:55
Add an optional loopback-only admin UI embedded in kouja-agent, including raw configuration editing, TLS certificate display, live VG and class management, client certificate downloads, status views, and live iSCSI traffic/error metrics with client IP and port connections.

Add the interactive TLS/config initializer, release binary layout, CI UI build, design documentation, and tests.
Add an admin UI action that force-unexports a live iSCSI target, drops active sessions, and retains the volume and export definition in SQLite. The shared operation manager handles locking, journaling, credentials, and forced teardown.
@msdmazvoid msdmazvoid changed the title Add local admin UI with live iSCSI metrics and client connections Add local admin UI with live iSCSI metrics and target controls Nov 7, 2026
voidstarit added 2 commits November 7, 2026 16:14
Recreate the live target from the retained export definition, generating a new credential when the previous disable superseded it. Expose the action in the volume table for unexported iSCSI exports.
Admin disable now keeps the active credential instead of superseding it, so re-enabling the target does not force initiator secret changes. Explicit client rotation remains the only automatic rotation path for this feature.
@msdmazvoid
msdmazvoid merged commit 1ce2d25 into main Nov 7, 2026
2 checks passed
@msdmazvoid
msdmazvoid deleted the feature/admin-ui branch November 7, 2026 21:51
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.

1 participant