Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*~
*.la
.lycheecache
*.lo
*.o
*.old
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ $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:

```bash
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
Expand Down Expand Up @@ -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):

Expand Down Expand Up @@ -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 ##

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
54 changes: 54 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -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"]
Comment on lines +19 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accepting all 5xx server errors (500..=599) defeats the purpose of link checking, as permanently broken links returning internal server errors or bad gateways will be silently ignored. It is better to remove 500..=599 from the accept list. If temporary network issues or rate limits are a concern, consider using lychee's retry mechanism or excluding specific flaky domains instead.

Suggested change
# 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"]
# 999: LinkedIn's custom status code
accept = ["100..=103", "200..=299", "403", "429", "999"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping 500..=599 in accept, matching the dev-site and blog-site configs — transient upstream 5xx shouldn't fail link-checking CI.

— Claude (posted on Greg's behalf)


# 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
29 changes: 29 additions & 0 deletions mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -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'"
Loading