Crate rumi2

Source
Expand description

§Rumi2 - Deployment Management CLI

Rumi2 is a robust CLI tool for deploying web applications, servers, and blockchain nodes with seamless SSH2 integration. It simplifies the deployment process to your existing server infrastructure, ensuring secure and efficient transfers with comprehensive backup, rollback, and monitoring capabilities.

§Features

  • Website Hosting: One-command deployments with automatic SSL certificate generation
  • Server Management: Binary deployment with automatic service management
  • Ethereum Node Deployment: Full Ethereum node setup with geth
  • Backup & Recovery: Automatic backups before deployments with easy restoration
  • Configuration Management: JSON-based configuration with validation
  • Security & Safety: Dry-run mode, SSH key authentication, firewall management

§Quick Start

# Initialize configuration
rumi2 config init

# Add SSH connection details
rumi2 config add-ssh --name prod --host server.com --user deploy

# Deploy a website
rumi2 hosting install --name my-site --domain example.com --dist-path ./dist

§Architecture

The library is organized into several key modules:

  • config - Configuration management and validation
  • session - SSH session management and command execution
  • backup - Backup and restore functionality
  • commands - Deployment command implementations
  • error - Error types and handling

§Examples

use rumi2::{config::RumiConfig, session::RumiSession};

// Load configuration
let config_path = RumiConfig::get_config_path();
let config = RumiConfig::load_from_file(&config_path)?;

// Create SSH session
if let Some(ssh_config) = config.default_ssh {
    let session = RumiSession::new(ssh_config)?;
     
    // Execute commands safely
    let result = session.execute_command("uptime")?;
    println!("Server uptime: {}", result.stdout);
}

Modules§

backup
certbot
commands
config
Configuration Management
error
Error Types and Handling
nginx
session
ufw
utils

Structs§

Rumi2

Constants§

ETH_GETH_NGINX_CONFIG_PATH
Path for Ethereum geth nginx proxy configuration
NGINX_WEB_CONFIG_PATH
Path where nginx site configuration files are stored (available sites)
NGINX_WEB_SITE_ENABLED
Path where nginx enabled site configuration files are symlinked
SERVER_BIN_PATH
Default path for server binary installations on Unix systems
SSL_CERTIFICATE_KEY_PATH
Path where Let’s Encrypt SSL certificate private keys are stored
SSL_CERTIFICATE_PATH
Path where Let’s Encrypt SSL certificates are stored
WEB_FOLDER
Default web root directory for hosting website files