From 9d4ef84b0d058ae4535f69ad2a0526cf70be5d44 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Thu, 18 Sep 2025 02:17:29 +0500 Subject: [PATCH] debian 12 --- install/installCyberPanel.py | 45 ++++++++++++++++++++++++++++++++++++ install/install_utils.py | 6 +++-- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index bd153751d..685a1baef 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -528,6 +528,51 @@ deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb-keyrin install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + command = "DEBIAN_FRONTEND=noninteractive apt-get install mariadb-server -y" + elif self.distro == debian12: + # Debian 12 uses similar setup to Ubuntu but with native packages + command = 'DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common apt-transport-https curl -y' + install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + + command = "mkdir -p /etc/apt/keyrings" + install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + + # Use MariaDB official repository for Debian 12 + command = 'curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=10.11' + 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...") + + # First, ensure directories exist + command = 'mkdir -p /usr/share/keyrings /etc/apt/sources.list.d' + install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + + # Download and add MariaDB signing key + command = '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) + + # Use Debian 12 bookworm codename + RepoPath = '/etc/apt/sources.list.d/mariadb.list' + RepoContent = """# MariaDB 10.11 repository list for Debian 12 +# Primary mirror +deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/10.11/debian bookworm main + +# Alternative mirrors (uncomment if primary fails) +# deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb-keyring.pgp] https://mirrors.gigenet.com/mariadb/repo/10.11/debian bookworm main +# deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb-keyring.pgp] https://ftp.osuosl.org/pub/mariadb/repo/10.11/debian bookworm main +""" + + WriteToFile = open(RepoPath, 'w') + WriteToFile.write(RepoContent) + WriteToFile.close() + + install_utils.writeToFile("Manual MariaDB repository configuration completed.") + + command = 'DEBIAN_FRONTEND=noninteractive apt-get update -y' + install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) + command = "DEBIAN_FRONTEND=noninteractive apt-get install mariadb-server -y" elif self.distro == centos: diff --git a/install/install_utils.py b/install/install_utils.py index 35a77b6fc..05e5989fc 100644 --- a/install/install_utils.py +++ b/install/install_utils.py @@ -138,7 +138,8 @@ def get_debian_mariadb_packages(): 'python-setuptools': 'python3-setuptools', 'python-minimal': '', # Not needed in newer versions 'python-gpg': 'python3-gpg', - 'python': 'python3' + 'python': 'python3', + 'dovecot-pigeonhole': 'dovecot-sieve' } elif debian_version >= 12.0: # Debian 12 (Bookworm) @@ -150,7 +151,8 @@ def get_debian_mariadb_packages(): 'python-setuptools': 'python3-setuptools', 'python-minimal': '', 'python-gpg': 'python3-gpg', - 'python': 'python3' + 'python': 'python3', + 'dovecot-pigeonhole': 'dovecot-sieve' } else: # Older Debian versions (11 and below)