From 7997b4e12263652a2d551f7980dbc5eb56914d3a Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 4 Jun 2026 20:39:39 +0000 Subject: [PATCH 1/2] Add lychee link checker config and CI workflow Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/links.yml | 32 ++++++++++++++++++++++ .gitignore | 1 + lychee.toml | 54 +++++++++++++++++++++++++++++++++++++ mise.lock | 29 ++++++++++++++++++++ mise.toml | 9 +++++++ 5 files changed, 125 insertions(+) create mode 100644 .github/workflows/links.yml create mode 100644 lychee.toml create mode 100644 mise.lock create mode 100644 mise.toml diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 0000000..5e3255b --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,32 @@ +name: Links + +on: + push: + pull_request: + schedule: + - cron: "0 13 * * 1" # weekly, to catch external link rot without a commit + workflow_dispatch: + +permissions: + contents: read + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Setup mise + uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 + with: + install: false + + # Install only lychee (not the repo's full toolchain) and run the check. + - name: Check links + env: + MISE_AUTO_INSTALL: "false" + run: | + mise install lychee + mise run check-links diff --git a/.gitignore b/.gitignore index 49ff275..bd8a375 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *~ *.la +.lycheecache *.lo *.o *.old diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..38ac1cb --- /dev/null +++ b/lychee.toml @@ -0,0 +1,54 @@ +# Lychee link checker configuration +# https://lychee.cli.rs/#/usage/config +# +# Run locally with: +# lychee './**/*.md' './src/**/*.php' './composer.json' + +# Include URL fragments in checks +include_fragments = true + +# Don't allow any redirects, so links that have moved are surfaced and updated +# to their canonical destination. +max_redirects = 0 + +# Accept these HTTP status codes +# 100-103: Informational responses +# 200-299: Success responses +# 403: Forbidden (some sites use this for rate limiting) +# 429: Too Many Requests +# 500-599: Server errors (temporary issues shouldn't fail CI) +# 999: LinkedIn's custom status code +accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"] + +# Exclude URL patterns from checking (treated as regular expressions) +exclude = [ + '^file://', + # Live / auth-gated endpoints that appear as string literals or require login + '^https://geoip\.maxmind\.com', + '^https://geolite\.info', + '^https://minfraud\.maxmind\.com', + '^https://sandbox\.maxmind\.com', + '^https://updates\.maxmind\.com', + '^https://www\.maxmind\.com/en/accounts/', + '^https://www\.maxmind\.com/en/account/login', + # Placeholders / local + '^https?://example\.(com|org|net)', + '^http://localhost', + '127\.0\.0\.1', +] + +# Exclude file paths from getting checked (treated as regular expressions) +exclude_path = [ + '(^|/)node_modules/', + '(^|/)vendor/', + '(^|/)\.git/', + # Changelog: historical entries are preserved as-is, not rewritten + '(^|/)CHANGELOG\.md$', +] + +# Cache results for 1 day to speed up repeated checks +cache = true +max_cache_age = "1d" + +# Skip missing input files instead of erroring +skip_missing = true diff --git a/mise.lock b/mise.lock new file mode 100644 index 0000000..156e912 --- /dev/null +++ b/mise.lock @@ -0,0 +1,29 @@ +# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html + +[[tools.lychee]] +version = "0.23.0" +backend = "aqua:lycheeverse/lychee" + +[tools.lychee."platforms.linux-arm64"] +checksum = "sha256:97eb93b02a7d78a752fc33e5b0983439ccaadbf3db952b68a0a4401acd92e6e0" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-aarch64-unknown-linux-gnu.tar.gz" + +[tools.lychee."platforms.linux-arm64-musl"] +checksum = "sha256:97eb93b02a7d78a752fc33e5b0983439ccaadbf3db952b68a0a4401acd92e6e0" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-aarch64-unknown-linux-gnu.tar.gz" + +[tools.lychee."platforms.linux-x64"] +checksum = "sha256:5538440d2c69a45a0a09983271e5dee0c2fe7137d8035d25b2632e10a66a090a" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-x86_64-unknown-linux-musl.tar.gz" + +[tools.lychee."platforms.linux-x64-musl"] +checksum = "sha256:5538440d2c69a45a0a09983271e5dee0c2fe7137d8035d25b2632e10a66a090a" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-x86_64-unknown-linux-musl.tar.gz" + +[tools.lychee."platforms.macos-arm64"] +checksum = "sha256:4c8034900e11083b68ac6f6582c377ff1f704e268991999e09d717973e493e7f" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-arm64-macos.dmg" + +[tools.lychee."platforms.windows-x64"] +checksum = "sha256:0fda7ff0a60c0250939fc25361c2d4e6e7853c31c996733fdd5a1dd760bcb824" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-x86_64-windows.exe" diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..30e2fba --- /dev/null +++ b/mise.toml @@ -0,0 +1,9 @@ +[settings] +lockfile = true + +[tools] +lychee = "latest" + +[tasks.check-links] +description = "Check links with lychee" +run = "lychee --no-progress './**/*.md' './src/**/*.php' './composer.json'" From 85bdd2d184f8865d3ef3b26c7c9b6bb153aebe47 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 4 Jun 2026 20:40:48 +0000 Subject: [PATCH 2/2] Update stale and redirecting links - composer.json author homepage: https://www.maxmind.com/ -> https://www.maxmind.com/en/home - README.md Fedora package page: https://apps.fedoraproject.org/packages/php-maxminddb -> https://packages.fedoraproject.org/pkgs/php-maxminddb/php-maxminddb/ - README.md EPEL repository: https://fedoraproject.org/wiki/EPEL -> https://docs.fedoraproject.org/en-US/epel/ - README.md libmaxminddb tarball anchor: .../README.md#installing-from-a-tarball -> .../README.md#from-a-named-release-tarball - README.md support page: https://www.maxmind.com/en/support -> https://support.maxmind.com/knowledge-base Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 8 ++++---- composer.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9843cf5..12ac0d5 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ $reader = new Reader('example.mmdb'); ## Installation (RPM) -RPMs are available in the [official Fedora repository](https://apps.fedoraproject.org/packages/php-maxminddb). +RPMs are available in the [official Fedora repository](https://packages.fedoraproject.org/pkgs/php-maxminddb/php-maxminddb/). To install on Fedora, run: @@ -83,7 +83,7 @@ To install on Fedora, run: dnf install php-maxminddb ``` -To install on CentOS or RHEL 7, first [enable the EPEL repository](https://fedoraproject.org/wiki/EPEL) +To install on CentOS or RHEL 7, first [enable the EPEL repository](https://docs.fedoraproject.org/en-US/epel/) and then run: ```bash @@ -139,7 +139,7 @@ for prerequisites including libmaxminddb installation instructions. First install [libmaxminddb](https://github.com/maxmind/libmaxminddb) as described in its [README.md -file](https://github.com/maxmind/libmaxminddb/blob/main/README.md#installing-from-a-tarball). +file](https://github.com/maxmind/libmaxminddb/blob/main/README.md#from-a-named-release-tarball). After successfully installing libmaxmindb, you may install the extension from [PECL](https://pecl.php.net/package/maxminddb): @@ -189,7 +189,7 @@ breaking change. Please report all issues with this code using the [GitHub issue tracker](https://github.com/maxmind/MaxMind-DB-Reader-php/issues). If you are having an issue with a MaxMind service that is not specific to the -client API, please see [our support page](https://www.maxmind.com/en/support). +client API, please see [our support page](https://support.maxmind.com/knowledge-base). ## Requirements ## diff --git a/composer.json b/composer.json index f33af98..7ce7766 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ { "name": "Gregory J. Oschwald", "email": "goschwald@maxmind.com", - "homepage": "https://www.maxmind.com/" + "homepage": "https://www.maxmind.com/en/home" } ], "require": {