Repository navigation
Fix libtiff license download blocked by GitLab Cloudflare challenge - #102
Open
Silvio Angelo (silvioangels) wants to merge 1 commit into
Open
Silvio Angelo (silvioangels) wants to merge 1 commit into
Silvio Angelo (silvioangels) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
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.
Summary
This PR fixes a failure in the Skill Recorder compliance preparation flow when retrieving the reviewed
libtiffCOPYRIGHTfile from GitLab.The current implementation retrieves the file through GitLab's web raw endpoint:
https://gitlab.com/libtiff/libtiff/-/raw//COPYRIGHT
In the environment where the issue was reproduced, automated requests to this endpoint consistently returned:
HTTP 403 Forbidden
Cf-Mitigated: challenge
Server: cloudflare
This caused
npm run compliance:licensesto fail during installation, even though the same resource was accessible through a browser.Root cause
The failure was isolated to GitLab's
/-/raw/web endpoint.During troubleshooting, the following behavior was reproduced:
COPYRIGHTfile was accessible through a browser.fetch()requests to the GitLab/-/raw/endpoint returned HTTP 403.curlrequests to the same endpoint also returned HTTP 403 withCf-Mitigated: challenge.COPYRIGHTfile.The GitLab API endpoint used is:
https://gitlab.com/api/v4/projects/libtiff%2Flibtiff/repository/files/COPYRIGHT/raw?ref=
Most importantly, the file returned by the GitLab API produced the exact SHA-256 already expected by Skill Recorder's reviewed compliance policy.
No reviewed hashes or compliance policy values were changed.
Solution
This change adds an optional
rawApiBaseto the libtiff source definition.When
rawApiBaseis available,buildTesseractNoticeSpecs()constructs the legal-material URL using GitLab's Repository Files API:https://gitlab.com/api/v4/projects/libtiff%2Flibtiff/repository/files//raw?ref=
Sources without
rawApiBasecontinue using the existingrawBasebehavior.This intentionally scopes the behavior change to libtiff while preserving the existing URL construction behavior for the other Tesseract dependencies.
Compliance and integrity
This change does not:
During troubleshooting, the
COPYRIGHTfile retrieved through the GitLab Repository Files API was verified against the existing reviewed SHA-256 and produced an exact match.The transport endpoint changes, but the reviewed material and its integrity validation remain unchanged.
Regression test
A regression test was added:
libtiff notice uses the GitLab repository files APIThe test verifies that:
gitlab.com/libtiff/libtiff/-/raw/endpoint.Compliance test results:
Validation performed
The change was validated using Node.js 24.22.1.
The following validation was performed:
Lockfile validation
npm run check:lockfileCompleted successfully.
Dependency installation
npm ciCompleted successfully.
Reviewed Electron setup
npm run electron:install-reviewedCompleted successfully.
Compliance tests
node --test scripts/compliance.test.mjsResult:
The new regression test passed successfully:
libtiff notice uses the GitLab repository files APICompliance preparation
npm run compliance:licensesCompleted successfully and prepared the compliance material without reproducing the previous GitLab HTTP 403 failure.
Build
npm run buildCompleted successfully.
Runtime validation
npm startSuccessfully launched Skill Recorder from the modified source tree.
The application reached the recording UI successfully.
Why use the GitLab Repository Files API?
The GitLab Repository Files API provides an official programmatic endpoint for retrieving repository files and, in this case, does not trigger the Cloudflare challenge encountered by automated clients using the web
/-/raw/endpoint.Because Skill Recorder continues to verify the retrieved legal material against the existing reviewed SHA-256, changing the retrieval endpoint does not change the trusted compliance artifact.
Scope
The change is intentionally limited to libtiff.
Other Tesseract source definitions continue using their existing
rawBaseURLs unchanged.No reviewed hashes or compliance-policy values are modified by this PR.