Skip to content

Commit df8c549

Browse files
authored
Merge pull request #716 from maxmind/greg/stf-557
Validate and update links (STF-557)
2 parents 0fc2443 + 0b38d59 commit df8c549

12 files changed

Lines changed: 144 additions & 14 deletions

File tree

.github/workflows/links.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Links
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 13 * * 1" # weekly, to catch external link rot without a commit
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
linkChecker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
21+
- name: Setup mise
22+
uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
23+
with:
24+
install: false
25+
26+
# Install only lychee (not the repo's full toolchain) and run the check.
27+
- name: Check links
28+
env:
29+
MISE_AUTO_INSTALL: "false"
30+
run: |
31+
mise install lychee
32+
mise run check-links

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ pom.xml.versionsBackup
2020
target
2121
reports
2222
Test.java
23+
.lycheecache

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public interface JsonSerializable {
397397
## Additional Resources
398398

399399
- [API Documentation](https://maxmind.github.io/GeoIP2-java/)
400-
- [GeoIP Web Services Docs](https://dev.maxmind.com/geoip/docs/web-services)
400+
- [GeoIP Web Services Docs](https://dev.maxmind.com/geoip/docs/web-services/)
401401
- [MaxMind DB Format](https://maxmind.github.io/MaxMind-DB/)
402402
- GitHub Issues: https://github.com/maxmind/GeoIP2-java/issues
403403

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Description ##
44

55
This distribution provides an API for the GeoIP and GeoLite [web
6-
services](https://dev.maxmind.com/geoip/docs/web-services?lang=en) and
7-
[databases](https://dev.maxmind.com/geoip/docs/databases?lang=en).
6+
services](https://dev.maxmind.com/geoip/docs/web-services/?lang=en) and
7+
[databases](https://dev.maxmind.com/geoip/docs/databases/?lang=en).
88

99
## Installation ##
1010

@@ -491,7 +491,7 @@ try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
491491

492492
For details on the possible errors returned by the web service itself, [see
493493
the GeoIP web service
494-
documentation](https://dev.maxmind.com/geoip/docs/web-services?lang=en).
494+
documentation](https://dev.maxmind.com/geoip/docs/web-services/?lang=en).
495495

496496
If the web service returns an explicit error document, this is thrown as an
497497
`AddressNotFoundException`, an `AuthenticationException`, an
@@ -537,7 +537,7 @@ Because of these factors, it is possible for any web service to return a record
537537
where some or all of the attributes are unpopulated.
538538

539539
[See our web-service developer
540-
documentation](https://dev.maxmind.com/geoip/docs/web-services?lang=en) for
540+
documentation](https://dev.maxmind.com/geoip/docs/web-services/?lang=en) for
541541
details on what data each web service may return.
542542

543543
The only piece of data which is always returned is the `ip_address`
@@ -562,7 +562,7 @@ the GeoNames premium data set.
562562

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

567567
If you find some other sort of mistake, like an incorrect spelling,
568568
please check [the GeoNames site](https://www.geonames.org/) first. Once
@@ -573,7 +573,7 @@ data set, it will be automatically incorporated into future MaxMind
573573
releases.
574574

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

579579
## Other Support ##
@@ -583,7 +583,7 @@ Please report all issues with this code using the
583583

584584
If you are having an issue with a MaxMind service that is not specific
585585
to the client API, please
586-
[contact MaxMind support](https://www.maxmind.com/en/support).
586+
[contact MaxMind support](https://support.maxmind.com/knowledge-base).
587587

588588
## Requirements ##
589589

lychee.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Lychee link checker configuration
2+
# https://lychee.cli.rs/#/usage/config
3+
#
4+
# Run locally with:
5+
# lychee './**/*.md' './src/**/*.java' './pom.xml'
6+
7+
# Include URL fragments in checks
8+
include_fragments = true
9+
10+
# Don't allow any redirects, so links that have moved are surfaced and updated
11+
# to their canonical destination.
12+
max_redirects = 0
13+
14+
# Accept these HTTP status codes
15+
# 100-103: Informational responses
16+
# 200-299: Success responses
17+
# 403: Forbidden (some sites use this for rate limiting)
18+
# 429: Too Many Requests
19+
# 500-599: Server errors (temporary issues shouldn't fail CI)
20+
# 999: LinkedIn's custom status code
21+
accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"]
22+
23+
# Exclude URL patterns from checking (treated as regular expressions)
24+
exclude = [
25+
'^file://',
26+
# Live / auth-gated endpoints that appear as string literals or require login
27+
'^https://geoip\.maxmind\.com',
28+
'^https://geolite\.info',
29+
'^https://minfraud\.maxmind\.com',
30+
'^https://sandbox\.maxmind\.com',
31+
'^https://updates\.maxmind\.com',
32+
'^https://www\.maxmind\.com/en/accounts/',
33+
'https://www\.maxmind\.com/en/account/login',
34+
# XML namespace identifiers in pom.xml (not real links)
35+
'^http://www\.w3\.org/',
36+
'^http://maven\.apache\.org/',
37+
'^https://maven\.apache\.org/xsd/',
38+
'^http://java\.sun\.com/',
39+
'^http://schemas\.',
40+
# Maven property placeholder in a build-time download URL (not a real link)
41+
'japicmp\.baselineVersion',
42+
# Placeholders / local
43+
'^https?://example\.(com|org|net)',
44+
'^http://localhost',
45+
'127\.0\.0\.1',
46+
]
47+
48+
# Exclude file paths from getting checked (treated as regular expressions)
49+
exclude_path = [
50+
'(^|/)node_modules/',
51+
'(^|/)target/',
52+
'(^|/)\.git/',
53+
# Test fixtures (MaxMind-DB submodule) contain example URLs, not ours
54+
'(^|/)src/test/resources/',
55+
# Changelog: historical entries are preserved as-is, not rewritten
56+
'(^|/)CHANGELOG\.md$',
57+
]
58+
59+
# Cache results for 1 day to speed up repeated checks
60+
cache = true
61+
max_cache_age = "1d"
62+
63+
# Skip missing input files instead of erroring
64+
skip_missing = true

mise.lock

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ disable_backends = [
99
[tools]
1010
hugo = "latest"
1111
java = "latest"
12+
lychee = "latest"
1213
maven = "latest"
1314

1415
[tasks.build-docs]
@@ -19,6 +20,10 @@ run = "hugo --source docs --minify"
1920
description = "Serve the docs site locally with Hugo dev server"
2021
run = "hugo server --source docs"
2122

23+
[tasks.check-links]
24+
description = "Check links with lychee"
25+
run = "lychee --no-progress './**/*.md' './src/**/*.java' './pom.xml'"
26+
2227
[hooks]
2328
enter = "mise install --quiet --locked"
2429

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<packaging>jar</packaging>
88
<name>MaxMind GeoIP API</name>
99
<description>GeoIP webservice client and database reader</description>
10-
<url>https://dev.maxmind.com/geoip?lang=en</url>
10+
<url>https://dev.maxmind.com/geoip/?lang=en</url>
1111
<licenses>
1212
<license>
1313
<name>Apache License, Version 2.0</name>
@@ -17,7 +17,7 @@
1717
</licenses>
1818
<organization>
1919
<name>MaxMind, Inc.</name>
20-
<url>https://www.maxmind.com/</url>
20+
<url>https://www.maxmind.com/en/home</url>
2121
</organization>
2222
<scm>
2323
<url>https://github.com/maxmind/GeoIP2-java</url>

src/main/java/com/maxmind/geoip2/WebServiceClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
* <h2>Exceptions</h2>
9292
* <p>
9393
* For details on the possible errors returned by the web service itself, see <a
94-
* href="https://dev.maxmind.com/geoip/docs/web-services?lang=en">the GeoIP web
94+
* href="https://dev.maxmind.com/geoip/docs/web-services/?lang=en">the GeoIP web
9595
* service documentation</a>.
9696
* </p>
9797
* <p>

src/main/java/com/maxmind/geoip2/model/CityResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* to most specific (smallest). If the response did not contain any
4141
* subdivisions, this is an empty list.
4242
* @param traits Record for the traits of the requested IP address.
43-
* @see <a href="https://dev.maxmind.com/geoip/docs/web-services?lang=en">GeoIP Web
43+
* @see <a href="https://dev.maxmind.com/geoip/docs/web-services/?lang=en">GeoIP Web
4444
* Services</a>
4545
*/
4646
public record CityResponse(

0 commit comments

Comments
 (0)