Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ USER root
RUN apk add --no-cache nodejs npm \
&& npm install -g --force yarn pnpm \
&& npm cache clean --force \
&& rm -rf /var/cache/apk/* /root/.npm
&& rm -rf /var/cache/apk/* /root/.npm /home/www-data/.npm

# Plain tool image: drop the inherited php-fpm entrypoint so the image just runs
# the command it is given (composer / npm / bash -c '...').
Expand Down
5 changes: 5 additions & 0 deletions ols-structure-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@ commandTests:
command: "php"
args: ["-r", "echo ini_get('session.upload_progress.enabled') ? 'upload_progress=on' : 'upload_progress=off';"]
expectedOutput: ["upload_progress=off"]

fileContentTests:
- name: "Entrypoint creates the WP-CLI and Composer home dirs on every start"
path: "/entrypoint.sh"
expectedContents: ["mkdir -p /var/www/.wp-cli/cache /var/www/.composer", "chown -R www-data:www-data /var/www/.wp-cli /var/www/.composer"]
4 changes: 4 additions & 0 deletions openlitespeed/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ echo "setting GID to $PGID and UID to $PUID"
groupmod -g $PGID www-data
usermod -u $PUID www-data

# Home dirs for WP-CLI and Composer
mkdir -p /var/www/.wp-cli/cache /var/www/.composer || echo "Warning: could not create the WP-CLI and Composer home dirs"
chown -R www-data:www-data /var/www/.wp-cli /var/www/.composer || echo "Warning: could not chown the WP-CLI and Composer home dirs"

# Ensure correct permissions
chown -R www-data:www-data /var/www/html
chown www-data:www-data /var/lib/php/sessions
Expand Down
15 changes: 15 additions & 0 deletions php-structure-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,26 @@ commandTests:
args: ["-version"]
expectedOutput: ["ImageMagick"]

- name: "HOME is world-writable (compose runs the image as any host uid)"
command: "stat"
args: ["-c", "%a", "/home/www-data"]
expectedOutput: ["1777"]

- name: "WP-CLI home dir is writable"
command: "sh"
args: ["-c", "test -w \"$HOME/.wp-cli\" && echo wpcli-home-writable"]
expectedOutput: ["wpcli-home-writable"]

- name: "Session upload progress is disabled (CVE-2026-109619)"
command: "php"
args: ["-r", "echo ini_get('session.upload_progress.enabled') ? 'upload_progress=on' : 'upload_progress=off';"]
expectedOutput: ["upload_progress=off"]

metadataTest:
envVars:
- key: "HOME"
value: "/home/www-data"

fileContentTests:
- name: "FPM pool locks session upload progress off"
path: "/usr/local/etc/php-fpm.d/zz-security.conf"
Expand Down
6 changes: 6 additions & 0 deletions php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Set pager for WP-CLI
ENV PAGER=less

# Writable home for WP-CLI and Composer, for any uid
RUN mkdir -p /home/www-data/.wp-cli /home/www-data/.composer \
&& chmod 1777 /home/www-data \
&& chmod -R a+rwX /home/www-data/.wp-cli /home/www-data/.composer
ENV HOME=/home/www-data

# Volume and User settings
VOLUME /var/www/html

Expand Down
Loading