Spuff Technical Architecture
Table of Contents
System Overview
Components
CLI (spuff)
spuff)Agent (spuff-agent)
spuff-agent)Cloud-Init
Protocol Stack
Protocol
Use Case
Port
Encryption
Protocol Flow Diagram
Data Flow
Instance Creation (spuff up)
spuff up)Instance Destruction (spuff down)
spuff down)Cloud Provider Integration
DigitalOcean API
Method
Endpoint
Purpose
SSH/Mosh/SCP Communication
Mosh Support
SSH Operations
SSH Functions
SSH Agent Forwarding
Agent HTTP API
Endpoints
GET /health (public)
GET /status (authenticated)
GET /metrics (authenticated)
GET /processes (authenticated)
POST /exec (authenticated)
GET /exec-log?lines=50 (authenticated)
POST /heartbeat (authenticated)
GET /logs?file=/var/log/syslog&lines=100 (authenticated)
GET /cloud-init (authenticated)
Cloud-Init Provisioning
Template Structure
Two-Phase Bootstrap
Status File
State Management
Storage Structure
Types
Operations
Instance Lifecycle
Volume Management
Architecture
Components
Data Flow
Platform-Specific Handling
SSH Wrapper for Paths with Spaces
Security Model
Authentication Layers
Network Security
VM Security Hardening
Sensitive Data Handling
Data
Storage
Protection
Error Handling
Structured Provider Errors
SSH Errors
Provider API Errors
Timeout Handling
Operation
Default Timeout
Extending Spuff
Adding a New Provider
Step 1: Create Provider Module
Step 2: Implement the Provider Trait
Step 3: Implement the ProviderFactory Trait
Step 4: Register the Provider
Step 5: Add Provider Type
Key Types for Provider Implementation
Adding Agent Endpoints
Debugging
Enable Debug Logging
Inspect Cloud-Init
Agent Status
Local State
Last updated
Was this helpful?