fofx/droplet-manager
最新稳定版本:v1.0.3
Composer 安装命令:
composer require fofx/droplet-manager
包简介
For managing DigitalOcean droplets, CyberPanel accounts, and DNS records for GoDaddy and Namecheap.
README 文档
README
This PHP library provides functionality to manage DigitalOcean droplets, CyberPanel accounts, and DNS settings with GoDaddy and Namecheap. This library provides a set of tools for automating server management tasks, and website deployments.
Features
-
DigitalOcean Management
- Create and configure droplets
- Manage DNS records
-
CyberPanel Integration
- Create and manage websites
- Configure PHP versions and extensions
- Manage databases
- Handle user accounts
-
DNS Management
- Support for Namecheap and GoDaddy
- Automated DNS record configuration
- Nameserver updates
-
Server Configuration
- Automated HTTPS setup
- PHP version management
- MySQL configuration
- Security settings
Installation
- Install via Composer:
composer require fofx/droplet-manager
- Create config folder and configuration file:
mkdir -p config && cp vendor/fofx/droplet-manager/config/droplet-manager.config.php.example config/droplet-manager.config.php
- Configure your credentials in
config/droplet-manager.config.php:
return [ 'digitalocean' => [ 'token' => 'your_do_token', 'image_id' => 'litespeedtechnol-cyberpanel-20-04', ], 'namecheap' => [ 'username' => 'your_username', 'token' => 'your_token', ], 'godaddy' => [ 'api_key' => 'your_godaddy_key', 'api_secret' => 'your_godaddy_secret', ], // ... other configurations ];
Usage
See docs/usage.md for more detailed usage instructions.
Setup
- Install:
composer require fofx/droplet-manager - Copy config:
cp vendor/fofx/droplet-manager/config/droplet-manager.config.php.example config/droplet-manager.config.php - Add your DigitalOcean API token to
config/droplet-manager.config.php
Workflow
- Create droplet →
$manager->createDroplet($dropletName, $region, $size) - Wait for email → DigitalOcean emails you the root password
- Get credentials → Log in to the droplet, run
cat /root/.litespeed_passwordandcat /root/.db_password - Add to config → Update config file with droplet IP and passwords
- Configure server →
$manager->configureDroplet()(installs PHP, MySQL, tools) - Create website →
$manager->setupWebsite(domainName: 'example.com', websiteEmail: 'admin@example.com', phpVersion: '8.4')
Requirements
- PHP 8.1 or higher
- Composer
- Required PHP extensions:
- curl
- json
- xml
- mbstring
Developer Tools
Run the PHPUnit test suite:
composer test
Run PHPStan static analysis:
composer analyse
Run PHP-CS-Fixer:
composer cs-fix
License
This project is licensed under the MIT License.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-05