site: same-origin avatars + dl.reasonix.io downloads (mainland access)#3923
Merged
Conversation
…nto the build Mainland-China visitors hit two walls on the new site: the contributor wall loads 40+ images from avatars.githubusercontent.com (blocked there), and downloads went through the rate-limited pub-*.r2.dev dev subdomain. - a prebuild script now fetches community stats and downloads every contributor avatar into public/av/, so the wall is served same-origin with zero third-party requests; any avatar that fails to fetch falls back to its remote URL, and the whole script degrades to the committed snapshot rather than failing the build - download links and the runtime version check now use the R2 bucket's custom domain dl.reasonix.io (Cloudflare-cached, range requests verified) instead of pub-*.r2.dev
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.
Two fixes for mainland-China access (and a general perf win everywhere):
Contributor avatars baked into the build. The community wall loaded 40+ images from
avatars.githubusercontent.com, which is blocked in mainland China — visitors there saw a wall of broken images. Aprebuildscript now fetches the contributor list / stars / merged-PR count and downloads every avatar intopublic/av/, so the wall is served same-origin from reasonix.io with zero third-party requests. Failure handling: an avatar that fails to download keeps its remote URL, and the whole script degrades to the committed snapshot instead of ever failing the build.Downloads on the R2 custom domain. Desktop download links and the runtime version check move from the rate-limited
pub-*.r2.devdev subdomain to the bucket's custom domaindl.reasonix.io. Verified live before switching: all three artifacts return 200 through Cloudflare and range requests return 206, so resumable downloads work.public/av/is build output and gitignored. The pages workflow already passesGITHUB_TOKENinto the build, which the prebuild script picks up to avoid anonymous rate limits.Verified with a clean local build: 44/44 avatars baked, zero
avatars.githubusercontent.com/r2.devreferences left in the built HTML/JS.