Merged
Conversation
Adds idempotent macOS DNS override installer for archive.today and mirrors, plus GitHub Actions workflows for CI and automated mirror list maintenance. - install.sh: idempotent script that writes /etc/resolver files (primary resolver + symlinks), tracks managed entries via manifest, removes stale entries, flushes DNS cache. Supports --update-mirrors (fetches live mirror list from Wikipedia API, no root needed), --dry-run, --uninstall, --no-fetch, --nameserver, --yes. - mirrors.txt: domain list sourced from Wikipedia; first entry is the primary (gets a resolver file), rest become symlinks to it. - .github/workflows/ci.yml: ShellCheck lint, bash syntax check, mirrors.txt format validation on every push/PR. - .github/workflows/release.yml: creates GitHub release on vX.Y.Z tags; verifies tag matches SCRIPT_VERSION in install.sh. - .github/workflows/update-mirrors.yml: runs first Monday of each month, diffs Wikipedia mirror list against mirrors.txt, opens a PR if the set has changed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DIFF_SUMMARY was computed in the 'Create pull request' step by diffing mirrors.txt against /tmp/ordered_domains.txt — but mirrors.txt had already been overwritten with the new content, so the diff was always empty and the PR body always read 'See diff'. Fix: capture the diff as a step output in the 'check' step (before the overwrite), then reference it via steps.check.outputs.diff_summary in the 'Create pull request' step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
export on a bash array only serialises element [0] to child processes;
relying on an implicit global inside a $() subshell is fragile and
misleading. Instead, pass both arrays as positional arguments using a
"--" delimiter, and parse them inside the function.
Also guard against the empty-manifest edge case: when no manifest file
exists yet, "${MANIFEST_DOMAINS[@]:-}" expands to a single empty string,
which was being treated as a domain to remove. Skip empty entries.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Adds the full project scaffold: installation script, mirror list, and GitHub Actions workflows.
What's included
install.sh— idempotent macOS DNS override installer/etc/resolver/archive.todaywith the configured nameserver--update-mirrorsfetches the current mirror list from the Wikipedia API (no root needed)--dry-run,--uninstall,--no-fetch,--nameserver,--yesmirrors.txt— domain list parsed from the Archive.today Wikipedia article; first entry is the primary.github/workflows/ci.yml— ShellCheck, bash syntax, and mirrors.txt format validation on every push/PR.github/workflows/release.yml— creates a GitHub release onvX.Y.Ztags; verifies the tag matchesSCRIPT_VERSIONininstall.sh.github/workflows/update-mirrors.yml— runs the first Monday of each month; diffs the Wikipedia mirror list againstmirrors.txtand opens a PR if the set has changedNotes
--update-mirrorsextracts domains from<li>archive.TLD</li>elements in the Wikipedia infobox (precise; avoids false positives likearchive.org)