Merge pull request #1523 from master3395/v2.5.5-dev

Update MariaDB repository URLs to use HTTPS and enhance setup logic f…
This commit is contained in:
Master3395 2025-09-24 00:37:03 +02:00 committed by GitHub
commit 77a3dc8368
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 52 additions and 33 deletions

View File

@ -451,7 +451,7 @@ setup_mariadb_repo() {
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
baseurl = https://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
@ -461,34 +461,45 @@ EOF
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11/rhel8-amd64
baseurl = https://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 <<EOF >/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.11 CentOS repository list - created 2021-08-06 02:01 UTC
# Use official MariaDB repository setup script for RHEL 9+ systems
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version='10.11' --skip-maxscale --skip-tools
if [ $? -ne 0 ]; then
# Fallback to manual setup
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.11 RHEL9+ repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11/rhel9-amd64/
baseurl = https://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 RHEL10 repository list - AlmaLinux 10 compatible
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11/rhel10-amd64/
module_hotfixes=1
EOF
fi
elif [[ "$Server_OS_Version" = "10" ]] && uname -m | grep -q 'x86_64'; then
# Use official MariaDB repository setup script for RHEL 10+ systems
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version='10.11' --skip-maxscale --skip-tools
if [ $? -ne 0 ]; then
# Fallback to manual setup
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.11 RHEL10+ repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = https://yum.mariadb.org/10.11/rhel9-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
enabled=1
gpgcheck=1
module_hotfixes=1
EOF
fi
fi
}
@ -1567,19 +1578,27 @@ if [[ "$Server_OS" =~ ^(CentOS|RHEL|AlmaLinux|RockyLinux|CloudLinux|openEuler) ]
dnf install -y epel-release
Check_Return "EPEL repository" "no_exit"
# Setup MariaDB repository for AlmaLinux 9/10 - using the working method from 2.4.3
if [[ "$Server_OS" =~ ^(AlmaLinux9|AlmaLinux10) ]] ; then
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.11 CentOS repository list - created 2021-08-06 02:01 UTC
# Setup MariaDB repository for RHEL 9+ based systems (AlmaLinux 9/10, RockyLinux 9, RHEL 9)
if [[ "$Server_OS" =~ ^(AlmaLinux9|AlmaLinux10|RockyLinux9|RHEL9) ]] ; then
# Use the official MariaDB repository setup script for better compatibility
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version='10.11' --skip-maxscale --skip-tools
Check_Return "MariaDB repository setup" "no_exit"
# Fallback manual repository setup if the script fails
if [ ! -f /etc/yum.repos.d/mariadb.repo ]; then
cat <<EOF >/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.11 RHEL9+ repository list
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.11/rhel9-amd64/
baseurl = https://yum.mariadb.org/10.11/rhel9-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
enabled=1
gpgcheck=1
module_hotfixes=1
EOF
Check_Return "MariaDB repository setup" "no_exit"
Check_Return "MariaDB repository fallback setup" "no_exit"
fi
fi
dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel MariaDB-server MariaDB-client MariaDB-devel curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils openssl-devel boost-devel boost-program-options

View File

@ -889,10 +889,10 @@ class Migration(migrations.Migration):
command = "usermod -G lscpd,lsadm,nogroup lscpd"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = "find /usr/local/CyberCP -type d -exec chmod 0755 {} \;"
command = r"find /usr/local/CyberCP -type d -exec chmod 0755 {} \;"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = "find /usr/local/CyberCP -type f -exec chmod 0644 {} \;"
command = r"find /usr/local/CyberCP -type f -exec chmod 0644 {} \;"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = "chmod -R 755 /usr/local/CyberCP/bin"
@ -905,10 +905,10 @@ class Migration(migrations.Migration):
########### Fix LSCPD
command = "find /usr/local/lscp -type d -exec chmod 0755 {} \;"
command = r"find /usr/local/lscp -type d -exec chmod 0755 {} \;"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = "find /usr/local/lscp -type f -exec chmod 0644 {} \;"
command = r"find /usr/local/lscp -type f -exec chmod 0644 {} \;"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = "chmod -R 755 /usr/local/lscp/bin"
@ -1663,12 +1663,12 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
os.chdir("/usr/local/CyberCP/public/snappymail")
command = 'find . -type d -exec chmod 755 {} \;'
command = r'find . -type d -exec chmod 755 {} \;'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
#############
command = 'find . -type f -exec chmod 644 {} \;'
command = r'find . -type f -exec chmod 644 {} \;'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
######
@ -3234,11 +3234,11 @@ vmail
time.sleep(3)
# Check if service is actually running
command = f'systemctl is-active {pdns_service}'
try:
command = f'systemctl is-active {pdns_service}'
try:
result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=10)
output = result.stdout.strip()
if output == 'active':
if output == 'active':
preFlightsChecks.stdOut("PowerDNS service started successfully!", 1)
# Double-check with systemctl status for more details
status_command = f'systemctl status {pdns_service} --no-pager -l'
@ -3246,9 +3246,9 @@ vmail
status_result = subprocess.run(status_command, shell=True, capture_output=True, text=True, timeout=10)
if status_result.returncode == 0:
preFlightsChecks.stdOut("PowerDNS service status verified", 1)
else:
else:
preFlightsChecks.stdOut("PowerDNS service running but status check failed", 0)
except:
except:
preFlightsChecks.stdOut("PowerDNS service running but status verification failed", 0)
break
else:
@ -3308,10 +3308,10 @@ vmail
release = install_utils.get_Ubuntu_release(use_print=False, exit_on_error=False)
if release and release >= 24.04:
preFlightsChecks.stdOut("Configuring Pure-FTPd for Ubuntu 24.04...")
command = f"sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' {config_file}"
command = f"sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' {config_file}"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
except:
pass
pass
# Start Pure-FTPd service with retry mechanism
max_retries = 3
@ -3651,7 +3651,7 @@ admin_password = "12345"
""")
writeToFile.close()
content = """<?php
content = r"""<?php
$_ENV['snappymail_INCLUDE_AS_API'] = true;
include '/usr/local/CyberCP/public/snappymail/index.php';