A powerful Telegram bot for managing multiple DigitalOcean VPS instances with advanced features and role-based access control.
- 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
- Role-based access management
- Secure token storage
- Multiple account support
- Granular VPS access permissions
- Privacy-focused design
- Interactive menu navigation
- Real-time creation progress
- Status indicators with emojis
- Automatic cleanup of sensitive data
- Error handling and recovery
- Admin: Full VPS management access
- Manager: Create and manage VPS
- Viewer: View-only access
- Specific: Access to assigned VPS only
# System requirements
Python 3.8 or higher
pip (Python package manager)
sshpass (for script execution)
# Install sshpass
sudo apt-get install sshpass- Visit my.telegram.org
- Log in with your phone number
- Click on "API Development Tools"
- Fill in the form with any name and description
- You will receive:
API_ID: A number like "123456"API_HASH: A 32-character string
- Open Telegram and message @BotFather
- Send
/newbotcommand - Follow instructions to create your bot
- You will receive a bot token like "123456789:ABCdefGHIjklmNOPQrstUVwxyz"
- Optional: Set bot commands using
/setcommands:start - Start the bot help - Show help guide privacy - View privacy policy
- Log in to your DigitalOcean Account
- Go to API section in the left sidebar
- Click "Generate New Token"
- Set token name (e.g., "DigiVPS Manager")
- Enable both read and write scopes
- Click "Generate Token"
- Important: Copy and save your token immediately as it won't be shown again
- Token format: 32-character string starting with "dop_v1_"
- Clone the repository:
git clone https://github.com/seayards/DigiVPS-Manager.git
cd DigiVPS-Manager- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
.\venv\Scripts\activate # Windows- Install dependencies:
pip install -r requirements.txt- 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_tokenpython main.pyAPI_ID: Telegram API IDAPI_HASH: Telegram API HashBOT_TOKEN: Telegram Bot Token
The bot uses JSON files for data storage:
data/auth.json: API tokens and authenticationdata/roles.json: User roles and permissionsdata/vps_access.json: VPS access assignments
/start: Initialize bot and show main menu/help: Display detailed help guide/privacy: View privacy policy
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
- API tokens are encrypted before storage
- No logging of sensitive operations
- Automatic message cleanup for tokens
- Secure SSH connections for scripts
- Role-based permission system
- Token validation and verification
- Protected API endpoints
- Session management
- Telegram User ID
- DigitalOcean API Token
- VPS configuration preferences
- API tokens: DigitalOcean API calls only
- User IDs: Role management
- No analytics or tracking
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
- Create new service in appropriate directory
- Update bot_service.py with new handlers
- Add necessary menu items and callbacks
- Update help documentation
- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Create Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, contact:
- Telegram: @mandoelsz