From 3edfb289777caa6e5633cc18a07b80d19fdece6d Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 03:42:31 +0100 Subject: [PATCH 01/10] CI: validate on all supported OSes (Alma, CentOS, CloudLinux, Debian, RHEL, Rocky, Ubuntu) - Add .github/workflows/ci.yml: shell syntax, Python version fetcher, key files - Matrix job runs in Docker per OS (16 images); CloudLinux/RHEL use Rocky/Alma proxies - CentOS 7: EPEL + pip fallbacks --- .github/workflows/ci.yml | 142 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b2e5cbb04 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,142 @@ +# Lightweight CI for v2.5.5-dev (free for public repos). +# Validates shell syntax, Python version fetcher, and key files on all supported OSes via Docker. +# CloudLinux and RHEL use Rocky/Alma images as proxies (same family, no official Docker images). +name: CI + +on: + push: + branches: [v2.5.5-dev, stable, master] + pull_request: + branches: [v2.5.5-dev, stable, master] + +jobs: + validate-shell: + name: Validate shell scripts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Syntax check shell scripts + run: | + for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh 2>/dev/null; do + [ -f "$f" ] && bash -n "$f" && echo "OK $f" || { echo "FAIL $f"; exit 1; } + done + echo "All shell scripts passed syntax check" + + validate-python: + name: Validate Python (version fetcher) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install requests + run: pip install requests + - name: Run version fetcher (phpMyAdmin / SnappyMail) + run: | + PYTHONPATH=. python3 -c " + from plogical.versionFetcher import get_latest_phpmyadmin_version, get_latest_snappymail_version + pma = get_latest_phpmyadmin_version() + snappy = get_latest_snappymail_version() + assert pma and len(pma) >= 5, 'phpMyAdmin version invalid' + assert snappy and len(snappy) >= 3, 'SnappyMail version invalid' + print('phpMyAdmin:', pma, 'SnappyMail:', snappy) + " + + smoke-key-files: + name: Key files present + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check key install/upgrade files exist + run: | + for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do + test -f "$f" || { echo "Missing: $f"; exit 1; } + done + grep -q 'download_install_phpmyadmin\|Branch_Name' preUpgrade.sh || exit 1 + echo "Key files OK" + + # Run validation inside a container per supported OS (AlmaLinux, CentOS, CloudLinux, Debian, RHEL, Rocky, Ubuntu). + validate-on-os: + name: Validate on ${{ matrix.os }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - os: AlmaLinux 8 + image: almalinux:8 + - os: AlmaLinux 9 + image: almalinux:9 + - os: AlmaLinux 10 + image: almalinux:10 + - os: CentOS 7 + image: centos:7 + - os: CloudLinux 8 + image: rockylinux:8 + - os: CloudLinux 9 + image: rockylinux:9 + - os: Debian 11 + image: debian:11 + - os: Debian 12 + image: debian:12 + - os: Debian 13 + image: debian:13 + - os: RHEL 8 + image: almalinux:8 + - os: RHEL 9 + image: almalinux:9 + - os: RockyLinux 8 + image: rockylinux:8 + - os: RockyLinux 9 + image: rockylinux:9 + - os: Ubuntu 20.04 + image: ubuntu:20.04 + - os: Ubuntu 22.04 + image: ubuntu:22.04 + - os: Ubuntu 24.04 + image: ubuntu:24.04 + steps: + - uses: actions/checkout@v4 + - name: Validate on ${{ matrix.os }} (${{ matrix.image }}) + run: | + docker run --rm \ + -v "$PWD:/repo:ro" \ + -w /repo \ + "${{ matrix.image }}" \ + bash -c ' + set -e + echo "=== Installing deps (apt or yum/dnf) ===" + if command -v apt-get >/dev/null 2>&1; then + apt-get update -qq + apt-get install -y -qq python3 python3-pip curl >/dev/null + pip3 install -q requests + else + if command -v dnf >/dev/null 2>&1; then + dnf install -y -q python3 python3-pip curl + else + yum install -y -q epel-release 2>/dev/null || true + yum install -y -q python3 python3-pip curl 2>/dev/null || yum install -y -q python3 curl + fi + pip3 install -q requests 2>/dev/null || python3 -m pip install -q requests 2>/dev/null || ( python3 -m ensurepip --user 2>/dev/null; python3 -m pip install -q requests ) + fi + echo "=== Shell syntax check ===" + for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh; do + [ -f "$f" ] && bash -n "$f" && echo "OK $f" || { echo "FAIL $f"; exit 1; } + done + echo "=== Python version fetcher ===" + PYTHONPATH=. python3 -c " + from plogical.versionFetcher import get_latest_phpmyadmin_version, get_latest_snappymail_version + pma = get_latest_phpmyadmin_version() + snappy = get_latest_snappymail_version() + assert pma and len(pma) >= 5 + assert snappy and len(snappy) >= 3 + print(\"phpMyAdmin:\", pma, \"SnappyMail:\", snappy) + " + echo "=== Key files ===" + for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do + test -f "$f" || { echo "Missing: $f"; exit 1; } + done + grep -q "Branch_Name\|download_install_phpmyadmin\|cyberpanel" preUpgrade.sh || exit 1 + echo "Done." + ' From 45fe91bb474cef9e41749858a590790837e43901 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 03:48:28 +0100 Subject: [PATCH 02/10] CI: fix Docker jobs (remove curl to avoid conflict), resilient shell check --- .github/workflows/ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2e5cbb04..695c6667f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,12 @@ jobs: - uses: actions/checkout@v4 - name: Syntax check shell scripts run: | - for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh 2>/dev/null; do - [ -f "$f" ] && bash -n "$f" && echo "OK $f" || { echo "FAIL $f"; exit 1; } + for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh; do + [ ! -f "$f" ] && continue + bash -n "$f" || { echo "FAIL (syntax): $f"; exit 1; } + echo "OK $f" done + test -f preUpgrade.sh && test -f cyberpanel_upgrade.sh || { echo "Missing required scripts"; exit 1; } echo "All shell scripts passed syntax check" validate-python: @@ -109,21 +112,24 @@ jobs: echo "=== Installing deps (apt or yum/dnf) ===" if command -v apt-get >/dev/null 2>&1; then apt-get update -qq - apt-get install -y -qq python3 python3-pip curl >/dev/null + apt-get install -y -qq python3 python3-pip >/dev/null pip3 install -q requests else if command -v dnf >/dev/null 2>&1; then - dnf install -y -q python3 python3-pip curl + dnf install -y -q python3 python3-pip else yum install -y -q epel-release 2>/dev/null || true - yum install -y -q python3 python3-pip curl 2>/dev/null || yum install -y -q python3 curl + yum install -y -q python3 python3-pip 2>/dev/null || yum install -y -q python3 fi pip3 install -q requests 2>/dev/null || python3 -m pip install -q requests 2>/dev/null || ( python3 -m ensurepip --user 2>/dev/null; python3 -m pip install -q requests ) fi echo "=== Shell syntax check ===" for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh; do - [ -f "$f" ] && bash -n "$f" && echo "OK $f" || { echo "FAIL $f"; exit 1; } + [ ! -f "$f" ] && continue + bash -n "$f" || { echo "FAIL (syntax): $f"; exit 1; } + echo "OK $f" done + test -f preUpgrade.sh && test -f cyberpanel_upgrade.sh || { echo "Missing required scripts"; exit 1; } echo "=== Python version fetcher ===" PYTHONPATH=. python3 -c " from plogical.versionFetcher import get_latest_phpmyadmin_version, get_latest_snappymail_version From a07974c758fe68aa9895d9565738b162364c77cb Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 03:49:33 +0100 Subject: [PATCH 03/10] Upgrade: phpMyAdmin version normalization, download verify and chown --- cyberpanel_upgrade.sh | 92 ++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 28 deletions(-) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 663eb6710..0caa5444a 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -449,7 +449,8 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Fixing AlmaLinux 9 repos (appstream/baseos) for reliable mirror access" | tee -a /var/log/cyberpanel_upgrade_debug.log ALMA_VER="${Server_OS_Version:-9}" ARCH="x86_64" - for repo in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo; do + ALMA_BASE="https://repo.almalinux.org/almalinux/${ALMA_VER}" + for repo in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do [[ ! -f "$repo" ]] && continue if grep -q '^mirrorlist=' "$repo" 2>/dev/null; then sed -i 's|^mirrorlist=|#mirrorlist=|g' "$repo" @@ -457,37 +458,72 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then sed -i 's|^#baseurl=\(.*repo\.almalinux\.org.*\)|baseurl=\1|' "$repo" fi done - # Ensure appstream/baseos have explicit baseurl (avoids "Cannot find valid baseurl"); process any .repo that has these sections - for repofile in /etc/yum.repos.d/almalinux.repo /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo; do + # Ensure appstream/baseos have explicit baseurl; support [appstream], [almalinux-appstream], etc. + for repofile in /etc/yum.repos.d/almalinux.repo /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do [[ ! -f "$repofile" ]] && continue - if grep -q '^\[appstream\]' "$repofile" 2>/dev/null; then - sed -i "/^\[appstream\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/AppStream/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" - # Add baseurl if section had only mirrorlist (no baseurl line) - if ! sed -n '/^\[appstream\]/,/^\[/p' "$repofile" | grep -q '^baseurl='; then - sed -i "/^\[appstream\]/a baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/AppStream/${ARCH}/os/" "$repofile" + for section in appstream almalinux-appstream AppStream; do + if grep -q "^\[${section}\]" "$repofile" 2>/dev/null; then + sed -i "/^\[${section}\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=${ALMA_BASE}/AppStream/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" + if ! sed -n "/^\[${section}\]/,/^\[/p" "$repofile" | grep -q '^baseurl='; then + sed -i "/^\[${section}\]/a baseurl=${ALMA_BASE}/AppStream/${ARCH}/os/" "$repofile" + fi fi - fi - if grep -q '^\[baseos\]' "$repofile" 2>/dev/null; then - sed -i "/^\[baseos\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/BaseOS/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" - if ! sed -n '/^\[baseos\]/,/^\[/p' "$repofile" | grep -q '^baseurl='; then - sed -i "/^\[baseos\]/a baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/BaseOS/${ARCH}/os/" "$repofile" + done + for section in baseos almalinux-baseos BaseOS; do + if grep -q "^\[${section}\]" "$repofile" 2>/dev/null; then + sed -i "/^\[${section}\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=${ALMA_BASE}/BaseOS/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" + if ! sed -n "/^\[${section}\]/,/^\[/p" "$repofile" | grep -q '^baseurl='; then + sed -i "/^\[${section}\]/a baseurl=${ALMA_BASE}/BaseOS/${ARCH}/os/" "$repofile" + fi fi - fi - # CRB (CodeReady Builder) - avoids "Cannot find a valid baseurl for repo: crb" - if grep -q '^\[crb\]' "$repofile" 2>/dev/null; then - sed -i "/^\[crb\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/CRB/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" - if ! sed -n '/^\[crb\]/,/^\[/p' "$repofile" | grep -q '^baseurl='; then - sed -i "/^\[crb\]/a baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/CRB/${ARCH}/os/" "$repofile" + done + for section in crb extras; do + if grep -q "^\[${section}\]" "$repofile" 2>/dev/null; then + [[ "$section" = "crb" ]] && path="CRB" || path="extras" + sed -i "/^\[${section}\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=${ALMA_BASE}/${path}/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" + if ! sed -n "/^\[${section}\]/,/^\[/p" "$repofile" | grep -q '^baseurl='; then + sed -i "/^\[${section}\]/a baseurl=${ALMA_BASE}/${path}/${ARCH}/os/" "$repofile" + fi fi - fi - # Extras - avoids "Cannot find a valid baseurl for repo: extras" - if grep -q '^\[extras\]' "$repofile" 2>/dev/null; then - sed -i "/^\[extras\]/,/^\[/ { s|^#\?baseurl=.*|baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/extras/${ARCH}/os/|; s|^mirrorlist=.*|#mirrorlist=disabled| }" "$repofile" - if ! sed -n '/^\[extras\]/,/^\[/p' "$repofile" | grep -q '^baseurl='; then - sed -i "/^\[extras\]/a baseurl=https://repo.almalinux.org/almalinux/${ALMA_VER}/extras/${ARCH}/os/" "$repofile" - fi - fi + done done + # Fallback: create override with same repo IDs to replace broken config (loads last via zz- prefix) + if ! dnf makecache --quiet 2>/dev/null; then + echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] dnf makecache failed, creating AlmaLinux repo override" | tee -a /var/log/cyberpanel_upgrade_debug.log + for f in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do + [[ -f "$f" ]] && sed -i 's/^enabled=1/enabled=0/' "$f" 2>/dev/null + done + cat > /etc/yum.repos.d/zz-almalinux-cyberpanel-fix.repo << EOF +[baseos] +name=AlmaLinux ${ALMA_VER} - BaseOS +baseurl=${ALMA_BASE}/BaseOS/${ARCH}/os/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 + +[appstream] +name=AlmaLinux ${ALMA_VER} - AppStream +baseurl=${ALMA_BASE}/AppStream/${ARCH}/os/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 + +[extras] +name=AlmaLinux ${ALMA_VER} - Extras +baseurl=${ALMA_BASE}/extras/${ARCH}/os/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 + +[crb] +name=AlmaLinux ${ALMA_VER} - CRB +baseurl=${ALMA_BASE}/CRB/${ARCH}/os/ +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-9 +EOF + dnf makecache --quiet 2>/dev/null || true + fi fi echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Setting up repositories for $Server_OS..." | tee -a /var/log/cyberpanel_upgrade_debug.log rm -f /etc/yum.repos.d/CyberPanel.repo @@ -1365,7 +1401,7 @@ if [[ -f Makefile ]]; then # Replace -O0 -g3 with -O2 -g to satisfy _FORTIFY_SOURCE sed -i 's/-O0 -g3/-O2 -g/g' Makefile # Ensure we have proper optimization flags - if grep -q "CFLAGS" Makefile && ! grep -q -e "-O2" Makefile; then + if grep -q "CFLAGS" Makefile && ! grep -qF '-O2' Makefile; then sed -i 's/CFLAGS =/CFLAGS = -O2/' Makefile fi echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] Makefile optimized for proper compilation" | tee -a /var/log/cyberpanel_upgrade_debug.log From e97365baeeb2656fc3d1b93ff47d5236f0224df9 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 03:50:37 +0100 Subject: [PATCH 04/10] AlmaLinux 9 repo fix: remove aggressive disable of originals, keep override fallback --- cyberpanel_upgrade.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 0caa5444a..3828c4ff4 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -487,12 +487,9 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then fi done done - # Fallback: create override with same repo IDs to replace broken config (loads last via zz- prefix) + # Fallback: create override with same repo IDs (loads last via zz- prefix, overrides broken config) if ! dnf makecache --quiet 2>/dev/null; then echo -e "[$(date +"%Y-%m-%d %H:%M:%S")] dnf makecache failed, creating AlmaLinux repo override" | tee -a /var/log/cyberpanel_upgrade_debug.log - for f in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do - [[ -f "$f" ]] && sed -i 's/^enabled=1/enabled=0/' "$f" 2>/dev/null - done cat > /etc/yum.repos.d/zz-almalinux-cyberpanel-fix.repo << EOF [baseos] name=AlmaLinux ${ALMA_VER} - BaseOS From c8747de5032db0c3b86a6ae9ea8a5c188e8354b4 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 03:57:01 +0100 Subject: [PATCH 05/10] CI: fix shell syntax (for-loop 2>/dev/null), key-files grep (BRANCH_NAME + cyberpanel_upgrade.sh) --- .github/workflows/ci.yml | 5 +++-- cyberpanel_upgrade.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 695c6667f..df22d57d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,8 @@ jobs: for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do test -f "$f" || { echo "Missing: $f"; exit 1; } done - grep -q 'download_install_phpmyadmin\|Branch_Name' preUpgrade.sh || exit 1 + grep -q 'BRANCH_NAME' preUpgrade.sh || exit 1 + grep -q 'Branch_Name\|download_install_phpmyadmin\|Branch_Check' cyberpanel_upgrade.sh || exit 1 echo "Key files OK" # Run validation inside a container per supported OS (AlmaLinux, CentOS, CloudLinux, Debian, RHEL, Rocky, Ubuntu). @@ -143,6 +144,6 @@ jobs: for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do test -f "$f" || { echo "Missing: $f"; exit 1; } done - grep -q "Branch_Name\|download_install_phpmyadmin\|cyberpanel" preUpgrade.sh || exit 1 + grep -q "BRANCH_NAME" preUpgrade.sh && grep -q "Branch_Name\|download_install_phpmyadmin\|Branch_Check" cyberpanel_upgrade.sh || exit 1 echo "Done." ' diff --git a/cyberpanel_upgrade.sh b/cyberpanel_upgrade.sh index 3828c4ff4..18d34e324 100644 --- a/cyberpanel_upgrade.sh +++ b/cyberpanel_upgrade.sh @@ -450,7 +450,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then ALMA_VER="${Server_OS_Version:-9}" ARCH="x86_64" ALMA_BASE="https://repo.almalinux.org/almalinux/${ALMA_VER}" - for repo in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do + for repo in /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo; do [[ ! -f "$repo" ]] && continue if grep -q '^mirrorlist=' "$repo" 2>/dev/null; then sed -i 's|^mirrorlist=|#mirrorlist=|g' "$repo" @@ -459,7 +459,7 @@ if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "AlmaLinux9" ]] ; then fi done # Ensure appstream/baseos have explicit baseurl; support [appstream], [almalinux-appstream], etc. - for repofile in /etc/yum.repos.d/almalinux.repo /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo 2>/dev/null; do + for repofile in /etc/yum.repos.d/almalinux.repo /etc/yum.repos.d/almalinux*.repo /etc/yum.repos.d/AlmaLinux*.repo; do [[ ! -f "$repofile" ]] && continue for section in appstream almalinux-appstream AppStream; do if grep -q "^\[${section}\]" "$repofile" 2>/dev/null; then From f06d6c7c71e03e2a0130b3c0ad08bdaead21dc07 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 04:02:01 +0100 Subject: [PATCH 06/10] CI: CentOS 7 vault.centos.org repo fix for Docker validate-on-os --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df22d57d5..c37016193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,7 @@ jobs: - name: Validate on ${{ matrix.os }} (${{ matrix.image }}) run: | docker run --rm \ + -e IMAGE="${{ matrix.image }}" \ -v "$PWD:/repo:ro" \ -w /repo \ "${{ matrix.image }}" \ @@ -116,6 +117,13 @@ jobs: apt-get install -y -qq python3 python3-pip >/dev/null pip3 install -q requests else + if [ "$IMAGE" = "centos:7" ]; then + for r in /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-*.repo; do + [ -f "$r" ] || continue + sed -i "s|^mirrorlist=|#mirrorlist=|g" "$r" + sed -i "s|^#*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" "$r" + done + fi if command -v dnf >/dev/null 2>&1; then dnf install -y -q python3 python3-pip else From 5750601c487e28209a97452476930c1140c64a4c Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 04:02:39 +0100 Subject: [PATCH 07/10] CI: pip install --break-system-packages fallback in Docker validate --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c37016193..7dcafbe73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,7 @@ jobs: if command -v apt-get >/dev/null 2>&1; then apt-get update -qq apt-get install -y -qq python3 python3-pip >/dev/null - pip3 install -q requests + pip3 install -q requests 2>/dev/null || pip3 install -q --break-system-packages requests 2>/dev/null || true else if [ "$IMAGE" = "centos:7" ]; then for r in /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-*.repo; do @@ -130,7 +130,7 @@ jobs: yum install -y -q epel-release 2>/dev/null || true yum install -y -q python3 python3-pip 2>/dev/null || yum install -y -q python3 fi - pip3 install -q requests 2>/dev/null || python3 -m pip install -q requests 2>/dev/null || ( python3 -m ensurepip --user 2>/dev/null; python3 -m pip install -q requests ) + pip3 install -q requests 2>/dev/null || python3 -m pip install -q requests 2>/dev/null || python3 -m pip install -q --break-system-packages requests 2>/dev/null || ( python3 -m ensurepip --user 2>/dev/null; python3 -m pip install -q requests 2>/dev/null ) fi echo "=== Shell syntax check ===" for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh; do From 9955e046cdce485d8b8c82647cfdbb537a4f797c Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 04:06:21 +0100 Subject: [PATCH 08/10] CI: use venv in Docker validate for reliable Python/requests --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dcafbe73..ad8f79f2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,7 +114,7 @@ jobs: echo "=== Installing deps (apt or yum/dnf) ===" if command -v apt-get >/dev/null 2>&1; then apt-get update -qq - apt-get install -y -qq python3 python3-pip >/dev/null + apt-get install -y -qq python3 python3-pip python3-venv >/dev/null pip3 install -q requests 2>/dev/null || pip3 install -q --break-system-packages requests 2>/dev/null || true else if [ "$IMAGE" = "centos:7" ]; then @@ -140,7 +140,12 @@ jobs: done test -f preUpgrade.sh && test -f cyberpanel_upgrade.sh || { echo "Missing required scripts"; exit 1; } echo "=== Python version fetcher ===" - PYTHONPATH=. python3 -c " + PYEXE=python3 + if python3 -m venv /tmp/venv 2>/dev/null; then + /tmp/venv/bin/pip install -q requests 2>/dev/null + PYEXE=/tmp/venv/bin/python + fi + PYTHONPATH=. $PYEXE -c " from plogical.versionFetcher import get_latest_phpmyadmin_version, get_latest_snappymail_version pma = get_latest_phpmyadmin_version() snappy = get_latest_snappymail_version() From e3eafc0df916a174c8b621ec5960ece6ca276dae Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 04:09:22 +0100 Subject: [PATCH 09/10] CI: Docker validate only shell + key files (no install/Python in container) --- .github/workflows/ci.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad8f79f2d..195b86137 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,33 +105,11 @@ jobs: - name: Validate on ${{ matrix.os }} (${{ matrix.image }}) run: | docker run --rm \ - -e IMAGE="${{ matrix.image }}" \ -v "$PWD:/repo:ro" \ -w /repo \ "${{ matrix.image }}" \ bash -c ' set -e - echo "=== Installing deps (apt or yum/dnf) ===" - if command -v apt-get >/dev/null 2>&1; then - apt-get update -qq - apt-get install -y -qq python3 python3-pip python3-venv >/dev/null - pip3 install -q requests 2>/dev/null || pip3 install -q --break-system-packages requests 2>/dev/null || true - else - if [ "$IMAGE" = "centos:7" ]; then - for r in /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-*.repo; do - [ -f "$r" ] || continue - sed -i "s|^mirrorlist=|#mirrorlist=|g" "$r" - sed -i "s|^#*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" "$r" - done - fi - if command -v dnf >/dev/null 2>&1; then - dnf install -y -q python3 python3-pip - else - yum install -y -q epel-release 2>/dev/null || true - yum install -y -q python3 python3-pip 2>/dev/null || yum install -y -q python3 - fi - pip3 install -q requests 2>/dev/null || python3 -m pip install -q requests 2>/dev/null || python3 -m pip install -q --break-system-packages requests 2>/dev/null || ( python3 -m ensurepip --user 2>/dev/null; python3 -m pip install -q requests 2>/dev/null ) - fi echo "=== Shell syntax check ===" for f in cyberpanel_upgrade.sh preUpgrade.sh fix-phpmyadmin.sh cyberpanel.sh cyberpanel_utility.sh; do [ ! -f "$f" ] && continue @@ -139,20 +117,6 @@ jobs: echo "OK $f" done test -f preUpgrade.sh && test -f cyberpanel_upgrade.sh || { echo "Missing required scripts"; exit 1; } - echo "=== Python version fetcher ===" - PYEXE=python3 - if python3 -m venv /tmp/venv 2>/dev/null; then - /tmp/venv/bin/pip install -q requests 2>/dev/null - PYEXE=/tmp/venv/bin/python - fi - PYTHONPATH=. $PYEXE -c " - from plogical.versionFetcher import get_latest_phpmyadmin_version, get_latest_snappymail_version - pma = get_latest_phpmyadmin_version() - snappy = get_latest_snappymail_version() - assert pma and len(pma) >= 5 - assert snappy and len(snappy) >= 3 - print(\"phpMyAdmin:\", pma, \"SnappyMail:\", snappy) - " echo "=== Key files ===" for f in preUpgrade.sh cyberpanel_upgrade.sh plogical/upgrade.py install/install.py plogical/versionFetcher.py; do test -f "$f" || { echo "Missing: $f"; exit 1; } From f7af4f1c621c33c0b3da5d5a6426a0e6e6f404e2 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 15 Feb 2026 04:15:44 +0100 Subject: [PATCH 10/10] ci: trigger workflows (Actions re-run)