From c1bbdbe0f2326a649f069a3075cf6f51dc758a5a Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sat, 20 Sep 2025 12:10:44 +0500 Subject: [PATCH 1/3] debian 12: add missing views to views.py in websitefunctions --- cyberpanel.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 20c465a87..90b3ca027 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1477,7 +1477,6 @@ cd cyberpanel || exit git checkout "$Branch_Name" Check_Return "git checkout" cd - || exit -cp -r cyberpanel /usr/local/cyberpanel cd cyberpanel/install || exit Debug_Log2 "Necessary components installed..,5" From 83cf33711ece6b9a9284290fdb2b67193e21b411 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sat, 20 Sep 2025 12:29:17 +0500 Subject: [PATCH 2/3] debian 12: add missing views to views.py in websitefunctions --- cyberpanel.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 90b3ca027..333720642 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1463,6 +1463,8 @@ Debug_Log2 "Installing requirments..,3" Retry_Command "pip install --default-timeout=3600 -r /usr/local/requirments.txt" Check_Return "requirments" "no_exit" +# Change to /usr/local directory to clone CyberPanel +cd /usr/local || exit rm -rf cyberpanel echo -e "\nFetching files from ${Git_Clone_URL}...\n" @@ -1476,8 +1478,7 @@ echo -e "\nCyberPanel source code downloaded...\n" cd cyberpanel || exit git checkout "$Branch_Name" Check_Return "git checkout" -cd - || exit -cd cyberpanel/install || exit +cd install || exit Debug_Log2 "Necessary components installed..,5" } @@ -1802,7 +1803,8 @@ if [[ $Server_Edition = "Enterprise" ]] ; then Enterprise_Flag="--ent ent --serial " fi -sed -i 's|git clone https://github.com/usmannasir/cyberpanel|echo downloaded|g' install.py +# Remove the git clone replacement - let install.py handle the move operation +# sed -i 's|git clone https://github.com/usmannasir/cyberpanel|echo downloaded|g' install.py sed -i 's|mirror.cyberpanel.net|cyberpanel.sh|g' install.py From 94c56c0015574a30fe7a9ca0602105553dc498fa Mon Sep 17 00:00:00 2001 From: usmannasir Date: Sat, 20 Sep 2025 20:21:18 +0500 Subject: [PATCH 3/3] bug fix: of evn creation --- cyberpanel.sh | 18 +++++++++--------- install/install.py | 9 +++++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 333720642..648ce5238 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1427,7 +1427,7 @@ mkdir -p /usr/local/CyberPanel if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$Server_OS_Version" = "24" ]]) ; then echo -e "Ubuntu 22.04/24.04 detected, using python3 -m venv..." - if python3 -m venv /usr/local/CyberPanel 2>&1; then + if python3 -m venv /usr/local/CyberPanel-venv 2>&1; then echo -e "Virtual environment created successfully" else echo -e "python3 -m venv failed, trying virtualenv..." @@ -1438,24 +1438,24 @@ if [[ "$Server_OS" = "Ubuntu" ]] && ([[ "$Server_OS_Version" = "22" ]] || [[ "$S # For Ubuntu 22.04, install virtualenv via apt Retry_Command "DEBIAN_FRONTEND=noninteractive apt-get install -y python3-virtualenv" fi - virtualenv -p /usr/bin/python3 /usr/local/CyberPanel + virtualenv -p /usr/bin/python3 /usr/local/CyberPanel-venv fi else - virtualenv -p /usr/bin/python3 /usr/local/CyberPanel + virtualenv -p /usr/bin/python3 /usr/local/CyberPanel-venv fi # Verify virtual environment was created -if [[ ! -f /usr/local/CyberPanel/bin/activate ]]; then +if [[ ! -f /usr/local/CyberPanel-venv/bin/activate ]]; then echo -e "ERROR: Virtual environment creation failed!" exit 1 fi if [ "$Server_OS" = "Ubuntu" ]; then # shellcheck disable=SC1091 - . /usr/local/CyberPanel/bin/activate + . /usr/local/CyberPanel-venv/bin/activate else # shellcheck disable=SC1091 - source /usr/local/CyberPanel/bin/activate + source /usr/local/CyberPanel-venv/bin/activate fi Debug_Log2 "Installing requirments..,3" @@ -1855,7 +1855,7 @@ if [[ "$Debug" = "On" ]] ; then Debug_Log "Final_Flags" "${Final_Flags[@]}" fi -/usr/local/CyberPanel/bin/python install.py "${Final_Flags[@]}" +/usr/local/CyberPanel-venv/bin/python install.py "${Final_Flags[@]}" if grep "CyberPanel installation successfully completed" /var/log/installLogs.txt >/dev/null; then @@ -2294,10 +2294,10 @@ curl --silent -o /etc/profile.d/cyberpanel.sh https://cyberpanel.sh/?banner 2>/d chmod 700 /etc/profile.d/cyberpanel.sh echo "$Admin_Pass" > /etc/cyberpanel/adminPass chmod 600 /etc/cyberpanel/adminPass -/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/adminPass.py --password "$Admin_Pass" +/usr/local/CyberPanel-venv/bin/python /usr/local/CyberCP/plogical/adminPass.py --password "$Admin_Pass" mkdir -p /etc/opendkim -echo '/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/adminPass.py --password "$@"' > /usr/bin/adminPass +echo '/usr/local/CyberPanel-venv/bin/python /usr/local/CyberCP/plogical/adminPass.py --password "$@"' > /usr/bin/adminPass echo "systemctl restart lscpd" >> /usr/bin/adminPass echo "echo \$@ > /etc/cyberpanel/adminPass" >> /usr/bin/adminPass chmod 700 /usr/bin/adminPass diff --git a/install/install.py b/install/install.py index b16c9504a..8e8b2ee0b 100644 --- a/install/install.py +++ b/install/install.py @@ -598,6 +598,10 @@ class preFlightsChecks: command = "git clone https://github.com/usmannasir/cyberpanel" preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + # Remove existing CyberCP directory if it exists (could be remnant from failed install) + if os.path.exists('CyberCP'): + shutil.rmtree('CyberCP') + shutil.move('cyberpanel', 'CyberCP') ## @@ -641,6 +645,7 @@ password="%s" logging.InstallLog.writeToFile("Environment configuration generated successfully!") if self.remotemysql == 'ON': + path = self.cyberPanelPath + "/CyberCP/settings.py" command = "sed -i 's|localhost|%s|g' %s" % (self.mysqlhost, path) preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) @@ -2896,11 +2901,11 @@ def main(): sys.exit(1) # Create fresh migrations for all apps - command = "/usr/local/CyberPanel/bin/python manage.py makemigrations" + command = "/usr/local/CyberPanel-venv/bin/python manage.py makemigrations" preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR) # Apply all migrations - command = "/usr/local/CyberPanel/bin/python manage.py migrate" + command = "/usr/local/CyberPanel-venv/bin/python manage.py migrate" preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR) checks.setupPHPAndComposer()