Repository navigation
fix: pin plugin and theme sources and clone them as www-data - #45
Conversation
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
vitormattos
left a comment
There was a problem hiding this comment.
Renovate is already configured in renovate.json, but its only custom manager currently tracks WORDPRESS_BASE_IMAGE in the Docker publishing workflow. The new version, ref, and sha256 fields introduced here are not covered.
Could we extend the existing Renovate configuration to track real, version-controlled plugin and theme declarations, and validate dependency detection and update proposals with a dry run? WordPress.org plugin versions and Git tags/refs need appropriate data sources; archive URLs and SHA-256 values must only be updated together when a trustworthy checksum is available.
The values in the README and Bats tests are examples/fixtures and should not be treated as production dependencies. Since WORDPRESS_SETUP_CONFIG_YAML can be supplied externally, please also clarify where the actual dependency declarations will live and how Renovate can access them. Otherwise, adding a manager that only detects example values would not solve the maintenance problem.
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
|
On Renovate: I didn't add a manager here, since this repository only has example values, as you pointed out. The real declarations live in Now that this is merged, LibreSign/saas#39 moves those two entries to |
The setup YAML could only point at moving targets:
wordpress_custom_pluginsandwordpress_custom_themeswere cloned from the default branch,wordpress_archive_pluginsinstalled whatever the URL returned andwordpress_org_pluginstook the latest release. Nothing recorded or checked what ended up inwp-content, and the clone ran as root.Changes
wordpress_custom_pluginsandwordpress_custom_themesaccept an optionalref. The repository is cloned aswww-data, the ref is fetched from the configuredsourceand checked out detached. Only a full commit SHA counts as a pin:HEADis verified, a plugin that does not match is not activated, and an existing checkout at another commit is moved to it. A tag or branch is still checked out and followed on every start, but it is reported as movable, since it can point to another commit without any change to the configuration.wordpress_archive_pluginsacceptssha256: the archive is downloaded, checked and installed from the local file, and a mismatch skips the plugin. The checksum is recorded in.archive-sha256inside the plugin folder (dotfiles are denied by nginx), so changingsha256reinstalls the plugin from the new archive on the next start.wordpress_org_pluginsaccepts a mapping withslugandversion; an installed plugin at another version is reinstalled at the pinned one. Plain slugs keep working.refis not a commit SHA, are reported in the log.WORDPRESS_SETUP_REQUIRE_PINNED=1skips them instead (passed throughcommon-services.yml, default0).ref: <sha> # vX.Y.Z, and explains that pins belong to the project that suppliesWORDPRESS_SETUP_CONFIG_YAML, which keeps them up to date (for example with Renovate). The values in the README and in the tests are only examples.Tests
tests/security/pinned-setup-sources.batsruns the real entrypoint in the published image with a stubbedwpand local Git and archive sources: commit pins, a commit that cannot be fetched, moving an existing checkout, a pinned theme, a tag that moves between two starts, tags and commits underWORDPRESS_SETUP_REQUIRE_PINNED=1, the unpinned warning and skip, a pinned wordpress.org version, archives with a matching and a wrong checksum, and an archive whose checksum changes across starts. 11 of the 13 cases fail onmain; the two that pass there only check that nothing is installed or activated.bats tests/security: 62/62; ShellCheck clean.On a fresh stack with WooCommerce and
WORDPRESS_SETUP_REQUIRE_PINNED=1: a GitHub plugin pinned to a commit is cloned at that commit, owned bywww-dataand activated, an unpinned one is skipped, WooCommerce pinned to the installed version is left alone, and login, wp-admin,/wp-json/,wp-cron.php, checkout and My Account keep working.