Make installing the proxy from a repository archive the documented way - #108
Merged
Merged
Conversation
sgiehl
force-pushed
the
make-install-method-safe
branch
from
August 17, 2026 09:10
41aba21 to
3a8f417
Compare
A repository checkout contains a lot that an installation does not need: the test suite, the CI configuration, coding standard rules and the git metadata itself. Installing from an archive instead keeps the installed directory to the files the proxy actually consists of. - mark the development-only files as export-ignore, so `git archive` output and the source archives GitHub attaches to releases contain only the files that belong in a web root - document the source archive as the way to install the proxy, and move the clone instructions to the contributing section - run the tests/server/ stand-in only for the test configuration it belongs to, give its non-image responses an explicit content type, and cover that with a test
sgiehl
force-pushed
the
make-install-method-safe
branch
from
August 17, 2026 09:23
3a8f417 to
c12a81b
Compare
tzi
reviewed
Aug 17, 2026
tzi
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The README documents
git cloneas one of the installation methods. A checkout contains a lot that an installation does not need — the test suite, the CI configuration, the coding standard rules and the git metadata itself — and none of that belongs in a public web root. Installing from an archive keeps the installed directory to the files the proxy actually consists of.What
.gitattributes:export-ignorefortests/,.github/,phpcs.xml,.editorconfig,.gitignore,.gitattributes,.php-versionandcomposer.lock.git archiveoutput — and the source archives GitHub attaches to releases and serves from/archive/— then contain onlyLICENSE,README.md,composer.json,config.php.example, the four entry points andplugins/HeatmapSessionRecording/configs.php.composer.jsonis kept deliberately: dropping it would break Composer-based consumption and it only lists dependency names.curl … | tar xz --strip-components=1recipe and an update instruction noting thatconfig.phpis not part of the archive and is left untouched, while extracting over an existing installation never removes files. The clone instructions move to the contributing section as a development checkout, and the installation section points installations that contain atests/directory at cleaning it up.tests/server/matomo.php: this stand-in for a Matomo server is only meaningful together with the test configuration, so it now runs only when the loaded config points attests/server/and returns403otherwise — the same gate.github/config.phpalready uses for its test-only header hooks. Its non-image responses also get an explicittext/plaincontent type plusnosniffinstead of falling back to whatever the web server assumes. A new test covers the refusal, via a newX-Test-Non-Test-Confighook in the test configuration.Notes
export-ignoreonly affects archives generated after this is merged, so the archives of the existing tags still contain the development files. The README therefore points at themasterarchive, which is clean as soon as this lands. Once a tag is cut on top of this, the README can document the tagged archive as the primary download.config.phpis kept in sync with.github/config.phpby hand; that duplication predates this PR, but is worth replacing with a pointer at some point.Tests
vendor/bin/phpunit -c tests/phpunit.xml.dist— 95 passed, 254 assertions, including the new one. Verified that the new test fails when the check intests/server/matomo.phpis removed, and thatgit archiveoutput matches the file list above.vendor/bin/phpcsis clean.