From 4bdcc1d09fdbae9d4da29faaf8df9a933548999f Mon Sep 17 00:00:00 2001 From: usmannasir Date: Mon, 14 Jul 2025 17:52:52 +0500 Subject: [PATCH] bug fix: https://www.facebook.com/groups/cyberpanel/posts/3921376734840612/ --- cyberpanel.sh | 11 +++++++++++ install/installCyberPanel.py | 20 ++++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 958dbd880..5cda7f943 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -194,6 +194,17 @@ name = MariaDB baseurl = http://yum.mariadb.org/10.4/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 +EOF + elif [[ "$Server_OS_Version" = "8" ]]; then + cat </etc/yum.repos.d/MariaDB.repo +# MariaDB 10.11 RHEL8 repository list +# http://downloads.mariadb.org/mariadb/repositories/ +[mariadb] +name = MariaDB +baseurl = http://yum.mariadb.org/10.11/rhel8-amd64 +module_hotfixes=1 +gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB +gpgcheck=1 EOF elif [[ "$Server_OS_Version" = "9" ]] && uname -m | grep -q 'x86_64'; then cat </etc/yum.repos.d/MariaDB.repo diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index dc68b8d12..dfb3a1a2d 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -348,10 +348,22 @@ Signed-By: /etc/apt/keyrings/mariadb-keyring.pgp if get_Ubuntu_release() > 21.00: command = 'curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.11' - install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) - # WriteToFile = open(RepoPath, 'w') - # WriteToFile.write(RepoContent) - # WriteToFile.close() + result = install_utils.call(command, self.distro, command, command, 1, 0, os.EX_OSERR, True) + + # If the download fails, use manual repo configuration as fallback + if result != 1: + install_utils.writeToFile("MariaDB repo setup script failed, using manual configuration...") + RepoPath = '/etc/apt/sources.list.d/mariadb.list' + RepoContent = f"""# MariaDB 10.11 repository list - manual fallback +deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/10.11/ubuntu {get_Ubuntu_code_name()} main +""" + # Download and add MariaDB signing key + command = 'mkdir -p /usr/share/keyrings && curl -fsSL https://mariadb.org/mariadb_release_signing_key.pgp | gpg --dearmor -o /usr/share/keyrings/mariadb-keyring.pgp' + install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + + WriteToFile = open(RepoPath, 'w') + WriteToFile.write(RepoContent) + WriteToFile.close()