From 1ecc824472d4d63261f46e6e6dbf59f023b8626e Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Wed, 13 May 2026 23:46:32 -0300 Subject: [PATCH 1/2] Fix plugin post-install commands to run as www-data Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .docker/wordpress/entrypoint.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.docker/wordpress/entrypoint.sh b/.docker/wordpress/entrypoint.sh index 9a78648..cf595b4 100644 --- a/.docker/wordpress/entrypoint.sh +++ b/.docker/wordpress/entrypoint.sh @@ -195,10 +195,7 @@ run_custom_plugin_post_install_commands() { continue fi - ( - cd /var/www/html - bash -lc "export PLUGIN_DIR='$plugin_dir'; $command" - ) + runuser -u www-data -- bash -lc "cd /var/www/html && export PLUGIN_DIR='$plugin_dir'; $command" done < <(printf '%s' "$entry" | base64 -d | yq -r '.post_install_commands[]?') } From 7d6cdb470a61efb8f82df23fb19fbdd1df5d563e Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Wed, 13 May 2026 23:50:44 -0300 Subject: [PATCH 2/2] docs: remove --allow-root from post-install examples Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cd9958d..6a2c80f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ services: # Plugins cloned from a Git repository. # Optional: post_install_commands — list of shell commands run after cloning # (and on every container start if the plugin directory already exists). - # Commands run from the WordPress root (/var/www/html) with --allow-root. + # Commands run as www-data from the WordPress root (/var/www/html). # The env var PLUGIN_DIR is set to the absolute plugin directory path. wordpress_custom_plugins: - slug: my-plugin @@ -63,7 +63,7 @@ services: source: https://github.com/org/my-plugin-with-fixup.git post_install_commands: - ln -sfn real-dir "$$PLUGIN_DIR/expected-dir" - - wp --allow-root option update my_plugin_option value + - wp option update my_plugin_option value # Themes cloned from a Git repository. wordpress_custom_themes: @@ -120,10 +120,10 @@ To route WordPress mail through mailpit, install the [wp-simple-smtp](https://gi - slug: wp-simple-smtp source: https://github.com/LibreCodeCoop/wp-simple-smtp.git post_install_commands: - - wp --allow-root option update smtp_host mailpit - - wp --allow-root option update smtp_port 1025 - - wp --allow-root option update smtp_auth 0 - - wp --allow-root option update smtp_secure '' + - wp option update smtp_host mailpit + - wp option update smtp_port 1025 + - wp option update smtp_auth 0 + - wp option update smtp_secure '' ``` mailpit's SMTP port inside the Docker network is **1025**; the web UI is exposed on host port **8025**.