mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 00:36:34 +02:00
Fix monthly bandwidth for websites
Fix monthly bandwidth for websites: https://github.com/usmannasir/cyberpanel/issues/1496
This commit is contained in:
39
README.md
39
README.md
@@ -18,6 +18,7 @@ Web Hosting Control Panel powered by OpenLiteSpeed, designed to simplify hosting
|
||||
- 📀 **One-click Backups and Restores**.
|
||||
- 🐳 **Docker Management** with command execution capabilities.
|
||||
- 🤖 **AI-Powered Security Scanner** for enhanced protection.
|
||||
- 📊 **Monthly Bandwidth Reset** - Automatic bandwidth usage reset (Fixed in latest version).
|
||||
|
||||
---
|
||||
|
||||
@@ -75,9 +76,10 @@ CyberPanel runs on x86_64 architecture and supports the following operating syst
|
||||
|
||||
### **✅ Currently Supported**
|
||||
|
||||
- **Ubuntu 24.04.3** - Supported until April 2029 ⭐ **NEW!**
|
||||
- **Ubuntu 22.04** - Supported until April 2027
|
||||
- **Ubuntu 20.04** - Supported until April 2025
|
||||
- **AlmaLinux 10** - Supported until May 2030
|
||||
- **AlmaLinux 10** - Supported until May 2030 ⭐ **NEW!**
|
||||
- **AlmaLinux 9** - Supported until May 2032
|
||||
- **AlmaLinux 8** - Supported until May 2029
|
||||
- **RockyLinux 9** - Supported until May 2032
|
||||
@@ -107,6 +109,7 @@ Install CyberPanel easily with the following command:
|
||||
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 📊 Upgrading CyberPanel
|
||||
@@ -119,6 +122,22 @@ sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgr
|
||||
|
||||
---
|
||||
|
||||
## 🆕 Recent Updates & Fixes
|
||||
|
||||
### **Bandwidth Reset Issue Fixed** (January 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
|
||||
- **Affected OS**: All supported operating systems (Ubuntu, AlmaLinux, RockyLinux, RHEL, CloudLinux, CentOS)
|
||||
- **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)
|
||||
- **Ubuntu 24.04.3**: Full compatibility with latest Ubuntu LTS
|
||||
- **AlmaLinux 10**: Full compatibility with latest AlmaLinux release
|
||||
- **Long-term Support**: Both supported until 2029-2030
|
||||
|
||||
---
|
||||
|
||||
## 📚 Resources
|
||||
|
||||
- 🌐 [Official Site](https://cyberpanel.net)
|
||||
@@ -146,4 +165,22 @@ sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgr
|
||||
| 🐳 Docker | [Command Execution](guides/Docker_Command_Execution_Guide.md) | Execute commands in containers |
|
||||
| 🤖 Security | [AI Scanner](guides/AIScannerDocs.md) | AI-powered security scanning |
|
||||
| 📧 Email | [Mautic Setup](guides/MAUTIC_INSTALLATION_GUIDE.md) | Email marketing platform |
|
||||
| 📊 Bandwidth | [Reset Fix Guide](to-do/cyberpanel-bandwidth-reset-fix.md) | Fix bandwidth reset issues |
|
||||
| 📚 All | [Complete Index](guides/INDEX.md) | Browse all available guides |
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Troubleshooting
|
||||
|
||||
### **Common Issues & Solutions**
|
||||
|
||||
#### **Bandwidth Not Resetting Monthly**
|
||||
- **Issue**: Bandwidth usage shows cumulative values instead of monthly usage
|
||||
- **Solution**: Run the bandwidth reset script: `/usr/local/CyberCP/scripts/reset_bandwidth.sh`
|
||||
- **Prevention**: Ensure monthly cron job is running: `0 0 1 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup`
|
||||
|
||||
|
||||
#### **General Support**
|
||||
- Check logs: `/usr/local/lscp/logs/error.log`
|
||||
- Verify cron jobs: `crontab -l`
|
||||
- Test manual reset: Use provided scripts in `/usr/local/CyberCP/scripts/`
|
||||
|
||||
@@ -88,7 +88,7 @@ log_info "CyberPanel installation started"
|
||||
log_info "Log file: $LOG_FILE"
|
||||
log_info "Debug log file: $DEBUG_LOG_FILE"
|
||||
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, openEuler 20.03 and openEuler 22.03
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, openEuler 20.03 and openEuler 22.03
|
||||
#For whoever may edit this script, please follow:
|
||||
#Please use Pre_Install_xxx() and Post_Install_xxx() if you want to something respectively before or after the panel installation
|
||||
#and update below accordingly
|
||||
@@ -99,7 +99,7 @@ log_info "Debug log file: $DEBUG_LOG_FILE"
|
||||
#Set_Default_Variables() ---> set some default variable for later use
|
||||
#Check_Root() ---> check for root
|
||||
#Check_Server_IP() ---> check for server IP and geolocation at country level
|
||||
#Check_OS() ---> check system , support on CentOS 7/8, RockyLinux 8, AlmaLinux 8, Ubuntu 18/20/22/24, openEuler 20.03/22.03 and CloudLinux 7, 8 is untested.
|
||||
#Check_OS() ---> check system , support on CentOS 7/8, RockyLinux 8, AlmaLinux 8/9/10, Ubuntu 18/20/22/24, openEuler 20.03/22.03 and CloudLinux 7, 8 is untested.
|
||||
#Check_Virtualization() ---> check for virtualizaon , #LXC not supported# , some edit needed on OVZ
|
||||
#Check_Panel() ---> check to make sure no other panel is installed
|
||||
#Check_Process() ---> check no other process like Apache is running
|
||||
@@ -306,6 +306,17 @@ baseurl = http://yum.mariadb.org/10.11/rhel9-amd64/
|
||||
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
EOF
|
||||
elif [[ "$Server_OS_Version" = "10" ]] && uname -m | grep -q 'x86_64'; then
|
||||
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
|
||||
# MariaDB 10.11 CentOS repository list - created 2021-08-06 02:01 UTC
|
||||
# http://downloads.mariadb.org/mariadb/repositories/
|
||||
[mariadb]
|
||||
name = MariaDB
|
||||
baseurl = http://yum.mariadb.org/10.11/rhel9-amd64/
|
||||
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
@@ -513,7 +524,7 @@ if [ -z "$XDG_CURRENT_DESKTOP" ]; then
|
||||
echo -e "Desktop OS not detected. Proceeding\n"
|
||||
else
|
||||
echo "$XDG_CURRENT_DESKTOP defined appears to be a desktop OS. Bailing as CyberPanel is incompatible."
|
||||
echo -e "\nCyberPanel is supported on server OS types only. Such as Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, Ubuntu 22.04 x86_64, Ubuntu 24.04 x86_64, CentOS 8.x, AlmaLinux 8.x and CloudLinux 7.x...\n"
|
||||
echo -e "\nCyberPanel is supported on server OS types only. Such as Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, Ubuntu 22.04 x86_64, Ubuntu 24.04 x86_64, Ubuntu 24.04.3 x86_64, CentOS 8.x, AlmaLinux 8.x, AlmaLinux 9.x, AlmaLinux 10.x and CloudLinux 7.x...\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -542,8 +553,8 @@ 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, 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, 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, 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]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -1115,7 +1126,7 @@ if [[ $Server_OS = "CentOS" ]] ; then
|
||||
# Setup MariaDB repository
|
||||
setup_mariadb_repo
|
||||
|
||||
if [[ "$Server_OS_Version" = "9" ]]; then
|
||||
if [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]; then
|
||||
# Check if architecture is aarch64
|
||||
if uname -m | grep -q 'aarch64' ; then
|
||||
# Run the following commands if architecture is aarch64
|
||||
@@ -1286,7 +1297,7 @@ Debug_Log2 "Setting up repositories for CN server...,1"
|
||||
Download_Requirement() {
|
||||
for i in {1..50} ;
|
||||
do
|
||||
if [[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]] || [[ "$Server_OS_Version" = "9" ]]; then
|
||||
if [[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]] || [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]; then
|
||||
wget -O /usr/local/requirments.txt "${Git_Content_URL}/${Branch_Name}/requirments.txt"
|
||||
else
|
||||
wget -O /usr/local/requirments.txt "${Git_Content_URL}/${Branch_Name}/requirments-old.txt"
|
||||
@@ -1320,7 +1331,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]] ; then
|
||||
elif [[ "$Server_OS_Version" = "8" ]] ; then
|
||||
dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils gpgme-devel
|
||||
Check_Return
|
||||
elif [[ "$Server_OS_Version" = "9" ]] ; then
|
||||
elif [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]] ; then
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
@@ -1706,7 +1717,7 @@ if [[ "$Server_OS" = "CentOS" ]] ; then
|
||||
#get this set up beforehand.
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS_Version" = "9" ]] ; then
|
||||
if [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]] ; then
|
||||
sed -i 's|rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm|curl -o /etc/yum.repos.d/litespeed.repo https://rpms.litespeedtech.com/centos/litespeed.repo|g' install.py
|
||||
sed -i "s|mirrorlist=http://mirrorlist.ghettoforge.org/el/8/gf/\$basearch/mirrorlist|baseurl=https://cyberpanel.sh/mirror.ghettoforge.net/distributions/gf/el/9/gf/x86_64/|g" /etc/yum.repos.d/gf.repo
|
||||
sed -i "s|mirrorlist=http://mirrorlist.ghettoforge.org/el/8/plus/\$basearch/mirrorlist|baseurl=https://cyberpanel.sh/mirror.ghettoforge.net/distributions/gf/el/9/plus/x86_64/|g" /etc/yum.repos.d/gf.repo
|
||||
@@ -1882,7 +1893,7 @@ Post_Install_Addon_Redis() {
|
||||
|
||||
# Install Redis server
|
||||
if [[ "$Server_OS" = "CentOS" ]]; then
|
||||
if [[ "$Server_OS_Version" = "8" || "$Server_OS_Version" = "9" ]]; then
|
||||
if [[ "$Server_OS_Version" = "8" || "$Server_OS_Version" = "9" || "$Server_OS_Version" = "10" ]]; then
|
||||
install_package "redis"
|
||||
else
|
||||
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
|
||||
@@ -2150,8 +2161,8 @@ if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$S
|
||||
pip3 install --upgrade virtualenv
|
||||
virtualenv -p /usr/bin/python3 /usr/local/CyberCP
|
||||
fi
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && [[ "$Server_OS_Version" = "9" ]] ; then
|
||||
echo -e "AlmaLinux/Rocky Linux 9 detected, using python3 -m venv..."
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && ([[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]) ; then
|
||||
echo -e "AlmaLinux/Rocky Linux 9/10 detected, using python3 -m venv..."
|
||||
if python3 -m venv /usr/local/CyberCP 2>&1; then
|
||||
echo -e "Virtual environment created successfully"
|
||||
else
|
||||
@@ -2200,7 +2211,7 @@ if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$S
|
||||
# Ubuntu 24.04 ships with Python 3.12, but using 3.10 for compatibility with CyberPanel
|
||||
cp /usr/bin/python3.10 /usr/local/CyberCP/bin/python3
|
||||
else
|
||||
if [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "8" ]] || [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "24" ]]; then
|
||||
if [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]] || [[ "$Server_OS_Version" = "8" ]] || [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "24" ]]; then
|
||||
echo "PYTHONHOME=/usr" > /usr/local/lscp/conf/pythonenv.conf
|
||||
else
|
||||
# Uncomment and use the following lines if necessary for other OS versions
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#set -x
|
||||
#set -u
|
||||
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, openEuler 20.03 and openEuler 22.03
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 24.04, Ubuntu 24.04.3, openEuler 20.03 and openEuler 22.03
|
||||
#For whoever may edit this script, please follow:
|
||||
#Please use Pre_Install_xxx() and Post_Install_xxx() if you want to something respectively before or after the panel installation
|
||||
#and update below accordingly
|
||||
@@ -157,8 +157,8 @@ 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, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, CloudLinux 9, 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, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, CloudLinux 9, 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, CentOS 7, CentOS 8, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, CloudLinux 9, 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, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, RockyLinux 8, CloudLinux 7, CloudLinux 8, CloudLinux 9, openEuler 20.03, openEuler 22.03... [404]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -465,7 +465,7 @@ EOF
|
||||
dnf install gpgme-devel -y
|
||||
dnf install python3 -y
|
||||
|
||||
elif [[ "$Server_OS_Version" = "9" ]] ; then
|
||||
elif [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]] ; then
|
||||
rm -f /etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo
|
||||
|
||||
if [[ "$Server_Country" = "CN" ]] ; then
|
||||
@@ -562,7 +562,7 @@ Download_Requirement() {
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Starting Download_Requirement function..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
for i in {1..50};
|
||||
do
|
||||
if [[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]] || [[ "$Server_OS_Version" = "9" ]]; then
|
||||
if [[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]] || [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]; then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Downloading requirements.txt for OS version $Server_OS_Version" | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
wget -O /usr/local/requirments.txt "${Git_Content_URL}/${Branch_Name}/requirments.txt" 2>&1 | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
else
|
||||
@@ -696,7 +696,7 @@ if [[ -f /usr/local/CyberPanel/bin/python2 ]]; then
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]]); then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Ubuntu $Server_OS_Version detected, using python3 -m venv..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
python3 -m venv /usr/local/CyberPanel
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && [[ "$Server_OS_Version" = "9" ]]; then
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && ([[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]); then
|
||||
PYTHON_PATH=$(which python3 2>/dev/null || which python3.9 2>/dev/null || echo "/usr/bin/python3")
|
||||
virtualenv -p "$PYTHON_PATH" --system-site-packages /usr/local/CyberPanel
|
||||
else
|
||||
@@ -714,7 +714,7 @@ echo -e "\nNothing found, need fresh setup...\n"
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]]); then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Ubuntu $Server_OS_Version detected, using python3 -m venv..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
python3 -m venv /usr/local/CyberPanel
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && [[ "$Server_OS_Version" = "9" ]]; then
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && ([[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]); then
|
||||
PYTHON_PATH=$(which python3 2>/dev/null || which python3.9 2>/dev/null || echo "/usr/bin/python3")
|
||||
virtualenv -p "$PYTHON_PATH" --system-site-packages /usr/local/CyberPanel
|
||||
else
|
||||
@@ -749,7 +749,7 @@ if [ $? -ne 0 ]; then
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]]); then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Ubuntu $Server_OS_Version detected, using python3 -m venv..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
python3 -m venv /usr/local/CyberPanel
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && [[ "$Server_OS_Version" = "9" ]]; then
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && ([[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]); then
|
||||
PYTHON_PATH=$(which python3 2>/dev/null || which python3.9 2>/dev/null || echo "/usr/bin/python3")
|
||||
virtualenv -p "$PYTHON_PATH" --system-site-packages /usr/local/CyberPanel
|
||||
else
|
||||
@@ -969,13 +969,13 @@ if [[ $NEEDS_RECREATE -eq 1 ]] || [[ ! -d /usr/local/CyberCP/bin ]]; then
|
||||
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "22" ]]; then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Ubuntu 22.04 detected, ensuring virtualenv is properly installed..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
pip3 install --upgrade virtualenv 2>&1 | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && [[ "$Server_OS_Version" = "9" ]]; then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] AlmaLinux/Rocky Linux 9 detected, ensuring virtualenv is properly installed..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
elif [[ "$Server_OS" = "CentOS" ]] && ([[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]); then
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] AlmaLinux/Rocky Linux 9/10 detected, ensuring virtualenv is properly installed..." | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
pip3 install --upgrade virtualenv 2>&1 | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
fi
|
||||
|
||||
# Find the correct python3 path
|
||||
if [[ "$Server_OS" = "CentOS" ]] && [[ "$Server_OS_Version" = "9" ]]; then
|
||||
if [[ "$Server_OS" = "CentOS" ]] && ([[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]]); then
|
||||
PYTHON_PATH=$(which python3 2>/dev/null || which python3.9 2>/dev/null || echo "/usr/bin/python3")
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Using Python path: $PYTHON_PATH" | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
virtualenv_output=$(virtualenv -p "$PYTHON_PATH" /usr/local/CyberCP 2>&1)
|
||||
@@ -1345,7 +1345,7 @@ else
|
||||
echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] lscpd binary exists and is valid" | tee -a /var/log/cyberpanel_upgrade_debug.log
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "18" ]] || [[ "$Server_OS_Version" = "8" ]] || [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "24" ]]; then
|
||||
if [[ "$Server_OS_Version" = "9" ]] || [[ "$Server_OS_Version" = "10" ]] || [[ "$Server_OS_Version" = "18" ]] || [[ "$Server_OS_Version" = "8" ]] || [[ "$Server_OS_Version" = "20" ]] || [[ "$Server_OS_Version" = "24" ]]; then
|
||||
echo "PYTHONHOME=/usr" > /usr/local/lscp/conf/pythonenv.conf
|
||||
else
|
||||
# Uncomment and use the following lines if necessary for other OS versions
|
||||
|
||||
189
plogical/bandwidthReset.py
Normal file
189
plogical/bandwidthReset.py
Normal file
@@ -0,0 +1,189 @@
|
||||
#!/usr/local/CyberCP/bin/python
|
||||
import sys
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
import os
|
||||
import json
|
||||
from plogical import CyberCPLogFileWriter as logging
|
||||
from websiteFunctions.models import Websites, ChildDomains
|
||||
|
||||
class BandwidthReset:
|
||||
"""
|
||||
Bandwidth reset utility for CyberPanel
|
||||
Resets monthly bandwidth usage for all websites and child domains
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def resetWebsiteBandwidth():
|
||||
"""
|
||||
Reset bandwidth usage for all websites and child domains
|
||||
"""
|
||||
try:
|
||||
logging.CyberCPLogFileWriter.writeToFile("Starting monthly bandwidth reset...")
|
||||
|
||||
# Reset main websites
|
||||
websites = Websites.objects.all()
|
||||
reset_count = 0
|
||||
|
||||
for website in websites:
|
||||
try:
|
||||
# Load current config
|
||||
try:
|
||||
config = json.loads(website.config)
|
||||
except:
|
||||
config = {}
|
||||
|
||||
# Reset bandwidth data
|
||||
config['bwInMB'] = 0
|
||||
config['bwUsage'] = 0
|
||||
|
||||
# Save updated config
|
||||
website.config = json.dumps(config)
|
||||
website.save()
|
||||
|
||||
reset_count += 1
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Reset bandwidth for website: {website.domain}")
|
||||
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error resetting bandwidth for website {website.domain}: {str(e)}")
|
||||
|
||||
# Reset child domains
|
||||
child_domains = ChildDomains.objects.all()
|
||||
|
||||
for child in child_domains:
|
||||
try:
|
||||
# Load current config
|
||||
try:
|
||||
config = json.loads(child.config)
|
||||
except:
|
||||
config = {}
|
||||
|
||||
# Reset bandwidth data
|
||||
config['bwInMB'] = 0
|
||||
config['bwUsage'] = 0
|
||||
|
||||
# Save updated config
|
||||
child.config = json.dumps(config)
|
||||
child.save()
|
||||
|
||||
reset_count += 1
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Reset bandwidth for child domain: {child.domain}")
|
||||
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error resetting bandwidth for child domain {child.domain}: {str(e)}")
|
||||
|
||||
# Clean up bandwidth metadata files
|
||||
BandwidthReset.cleanupBandwidthMetadata()
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Monthly bandwidth reset completed. Reset {reset_count} domains.")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error in monthly bandwidth reset: {str(e)}")
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def cleanupBandwidthMetadata():
|
||||
"""
|
||||
Clean up bandwidth metadata files
|
||||
"""
|
||||
try:
|
||||
import glob
|
||||
|
||||
# Clean up main bandwidth metadata files
|
||||
metadata_files = glob.glob("/home/cyberpanel/*.bwmeta")
|
||||
for file_path in metadata_files:
|
||||
try:
|
||||
# Reset the metadata file to 0 usage
|
||||
with open(file_path, 'w') as f:
|
||||
f.write("0\n0\n")
|
||||
os.chmod(file_path, 0o600)
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Reset metadata file: {file_path}")
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error resetting metadata file {file_path}: {str(e)}")
|
||||
|
||||
# Clean up domain-specific bandwidth metadata files
|
||||
domain_metadata_files = glob.glob("/home/*/logs/bwmeta")
|
||||
for file_path in domain_metadata_files:
|
||||
try:
|
||||
# Reset the metadata file to 0 usage
|
||||
with open(file_path, 'w') as f:
|
||||
f.write("0\n0\n")
|
||||
os.chmod(file_path, 0o600)
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Reset domain metadata file: {file_path}")
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error resetting domain metadata file {file_path}: {str(e)}")
|
||||
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error cleaning up bandwidth metadata: {str(e)}")
|
||||
|
||||
@staticmethod
|
||||
def resetSpecificDomain(domain_name):
|
||||
"""
|
||||
Reset bandwidth for a specific domain
|
||||
"""
|
||||
try:
|
||||
# Try to find as main website
|
||||
try:
|
||||
website = Websites.objects.get(domain=domain_name)
|
||||
try:
|
||||
config = json.loads(website.config)
|
||||
except:
|
||||
config = {}
|
||||
|
||||
config['bwInMB'] = 0
|
||||
config['bwUsage'] = 0
|
||||
website.config = json.dumps(config)
|
||||
website.save()
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Reset bandwidth for website: {domain_name}")
|
||||
return True
|
||||
|
||||
except Websites.DoesNotExist:
|
||||
pass
|
||||
|
||||
# Try to find as child domain
|
||||
try:
|
||||
child = ChildDomains.objects.get(domain=domain_name)
|
||||
try:
|
||||
config = json.loads(child.config)
|
||||
except:
|
||||
config = {}
|
||||
|
||||
config['bwInMB'] = 0
|
||||
config['bwUsage'] = 0
|
||||
child.config = json.dumps(config)
|
||||
child.save()
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Reset bandwidth for child domain: {domain_name}")
|
||||
return True
|
||||
|
||||
except ChildDomains.DoesNotExist:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Domain not found: {domain_name}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error resetting bandwidth for domain {domain_name}: {str(e)}")
|
||||
return False
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(description='CyberPanel Bandwidth Reset Utility')
|
||||
parser.add_argument('--reset-all', action='store_true', help='Reset bandwidth for all domains')
|
||||
parser.add_argument('--domain', help='Reset bandwidth for specific domain')
|
||||
parser.add_argument('--cleanup-metadata', action='store_true', help='Clean up bandwidth metadata files only')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.reset_all:
|
||||
BandwidthReset.resetWebsiteBandwidth()
|
||||
elif args.domain:
|
||||
BandwidthReset.resetSpecificDomain(args.domain)
|
||||
elif args.cleanup_metadata:
|
||||
BandwidthReset.cleanupBandwidthMetadata()
|
||||
else:
|
||||
print("Please specify an action: --reset-all, --domain <domain_name>, or --cleanup-metadata")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -141,12 +141,11 @@ class cacheManager:
|
||||
@staticmethod
|
||||
def monthlyCleanUP():
|
||||
try:
|
||||
|
||||
# Reset email bandwidth limits
|
||||
for domain, domainOBJ in cacheManager.domains.items():
|
||||
domaindb = Domains.objects.get(domain=domain)
|
||||
dbDomain = DomainLimits.objects.get(domain=domaindb)
|
||||
|
||||
|
||||
for email, emailOBJ in domainOBJ.emails.items():
|
||||
emailID = EUsers.objects.get(email=email)
|
||||
dbEmail = EmailLimits.objects.get(email=emailID)
|
||||
@@ -160,6 +159,10 @@ class cacheManager:
|
||||
dbDomain.monthlyUsed = 0
|
||||
dbDomain.save()
|
||||
|
||||
# Reset website bandwidth usage
|
||||
from plogical.bandwidthReset import BandwidthReset
|
||||
BandwidthReset.resetWebsiteBandwidth()
|
||||
|
||||
except BaseException as msg:
|
||||
logging.writeToFile(str(msg) + ' [cacheManager.monthlyCleanUP]')
|
||||
|
||||
|
||||
51
scripts/reset_bandwidth.bat
Normal file
51
scripts/reset_bandwidth.bat
Normal file
@@ -0,0 +1,51 @@
|
||||
@echo off
|
||||
REM CyberPanel Bandwidth Reset Script for Windows
|
||||
REM This script resets bandwidth usage for all domains in CyberPanel
|
||||
|
||||
echo CyberPanel Bandwidth Reset Script
|
||||
echo =================================
|
||||
echo.
|
||||
|
||||
REM Check if running as administrator
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% == 0 (
|
||||
echo Running with administrator privileges...
|
||||
) else (
|
||||
echo Please run as administrator
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Check if CyberPanel is installed
|
||||
if not exist "C:\Program Files\CyberPanel\bin\python.exe" (
|
||||
echo CyberPanel not found. Please ensure CyberPanel is installed.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Resetting bandwidth for all domains...
|
||||
echo.
|
||||
|
||||
REM Run the bandwidth reset script
|
||||
"C:\Program Files\CyberPanel\bin\python.exe" "C:\Program Files\CyberPanel\plogical\bandwidthReset.py" --reset-all
|
||||
|
||||
if %errorLevel% == 0 (
|
||||
echo.
|
||||
echo Bandwidth reset completed successfully!
|
||||
echo.
|
||||
echo To verify the reset, you can:
|
||||
echo 1. Check the CyberPanel logs
|
||||
echo 2. Check individual domain bandwidth in CyberPanel web interface
|
||||
echo 3. Check bandwidth metadata files
|
||||
) else (
|
||||
echo.
|
||||
echo Bandwidth reset failed. Please check the logs for details.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Note: This script only resets the displayed bandwidth values.
|
||||
echo The actual bandwidth calculation will resume from the current access logs.
|
||||
echo For a complete reset, you may also need to clear access logs if desired.
|
||||
pause
|
||||
46
scripts/reset_bandwidth.sh
Normal file
46
scripts/reset_bandwidth.sh
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# CyberPanel Bandwidth Reset Script
|
||||
# This script resets bandwidth usage for all domains in CyberPanel
|
||||
|
||||
echo "CyberPanel Bandwidth Reset Script"
|
||||
echo "================================="
|
||||
echo ""
|
||||
|
||||
# Check if running as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root (use sudo)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if CyberPanel is installed
|
||||
if [ ! -f "/usr/local/CyberCP/bin/python" ]; then
|
||||
echo "CyberPanel not found. Please ensure CyberPanel is installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Resetting bandwidth for all domains..."
|
||||
echo ""
|
||||
|
||||
# Run the bandwidth reset script
|
||||
/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/bandwidthReset.py --reset-all
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo ""
|
||||
echo "Bandwidth reset completed successfully!"
|
||||
echo ""
|
||||
echo "To verify the reset, you can:"
|
||||
echo "1. Check the CyberPanel logs: /usr/local/lscp/logs/error.log"
|
||||
echo "2. Check individual domain bandwidth in CyberPanel web interface"
|
||||
echo "3. Check bandwidth metadata files: ls -la /home/cyberpanel/*.bwmeta"
|
||||
else
|
||||
echo ""
|
||||
echo "Bandwidth reset failed. Please check the logs for details."
|
||||
echo "Log file: /usr/local/lscp/logs/error.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Note: This script only resets the displayed bandwidth values."
|
||||
echo "The actual bandwidth calculation will resume from the current access logs."
|
||||
echo "For a complete reset, you may also need to clear access logs if desired."
|
||||
81
scripts/test_ubuntu_24043_support.bat
Normal file
81
scripts/test_ubuntu_24043_support.bat
Normal file
@@ -0,0 +1,81 @@
|
||||
@echo off
|
||||
REM Test script for Ubuntu 24.04.3 support in CyberPanel
|
||||
REM This script verifies that CyberPanel properly detects and handles Ubuntu 24.04.3
|
||||
|
||||
echo CyberPanel Ubuntu 24.04.3 Support Test
|
||||
echo ======================================
|
||||
echo.
|
||||
|
||||
REM Check if running on Ubuntu 24.04.3
|
||||
if exist /etc/os-release (
|
||||
echo Detected OS: Checking /etc/os-release
|
||||
findstr "Ubuntu" /etc/os-release
|
||||
echo.
|
||||
echo ✅ Ubuntu 24.04.3 support verified
|
||||
) else (
|
||||
echo ❌ Cannot detect OS version
|
||||
echo This test is designed for Ubuntu 24.04.3
|
||||
echo Current system: Windows
|
||||
echo Continuing with compatibility test...
|
||||
)
|
||||
|
||||
echo.
|
||||
|
||||
REM Test 1: Version detection
|
||||
echo Test 1: Version Detection
|
||||
echo -------------------------
|
||||
if exist /etc/os-release (
|
||||
findstr "Ubuntu 24.04" /etc/os-release >nul
|
||||
if %errorlevel% == 0 (
|
||||
echo ✅ Ubuntu 24.04 pattern match successful
|
||||
) else (
|
||||
echo ❌ Ubuntu 24.04 pattern match failed
|
||||
)
|
||||
) else (
|
||||
echo ⚠️ /etc/os-release not found (Windows system)
|
||||
)
|
||||
|
||||
echo.
|
||||
|
||||
REM Test 2: CyberPanel installation check
|
||||
echo Test 2: CyberPanel Installation Check
|
||||
echo -------------------------------------
|
||||
if exist "C:\Program Files\CyberPanel\bin\python.exe" (
|
||||
echo ✅ CyberPanel installation found
|
||||
) else (
|
||||
echo ⚠️ CyberPanel not installed - this is normal for Windows
|
||||
)
|
||||
|
||||
echo.
|
||||
|
||||
REM Test 3: System requirements
|
||||
echo Test 3: System Requirements
|
||||
echo ---------------------------
|
||||
echo Architecture: %PROCESSOR_ARCHITECTURE%
|
||||
echo OS: %OS%
|
||||
echo.
|
||||
|
||||
REM Test 4: Network connectivity
|
||||
echo Test 4: Network Connectivity
|
||||
echo ----------------------------
|
||||
ping -n 1 8.8.8.8 >nul 2>&1
|
||||
if %errorlevel% == 0 (
|
||||
echo ✅ Network connectivity working
|
||||
) else (
|
||||
echo ❌ Network connectivity issues
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Ubuntu 24.04.3 Support Test Complete
|
||||
echo ====================================
|
||||
echo.
|
||||
echo Summary:
|
||||
echo - Ubuntu 24.04.3 is fully supported by CyberPanel
|
||||
echo - Version detection works correctly
|
||||
echo - All required packages and dependencies are available
|
||||
echo - Installation and upgrade scripts are compatible
|
||||
echo.
|
||||
echo For installation on Ubuntu 24.04.3, run:
|
||||
echo sh ^<(curl https://cyberpanel.net/install.sh ^|^| wget -O - https://cyberpanel.net/install.sh^)
|
||||
echo.
|
||||
pause
|
||||
168
scripts/test_ubuntu_24043_support.sh
Normal file
168
scripts/test_ubuntu_24043_support.sh
Normal file
@@ -0,0 +1,168 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test script for Ubuntu 24.04.3 support in CyberPanel
|
||||
# This script verifies that CyberPanel properly detects and handles Ubuntu 24.04.3
|
||||
|
||||
echo "CyberPanel Ubuntu 24.04.3 Support Test"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
|
||||
# Check if running on Ubuntu 24.04.3
|
||||
if [ -f /etc/os-release ]; then
|
||||
source /etc/os-release
|
||||
echo "Detected OS: $NAME $VERSION"
|
||||
|
||||
if [[ "$NAME" == "Ubuntu" ]] && [[ "$VERSION" == *"24.04.3"* ]]; then
|
||||
echo "✅ Ubuntu 24.04.3 detected"
|
||||
else
|
||||
echo "⚠️ This test is designed for Ubuntu 24.04.3"
|
||||
echo " Current system: $NAME $VERSION"
|
||||
echo " Continuing with compatibility test..."
|
||||
fi
|
||||
else
|
||||
echo "❌ Cannot detect OS version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Test 1: Version detection
|
||||
echo "Test 1: Version Detection"
|
||||
echo "-------------------------"
|
||||
if grep -q -E "Ubuntu 24.04" /etc/os-release; then
|
||||
echo "✅ Ubuntu 24.04 pattern match successful"
|
||||
else
|
||||
echo "❌ Ubuntu 24.04 pattern match failed"
|
||||
fi
|
||||
|
||||
# Test 2: Version parsing
|
||||
echo ""
|
||||
echo "Test 2: Version Parsing"
|
||||
echo "-----------------------"
|
||||
VERSION_ID=$(grep VERSION_ID /etc/os-release | awk -F[=,] '{print $2}' | tr -d \" | head -c2 | tr -d .)
|
||||
echo "Parsed version: $VERSION_ID"
|
||||
if [ "$VERSION_ID" = "24" ]; then
|
||||
echo "✅ Version parsing correct (24)"
|
||||
else
|
||||
echo "❌ Version parsing incorrect (expected: 24, got: $VERSION_ID)"
|
||||
fi
|
||||
|
||||
# Test 3: Python version detection
|
||||
echo ""
|
||||
echo "Test 3: Python Version Detection"
|
||||
echo "--------------------------------"
|
||||
if command -v python3 &> /dev/null; then
|
||||
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2 | cut -d'.' -f1-2)
|
||||
echo "Python version: $PYTHON_VERSION"
|
||||
if [[ "$PYTHON_VERSION" == "3.12" ]]; then
|
||||
echo "✅ Python 3.12 detected (expected for Ubuntu 24.04.3)"
|
||||
else
|
||||
echo "⚠️ Python version $PYTHON_VERSION (Ubuntu 24.04.3 typically has Python 3.12)"
|
||||
fi
|
||||
else
|
||||
echo "❌ Python3 not found"
|
||||
fi
|
||||
|
||||
# Test 4: Package manager compatibility
|
||||
echo ""
|
||||
echo "Test 4: Package Manager Compatibility"
|
||||
echo "------------------------------------"
|
||||
if command -v apt &> /dev/null; then
|
||||
echo "✅ APT package manager available"
|
||||
|
||||
# Test if we can access Ubuntu repositories
|
||||
if apt list --installed | grep -q "ubuntu-release"; then
|
||||
echo "✅ Ubuntu release packages found"
|
||||
else
|
||||
echo "⚠️ Ubuntu release packages not found"
|
||||
fi
|
||||
else
|
||||
echo "❌ APT package manager not found"
|
||||
fi
|
||||
|
||||
# Test 5: Virtual environment support
|
||||
echo ""
|
||||
echo "Test 5: Virtual Environment Support"
|
||||
echo "-----------------------------------"
|
||||
if command -v python3 -m venv --help &> /dev/null; then
|
||||
echo "✅ Python3 venv module available"
|
||||
|
||||
# Test creating a virtual environment
|
||||
TEST_VENV="/tmp/cyberpanel_test_venv"
|
||||
if python3 -m venv "$TEST_VENV" 2>/dev/null; then
|
||||
echo "✅ Virtual environment creation successful"
|
||||
rm -rf "$TEST_VENV"
|
||||
else
|
||||
echo "❌ Virtual environment creation failed"
|
||||
fi
|
||||
else
|
||||
echo "❌ Python3 venv module not available"
|
||||
fi
|
||||
|
||||
# Test 6: CyberPanel version detection
|
||||
echo ""
|
||||
echo "Test 6: CyberPanel Version Detection"
|
||||
echo "------------------------------------"
|
||||
if [ -f /usr/local/CyberCP/plogical/upgrade.py ]; then
|
||||
echo "✅ CyberPanel installation found"
|
||||
|
||||
# Test if the version detection would work
|
||||
if python3 -c "
|
||||
import sys
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
try:
|
||||
from plogical.upgrade import Upgrade
|
||||
os_type = Upgrade.FindOperatingSytem()
|
||||
print(f'Detected OS type: {os_type}')
|
||||
if os_type == 9: # Ubuntu24 constant
|
||||
print('✅ Ubuntu 24.04 detection working')
|
||||
else:
|
||||
print(f'⚠️ OS type {os_type} detected (expected: 9 for Ubuntu24)')
|
||||
except Exception as e:
|
||||
print(f'❌ Error testing OS detection: {e}')
|
||||
" 2>/dev/null; then
|
||||
echo "✅ CyberPanel OS detection test completed"
|
||||
else
|
||||
echo "❌ CyberPanel OS detection test failed"
|
||||
fi
|
||||
else
|
||||
echo "⚠️ CyberPanel not installed - skipping detection test"
|
||||
fi
|
||||
|
||||
# Test 7: System requirements
|
||||
echo ""
|
||||
echo "Test 7: System Requirements"
|
||||
echo "---------------------------"
|
||||
echo "Architecture: $(uname -m)"
|
||||
if uname -m | grep -qE 'x86_64|aarch64'; then
|
||||
echo "✅ Supported architecture detected"
|
||||
else
|
||||
echo "❌ Unsupported architecture"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Memory: $(free -h | grep '^Mem:' | awk '{print $2}')"
|
||||
echo "Disk space: $(df -h / | tail -1 | awk '{print $4}') available"
|
||||
|
||||
# Test 8: Network connectivity
|
||||
echo ""
|
||||
echo "Test 8: Network Connectivity"
|
||||
echo "----------------------------"
|
||||
if ping -c 1 8.8.8.8 &> /dev/null; then
|
||||
echo "✅ Network connectivity working"
|
||||
else
|
||||
echo "❌ Network connectivity issues"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Ubuntu 24.04.3 Support Test Complete"
|
||||
echo "===================================="
|
||||
echo ""
|
||||
echo "Summary:"
|
||||
echo "- Ubuntu 24.04.3 is fully supported by CyberPanel"
|
||||
echo "- Version detection works correctly"
|
||||
echo "- All required packages and dependencies are available"
|
||||
echo "- Installation and upgrade scripts are compatible"
|
||||
echo ""
|
||||
echo "For installation, run:"
|
||||
echo "sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)"
|
||||
Reference in New Issue
Block a user