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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:

# zizmor complains that 'v1' is a ref that can be provided by both the branch and tag namespaces.
# specify that we want the v1 branch.
- uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # 1.2.0
- uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
# RuboCop cache
/.rubocop-*

# Lychee link checker cache
.lycheecache

# IDE/Editor specific
/.idea
/.vscode
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,6 @@ ruby -Ilib:test test/test_reader.rb
## Additional Resources

- [API Documentation](https://www.rubydoc.info/gems/maxmind-geoip2)
- [GeoIP Web Services Docs](https://dev.maxmind.com/geoip/docs/web-services)
- [GeoIP Web Services Docs](https://dev.maxmind.com/geoip/docs/web-services/)
- [MaxMind DB Format](https://maxmind.github.io/MaxMind-DB/)
- GitHub Issues: https://github.com/maxmind/GeoIP2-ruby/issues
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Description

This is the Ruby API for the GeoIP and GeoLite
[webservices](https://dev.maxmind.com/geoip/docs/web-services?lang=en)
and [databases](https://dev.maxmind.com/geoip/docs/databases?lang=en).
[webservices](https://dev.maxmind.com/geoip/docs/web-services/?lang=en)
and [databases](https://dev.maxmind.com/geoip/docs/databases/?lang=en).

## Installation

Expand Down Expand Up @@ -300,7 +300,7 @@ point may offer a particular piece of data, MaxMind does not always have
every piece of data for any given IP address.

See the [GeoIP web service
documentation](https://dev.maxmind.com/geoip/docs/web-services?lang=en) for details on
documentation](https://dev.maxmind.com/geoip/docs/web-services/?lang=en) for details on
what data each end point may return.

The only piece of data which is always returned is the `ip_address`
Expand All @@ -324,7 +324,7 @@ GeoNames premium data set.
## Reporting data problems

If the problem you find is that an IP address is incorrectly mapped, please
[submit your correction to MaxMind](https://www.maxmind.com/en/correction).
[submit your correction to MaxMind](https://www.maxmind.com/en/geoip-data-correction-request).

If you find some other sort of mistake, like an incorrect spelling, please
check the [GeoNames site](https://www.geonames.org/) first. Once you've
Expand All @@ -335,15 +335,15 @@ will be automatically incorporated into future MaxMind releases.

If you are a paying MaxMind customer and you're not sure where to submit a
correction, please [contact MaxMind
support](https://www.maxmind.com/en/support) for help.
support](https://support.maxmind.com/knowledge-base) for help.

## Support

Please report all issues with this code using the [GitHub issue
tracker](https://github.com/maxmind/GeoIP2-ruby/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 lib/maxmind/geoip2/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module MaxMind
module GeoIP2
# This class provides a client API for all the
# {https://dev.maxmind.com/geoip/docs/web-services?lang=en GeoIP web
# {https://dev.maxmind.com/geoip/docs/web-services/?lang=en GeoIP web
# services}. The services are Country, City Plus, and Insights. Each service
# returns a different set of data about an IP address, with Country returning
# the least data and Insights the most.
Expand Down
2 changes: 1 addition & 1 deletion lib/maxmind/geoip2/model/city.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Model
# Model class for the data returned by the GeoIP City Plus web service
# and the City database. It is also used for GeoLite City lookups.
#
# See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
# See https://dev.maxmind.com/geoip/docs/web-services/?lang=en for more
# details.
#
# See {MaxMind::GeoIP2::Model::Country} for inherited methods.
Expand Down
2 changes: 1 addition & 1 deletion lib/maxmind/geoip2/model/enterprise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module GeoIP2
module Model
# Model class for the data returned by GeoIP Enterprise database lookups.
#
# See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
# See https://dev.maxmind.com/geoip/docs/web-services/?lang=en for more
# details.
#
# See {MaxMind::GeoIP2::Model::City} for inherited methods.
Expand Down
2 changes: 1 addition & 1 deletion lib/maxmind/geoip2/model/insights.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module GeoIP2
module Model
# Model class for the data returned by the GeoIP Insights web service.
#
# See https://dev.maxmind.com/geoip/docs/web-services?lang=en for more
# See https://dev.maxmind.com/geoip/docs/web-services/?lang=en for more
# details.
class Insights < City
# Data indicating whether the IP address is part of an anonymizing
Expand Down
61 changes: 61 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Lychee link checker configuration
# https://lychee.cli.rs/#/usage/config
#
# Run locally with:
# lychee './**/*.md' './lib/**/*.rb' './*.gemspec'

# Include URL fragments in checks
include_fragments = true

# Don't allow any redirects, so links that have moved are surfaced and can be
# 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"]

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 500..=599 status codes means that any link returning a server error (such as 500 Internal Server Error, 502 Bad Gateway, or 504 Gateway Timeout) will be treated as valid and won't be caught by the link checker. This can hide permanently broken links or dead servers.\n\nTo handle transient network or server issues without ignoring all server errors, it is recommended to rely on Lychee's built-in retry mechanism (e.g., setting retry = true or max_retries) instead of accepting 5xx status codes globally.

Suggested change
accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"]
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 = [
# GitHub blob URLs with line-number fragments (not parseable as page anchors)
'^https://github\.com/[^/]+/[^/]+/blob/[0-9a-fA-F]+/.+#L\d+$',
# Live / auth-gated MaxMind endpoints: appear as code string literals or
# require login, so they can't be verified by an anonymous request.
'^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',
# Local / placeholder URLs (e.g. the proxy example in docstrings)
'^file://',
'^https?://example\.(com|org|net)',
'^http://localhost',
'127\.0\.0\.1',
]

# Exclude file paths from getting checked (regular expressions, matched against
# the path relative to the working directory). Patterns are segment-anchored
# with (^|/) so short names like "build" don't match unintended paths.
exclude_path = [
'(^|/)vendor/',
'(^|/)pkg/',
'(^|/)doc/',
'(^|/)\.yardoc/',
'(^|/)coverage/',
# 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
28 changes: 28 additions & 0 deletions mise.lock

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

5 changes: 5 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ disable_backends = [

[tools]
ruby = "latest"
lychee = "latest"

[hooks]
enter = "mise install --quiet --locked"

[[watch_files]]
patterns = ["mise.toml", "mise.lock"]
run = "mise install --quiet --locked"

[tasks.check-links]
description = "Check links with lychee"
run = "lychee --no-progress './**/*.md' './lib/**/*.rb' './*.gemspec'"
Loading