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
Expand Up @@ -11,6 +11,7 @@
*.so
*.so.*
*.sw?
.lycheecache
docs/.hugo_build.lock
docs/public/
.libs
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ somewhere in your config, such as `LoadModule maxminddb_module
## Usage ##

To use this module, you must first download or create a MaxMind DB file. We
provide [free GeoLite databases](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?lang=en)
as well as [commercial GeoIP databases](https://www.maxmind.com/en/geoip2-databases).
provide [free GeoLite databases](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data/?lang=en)
as well as [commercial GeoIP databases](https://www.maxmind.com/en/geoip-databases).

After installing this module and obtaining a database, you must now set up the
module in your Apache configuration file (e.g., `/etc/apache2/apache2.conf`)
Expand Down Expand Up @@ -159,7 +159,7 @@ Apache notes.
In case you want supply your own value for the IP address to lookup, it may be
done by setting the environment variable `MMDB_ADDR`.
This can be done, for instance, with
[ModSecurity](https://github.com/SpiderLabs/ModSecurity/) in (real) phase 1.
[ModSecurity](https://github.com/owasp-modsecurity/ModSecurity) in (real) phase 1.
Note that mod_setenvif and mod_rewrite cannot be used for this as they are
running after this module. For most usages,
[mod_remoteip](https://httpd.apache.org/docs/current/mod/mod_remoteip.html)
Expand Down Expand Up @@ -283,7 +283,7 @@ Note that data stored as the "bytes" type in a MaxMind DB database can contain
null bytes and may end up truncated when stored in an environment variable. If
you really need to access this data, we recommend using [one of our
programming language
APIs](https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en) instead.
APIs](https://dev.maxmind.com/geoip/geolocate-an-ip/databases/?lang=en) instead.

## Support ##

Expand All @@ -292,7 +292,7 @@ tracker](https://github.com/maxmind/mod_maxminddb/issues).

If you are having an issue with a commercial MaxMind database that is not
specific to this module, please see [our support
page](https://www.maxmind.com/en/support).
page](https://support.maxmind.com/knowledge-base).

## Versioning ##

Expand Down
60 changes: 60 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Lychee link checker configuration
# https://lychee.cli.rs/#/usage/config
#
# Run locally with:
# lychee './**/*.md' './src/**/*.c'

# 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"]

# Exclude URL patterns from checking (treated as regular expressions)
exclude = [
# 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://updates\.maxmind\.com',
'^https://www\.maxmind\.com/en/accounts/',
# Local / placeholder URLs
'^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 = [
# Build / generated directories
'(^|/)build/',
'(^|/)\.libs/',
'(^|/)autom4te\.cache/',
# Generated Hugo site output
'(^|/)docs/public/',
# Vendored submodule and test harness/fixtures
'(^|/)maxmind-db/',
'(^|/)t/',
# Changelog: historical entries are preserved as-is, not rewritten
'(^|/)Changes\.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 @@ -7,6 +7,7 @@ disable_backends = [

[tools]
hugo = "latest"
lychee = "latest"

[hooks]
enter = "mise install --quiet"
Expand All @@ -22,3 +23,7 @@ run = "hugo --source docs --minify"
[tasks.serve-docs]
description = "Serve the docs site locally with Hugo dev server"
run = "hugo server --source docs"

[tasks.check-links]
description = "Check links with lychee"
run = "lychee --no-progress './**/*.md' './src/**/*.c'"
2 changes: 1 addition & 1 deletion src/mod_maxminddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Loading