Compare commits

...
Author SHA1 Message Date
shadowdaoandClaude Sonnet 5.5 47fef38052 install-php86: keep geoip (Remi php-rlerdorf-geoip provides php-pecl-geoip on 8.6); fix grep pipe
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 11:37:57 -08:00
shadowdaoandClaude Sonnet 5.5 854042b1c3 feat: PHP 8.6 for cac and cac-fpm (Remi php:remi-8.6), per-family version lists in plan-legs
install-php86.sh = install-php85.sh minus php-pecl-geoip (no 8.6 build), fail-loud with
extension assertion. plan-legs.sh: per-family lists so cac/cac-fpm get 82-86 while
cac-litespeed/cac-lsphp stay 82-85 (no lsphp86). :latest stays on php85. ini files are
shared (single prod-php.ini), so 8.5 hardening incl. session.use_strict_mode=0 applies unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 11:32:25 -08:00
jknapp e6e3f1fd48 Merge pull request #45 re-pin LSAPI [skip ci]
[skip ci]
2026-11-19 17:54:45 +00:00
5 changed files with 60 additions and 19 deletions

No files matched your search

+15 -6
View File
@@ -7,8 +7,9 @@
## GITHUB_OUTPUT file the outputs are appended to (set by the runner). ## GITHUB_OUTPUT file the outputs are appended to (set by the runner).
## ##
## ONLY is a comma list of tokens (spaces ignored): ## ONLY is a comma list of tokens (spaces ignored):
## cac:php85 cac-fpm:php84 cac-litespeed:php83 cac-lsphp:php82 one leg ## cac:php86 cac-fpm:php84 cac-litespeed:php83 cac-lsphp:php82 one leg
## cac | cac-fpm | cac-litespeed | cac-lsphp every PHP version of that image ## cac | cac-fpm | cac-litespeed | cac-lsphp every PHP version of that image
## (php86 exists for cac and cac-fpm only; lsphp86 does not exist yet)
## shared-httpd | shared-ols that image ## shared-httpd | shared-ols that image
## Any other token is an error (exit 2, nothing is written): a typo must fail ## Any other token is an error (exit 2, nothing is written): a typo must fail
## the plan job loudly, never silently build nothing. ## the plan job loudly, never silently build nothing.
@@ -20,7 +21,15 @@ set -euo pipefail
MATRIX_FAMILIES=(cac cac-fpm cac-litespeed cac-lsphp) MATRIX_FAMILIES=(cac cac-fpm cac-litespeed cac-lsphp)
SINGLE_FAMILIES=(shared-httpd shared-ols) SINGLE_FAMILIES=(shared-httpd shared-ols)
ALL_PHPVER=(82 83 84 85) # PHP versions per family. cac/cac-fpm (AlmaLinux + Remi) also ship 8.6; the
# LiteSpeed families have no lsphp86 package yet, so they stay on 82..85 (a
# shared list would make every trunk push build, and fail, litespeed/lsphp php86).
declare -A FAM_PHPVER=(
[cac]="82 83 84 85 86"
[cac-fpm]="82 83 84 85 86"
[cac-litespeed]="82 83 84 85"
[cac-lsphp]="82 83 84 85"
)
die() { echo "plan-legs: $*" >&2; exit 2; } die() { echo "plan-legs: $*" >&2; exit 2; }
@@ -46,11 +55,11 @@ else
fi fi
if [[ " ${MATRIX_FAMILIES[*]} " == *" $fam "* ]]; then if [[ " ${MATRIX_FAMILIES[*]} " == *" $fam "* ]]; then
if [ -z "$ver" ]; then if [ -z "$ver" ]; then
for v in "${ALL_PHPVER[@]}"; do want_ver["$fam:$v"]=1; done for v in ${FAM_PHPVER[$fam]}; do want_ver["$fam:$v"]=1; done
elif [[ "$ver" =~ ^php(8[2-5])$ ]]; then elif [[ "$ver" =~ ^php(8[2-6])$ ]] && [[ " ${FAM_PHPVER[$fam]} " == *" ${BASH_REMATCH[1]} "* ]]; then
want_ver["$fam:${BASH_REMATCH[1]}"]=1 want_ver["$fam:${BASH_REMATCH[1]}"]=1
else else
die "unknown PHP version in '$t' (want ${fam}:php82 .. ${fam}:php85)" die "unknown PHP version in '$t' (${fam} has: ${FAM_PHPVER[$fam]// /, })"
fi fi
elif [[ " ${SINGLE_FAMILIES[*]} " == *" $fam "* ]]; then elif [[ " ${SINGLE_FAMILIES[*]} " == *" $fam "* ]]; then
[ "$fam" = "$t" ] || die "'$t': $fam has a single leg, use plain '$fam'" [ "$fam" = "$t" ] || die "'$t': $fam has a single leg, use plain '$fam'"
@@ -64,7 +73,7 @@ fi
matrix_json() { # family matrix_json() { # family
local fam=$1 v out="" local fam=$1 v out=""
for v in "${ALL_PHPVER[@]}"; do for v in ${FAM_PHPVER[$fam]}; do
if $want_all || [ -n "${want_ver["$fam:$v"]-}" ]; then out+="${out:+,}$v"; fi if $want_all || [ -n "${want_ver["$fam:$v"]-}" ]; then out+="${out:+,}$v"; fi
done done
printf '[%s]' "$out" printf '[%s]' "$out"
+3 -3
View File
@@ -2,7 +2,7 @@ name: Cloud Apache Container
run-name: ${{ gitea.actor }} pushed a change to trunk run-name: ${{ gitea.actor }} pushed a change to trunk
# Manual run. `only` (optional) rebuilds just the named legs instead of every # Manual run. `only` (optional) rebuilds just the named legs instead of every
# image: Gitea cannot re-run a single job and a full run takes ~1h. # image: Gitea cannot re-run a single job and a full run takes ~1h.
# Syntax: comma list of cac:php85, cac-fpm:php84, cac-litespeed:php83, # Syntax: comma list of cac:php86, cac-fpm:php84, cac-litespeed:php83,
# cac-lsphp:php82, shared-httpd, shared-ols; a bare family name (cac) = all its # cac-lsphp:php82, shared-httpd, shared-ols; a bare family name (cac) = all its
# PHP versions. Empty = everything (same as a push). Unknown values fail the # PHP versions. Empty = everything (same as a push). Unknown values fail the
# plan job. See .gitea/scripts/plan-legs.sh. # plan job. See .gitea/scripts/plan-legs.sh.
@@ -302,7 +302,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
tags=(--tag "php${PHPVER}") tags=(--tag "php${PHPVER}")
# :latest tracks php85 (unchanged tag scheme). # :latest tracks php85 (unchanged tag scheme; php86 is a new tag, NOT latest).
[ "$PHPVER" = 85 ] && tags+=(--tag latest) [ "$PHPVER" = 85 ] && tags+=(--tag latest)
scripts/assemble-multiarch-index.sh \ scripts/assemble-multiarch-index.sh \
--amd64 "$AMD64_DIGEST" \ --amd64 "$AMD64_DIGEST" \
@@ -471,7 +471,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
tags=(--tag "php${PHPVER}") tags=(--tag "php${PHPVER}")
# :latest tracks php85 (unchanged tag scheme). # :latest tracks php85 (unchanged tag scheme; php86 is a new tag, NOT latest).
[ "$PHPVER" = 85 ] && tags+=(--tag latest) [ "$PHPVER" = 85 ] && tags+=(--tag latest)
scripts/assemble-multiarch-index.sh \ scripts/assemble-multiarch-index.sh \
--amd64 "$AMD64_DIGEST" \ --amd64 "$AMD64_DIGEST" \
+3 -3
View File
@@ -1,6 +1,6 @@
# Cloud Apache Container # Cloud Apache Container
This is a base container for running PHP-based applications, supporting multiple PHP versions (7.4, 8.0, 8.1, 8.2, 8.3, 8.4). The default is PHP 8.3. The container is based on AlmaLinux 9 and uses Apache with mod_ssl. It is designed for both development and production use. This is a base container for running PHP-based applications, supporting multiple PHP versions (7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6; 8.6 is cac and cac-fpm only, no LiteSpeed lsphp86 yet). The default is PHP 8.3. The container is based on AlmaLinux 9 and uses Apache with mod_ssl. It is designed for both development and production use.
**You must have Docker or compatible containerization software running.** **You must have Docker or compatible containerization software running.**
@@ -29,7 +29,7 @@ The easiest way to start a local development environment is with the provided `l
- `-p` HTTP port (default: 80) - `-p` HTTP port (default: 80)
- `-s` HTTPS port (default: 443) - `-s` HTTPS port (default: 443)
- `-r` Root path for files and database (default: current directory) - `-r` Root path for files and database (default: current directory)
- `-a` PHP version (default: 8.3; options: 74, 80, 81, 82, 83, 84) - `-a` PHP version (default: 8.3; options: 74, 80, 81, 82, 83, 84, 85, 86)
- `-v` Enable verbose mode - `-v` Enable verbose mode
- `-h` Show help - `-h` Show help
@@ -86,7 +86,7 @@ Then visit https://localhost (accept the SSL warning) to complete setup.
## Features ## Features
- **Multiple PHP Versions:** 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 (set with `PHPVER` or `-a` flag) - **Multiple PHP Versions:** 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6 (8.6: cac and cac-fpm only) (set with `PHPVER` or `-a` flag)
- **Pre-built Images:** Pull the image for your desired PHP version directly from the registry. No need to build locally unless customizing. - **Pre-built Images:** Pull the image for your desired PHP version directly from the registry. No need to build locally unless customizing.
- **Optimized Build:** Smaller, faster, and more secure images thanks to the improved Dockerfile and `.dockerignore`. - **Optimized Build:** Smaller, faster, and more secure images thanks to the improved Dockerfile and `.dockerignore`.
- **Automatic Database Setup:** MariaDB is started in DEV mode, credentials are auto-generated and stored in `/home/$user/mysql_creds`. - **Automatic Database Setup:** MariaDB is started in DEV mode, credentials are auto-generated and stored in `/home/$user/mysql_creds`.
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# PHP 8.6 (Remi EL10 modular php:remi-8.6). Same package set as install-php85.sh.
# php-pecl-geoip is provided on 8.6 by Remi's maintained fork php-rlerdorf-geoip.
# Fails loudly (set -e) instead of the older scripts' "exit 0".
set -euo pipefail
dnf module enable php:remi-8.6 -y
dnf install -y php php-fpm php-mysqlnd php-xml php-pecl-zip php-sodium php-soap php-pecl-xmlrpc \
php-pecl-redis5 php-pecl-memcached php-pecl-memcache php-pecl-ip2location php-pecl-imagick php-pecl-geoip \
php-mysqlnd php-mbstring php-intl php-gd php-pgsql libzip php-cli
# A silently missing extension must fail the build, not ship.
loaded=$(php -m)
for ext in mysqlnd gd intl soap sodium zip mbstring xml pgsql redis memcached memcache imagick ip2location xmlrpc geoip; do
grep -qix "$ext" <<<"$loaded" || { echo "FATAL: PHP 8.6 extension '$ext' not loaded" >&2; exit 1; }
done
exit 0
+24 -7
View File
@@ -136,7 +136,7 @@ class Wiring(unittest.TestCase):
st = step(self.jobs[j], 'Assemble') st = step(self.jobs[j], 'Assemble')
script = re.search(r'run: \|\n((?: .*\n?)+)', st).group(1) script = re.search(r'run: \|\n((?: .*\n?)+)', st).group(1)
script = '\n'.join(l[10:] for l in script.split('\n')) script = '\n'.join(l[10:] for l in script.split('\n'))
for ver in (['82', '83', '84', '85'] if matrix else ['']): for ver in (['82', '83', '84', '85', '86'] if matrix else ['']):
with tempfile.TemporaryDirectory() as d: with tempfile.TemporaryDirectory() as d:
os.makedirs(os.path.join(d, 'scripts')) os.makedirs(os.path.join(d, 'scripts'))
stub = os.path.join(d, 'scripts', 'assemble-multiarch-index.sh') stub = os.path.join(d, 'scripts', 'assemble-multiarch-index.sh')
@@ -171,7 +171,8 @@ class Wiring(unittest.TestCase):
# ---- single-leg dispatch (workflow_dispatch input `only`, plan job) ---------------------- # ---- single-leg dispatch (workflow_dispatch input `only`, plan job) ----------------------
PLAN = os.path.join(ROOT, '.gitea', 'scripts', 'plan-legs.sh') PLAN = os.path.join(ROOT, '.gitea', 'scripts', 'plan-legs.sh')
FULL = '[82,83,84,85]' FULL = '[82,83,84,85]' # LiteSpeed families
FULL86 = '[82,83,84,85,86]' # cac / cac-fpm (Remi) also ship 8.6
# image job -> (plan output, matrix?) # image job -> (plan output, matrix?)
LEGS = { LEGS = {
'Build-and-Push': ('cac', True), 'Build-and-Push': ('cac', True),
@@ -183,7 +184,7 @@ LEGS = {
} }
EMPTY = {'cac': '[]', 'cac_fpm': '[]', 'cac_litespeed': '[]', 'cac_lsphp': '[]', EMPTY = {'cac': '[]', 'cac_fpm': '[]', 'cac_litespeed': '[]', 'cac_lsphp': '[]',
'shared_httpd': 'false', 'shared_ols': 'false'} 'shared_httpd': 'false', 'shared_ols': 'false'}
EVERYTHING = {'cac': FULL, 'cac_fpm': FULL, 'cac_litespeed': FULL, 'cac_lsphp': FULL, EVERYTHING = {'cac': FULL86, 'cac_fpm': FULL86, 'cac_litespeed': FULL, 'cac_lsphp': FULL,
'shared_httpd': 'true', 'shared_ols': 'true'} 'shared_httpd': 'true', 'shared_ols': 'true'}
@@ -262,9 +263,11 @@ class SingleLegDispatch(unittest.TestCase):
self.assertEqual((rc, kv), (0, EVERYTHING), (only, err)) self.assertEqual((rc, kv), (0, EVERYTHING), (only, err))
def test_full_matrix_equals_the_old_literal(self): def test_full_matrix_equals_the_old_literal(self):
# the pre-change matrix was `phpver: [82, 83, 84, 85]` # the pre-86 matrix was `phpver: [82, 83, 84, 85]`; the LiteSpeed families keep it
rc, kv, _ = plan(None) rc, kv, _ = plan(None)
self.assertEqual([int(x) for x in kv['cac'].strip('[]').split(',')], [82, 83, 84, 85]) self.assertEqual([int(x) for x in kv['cac'].strip('[]').split(',')], [82, 83, 84, 85, 86])
for fam in ('cac_litespeed', 'cac_lsphp'):
self.assertEqual([int(x) for x in kv[fam].strip('[]').split(',')], [82, 83, 84, 85], fam)
def test_single_leg(self): def test_single_leg(self):
rc, kv, _ = plan('cac:php85') rc, kv, _ = plan('cac:php85')
@@ -287,7 +290,21 @@ class SingleLegDispatch(unittest.TestCase):
def test_family_name_means_every_version(self): def test_family_name_means_every_version(self):
rc, kv, _ = plan('cac-fpm') rc, kv, _ = plan('cac-fpm')
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_fpm=FULL))) self.assertEqual((rc, kv), (0, dict(EMPTY, cac_fpm=FULL86)))
rc, kv, _ = plan('cac-lsphp')
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_lsphp=FULL)))
rc, kv, _ = plan('cac-litespeed')
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_litespeed=FULL)))
def test_php86_only_for_remi_families(self):
rc, kv, _ = plan('cac:php86')
self.assertEqual((rc, kv), (0, dict(EMPTY, cac='[86]')))
rc, kv, _ = plan('cac-fpm:php86')
self.assertEqual((rc, kv), (0, dict(EMPTY, cac_fpm='[86]')))
for fam in ('cac-litespeed', 'cac-lsphp'):
rc, kv, err = plan(fam + ':php86')
self.assertEqual((rc, kv), (2, {}), fam)
self.assertIn('plan-legs:', err)
def test_comma_list_spaces_duplicates_and_ordering(self): def test_comma_list_spaces_duplicates_and_ordering(self):
rc, kv, _ = plan(' cac:php85 , cac:php82,cac:php85, shared-httpd ,') rc, kv, _ = plan(' cac:php85 , cac:php82,cac:php85, shared-httpd ,')
@@ -296,7 +313,7 @@ class SingleLegDispatch(unittest.TestCase):
self.assertEqual((rc, kv), (0, dict(EMPTY, cac='[85]', cac_fpm='[84]'))) self.assertEqual((rc, kv), (0, dict(EMPTY, cac='[85]', cac_fpm='[84]')))
def test_unknown_values_fail_loudly_and_emit_nothing(self): def test_unknown_values_fail_loudly_and_emit_nothing(self):
bad = ['foo', 'cac:php99', 'cac:85', 'cac:php8', 'CAC:php85', 'cac:', 'cac:php85:x', 'php85', bad = ['foo', 'cac:php99', 'cac:php87', 'cac-lsphp:php86', 'cac-litespeed:php86', 'cac:85', 'cac:php8', 'CAC:php85', 'cac:', 'cac:php85:x', 'php85',
'shared-httpd:php85', 'shared-ols:latest', ',', ' , ', 'cac:php85,nope', 'shared-httpd:php85', 'shared-ols:latest', ',', ' , ', 'cac:php85,nope',
'cac:php85;rm -rf x', '$(id)', 'all', 'latest'] 'cac:php85;rm -rf x', '$(id)', 'all', 'latest']
for only in bad: for only in bad: