mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 00:36:34 +02:00
Enhance OS compatibility and documentation for CyberPanel
- Added support for Debian 11, 12, and 13 in the OS detection logic within cyberpanel.sh. - Updated README.md to include Debian versions with their respective support timelines. - Introduced a new Debian 13 Installation Guide in the documentation. - Revised OS compatibility details in the testPlugin documentation to reflect full support for Debian versions.
This commit is contained in:
11
README.md
11
README.md
@@ -80,6 +80,9 @@ CyberPanel runs on x86_64 architecture and supports the following operating syst
|
||||
- **Ubuntu 24.04.3** - Supported until April 2029 ⭐ **NEW!**
|
||||
- **Ubuntu 22.04** - Supported until April 2027
|
||||
- **Ubuntu 20.04** - Supported until April 2025
|
||||
- **Debian 13** - Supported until 2029 ⭐ **NEW!**
|
||||
- **Debian 12** - Supported until 2027
|
||||
- **Debian 11** - Supported until 2026
|
||||
- **AlmaLinux 10** - Supported until May 2030 ⭐ **NEW!**
|
||||
- **AlmaLinux 9** - Supported until May 2032
|
||||
- **AlmaLinux 8** - Supported until May 2029
|
||||
@@ -94,7 +97,6 @@ CyberPanel runs on x86_64 architecture and supports the following operating syst
|
||||
|
||||
Additional operating systems may be supported through third-party repositories or community efforts:
|
||||
|
||||
- **Debian** - May work with Ubuntu-compatible packages
|
||||
- **openEuler** - Community-supported with limited testing
|
||||
- **Other RHEL derivatives** - May work with AlmaLinux/RockyLinux packages
|
||||
|
||||
@@ -124,7 +126,7 @@ sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgr
|
||||
|
||||
## 🆕 Recent Updates & Fixes
|
||||
|
||||
### **Bandwidth Reset Issue Fixed** (January 2025)
|
||||
### **Bandwidth Reset Issue Fixed** (September 2025)
|
||||
|
||||
- **Issue**: Monthly bandwidth usage was not resetting, causing cumulative values to grow indefinitely
|
||||
- **Solution**: Implemented automatic monthly bandwidth reset for all websites and child domains
|
||||
@@ -132,11 +134,12 @@ sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgr
|
||||
- **Manual Reset**: Use `/usr/local/CyberCP/scripts/reset_bandwidth.sh` for immediate reset
|
||||
- **Documentation**: See [Bandwidth Reset Fix Guide](to-do/cyberpanel-bandwidth-reset-fix.md)
|
||||
|
||||
### **New Operating System Support Added** (January 2025)
|
||||
### **New Operating System Support Added** (September 2025)
|
||||
|
||||
- **Ubuntu 24.04.3**: Full compatibility with latest Ubuntu LTS
|
||||
- **Debian 13**: Full compatibility with latest Debian stable release
|
||||
- **AlmaLinux 10**: Full compatibility with latest AlmaLinux release
|
||||
- **Long-term Support**: Both supported until 2029-2030
|
||||
- **Long-term Support**: All supported until 2029-2030
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -549,12 +549,14 @@ elif grep -q -E "Rocky Linux" /etc/os-release ; then
|
||||
Server_OS="RockyLinux"
|
||||
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04|Ubuntu 24.04" /etc/os-release ; then
|
||||
Server_OS="Ubuntu"
|
||||
elif grep -q -E "Debian GNU/Linux 11|Debian GNU/Linux 12|Debian GNU/Linux 13" /etc/os-release ; then
|
||||
Server_OS="Debian"
|
||||
elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then
|
||||
Server_OS="openEuler"
|
||||
else
|
||||
echo -e "Unable to detect your system..."
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, CentOS 7, CentOS 8, CentOS 9, RHEL 8, RHEL 9, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, CentOS 7, CentOS 8, CentOS 9, RHEL 8, RHEL 9, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03... [404]"
|
||||
echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, Debian 11, Debian 12, Debian 13, CentOS 7, CentOS 8, CentOS 9, RHEL 8, RHEL 9, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n"
|
||||
Debug_Log2 "CyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, Debian 11, Debian 12, Debian 13, CentOS 7, CentOS 8, CentOS 9, RHEL 8, RHEL 9, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03... [404]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -568,6 +570,9 @@ if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] || [[ "$S
|
||||
Server_OS="CentOS"
|
||||
#CloudLinux gives version id like 7.8, 7.9, so cut it to show first number only
|
||||
#treat CloudLinux, Rocky and Alma as CentOS
|
||||
elif [[ "$Server_OS" = "Debian" ]] ; then
|
||||
Server_OS="Ubuntu"
|
||||
#Treat Debian as Ubuntu for package management (both use apt-get)
|
||||
fi
|
||||
|
||||
if [[ "$Debug" = "On" ]] ; then
|
||||
|
||||
327
guides/DEBIAN_13_INSTALLATION_GUIDE.md
Normal file
327
guides/DEBIAN_13_INSTALLATION_GUIDE.md
Normal file
@@ -0,0 +1,327 @@
|
||||
# Debian 13 Installation Guide for CyberPanel
|
||||
|
||||
## 🎯 Overview
|
||||
|
||||
This guide provides step-by-step instructions for installing CyberPanel on Debian 13 (Bookworm). Debian 13 support has been added to CyberPanel with full compatibility for package management, service configuration, and web server setup.
|
||||
|
||||
## 📋 Prerequisites
|
||||
|
||||
### System Requirements
|
||||
- **OS**: Debian 13 (Bookworm) x86_64
|
||||
- **RAM**: Minimum 1GB (2GB+ recommended)
|
||||
- **Storage**: Minimum 10GB free space (20GB+ recommended)
|
||||
- **CPU**: 2+ cores recommended
|
||||
- **Network**: Internet connection required
|
||||
|
||||
### Supported Debian Versions
|
||||
- ✅ **Debian 13** (Bookworm) - Full Support
|
||||
- ✅ **Debian 12** (Bookworm) - Full Support
|
||||
- ✅ **Debian 11** (Bullseye) - Full Support
|
||||
|
||||
## 🚀 Installation Steps
|
||||
|
||||
### Step 1: Update System
|
||||
|
||||
```bash
|
||||
# Update package lists
|
||||
sudo apt update
|
||||
|
||||
# Upgrade system packages
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Install essential packages
|
||||
sudo apt install -y curl wget git
|
||||
```
|
||||
|
||||
### Step 2: Download and Run CyberPanel Installer
|
||||
|
||||
```bash
|
||||
# Download the latest CyberPanel installer
|
||||
wget https://cyberpanel.sh/install.sh
|
||||
|
||||
# Make the installer executable
|
||||
chmod +x install.sh
|
||||
|
||||
# Run the installer
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
### Step 3: Follow Installation Prompts
|
||||
|
||||
The installer will guide you through:
|
||||
|
||||
1. **License Agreement**: Accept the terms
|
||||
2. **Installation Type**: Choose between:
|
||||
- OpenLiteSpeed (Free)
|
||||
- LiteSpeed Enterprise (Requires license)
|
||||
3. **MySQL Configuration**:
|
||||
- Single MySQL instance (recommended)
|
||||
- Double MySQL instance (for high availability)
|
||||
4. **Additional Services**:
|
||||
- Postfix/Dovecot (Email server)
|
||||
- PowerDNS (DNS server)
|
||||
- PureFTPD (FTP server)
|
||||
|
||||
### Step 4: Verify Installation
|
||||
|
||||
```bash
|
||||
# Check CyberPanel service status
|
||||
sudo systemctl status lscpd
|
||||
|
||||
# Check web server status
|
||||
sudo systemctl status apache2
|
||||
|
||||
# Check if CyberPanel is accessible
|
||||
curl -I http://localhost:8090
|
||||
```
|
||||
|
||||
## 🔧 Post-Installation Configuration
|
||||
|
||||
### Access CyberPanel
|
||||
|
||||
1. Open your web browser
|
||||
2. Navigate to: `http://your-server-ip:8090`
|
||||
3. Default login credentials:
|
||||
- **Username**: `admin`
|
||||
- **Password**: `123456` (change immediately!)
|
||||
|
||||
### Change Default Password
|
||||
|
||||
```bash
|
||||
# Login to CyberPanel CLI
|
||||
sudo cyberpanel
|
||||
|
||||
# Change admin password
|
||||
cyberpanel --change-password admin
|
||||
```
|
||||
|
||||
### Configure Firewall
|
||||
|
||||
```bash
|
||||
# Allow CyberPanel ports
|
||||
sudo ufw allow 8090/tcp
|
||||
sudo ufw allow 80/tcp
|
||||
sudo ufw allow 443/tcp
|
||||
sudo ufw allow 21/tcp
|
||||
sudo ufw allow 25/tcp
|
||||
sudo ufw allow 53/tcp
|
||||
sudo ufw allow 587/tcp
|
||||
sudo ufw allow 993/tcp
|
||||
sudo ufw allow 995/tcp
|
||||
|
||||
# Enable firewall
|
||||
sudo ufw enable
|
||||
```
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### 1. OS Detection Failed
|
||||
**Problem**: Installer doesn't recognize Debian 13
|
||||
**Solution**: Ensure you're running the latest installer version
|
||||
|
||||
```bash
|
||||
# Download latest installer
|
||||
wget https://cyberpanel.sh/install.sh
|
||||
chmod +x install.sh
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
#### 2. Package Installation Failed
|
||||
**Problem**: apt-get errors during installation
|
||||
**Solution**: Update repositories and retry
|
||||
|
||||
```bash
|
||||
# Update package lists
|
||||
sudo apt update
|
||||
|
||||
# Fix broken packages
|
||||
sudo apt --fix-broken install
|
||||
|
||||
# Retry installation
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
#### 3. Service Won't Start
|
||||
**Problem**: CyberPanel service fails to start
|
||||
**Solution**: Check logs and restart services
|
||||
|
||||
```bash
|
||||
# Check service status
|
||||
sudo systemctl status lscpd
|
||||
|
||||
# Check logs
|
||||
sudo journalctl -u lscpd -f
|
||||
|
||||
# Restart service
|
||||
sudo systemctl restart lscpd
|
||||
```
|
||||
|
||||
#### 4. Web Server Issues
|
||||
**Problem**: Apache2 configuration problems
|
||||
**Solution**: Reconfigure web server
|
||||
|
||||
```bash
|
||||
# Check Apache2 status
|
||||
sudo systemctl status apache2
|
||||
|
||||
# Test configuration
|
||||
sudo apache2ctl configtest
|
||||
|
||||
# Restart Apache2
|
||||
sudo systemctl restart apache2
|
||||
```
|
||||
|
||||
### Log Files
|
||||
|
||||
Important log locations:
|
||||
- **CyberPanel**: `/usr/local/CyberCP/logs/`
|
||||
- **Apache2**: `/var/log/apache2/`
|
||||
- **System**: `/var/log/syslog`
|
||||
- **Installation**: `/root/cyberpanel-install.log`
|
||||
|
||||
## 🔒 Security Considerations
|
||||
|
||||
### Initial Security Setup
|
||||
|
||||
1. **Change Default Password**
|
||||
```bash
|
||||
sudo cyberpanel --change-password admin
|
||||
```
|
||||
|
||||
2. **Update System**
|
||||
```bash
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
3. **Configure Firewall**
|
||||
```bash
|
||||
sudo ufw enable
|
||||
sudo ufw default deny incoming
|
||||
sudo ufw default allow outgoing
|
||||
```
|
||||
|
||||
4. **Enable Fail2Ban**
|
||||
```bash
|
||||
sudo apt install fail2ban -y
|
||||
sudo systemctl enable fail2ban
|
||||
sudo systemctl start fail2ban
|
||||
```
|
||||
|
||||
### SSL Certificate Setup
|
||||
|
||||
1. **Access CyberPanel Web Interface**
|
||||
2. **Navigate to**: SSL → Let's Encrypt
|
||||
3. **Enter your domain name**
|
||||
4. **Click "Issue" to get free SSL certificate**
|
||||
|
||||
## 📊 Performance Optimization
|
||||
|
||||
### System Optimization
|
||||
|
||||
```bash
|
||||
# Optimize Apache2 for Debian
|
||||
sudo nano /etc/apache2/apache2.conf
|
||||
|
||||
# Add these lines:
|
||||
ServerTokens Prod
|
||||
ServerSignature Off
|
||||
KeepAlive On
|
||||
MaxKeepAliveRequests 100
|
||||
KeepAliveTimeout 5
|
||||
```
|
||||
|
||||
### PHP Optimization
|
||||
|
||||
1. **Access CyberPanel Web Interface**
|
||||
2. **Navigate to**: PHP → PHP Settings
|
||||
3. **Configure**:
|
||||
- Memory limit: 256M
|
||||
- Max execution time: 300
|
||||
- Upload max filesize: 64M
|
||||
|
||||
## 🔄 Updates and Maintenance
|
||||
|
||||
### Update CyberPanel
|
||||
|
||||
```bash
|
||||
# Update to latest version
|
||||
sudo cyberpanel --update
|
||||
|
||||
# Or use the upgrade script
|
||||
sudo ./cyberpanel_upgrade.sh
|
||||
```
|
||||
|
||||
### System Maintenance
|
||||
|
||||
```bash
|
||||
# Update system packages
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
|
||||
# Clean package cache
|
||||
sudo apt autoremove -y
|
||||
sudo apt autoclean
|
||||
|
||||
# Check disk usage
|
||||
df -h
|
||||
|
||||
# Check memory usage
|
||||
free -h
|
||||
```
|
||||
|
||||
## 📚 Additional Resources
|
||||
|
||||
### Documentation
|
||||
- [CyberPanel Official Docs](https://cyberpanel.net/docs/)
|
||||
- [Debian 13 Release Notes](https://www.debian.org/releases/bookworm/releasenotes)
|
||||
- [Apache2 Configuration Guide](https://httpd.apache.org/docs/2.4/)
|
||||
|
||||
### Community Support
|
||||
- [CyberPanel Community Forum](https://forums.cyberpanel.net/)
|
||||
- [GitHub Issues](https://github.com/usmannasir/cyberpanel/issues)
|
||||
- [Discord Server](https://discord.gg/cyberpanel)
|
||||
|
||||
### Testing Compatibility
|
||||
|
||||
Run the compatibility test script:
|
||||
|
||||
```bash
|
||||
# Download test script
|
||||
wget https://raw.githubusercontent.com/cyberpanel/cyberpanel/main/test_debian13_support.sh
|
||||
|
||||
# Make executable
|
||||
chmod +x test_debian13_support.sh
|
||||
|
||||
# Run test
|
||||
sudo ./test_debian13_support.sh
|
||||
```
|
||||
|
||||
## ✅ Verification Checklist
|
||||
|
||||
After installation, verify these components:
|
||||
|
||||
- [ ] CyberPanel web interface accessible
|
||||
- [ ] Admin password changed
|
||||
- [ ] SSL certificate installed
|
||||
- [ ] Firewall configured
|
||||
- [ ] Email server working (if installed)
|
||||
- [ ] DNS server working (if installed)
|
||||
- [ ] FTP server working (if installed)
|
||||
- [ ] System updates applied
|
||||
- [ ] Logs are clean
|
||||
- [ ] Services are running
|
||||
|
||||
## 🆘 Getting Help
|
||||
|
||||
If you encounter issues:
|
||||
|
||||
1. **Check the logs** (see Troubleshooting section)
|
||||
2. **Run the compatibility test**
|
||||
3. **Search the documentation**
|
||||
4. **Ask in the community forum**
|
||||
5. **Create a GitHub issue** with detailed information
|
||||
|
||||
---
|
||||
|
||||
**Note**: This guide is specifically for Debian 13. For other operating systems, refer to the main CyberPanel documentation.
|
||||
@@ -14,6 +14,9 @@ Welcome to the CyberPanel documentation hub! This folder contains all guides, tu
|
||||
### 📧 Email & Marketing
|
||||
- **[Mautic Installation Guide](MAUTIC_INSTALLATION_GUIDE.md)** - Step-by-step guide for installing and configuring Mautic email marketing platform
|
||||
|
||||
### 🐧 Operating System Support
|
||||
- **[Debian 13 Installation Guide](DEBIAN_13_INSTALLATION_GUIDE.md)** - Complete installation and configuration guide for CyberPanel on Debian 13 (Bookworm)
|
||||
|
||||
### 🎨 Customization & Design
|
||||
- **[Custom CSS Guide](CUSTOM_CSS_GUIDE.md)** - Complete guide for creating custom CSS that works with CyberPanel 2.5.5-dev design system
|
||||
|
||||
@@ -24,14 +27,16 @@ Welcome to the CyberPanel documentation hub! This folder contains all guides, tu
|
||||
## 🚀 Quick Start
|
||||
|
||||
1. **New to CyberPanel?** Start with the [README](../README.md) for installation and basic setup
|
||||
2. **Need Docker help?** Check the [Docker Command Execution Guide](Docker_Command_Execution_Guide.md)
|
||||
3. **Setting up email marketing?** Follow the [Mautic Installation Guide](MAUTIC_INSTALLATION_GUIDE.md)
|
||||
4. **Want to customize the interface?** Check the [Custom CSS Guide](CUSTOM_CSS_GUIDE.md)
|
||||
5. **Want to contribute?** Read the [Contributing Guide](CONTRIBUTING.md)
|
||||
2. **Installing on Debian 13?** Follow the [Debian 13 Installation Guide](DEBIAN_13_INSTALLATION_GUIDE.md)
|
||||
3. **Need Docker help?** Check the [Docker Command Execution Guide](Docker_Command_Execution_Guide.md)
|
||||
4. **Setting up email marketing?** Follow the [Mautic Installation Guide](MAUTIC_INSTALLATION_GUIDE.md)
|
||||
5. **Want to customize the interface?** Check the [Custom CSS Guide](CUSTOM_CSS_GUIDE.md)
|
||||
6. **Want to contribute?** Read the [Contributing Guide](CONTRIBUTING.md)
|
||||
|
||||
## 🔍 Finding What You Need
|
||||
|
||||
- **Installation & Setup**: [README](../README.md)
|
||||
- **Debian 13 Installation**: [Debian 13 Installation Guide](DEBIAN_13_INSTALLATION_GUIDE.md)
|
||||
- **Docker Features**: [Docker Command Execution Guide](Docker_Command_Execution_Guide.md)
|
||||
- **Security Features**: [AI Scanner Documentation](AIScannerDocs.md)
|
||||
- **Email Marketing**: [Mautic Installation Guide](MAUTIC_INSTALLATION_GUIDE.md)
|
||||
|
||||
@@ -10,7 +10,9 @@ The CyberPanel Test Plugin is designed to work seamlessly across all CyberPanel-
|
||||
|------------------|---------|----------------|----------------|-----------------|-----------------|
|
||||
| **Ubuntu** | 22.04 | ✅ Full Support | 3.10+ | apt-get | systemctl |
|
||||
| **Ubuntu** | 20.04 | ✅ Full Support | 3.8+ | apt-get | systemctl |
|
||||
| **Debian** | 11+ | ✅ Full Support | 3.9+ | apt-get | systemctl |
|
||||
| **Debian** | 13 | ✅ Full Support | 3.11+ | apt-get | systemctl |
|
||||
| **Debian** | 12 | ✅ Full Support | 3.10+ | apt-get | systemctl |
|
||||
| **Debian** | 11 | ✅ Full Support | 3.9+ | apt-get | systemctl |
|
||||
| **AlmaLinux** | 10 | ✅ Full Support | 3.11+ | dnf | systemctl |
|
||||
| **AlmaLinux** | 9 | ✅ Full Support | 3.9+ | dnf | systemctl |
|
||||
| **AlmaLinux** | 8 | ✅ Full Support | 3.6+ | dnf/yum | systemctl |
|
||||
@@ -457,6 +459,6 @@ sudo rm -f /home/cyberpanel/plugins/testPlugin
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: December 2024
|
||||
**Last Updated**: September 2025
|
||||
**Compatibility Version**: 1.0.0
|
||||
**Next Review**: March 2025
|
||||
**Next Review**: March 2026
|
||||
|
||||
430
test_debian13_support.sh
Normal file
430
test_debian13_support.sh
Normal file
@@ -0,0 +1,430 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Debian 13 Support Test Script for CyberPanel
|
||||
# This script tests the compatibility of CyberPanel with Debian 13
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Test results
|
||||
TESTS_PASSED=0
|
||||
TESTS_FAILED=0
|
||||
TESTS_TOTAL=0
|
||||
|
||||
# Function to print colored output
|
||||
print_status() {
|
||||
echo -e "${BLUE}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
||||
((TESTS_PASSED++))
|
||||
}
|
||||
|
||||
print_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${NC} $1"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
((TESTS_FAILED++))
|
||||
}
|
||||
|
||||
print_test_header() {
|
||||
echo -e "\n${BLUE}=== $1 ===${NC}"
|
||||
((TESTS_TOTAL++))
|
||||
}
|
||||
|
||||
# Function to run a test
|
||||
run_test() {
|
||||
local test_name="$1"
|
||||
local test_command="$2"
|
||||
local expected_result="$3"
|
||||
|
||||
print_test_header "$test_name"
|
||||
|
||||
if eval "$test_command" >/dev/null 2>&1; then
|
||||
if [[ "$expected_result" == "success" ]]; then
|
||||
print_success "$test_name passed"
|
||||
return 0
|
||||
else
|
||||
print_error "$test_name failed (unexpected success)"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if [[ "$expected_result" == "failure" ]]; then
|
||||
print_success "$test_name passed (expected failure)"
|
||||
return 0
|
||||
else
|
||||
print_error "$test_name failed"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to check OS detection
|
||||
test_os_detection() {
|
||||
print_test_header "OS Detection Test"
|
||||
|
||||
# Check if we're on Debian 13
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
source /etc/os-release
|
||||
if [[ "$ID" == "debian" && "$VERSION_ID" == "13" ]]; then
|
||||
print_success "Debian 13 detected correctly"
|
||||
else
|
||||
print_warning "Not running on Debian 13 (Current: $ID $VERSION_ID)"
|
||||
print_status "This test is designed for Debian 13, but will continue with current OS"
|
||||
fi
|
||||
else
|
||||
print_error "Cannot detect OS - /etc/os-release not found"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test CyberPanel OS detection logic
|
||||
test_cyberpanel_os_detection() {
|
||||
print_test_header "CyberPanel OS Detection Logic Test"
|
||||
|
||||
# Test the OS detection logic from cyberpanel.sh
|
||||
if grep -q -E "Debian GNU/Linux 11|Debian GNU/Linux 12|Debian GNU/Linux 13" /etc/os-release; then
|
||||
print_success "CyberPanel OS detection logic recognizes Debian 11/12/13"
|
||||
else
|
||||
print_error "CyberPanel OS detection logic does not recognize current Debian version"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test package manager compatibility
|
||||
test_package_manager() {
|
||||
print_test_header "Package Manager Compatibility Test"
|
||||
|
||||
# Test apt-get availability
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
print_success "apt-get package manager is available"
|
||||
else
|
||||
print_error "apt-get package manager not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Test apt-get update (dry run)
|
||||
if apt-get update --dry-run >/dev/null 2>&1; then
|
||||
print_success "apt-get update works correctly"
|
||||
else
|
||||
print_warning "apt-get update failed (may be network related)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test systemd compatibility
|
||||
test_systemd_compatibility() {
|
||||
print_test_header "Systemd Compatibility Test"
|
||||
|
||||
# Test systemctl availability
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
print_success "systemctl is available"
|
||||
else
|
||||
print_error "systemctl not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Test systemd status
|
||||
if systemctl is-system-running >/dev/null 2>&1; then
|
||||
print_success "systemd is running"
|
||||
else
|
||||
print_warning "systemd status unclear"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test Python compatibility
|
||||
test_python_compatibility() {
|
||||
print_test_header "Python Compatibility Test"
|
||||
|
||||
# Test Python 3 availability
|
||||
if command -v python3 >/dev/null 2>&1; then
|
||||
local python_version=$(python3 --version 2>&1 | cut -d' ' -f2)
|
||||
print_success "Python 3 is available: $python_version"
|
||||
|
||||
# Check if Python version is compatible (3.6+)
|
||||
local major_version=$(echo "$python_version" | cut -d'.' -f1)
|
||||
local minor_version=$(echo "$python_version" | cut -d'.' -f2)
|
||||
|
||||
if [[ $major_version -ge 3 && $minor_version -ge 6 ]]; then
|
||||
print_success "Python version is compatible (3.6+)"
|
||||
else
|
||||
print_warning "Python version may not be fully compatible (requires 3.6+)"
|
||||
fi
|
||||
else
|
||||
print_error "Python 3 not found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Test pip3 availability
|
||||
if command -v pip3 >/dev/null 2>&1; then
|
||||
print_success "pip3 is available"
|
||||
else
|
||||
print_warning "pip3 not found (may need to be installed)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test web server compatibility
|
||||
test_web_server_compatibility() {
|
||||
print_test_header "Web Server Compatibility Test"
|
||||
|
||||
# Test Apache2 availability
|
||||
if command -v apache2 >/dev/null 2>&1; then
|
||||
print_success "Apache2 is available"
|
||||
else
|
||||
print_warning "Apache2 not found (will be installed by CyberPanel)"
|
||||
fi
|
||||
|
||||
# Test if Apache2 can be installed
|
||||
if apt-cache show apache2 >/dev/null 2>&1; then
|
||||
print_success "Apache2 package is available in repositories"
|
||||
else
|
||||
print_error "Apache2 package not found in repositories"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test required packages availability
|
||||
test_required_packages() {
|
||||
print_test_header "Required Packages Availability Test"
|
||||
|
||||
local required_packages=(
|
||||
"curl"
|
||||
"wget"
|
||||
"git"
|
||||
"build-essential"
|
||||
"python3-dev"
|
||||
"python3-pip"
|
||||
"python3-venv"
|
||||
"software-properties-common"
|
||||
"apt-transport-https"
|
||||
"ca-certificates"
|
||||
"gnupg"
|
||||
)
|
||||
|
||||
local available_count=0
|
||||
local total_count=${#required_packages[@]}
|
||||
|
||||
for package in "${required_packages[@]}"; do
|
||||
if apt-cache show "$package" >/dev/null 2>&1; then
|
||||
print_success "$package is available"
|
||||
((available_count++))
|
||||
else
|
||||
print_warning "$package not found in repositories"
|
||||
fi
|
||||
done
|
||||
|
||||
print_status "Available packages: $available_count/$total_count"
|
||||
|
||||
if [[ $available_count -ge $((total_count * 8 / 10)) ]]; then
|
||||
print_success "Most required packages are available"
|
||||
else
|
||||
print_warning "Many required packages are missing"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test LiteSpeed repository compatibility
|
||||
test_litespeed_repo_compatibility() {
|
||||
print_test_header "LiteSpeed Repository Compatibility Test"
|
||||
|
||||
# Test if we can access LiteSpeed Debian repository
|
||||
if curl -s --head "http://rpms.litespeedtech.com/debian/" | head -n 1 | grep -q "200 OK"; then
|
||||
print_success "LiteSpeed Debian repository is accessible"
|
||||
else
|
||||
print_warning "LiteSpeed Debian repository may not be accessible"
|
||||
fi
|
||||
|
||||
# Test if we can download the repository setup script
|
||||
if wget --spider "http://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh" 2>/dev/null; then
|
||||
print_success "LiteSpeed repository setup script is available"
|
||||
else
|
||||
print_warning "LiteSpeed repository setup script may not be available"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test MariaDB compatibility
|
||||
test_mariadb_compatibility() {
|
||||
print_test_header "MariaDB Compatibility Test"
|
||||
|
||||
# Test MariaDB repository accessibility
|
||||
if curl -s --head "https://mariadb.org/mariadb_release_signing_key.pgp" | head -n 1 | grep -q "200 OK"; then
|
||||
print_success "MariaDB signing key is accessible"
|
||||
else
|
||||
print_warning "MariaDB signing key may not be accessible"
|
||||
fi
|
||||
|
||||
# Test if MariaDB packages are available
|
||||
if apt-cache show mariadb-server >/dev/null 2>&1; then
|
||||
print_success "MariaDB packages are available in repositories"
|
||||
else
|
||||
print_warning "MariaDB packages not found in default repositories"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test network connectivity
|
||||
test_network_connectivity() {
|
||||
print_test_header "Network Connectivity Test"
|
||||
|
||||
local test_urls=(
|
||||
"https://github.com"
|
||||
"https://pypi.org"
|
||||
"http://rpms.litespeedtech.com"
|
||||
"https://mariadb.org"
|
||||
)
|
||||
|
||||
local accessible_count=0
|
||||
local total_count=${#test_urls[@]}
|
||||
|
||||
for url in "${test_urls[@]}"; do
|
||||
if curl -s --head "$url" >/dev/null 2>&1; then
|
||||
print_success "$url is accessible"
|
||||
((accessible_count++))
|
||||
else
|
||||
print_warning "$url is not accessible"
|
||||
fi
|
||||
done
|
||||
|
||||
print_status "Accessible URLs: $accessible_count/$total_count"
|
||||
|
||||
if [[ $accessible_count -ge $((total_count * 3 / 4)) ]]; then
|
||||
print_success "Network connectivity is good"
|
||||
else
|
||||
print_warning "Network connectivity may be limited"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to test system resources
|
||||
test_system_resources() {
|
||||
print_test_header "System Resources Test"
|
||||
|
||||
# Test available memory
|
||||
local total_memory=$(free -m | awk 'NR==2{print $2}')
|
||||
if [[ $total_memory -ge 1024 ]]; then
|
||||
print_success "Sufficient memory available: ${total_memory}MB"
|
||||
else
|
||||
print_warning "Low memory: ${total_memory}MB (recommended: 1GB+)"
|
||||
fi
|
||||
|
||||
# Test available disk space
|
||||
local available_space=$(df / | awk 'NR==2{print $4}')
|
||||
local available_gb=$((available_space / 1024 / 1024))
|
||||
if [[ $available_gb -ge 10 ]]; then
|
||||
print_success "Sufficient disk space: ${available_gb}GB"
|
||||
else
|
||||
print_warning "Low disk space: ${available_gb}GB (recommended: 10GB+)"
|
||||
fi
|
||||
|
||||
# Test CPU cores
|
||||
local cpu_cores=$(nproc)
|
||||
if [[ $cpu_cores -ge 2 ]]; then
|
||||
print_success "Sufficient CPU cores: $cpu_cores"
|
||||
else
|
||||
print_warning "Limited CPU cores: $cpu_cores (recommended: 2+)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to run all tests
|
||||
run_all_tests() {
|
||||
echo -e "${BLUE}========================================${NC}"
|
||||
echo -e "${BLUE} CyberPanel Debian 13 Compatibility Test${NC}"
|
||||
echo -e "${BLUE}========================================${NC}\n"
|
||||
|
||||
test_os_detection
|
||||
test_cyberpanel_os_detection
|
||||
test_package_manager
|
||||
test_systemd_compatibility
|
||||
test_python_compatibility
|
||||
test_web_server_compatibility
|
||||
test_required_packages
|
||||
test_litespeed_repo_compatibility
|
||||
test_mariadb_compatibility
|
||||
test_network_connectivity
|
||||
test_system_resources
|
||||
|
||||
echo -e "\n${BLUE}========================================${NC}"
|
||||
echo -e "${BLUE} Test Results Summary${NC}"
|
||||
echo -e "${BLUE}========================================${NC}"
|
||||
echo -e "Total Tests: $TESTS_TOTAL"
|
||||
echo -e "Passed: ${GREEN}$TESTS_PASSED${NC}"
|
||||
echo -e "Failed: ${RED}$TESTS_FAILED${NC}"
|
||||
|
||||
if [[ $TESTS_FAILED -eq 0 ]]; then
|
||||
echo -e "\n${GREEN}✅ All tests passed! Debian 13 appears to be compatible with CyberPanel.${NC}"
|
||||
return 0
|
||||
elif [[ $TESTS_FAILED -le 2 ]]; then
|
||||
echo -e "\n${YELLOW}⚠️ Most tests passed. Debian 13 should be compatible with minor issues.${NC}"
|
||||
return 0
|
||||
else
|
||||
echo -e "\n${RED}❌ Multiple tests failed. Debian 13 may have compatibility issues.${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to show usage
|
||||
show_usage() {
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -h, --help Show this help message"
|
||||
echo " -v, --verbose Enable verbose output"
|
||||
echo " --quick Run only essential tests"
|
||||
echo ""
|
||||
echo "This script tests CyberPanel compatibility with Debian 13."
|
||||
echo "Run as root for best results."
|
||||
}
|
||||
|
||||
# Main execution
|
||||
main() {
|
||||
local verbose=false
|
||||
local quick=false
|
||||
|
||||
# Parse command line arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-h|--help)
|
||||
show_usage
|
||||
exit 0
|
||||
;;
|
||||
-v|--verbose)
|
||||
verbose=true
|
||||
shift
|
||||
;;
|
||||
--quick)
|
||||
quick=true
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
show_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if running as root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
print_warning "Not running as root. Some tests may fail."
|
||||
print_status "Consider running: sudo $0"
|
||||
fi
|
||||
|
||||
# Run tests
|
||||
if [[ "$quick" == "true" ]]; then
|
||||
print_status "Running quick compatibility test..."
|
||||
test_os_detection
|
||||
test_cyberpanel_os_detection
|
||||
test_package_manager
|
||||
test_systemd_compatibility
|
||||
else
|
||||
run_all_tests
|
||||
fi
|
||||
}
|
||||
|
||||
# Run main function
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user