R-Bot Multi-Cloud Infrastructure Management System

repository·main·Indexed 24 days ago

https://github.com/semicons/java_oci_manage

A dual-end multi-cloud management system that uses a Telegram bot to drive a local client for managing resources across OCI, AWS, GCP, Azure, DigitalOcean, SolusVM, and VirtFusion. It features a Web-based SSH intelligent terminal with SFTP support and a Web Cloud Management Panel for resource control, instance lifecycle management, and network configuration. R-Bot employs a secure architecture where sensitive API private keys are stored exclusively on the local client.

Tokens
18.2K
Snippets
32
Records
105
Agent score
82%

What's inside R-Bot

  1. Overview of R-Bot features

    main

    R-Bot is a multi-cloud infrastructure management system that provides three main interfaces:

    1. Telegram Bot (Cloud Management)

    Control cloud resources via Telegram commands. Supports Oracle Cloud, AWS (EC2/Lightsail), GCP, Azure, DigitalOcean, SolusVM, and VirtFusion.

    • Instance Management: Power on, resize, reset system, terminate.
    • IP/Disk/Monitoring: IP management (including auto DNS updates), disk expansion, and status monitoring/alerts.
    • Account Management: User management, API keys, and quota queries.

    2. Web SSH Intelligent Terminal

    A browser-based terminal for server maintenance.

    • SSH Features: Password/Key authentication, multi-tab, split-screen, persistent shells, and SOCKS5 proxy.
    • File Management: SFTP support for browsing, uploading, downloading, and online editing.
    • Monitoring & Tools: Real-time CPU/RAM/Disk/Network metrics, port forwarding, and batch command execution.
    • Cloud Sync: One-click discovery and import of hosts from supported cloud platforms.

    3. Web Cloud Management Panel

    A comprehensive browser dashboard for managing cloud resources directly.

    • Resource Control: Create, start, stop, restart, terminate, and reinstall instances across multiple clouds.
    • OCI Specifics: ARM free tier scanning, serial console connection, and Netboot.xyz automation.
    • Network & Storage: IP management (IPv4/IPv6), volume resizing, and DNS management (Cloudflare integration).
    • Other Services: OCI Object Storage management, AWS/GCP/DigitalOcean/Azure resource management, and automated Email Delivery setup.
  2. How R-Bot's dual-architecture security works

    main

    R-Bot uses a dual-architecture design to ensure security for your cloud credentials:

    1. R-Bot Server: Receives commands from Telegram and routes them to your local client.
    2. Local Client: This is the component you install on your server. It wraps the Cloud Platform SDKs and provides the Web SSH and Cloud Management UIs.
    3. API Keys: Crucially, all sensitive API private keys are stored only on your local client. The R-Bot server never touches or stores your credentials.

    Data Flow:

    • User → Telegram → R-Bot Server → HTTP/WS → Local Client → Cloud SDK
    • User → Browser → Local Client (Web UI) → Cloud SDK
  3. Manage SSH Sessions with Split-Screen and Tabs

    main

    The terminal supports advanced workspace management:

    • Multi-Tab: Open multiple SSH connections simultaneously. Each tab includes a tab bar with system resource metrics (CPU, Memory, Disk, Network).
    • Split-Screen: Click the Split button in the toolbar to divide the terminal into two independent panes.
      • One-click clone: Automatically connects the second pane to the same host.
      • Independent connections: Each pane operates on its own WebSocket.
      • Persistence: The split layout is restored after a page refresh.
    • Auto-Reconnect: If a connection is interrupted, the terminal uses an exponential backoff strategy to attempt reconnection automatically.
  4. Use A1 Config Audit and Downscale for OCI ARM

    main

    For users managing OCI ARM (A1.Flex) always-free quotas, the panel includes a dedicated workbench to prevent over-provisioning:

    • Config Audit: Scans all accounts in parallel to check A1.Flex usage against the free-tier cap (2 OCPU / 12 GB). Results are flagged as Over quota, Within quota, or Query failed.
    • Account Downscale: Automatically splits a target spec (e.g., 2 OCPU / 12 GB) across all instances in an account to bring them back within the free tier.
    • Batch Downscale: Allows selecting multiple accounts for bulk downscaling.
    • Downscale Method: Uses a preemptive resize strategy that auto-retries on capacity contention and notifies you via Telegram upon completion. It only resizes; it never automatically deletes instances.
  5. Manage SSH sessions with Split Screen and Suspension

    main

    The terminal workspace provides advanced session management features via the toolbar:

    Split Screen (分屏)

    Click the "Split" (分屏) button to divide the current terminal into two independent panels (side-by-side).

    • One-click Clone: Automatically uses the current session to connect to the second panel.
    • Independent Connections: Each panel maintains its own WebSocket.
    • Auto-collapse: Panels collapse when the window is too narrow and restore when resized.
    • Layout Persistence: The split layout is automatically restored upon page refresh.

    Session Suspension (会话挂起)

    Similar to Unix screen, you can explicitly suspend an active SSH session so it continues running on the server even if you close the browser tab.

    • Suspend: Click the "Suspend" (挂起) button in the toolbar.
    • Reattach: Resume a session from the "Suspended" (已挂起) entry in the Host Panel.
    • Limits: A single user can maintain up to 20 suspended sessions; these are cleared if the client restarts.
  6. How R-Bot's dual-end architecture works

    main

    R-Bot uses a dual-end architecture designed for security and multi-cloud management.

    Architecture Components

    • R-Bot Server: Receives commands from Telegram and routes them to your local client.
    • Local Client: Encapsulates Cloud Platform SDK calls and provides the Web SSH and Web Cloud Management UIs. It is responsible for executing the actual operations.
    • API Private Keys: Crucially, API keys are only stored on your local client. The R-Bot server never touches or stores sensitive credentials.

    Data Flow

    • Telegram Control: User $\rightarrow$ Telegram $\rightarrow$ R-Bot Server $\rightarrow$ HTTP/WS $\rightarrow$ Local Client $\rightarrow$ Cloud Platform SDK
    • Web UI Control: User $\rightarrow$ Browser $\rightarrow$ Local Client (Web UI) $\rightarrow$ Cloud Platform SDK
  7. Use A1 Configuration Check and Downgrade for OCI ARM

    main

    A specialized workbench for OCI ARM (A1.Flex) accounts to help stay within the permanent free tier limits (typically 2 Cores, 12GB RAM).

    Key Features:

    • Configuration Check (配置体检): Scans all accounts in a region to compare current A1.Flex usage against free tier limits, marking them as "Over-provisioned / Within limits / Query failed".
    • Downgrade (降配):
      • Account Downgrade: Automatically distributes resources across multiple instances in an account to meet the target configuration (default 2 Cores, 12GB).
      • Batch Downgrade: Select multiple accounts and submit for batch processing.
      • Single Instance Downgrade: Manually enter recommended values for a specific instance.
    • Downgrade Mechanism: Uses a "搶機式" (competitive/retry) resize method that automatically retries until successful when encountering capacity limits. It only performs downgrades (never upgrades) and does not automatically delete instances. It provides Telegram notifications and a task list for cancellation.
  8. Suspend and Resume SSH Sessions

    main

    You can suspend an active SSH session to keep processes running on the server without keeping the browser tab active. This functions similarly to Unix screen.

    • To Suspend: Click the Suspend button in the terminal toolbar.
    • To Reattach: Find the session in the Suspended list on the Host Dashboard.
    • Group Suspend: In split-screen mode, you can suspend and reattach multiple panes as a group.
    • Limits: There is a limit of 20 suspended sessions per user, which are cleared upon client restart.
  9. Configure Cloud Platform API settings online

    main

    You can manage API configurations for all 7 supported cloud platforms (OCI, AWS, GCP, Azure, DO, SolusVM, and VirtFusion) directly through the web interface. This eliminates the need to manually edit the client_config file via SSH.

    Supported Platform Configuration Methods

    • OCI: Paste API config text and upload a PEM key file; the key_file path is automatically configured.
    • AWS: Paste your Access Key ID and Secret Access Key.
    • GCP: Upload a Service Account JSON key file; credentials are automatically extracted.
    • DO (DigitalOcean): Paste your DigitalOcean API Token.
    • Azure: Paste appId, password, and tenant configuration.
    • SolusVM: Paste the API URL and key.
    • VirtFusion: Paste host/token/preset or use preset vendors for quick filling.
    • Cloudflare: Edit Cloudflare email and API Key online.

    Key Features

    • Merge Mode: When uploading, duplicate Profile names are skipped with a warning, and new Profiles are appended.
    • Online Profile Editing: Profiles are displayed as a chip list; click a chip to edit fields inline.
    • Hot Reload: Changes are applied immediately upon saving without requiring a client restart.
    • Secret Masking: Tokens and secrets are masked in the UI; plaintext is never sent to the browser.
  10. Use One-Click SSH and IP Copying

    main

    For all supported cloud platforms (OCI, AWS EC2, AWS Lightsail, GCP, Azure, DO, SolusVM, VirtFusion), instance cards in the Web UI provide quick access tools:

    • SSH Button: Clicking the 「SSH」 button on an instance card automatically redirects you to the terminal and connects to that instance without requiring manual connection details.
    • Copy IP: Each card includes a one-click button to copy the instance's IP address.
  11. Execute Batch Commands on Multiple Hosts

    main

    You can run the same command across multiple selected hosts simultaneously:

    1. In the Host Dashboard, select one or more host cards.
    2. A batch toolbar will appear at the bottom of the screen.
    3. Enter your command and click execute.
    4. The result workbench will open, displaying real-time execution status and output for each host in a grid of cards.
    5. You can execute further commands directly from the result workbench without re-selecting hosts.