Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af7fd193e5 | ||
|
|
e8e3bfd490 | ||
|
|
c49f456336 | ||
|
|
bcd737a9e2 | ||
|
|
955aec4573 | ||
|
|
998eb17f39 | ||
|
|
f461d22aae | ||
|
|
cfde82ae44 | ||
|
|
132e591503 | ||
|
|
642b97707d |
No files matched your search
@@ -61,6 +61,9 @@ jobs:
|
|||||||
Build-and-Push:
|
Build-and-Push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
# One PHP version failing (e.g. an EOL stream) must not cancel the
|
||||||
|
# security builds of the others.
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
phpver: [74, 80, 81, 82, 83, 84, 85]
|
phpver: [74, 80, 81, 82, 83, 84, 85]
|
||||||
steps:
|
steps:
|
||||||
@@ -81,6 +84,20 @@ jobs:
|
|||||||
id: bust
|
id: bust
|
||||||
run: echo "value=$(date -u +%Y%m%dT%H%M%SZ)-${{ gitea.run_id }}" >> "$GITHUB_OUTPUT"
|
run: echo "value=$(date -u +%Y%m%dT%H%M%SZ)-${{ gitea.run_id }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# The minimum PHP version this build must ship: php.net's current release for
|
||||||
|
# the branch (over HTTPS). The Dockerfile fails if Remi gave us anything older,
|
||||||
|
# so lagging mirrors or replayed repo metadata can't ship a vulnerable PHP.
|
||||||
|
- name: Resolve current PHP release from php.net
|
||||||
|
id: phpmin
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
v="${{ matrix.phpver }}"; branch="${v:0:1}.${v:1}"
|
||||||
|
json=$(curl -fsS --retry 5 --max-time 60 "https://www.php.net/releases/index.php?json&max=1&version=${branch}")
|
||||||
|
min=$(printf '%s' "$json" | python3 -c 'import json,sys; d=json.load(sys.stdin); print(next(iter(d)) if isinstance(d,dict) and d else "")')
|
||||||
|
if [ -z "$min" ]; then echo "::error::no php.net release found for ${branch}"; exit 1; fi
|
||||||
|
echo "php.net current ${branch}: ${min}"
|
||||||
|
echo "min=${min}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Login to Gitea
|
- name: Login to Gitea
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -96,6 +113,7 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
PHPVER=${{ matrix.phpver }}
|
PHPVER=${{ matrix.phpver }}
|
||||||
CACHE_BUST=${{ steps.bust.outputs.value }}
|
CACHE_BUST=${{ steps.bust.outputs.value }}
|
||||||
|
EXPECT_PHP_MIN=${{ steps.phpmin.outputs.min }}
|
||||||
tags: |
|
tags: |
|
||||||
repo.anhonesthost.net/cloud-hosting-platform/cac:php${{ matrix.phpver }}
|
repo.anhonesthost.net/cloud-hosting-platform/cac:php${{ matrix.phpver }}
|
||||||
${{ matrix.phpver == '85' && 'repo.anhonesthost.net/cloud-hosting-platform/cac:latest' || '' }}
|
${{ matrix.phpver == '85' && 'repo.anhonesthost.net/cloud-hosting-platform/cac:latest' || '' }}
|
||||||
@@ -103,6 +121,9 @@ jobs:
|
|||||||
Build-FPM-Images:
|
Build-FPM-Images:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
# One PHP version failing (e.g. an EOL stream) must not cancel the
|
||||||
|
# security builds of the others.
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
phpver: [74, 80, 81, 82, 83, 84, 85]
|
phpver: [74, 80, 81, 82, 83, 84, 85]
|
||||||
steps:
|
steps:
|
||||||
@@ -123,6 +144,20 @@ jobs:
|
|||||||
id: bust
|
id: bust
|
||||||
run: echo "value=$(date -u +%Y%m%dT%H%M%SZ)-${{ gitea.run_id }}" >> "$GITHUB_OUTPUT"
|
run: echo "value=$(date -u +%Y%m%dT%H%M%SZ)-${{ gitea.run_id }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# The minimum PHP version this build must ship: php.net's current release for
|
||||||
|
# the branch (over HTTPS). The Dockerfile fails if Remi gave us anything older,
|
||||||
|
# so lagging mirrors or replayed repo metadata can't ship a vulnerable PHP.
|
||||||
|
- name: Resolve current PHP release from php.net
|
||||||
|
id: phpmin
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
v="${{ matrix.phpver }}"; branch="${v:0:1}.${v:1}"
|
||||||
|
json=$(curl -fsS --retry 5 --max-time 60 "https://www.php.net/releases/index.php?json&max=1&version=${branch}")
|
||||||
|
min=$(printf '%s' "$json" | python3 -c 'import json,sys; d=json.load(sys.stdin); print(next(iter(d)) if isinstance(d,dict) and d else "")')
|
||||||
|
if [ -z "$min" ]; then echo "::error::no php.net release found for ${branch}"; exit 1; fi
|
||||||
|
echo "php.net current ${branch}: ${min}"
|
||||||
|
echo "min=${min}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Login to Gitea
|
- name: Login to Gitea
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -139,6 +174,7 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
PHPVER=${{ matrix.phpver }}
|
PHPVER=${{ matrix.phpver }}
|
||||||
CACHE_BUST=${{ steps.bust.outputs.value }}
|
CACHE_BUST=${{ steps.bust.outputs.value }}
|
||||||
|
EXPECT_PHP_MIN=${{ steps.phpmin.outputs.min }}
|
||||||
tags: |
|
tags: |
|
||||||
repo.anhonesthost.net/cloud-hosting-platform/cac-fpm:php${{ matrix.phpver }}
|
repo.anhonesthost.net/cloud-hosting-platform/cac-fpm:php${{ matrix.phpver }}
|
||||||
${{ matrix.phpver == '85' && 'repo.anhonesthost.net/cloud-hosting-platform/cac-fpm:latest' || '' }}
|
${{ matrix.phpver == '85' && 'repo.anhonesthost.net/cloud-hosting-platform/cac-fpm:latest' || '' }}
|
||||||
@@ -146,6 +182,9 @@ jobs:
|
|||||||
Build-LiteSpeed-Images:
|
Build-LiteSpeed-Images:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
# One PHP version failing (e.g. an EOL stream) must not cancel the
|
||||||
|
# security builds of the others.
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# PHP 7.4/8.0 deliberately excluded — the LiteSpeed prebuilt base
|
# PHP 7.4/8.0 deliberately excluded — the LiteSpeed prebuilt base
|
||||||
# images stop at older OLS releases for those PHP versions, and the
|
# images stop at older OLS releases for those PHP versions, and the
|
||||||
@@ -216,6 +255,9 @@ jobs:
|
|||||||
Build-LSPHP-Images:
|
Build-LSPHP-Images:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
# One PHP version failing (e.g. an EOL stream) must not cancel the
|
||||||
|
# security builds of the others.
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# Same PHP matrix as cac-litespeed (81–85): cac-lsphp is the detached
|
# Same PHP matrix as cac-litespeed (81–85): cac-lsphp is the detached
|
||||||
# backend for the shared-ols tier and shares the litespeed prebuilt
|
# backend for the shared-ols tier and shares the litespeed prebuilt
|
||||||
|
|||||||
+19
@@ -4,11 +4,21 @@ ARG PHPVER=83
|
|||||||
# never be a layer-cache hit, so every build gets the repos' current packages.
|
# never be a layer-cache hit, so every build gets the repos' current packages.
|
||||||
# Local builds: --build-arg CACHE_BUST=$(date +%s) or --no-cache.
|
# Local builds: --build-arg CACHE_BUST=$(date +%s) or --no-cache.
|
||||||
ARG CACHE_BUST=
|
ARG CACHE_BUST=
|
||||||
|
# php.net's current release for this branch (CI); the build fails on older PHP.
|
||||||
|
ARG EXPECT_PHP_MIN=
|
||||||
|
|
||||||
# Install repos, update, install only needed packages, clean up in one layer
|
# Install repos, update, install only needed packages, clean up in one layer
|
||||||
RUN dnf install -y \
|
RUN dnf install -y \
|
||||||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm \
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm \
|
||||||
https://rpms.remirepo.net/enterprise/remi-release-10.rpm && \
|
https://rpms.remirepo.net/enterprise/remi-release-10.rpm && \
|
||||||
|
# Use Remi's origin, not the mirrorlist: during the 2026-10-21 PHP security
|
||||||
|
# release the mirrors lagged hours behind (still 8.2.34 when 8.2.35 was out),
|
||||||
|
# so builds shipped unpatched PHP. HTTPS first; plain http only as a fallback
|
||||||
|
# because the origin's HTTPS dropped/timed out under that day's load. A
|
||||||
|
# replayed (old) http index can't ship old PHP: packages stay GPG-checked and
|
||||||
|
# the EXPECT_PHP_MIN gate below fails the build on anything older than php.net.
|
||||||
|
sed -i -e 's|^#baseurl=http://\(.*\)$|baseurl=https://\1 http://\1|' -e 's/^mirrorlist=/#mirrorlist=/' /etc/yum.repos.d/remi*.repo && \
|
||||||
|
printf 'retries=10\ntimeout=60\n' >> /etc/dnf/dnf.conf && \
|
||||||
dnf update -y && \
|
dnf update -y && \
|
||||||
dnf install -y httpd mod_ssl openssl wget procps cronie iproute postgresql-devel microdnf less git \
|
dnf install -y httpd mod_ssl openssl wget procps cronie iproute postgresql-devel microdnf less git \
|
||||||
nano rsync unzip zip mariadb bind-utils jq patch nc tree dos2unix && \
|
nano rsync unzip zip mariadb bind-utils jq patch nc tree dos2unix && \
|
||||||
@@ -27,6 +37,11 @@ RUN dnf install -y ImageMagick ImageMagick-libs ImageMagick-heic && \
|
|||||||
RUN openssl req -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/localhost.key -x509 -days 3650 -subj "/CN=localhost" -out /etc/pki/tls/certs/localhost.crt && \
|
RUN openssl req -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/localhost.key -x509 -days 3650 -subj "/CN=localhost" -out /etc/pki/tls/certs/localhost.crt && \
|
||||||
mkdir -p /run/php-fpm/ && \
|
mkdir -p /run/php-fpm/ && \
|
||||||
/scripts/install-php$PHPVER.sh && \
|
/scripts/install-php$PHPVER.sh && \
|
||||||
|
# CI passes php.net's current release for the branch; never ship older PHP.
|
||||||
|
if [ -n "$EXPECT_PHP_MIN" ]; then \
|
||||||
|
php -r 'exit(version_compare(PHP_VERSION, getenv("EXPECT_PHP_MIN"), ">=") ? 0 : 1);' || \
|
||||||
|
{ echo "FATAL: built PHP $(php -r 'echo PHP_VERSION;') is older than php.net $EXPECT_PHP_MIN"; exit 1; }; \
|
||||||
|
else echo "WARNING: no EXPECT_PHP_MIN (local build) - PHP version not gated"; fi && \
|
||||||
echo "PHP version report:" && php -v && rpm -q php-cli php-common php-fpm && \
|
echo "PHP version report:" && php -v && rpm -q php-cli php-common php-fpm && \
|
||||||
rm -rf /tmp/*
|
rm -rf /tmp/*
|
||||||
|
|
||||||
@@ -41,6 +56,10 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
|||||||
# Copy configs and web files
|
# Copy configs and web files
|
||||||
COPY ./configs/default-index.conf /etc/httpd/conf.d/
|
COPY ./configs/default-index.conf /etc/httpd/conf.d/
|
||||||
COPY ./configs/prod-php.ini /etc/php.ini
|
COPY ./configs/prod-php.ini /etc/php.ini
|
||||||
|
# php2shell mitigation (CVE-2026-109618/-109619). Named zz- so it sorts after
|
||||||
|
# every other scan-dir ini (incl. runtime-written 99-*) and wins. Remove once
|
||||||
|
# all images ship PHP >= 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.
|
||||||
|
COPY ./configs/zz-php2shell-mitigation.ini /etc/php.d/zz-php2shell-mitigation.ini
|
||||||
COPY ./configs/phpinfo.php /var/www/html/
|
COPY ./configs/phpinfo.php /var/www/html/
|
||||||
COPY ./configs/mariadb.repo /etc/yum.repos.d/
|
COPY ./configs/mariadb.repo /etc/yum.repos.d/
|
||||||
COPY ./configs/index.php /var/www/html/
|
COPY ./configs/index.php /var/www/html/
|
||||||
|
|||||||
@@ -4,11 +4,21 @@ ARG PHPVER=83
|
|||||||
# never be a layer-cache hit, so every build gets the repos' current packages.
|
# never be a layer-cache hit, so every build gets the repos' current packages.
|
||||||
# Local builds: --build-arg CACHE_BUST=$(date +%s) or --no-cache.
|
# Local builds: --build-arg CACHE_BUST=$(date +%s) or --no-cache.
|
||||||
ARG CACHE_BUST=
|
ARG CACHE_BUST=
|
||||||
|
# php.net's current release for this branch (CI); the build fails on older PHP.
|
||||||
|
ARG EXPECT_PHP_MIN=
|
||||||
|
|
||||||
# Install repos, update, install only needed packages (no httpd/mod_ssl), clean up in one layer
|
# Install repos, update, install only needed packages (no httpd/mod_ssl), clean up in one layer
|
||||||
RUN dnf install -y \
|
RUN dnf install -y \
|
||||||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm \
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm \
|
||||||
https://rpms.remirepo.net/enterprise/remi-release-10.rpm && \
|
https://rpms.remirepo.net/enterprise/remi-release-10.rpm && \
|
||||||
|
# Use Remi's origin, not the mirrorlist: during the 2026-10-21 PHP security
|
||||||
|
# release the mirrors lagged hours behind (still 8.2.34 when 8.2.35 was out),
|
||||||
|
# so builds shipped unpatched PHP. HTTPS first; plain http only as a fallback
|
||||||
|
# because the origin's HTTPS dropped/timed out under that day's load. A
|
||||||
|
# replayed (old) http index can't ship old PHP: packages stay GPG-checked and
|
||||||
|
# the EXPECT_PHP_MIN gate below fails the build on anything older than php.net.
|
||||||
|
sed -i -e 's|^#baseurl=http://\(.*\)$|baseurl=https://\1 http://\1|' -e 's/^mirrorlist=/#mirrorlist=/' /etc/yum.repos.d/remi*.repo && \
|
||||||
|
printf 'retries=10\ntimeout=60\n' >> /etc/dnf/dnf.conf && \
|
||||||
dnf update -y && \
|
dnf update -y && \
|
||||||
dnf install -y openssl wget procps cronie iproute postgresql-devel microdnf less git \
|
dnf install -y openssl wget procps cronie iproute postgresql-devel microdnf less git \
|
||||||
nano rsync unzip zip mariadb bind-utils jq patch nc tree dos2unix fcgi && \
|
nano rsync unzip zip mariadb bind-utils jq patch nc tree dos2unix fcgi && \
|
||||||
@@ -26,6 +36,11 @@ RUN dnf install -y ImageMagick ImageMagick-libs ImageMagick-heic && \
|
|||||||
# Create needed dirs, install PHP, clean up (no SSL cert, no httpd)
|
# Create needed dirs, install PHP, clean up (no SSL cert, no httpd)
|
||||||
RUN mkdir -p /run/php-fpm/ && \
|
RUN mkdir -p /run/php-fpm/ && \
|
||||||
/scripts/install-php$PHPVER.sh && \
|
/scripts/install-php$PHPVER.sh && \
|
||||||
|
# CI passes php.net's current release for the branch; never ship older PHP.
|
||||||
|
if [ -n "$EXPECT_PHP_MIN" ]; then \
|
||||||
|
php -r 'exit(version_compare(PHP_VERSION, getenv("EXPECT_PHP_MIN"), ">=") ? 0 : 1);' || \
|
||||||
|
{ echo "FATAL: built PHP $(php -r 'echo PHP_VERSION;') is older than php.net $EXPECT_PHP_MIN"; exit 1; }; \
|
||||||
|
else echo "WARNING: no EXPECT_PHP_MIN (local build) - PHP version not gated"; fi && \
|
||||||
echo "PHP version report:" && php -v && rpm -q php-cli php-common php-fpm && \
|
echo "PHP version report:" && php -v && rpm -q php-cli php-common php-fpm && \
|
||||||
rm -rf /tmp/*
|
rm -rf /tmp/*
|
||||||
|
|
||||||
@@ -39,6 +54,10 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
|||||||
|
|
||||||
# Copy configs (PHP only, no Apache configs)
|
# Copy configs (PHP only, no Apache configs)
|
||||||
COPY ./configs/prod-php.ini /etc/php.ini
|
COPY ./configs/prod-php.ini /etc/php.ini
|
||||||
|
# php2shell mitigation (CVE-2026-109618/-109619). Named zz- so it sorts after
|
||||||
|
# every other scan-dir ini (incl. runtime-written 99-*) and wins. Remove once
|
||||||
|
# all images ship PHP >= 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.
|
||||||
|
COPY ./configs/zz-php2shell-mitigation.ini /etc/php.d/zz-php2shell-mitigation.ini
|
||||||
COPY ./configs/mariadb.repo /etc/yum.repos.d/
|
COPY ./configs/mariadb.repo /etc/yum.repos.d/
|
||||||
|
|
||||||
# Set up cron job for log rotation
|
# Set up cron job for log rotation
|
||||||
|
|||||||
@@ -83,6 +83,10 @@ COPY ./scripts/entrypoint-litespeed.sh \
|
|||||||
/scripts/
|
/scripts/
|
||||||
RUN chmod +x /scripts/*
|
RUN chmod +x /scripts/*
|
||||||
COPY ./configs/litespeed/ /etc/lsws-templates/
|
COPY ./configs/litespeed/ /etc/lsws-templates/
|
||||||
|
## php2shell mitigation (CVE-2026-109618/-109619). Named zz- so it sorts after
|
||||||
|
## every other scan-dir ini (incl. runtime-written 99-*) and wins. Remove once
|
||||||
|
## all images ship PHP >= 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.
|
||||||
|
COPY ./configs/zz-php2shell-mitigation.ini /etc/lsws-templates/zz-php2shell-mitigation.ini
|
||||||
|
|
||||||
## Apply our production lsphp ini overrides. Ask lsphp for its scan dir
|
## Apply our production lsphp ini overrides. Ask lsphp for its scan dir
|
||||||
## directly (varies by PHP minor version: 8.3/8.4/8.5 each have their own
|
## directly (varies by PHP minor version: 8.3/8.4/8.5 each have their own
|
||||||
@@ -92,6 +96,7 @@ RUN bash -c 'set -e; \
|
|||||||
SCAN_DIR=$(/usr/local/lsws/lsphp${PHPVER}/bin/lsphp -i 2>/dev/null | awk -F"=> " "/^Scan this dir/ {print \$2; exit}"); \
|
SCAN_DIR=$(/usr/local/lsws/lsphp${PHPVER}/bin/lsphp -i 2>/dev/null | awk -F"=> " "/^Scan this dir/ {print \$2; exit}"); \
|
||||||
mkdir -p "$SCAN_DIR"; \
|
mkdir -p "$SCAN_DIR"; \
|
||||||
cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; \
|
cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; \
|
||||||
|
cp /etc/lsws-templates/zz-php2shell-mitigation.ini "$SCAN_DIR/zz-php2shell-mitigation.ini"; \
|
||||||
echo "wrote overrides to $SCAN_DIR"'
|
echo "wrote overrides to $SCAN_DIR"'
|
||||||
|
|
||||||
## Disable the OLS WebAdmin port for customer-facing containers. Bind admin
|
## Disable the OLS WebAdmin port for customer-facing containers. Bind admin
|
||||||
|
|||||||
@@ -201,10 +201,15 @@ RUN chmod +x /scripts/entrypoint-lsphp.sh /scripts/detect-memory-lsphp.sh /scrip
|
|||||||
## Apply production lsphp ini overrides into lsphp's scan dir (path varies by
|
## Apply production lsphp ini overrides into lsphp's scan dir (path varies by
|
||||||
## PHP minor version; ask lsphp directly — same idiom as Dockerfile.litespeed).
|
## PHP minor version; ask lsphp directly — same idiom as Dockerfile.litespeed).
|
||||||
COPY ./configs/litespeed/lsphp-overrides.ini /etc/lsws-templates/lsphp-overrides.ini
|
COPY ./configs/litespeed/lsphp-overrides.ini /etc/lsws-templates/lsphp-overrides.ini
|
||||||
|
## php2shell mitigation (CVE-2026-109618/-109619). Named zz- so it sorts after
|
||||||
|
## every other scan-dir ini (incl. runtime-written 99-*) and wins. Remove once
|
||||||
|
## all images ship PHP >= 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.
|
||||||
|
COPY ./configs/zz-php2shell-mitigation.ini /etc/lsws-templates/zz-php2shell-mitigation.ini
|
||||||
RUN bash -c 'set -e; \
|
RUN bash -c 'set -e; \
|
||||||
SCAN_DIR=$(/usr/local/lsws/lsphp${PHPVER}/bin/lsphp -i 2>/dev/null | awk -F"=> " "/^Scan this dir/ {print \$2; exit}"); \
|
SCAN_DIR=$(/usr/local/lsws/lsphp${PHPVER}/bin/lsphp -i 2>/dev/null | awk -F"=> " "/^Scan this dir/ {print \$2; exit}"); \
|
||||||
mkdir -p "$SCAN_DIR"; \
|
mkdir -p "$SCAN_DIR"; \
|
||||||
cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; \
|
cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; \
|
||||||
|
cp /etc/lsws-templates/zz-php2shell-mitigation.ini "$SCAN_DIR/zz-php2shell-mitigation.ini"; \
|
||||||
echo "wrote overrides to $SCAN_DIR"'
|
echo "wrote overrides to $SCAN_DIR"'
|
||||||
|
|
||||||
## Install the cac_path_parity extension into lsphp's own extension_dir and load
|
## Install the cac_path_parity extension into lsphp's own extension_dir and load
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
; php2shell mitigation (CVE-2026-109618 / CVE-2026-109619, GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rp)
|
||||||
|
; Remove once all images ship PHP >= 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.
|
||||||
|
fatal_error_backtraces = 0
|
||||||
|
session.upload_progress.enabled = 0
|
||||||
|
max_input_nesting_level = 16
|
||||||
@@ -49,11 +49,16 @@ echo "lsphp-apt-upgrade: base image lsphp${PHPVER}=$(dpkg-query -W -f='${Version
|
|||||||
|
|
||||||
# The candidate for lsphpNN must come from the LiteSpeed repo — not "none", and
|
# The candidate for lsphpNN must come from the LiteSpeed repo — not "none", and
|
||||||
# not merely whatever is already installed.
|
# not merely whatever is already installed.
|
||||||
if ! apt-cache madison "lsphp${PHPVER}" | grep -q 'rpms.litespeedtech.com'; then
|
# Read each output into a variable and match in the shell: piping into an
|
||||||
|
# early-exit reader (grep -q, awk ... exit) under pipefail can SIGPIPE the writer
|
||||||
|
# and report "missing" for a package that is there (scripts/tests/lsphp-info-probe.test.sh).
|
||||||
|
MADISON=$(apt-cache madison "lsphp${PHPVER}")
|
||||||
|
if [[ "$MADISON" != *rpms.litespeedtech.com* ]]; then
|
||||||
apt-cache policy "lsphp${PHPVER}" >&2 || true
|
apt-cache policy "lsphp${PHPVER}" >&2 || true
|
||||||
die "the LiteSpeed apt repo does not offer lsphp${PHPVER} (repo missing from sources, or its index is empty)."
|
die "the LiteSpeed apt repo does not offer lsphp${PHPVER} (repo missing from sources, or its index is empty)."
|
||||||
fi
|
fi
|
||||||
CAND=$(apt-cache policy "lsphp${PHPVER}" | awk '/Candidate:/ {print $2; exit}')
|
POLICY=$(apt-cache policy "lsphp${PHPVER}")
|
||||||
|
CAND=$(awk '/Candidate:/ {print $2; exit}' <<<"$POLICY")
|
||||||
echo "lsphp-apt-upgrade: repo candidate lsphp${PHPVER}=${CAND}"
|
echo "lsphp-apt-upgrade: repo candidate lsphp${PHPVER}=${CAND}"
|
||||||
|
|
||||||
if [ "$OS_UPGRADE" = 1 ]; then
|
if [ "$OS_UPGRADE" = 1 ]; then
|
||||||
|
|||||||
Reference in new issue
Block a user