Skip to main content
This page details the Palyra lifecycle management systems, focusing on the initial bootstrap via the Setup Wizard, the Onboarding flows for local and remote environments, and the Doctor diagnostic and recovery framework. These systems ensure that the Palyra daemon (palyrad) and CLI are correctly configured, secured, and maintainable.

1. Setup and Onboarding Infrastructure

The setup process is the primary entry point for new users. It handles configuration generation, TLS scaffolding, and identity initialization.

1.1 Init Modes and Scaffolding

The CLI supports two primary initialization modes defined in InitModeArg:

1.2 The Operator Wizard

The OnboardingWizard is an interactive (or non-interactive) engine that guides the user through complex configuration steps. It uses a generic WizardBackend trait to support both terminal-based interaction and automated flag-based setup. Key Components:

Onboarding Flow Logic

The following diagram illustrates how the palyra setup command transitions from user input to a functional RootFileConfig. Title: Onboarding and Setup Data Flow Sources: crates/palyra-cli/src/commands/operator_wizard.rs#239-250, crates/palyra-cli/src/lib.rs#95-100, crates/palyra-cli/src/commands/operator_wizard.rs#168-194

2. Doctor: Diagnostic and Recovery Framework

The Doctor system is a multi-tiered diagnostic framework designed to detect configuration drift, filesystem corruption, and stale runtime artifacts.

2.1 Diagnostic Framework

The system runs a series of DoctorCheck routines. Each check returns a DoctorSeverity (Info, Warning, Error, Critical) and a DoctorReport. Core Checks include:

2.2 Recovery and Repair

When palyra doctor --repair is invoked, the system generates a DoctorRepairPlan. Implementation Details: Title: Doctor Diagnostic and Repair Loop Sources: crates/palyra-cli/src/commands/doctor/recovery.rs#8-10, crates/palyra-cli/src/commands/doctor/recovery.rs#172-176, crates/palyra-cli/src/commands/doctor/recovery.rs#141-155

3. Connectivity Probes and Health

The CLI provides two levels of connectivity verification: health and status.

3.1 Health Probes

The palyra health command executes a narrow liveness/readiness probe. It attempts to reach both the HTTP Admin surface and the gRPC Gateway surface crates/palyra-cli/tests/help_snapshots/root-help-unix.txt#9.

3.2 System Status

The status command provides a broader snapshot, including:

4. Sandbox and Environment Checks

Before execution, Palyra performs “Sandbox Checks” to ensure the host environment supports the requested isolation tiers.
TierMechanismCLI Diagnostic Command
Tier-AWasmtime / WASMpalyra sandbox explain --runtime wasm
Tier-Cbwrap (Linux) / sandbox-exec (macOS)palyra sandbox explain --runtime process-runner
The sandbox command group inspects effective policies and validates that binary dependencies (like bwrap) are present in the system path crates/palyra-cli/tests/help_snapshots/root-help-unix.txt:33, 89.

5. Support Bundle System

For troubleshooting complex issues, the support-bundle command aggregates diagnostics into a single portable archive. Data Inclusion: Sources: crates/palyra-cli/src/lib.rs#1-110, crates/palyra-cli/src/commands/doctor/recovery.rs#1-150, crates/palyra-cli/src/commands/operator_wizard.rs#1-215, crates/palyra-daemon/src/transport/http/handlers/console/diagnostics.rs#1-114