Skip to content

wsprfme/DigiVPS-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DigiVPS Manager

A powerful Telegram bot for managing multiple DigitalOcean VPS instances with advanced features and role-based access control.

✨ Features

πŸ–₯️ VPS Management

  • Create and manage multiple VPS instances
  • Support for multiple DigitalOcean accounts
  • Real-time status monitoring
  • One-click OS reinstallation
  • Post-creation script execution
  • Reboot and delete operations

πŸ” Security & Access Control

  • Role-based access management
  • Secure token storage
  • Multiple account support
  • Granular VPS access permissions
  • Privacy-focused design

πŸ’‘ Smart Features

  • Interactive menu navigation
  • Real-time creation progress
  • Status indicators with emojis
  • Automatic cleanup of sensitive data
  • Error handling and recovery

πŸ‘₯ Role System

  • Admin: Full VPS management access
  • Manager: Create and manage VPS
  • Viewer: View-only access
  • Specific: Access to assigned VPS only

πŸ›  Installation

Prerequisites

# System requirements
Python 3.8 or higher
pip (Python package manager)
sshpass (for script execution)

# Install sshpass
sudo apt-get install sshpass

Getting API Credentials

Telegram API Credentials

  1. Visit my.telegram.org
  2. Log in with your phone number
  3. Click on "API Development Tools"
  4. Fill in the form with any name and description
  5. You will receive:
    • API_ID: A number like "123456"
    • API_HASH: A 32-character string

Telegram Bot Token

  1. Open Telegram and message @BotFather
  2. Send /newbot command
  3. Follow instructions to create your bot
  4. You will receive a bot token like "123456789:ABCdefGHIjklmNOPQrstUVwxyz"
  5. Optional: Set bot commands using /setcommands:
    start - Start the bot
    help - Show help guide
    privacy - View privacy policy
    

DigitalOcean API Token

  1. Log in to your DigitalOcean Account
  2. Go to API section in the left sidebar
  3. Click "Generate New Token"
  4. Set token name (e.g., "DigiVPS Manager")
  5. Enable both read and write scopes
  6. Click "Generate Token"
  7. Important: Copy and save your token immediately as it won't be shown again
  8. Token format: 32-character string starting with "dop_v1_"

Setup

  1. Clone the repository:
git clone https://github.com/seayards/DigiVPS-Manager.git
cd DigiVPS-Manager
  1. Create and activate virtual environment:
python -m venv venv
source venv/bin/activate  # Linux/Mac
# or
.\venv\Scripts\activate  # Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your settings:
# API_ID=your_telegram_api_id
# API_HASH=your_telegram_api_hash
# BOT_TOKEN=your_telegram_bot_token

Running the Bot

python main.py

πŸ“ Configuration

Environment Variables

  • API_ID: Telegram API ID
  • API_HASH: Telegram API Hash
  • BOT_TOKEN: Telegram Bot Token

Storage

The bot uses JSON files for data storage:

  • data/auth.json: API tokens and authentication
  • data/roles.json: User roles and permissions
  • data/vps_access.json: VPS access assignments

πŸ€– Bot Commands

Basic Commands

  • /start: Initialize bot and show main menu
  • /help: Display detailed help guide
  • /privacy: View privacy policy

Menu Structure

Main Menu
β”œβ”€β”€ Select Account
β”‚   β”œβ”€β”€ Account List
β”‚   └── Add New Account
β”œβ”€β”€ Create New VPS
β”‚   β”œβ”€β”€ Select OS
β”‚   β”œβ”€β”€ Choose Region
β”‚   └── Select Plan
β”œβ”€β”€ List My VPS
β”‚   └── VPS Actions
β”‚       β”œβ”€β”€ Reboot
β”‚       β”œβ”€β”€ Reinstall OS
β”‚       └── Delete
β”œβ”€β”€ Manage API Token
β”‚   β”œβ”€β”€ Set New Token
β”‚   β”œβ”€β”€ View Token
β”‚   └── Delete Token
β”œβ”€β”€ Manage Roles
β”‚   β”œβ”€β”€ Add User Role
β”‚   β”œβ”€β”€ View Roles
β”‚   β”œβ”€β”€ Remove Role
β”‚   └── Grant VPS Access
└── Account Info

πŸ”’ Security

Data Protection

  • API tokens are encrypted before storage
  • No logging of sensitive operations
  • Automatic message cleanup for tokens
  • Secure SSH connections for scripts

Access Control

  • Role-based permission system
  • Token validation and verification
  • Protected API endpoints
  • Session management

πŸ›‘οΈ Privacy

Data Collection

  • Telegram User ID
  • DigitalOcean API Token
  • VPS configuration preferences

Data Usage

  • API tokens: DigitalOcean API calls only
  • User IDs: Role management
  • No analytics or tracking

πŸ”§ Development

Project Structure

DigiVPS-Manager/
β”œβ”€β”€ main.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ auth_service.py
β”‚   β”‚   └── role_service.py
β”‚   β”œβ”€β”€ bot/
β”‚   β”‚   └── bot_service.py
β”‚   β”œβ”€β”€ vps/
β”‚   β”‚   └── vps_service.py
β”‚   └── common/
β”‚       β”œβ”€β”€ storage_service.py
β”‚       └── utils.py
└── data/
    β”œβ”€β”€ auth.json
    β”œβ”€β”€ roles.json
    └── vps_access.json

Adding New Features

  1. Create new service in appropriate directory
  2. Update bot_service.py with new handlers
  3. Add necessary menu items and callbacks
  4. Update help documentation

πŸ“š Contributing

  1. Fork the repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Create Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Support

For support, contact:

  • Telegram: @mandoelsz

πŸ™ Acknowledgments

About

πŸš€ A powerful Telegram bot for managing DigitalOcean VPS instances. Features role-based access control, multi-account support, and automated VPS management. Built with Python & Telethon.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors