Expand description
§Product OS Command and Control
This crate provides a distributed command and control system for coordinating multiple Product OS server instances. It enables secure communication, service discovery, and workload distribution across a cluster of nodes.
§Features
- Secure Communication: Authentication framework using Diffie-Hellman key exchange
- Service Discovery: Automatic node registration and discovery
- Load Balancing: Smart routing to available nodes based on capabilities
- Health Monitoring: Pulse checks and automatic failure detection
- Feature Management: Dynamic feature and service registration
§Basic Usage
use product_os_command_control::ProductOSController;
use product_os_command_control::CommandControl;
use product_os_security::certificates::Certificates;
let config = CommandControl::default();
let certs = Certificates::new_self_signed(
vec![("CN".to_string(), "localhost".to_string())],
None, None, None, None, None,
);
let controller = ProductOSController::new(
config,
certs,
None, // Optional key-value store
#[cfg(feature = "relational_store")]
None, // Optional relational store
);
let registry = controller.get_registry();
let my_node = registry.get_me();
println!("Node ID: {}", my_node.get_identifier());§Architecture
The command and control system consists of several key components:
- ProductOSController: Main coordinator that manages nodes and services
- Registry: Tracks available nodes and their capabilities
- Node: Represents a single server instance in the cluster
- Commands: Structured way to send instructions to remote nodes
§Security
All node-to-node communication is secured using:
- TLS/SSL certificates for transport security
- Diffie-Hellman key exchange for establishing shared secrets
- Message authentication using HMAC
§Cargo Features
| Feature | Default | Description |
|---|---|---|
std_base | Yes | Std support with core Product OS dependencies |
framework_axum | Yes | Axum HTTP framework |
framework_flow | No | Flow HTTP framework |
monitor | Yes | Monitoring via product-os-monitoring |
tokio | No | Tokio async executor |
distributed | No | Distributed node discovery (placeholder) |
relational_store | No | Base relational store support |
postgres_store | No | PostgreSQL relational store |
sqlite_store | No | SQLite relational store |
redis_key_value_store | No | Redis key-value store |
memory_key_value_store | No | In-memory key-value store |
file_key_value_store | No | File-based key-value store |
redis_queue_store | No | Redis queue store |
memory_queue_store | No | In-memory queue store |
Modules§
- authentication
- Authentication module
- commands
- Command execution module
Structs§
- Command
Control - Command and control configuration for managing distributed services.
- Node
- Represents a single server instance (node) in the Product OS cluster.
- ProductOS
Controller - Main controller for managing a distributed command and control system.
Enums§
- Method
- HTTP request method enumeration
Functions§
- pulse_
run - Runs a single pulse check cycle, verifying node health and connectivity.
- run_
controller - Runs the controller lifecycle: self-trust, discovery, announcements, and periodic tasks.