Skip to content

CI: verify the SHA-256 of the Joomla package before installing it - #242

Open
codeling wants to merge 1 commit into
mainfrom
verify-joomla-download
Open

codeling wants to merge 1 commit into
mainfrom
verify-joomla-download

Conversation

@codeling

Copy link
Copy Markdown
Owner

Why

tests/ci/install-joomla.sh piped the Joomla full package from the GitHub release straight into tar. Everything the integration tests then run (Joomla, plus plugin and component installed into it) starts from that download, so it should be the package that was checked, not whatever the network - or a replaced release asset - delivers.

Change

  • tests/ci/joomla-checksums.sha256: the SHA-256 of the packages in the CI matrix (5.4.8, 6.1.3).
  • tests/ci/download-joomla.sh VERSION TARGET: downloads the package, compares its SHA-256 and unpacks only on a match. A version that is not listed fails immediately, before downloading, with a hint on how to add it (JOOMLA_SHA256 can supply a hash for trying a version locally). install-joomla.sh uses it; the com_bfstop workflow installs through this script as well.
  • tests/lint/check-joomla-checksums.php, run by the lint job, checks the file's format and that every Joomla version of the matrix in ci.yml has an entry, so raising a version without a checksum fails the cheap lint job with a clear message instead of every integration job.

How the checksums were established

  • 5.4.8: the MD5 and SHA1 of my download equal those that downloads.joomla.org lists for the 5.4.8 full package (e7ce8043..., bdb3752f...; Joomla's page lists no SHA-256, so the SHA-256 is computed from that same file).
  • 6.1.3: I could not consult Joomla's page for it from my environment, so this one is the hash of the GitHub release asset only (trust on first use). The file says so; please compare it with https://downloads.joomla.org/cms/joomla6/6-1-3 (MD5/SHA1) when you merge.

Tested

  • download-joomla.sh: valid package unpacks; a wrong hash exits 1 and unpacks nothing; an unlisted version fails before downloading; JOOMLA_SHA256 with the right hash is accepted.
  • The whole install-joomla.sh on a fresh directory and database with Joomla 6.1.3 (and earlier with 5.4.8, through the same script): installs, plugin and component install.
  • The lint exits 1 when the matrix has a version without checksum.

The runs of this PR exercise the new path on all six database/Joomla combinations.


Generated by Claude Code

The integration tests install and run the Joomla full package they download
from the GitHub release. tests/ci/download-joomla.sh now compares its SHA-256
with tests/ci/joomla-checksums.sha256 and unpacks nothing on a mismatch (or if
the version is not listed). 5.4.8's MD5/SHA1 were checked against
downloads.joomla.org; 6.1.3's checksum is from the release asset and says so.
tests/lint/check-joomla-checksums.php, run by the lint job, makes sure every
version of the CI matrix has an entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhhhdjhErC9ZiaS4HyRjsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants