CraftLab-ctl (Control System & Daemon)
CraftLab-ctl is the supervisor control plane for CraftLab. It consists of the craftctld background daemon, the craftctl operator CLI, an atomic update engine, and an embedded web control dashboard.
Architecture Overview
+---------------------------------------------------------------------------------+| CRAFTLAB-CTL |+---------------------------------------------------------------------------------+| || CLI (craftctl) <-----------> REST / Control Socket <-------> Web Panel (:8443)|| | || v || Daemon Supervisor (craftctld) || | || +----------------------------+----------------------------+ || | | | || v v v || [LifecyclePlugin] [CorePlugin] [UpdatePlugin] || * Service supervisor * Health & Doctor * Releases API || * Process monitor * Paths resolution * Wheel cache || * Uvicorn / Vite runners * Config loader * Rollback manager |+---------------------------------------------------------------------------------+Command-Line Interface (craftctl)
The craftctl executable provides administrative access to service operations:
Service Lifecycle
| Command | Description |
|---|---|
craftctl status | Shows current operational status of backend, frontend, and daemon services. |
craftctl start | Boots managed services (backend API and control endpoints). |
craftctl stop | Gracefully shuts down managed platform services. |
craftctl restart | Performs a clean restart of platform services. |
System Diagnostics
craftctl doctorInspects:
- Virtual environment health and Python dependencies.
- Static assets availability (
frontend_dist/index.htmlandctl_web_dist/index.html). - Database connectivity and write permissions.
- Network port availability (
CRAFTLAB_PORT, control panel port8443).
Atomic Update Engine
CraftLab features a zero-downtime, rollback-safe update system orchestrated by UpdatePlugin:
[GitHub Releases: DarkBladeDev/CraftLab] │ (craftctl update check) │ ▼ Download craftlab-v*.tar.gz │ ▼ Create Isolated Release Venv (/releases/vX.Y.Z) Install Wheels from Cache (/cache/wheels) │ ▼ Switch Symlink (/current -> /releases/vX.Y.Z) Restart Managed ServicesUpdate Commands
- Check for available updates:
Ventana de terminal craftctl update check - Prepare release archive (downloads and validates checksums without applying):
Ventana de terminal craftctl update prepare --version 0.3.3 - Apply update (switches active release and restarts services):
Ventana de terminal craftctl update apply --version 0.3.3 - Rollback to previous release (instant restore if an update fails validation):
Ventana de terminal craftctl update rollback
Web Control Dashboard
craftctld serves a modern, modular web control dashboard on port 8443 built with React and Tailwind CSS:
- Categorized Pages: Top horizontal navigation tabs (
Overview,System & Host,Lifecycle & Ops,Releases & Updates,Doctor & Health,Terminal & Logs) organize operational domains while preserving 100% of the screen width for panel grids. - Modular Paginated Data Containers: Powered by a typed declarative TypeScript schema (
PaginatedContainerPreset) and<ContainerEngine />supporting hybrid pagination:- Subviews Mode (
subviews): Internal carousel-style mode switching (metrics summary granular breakdown operational actions) inside a single compact card footprint. - Records Collection Mode (
records): Paginated collection rows (installed releases, audit logs, agents) with next/previous controls without overflowing cards. - Simple Mode (
none): Direct single-surface rendering for wide streams such as the real-time log terminal.
- Subviews Mode (
- Draggable & Resizable Grid (
DraggableGrid): Native drag-to-reorder via drag handles ([::]), dynamic column span resizing (- / + Cols), automatic layout persistence in browserlocalStorage, and a one-click “Reset Layout” action. - Role-Based Access Control (RBAC): Fine-grained role checks (
admin,operator,viewer,is_break_glass) on input action controls, disabling or locking restricted triggers.