Commit graph

3 commits

Author SHA1 Message Date
Matthew Kobayashi
f1f48ae53e
fix: return client IPv6 address via cloudflared (#757)
* fix: return client IPv6 address via cloudflared

The cloudflared reverse proxy populates the X-Forwarded-For header for origin IPv4 addresses, however origin IPv6 addresses are added in a different header: Cf-Connecting-Ipv6. This updates the getIP.php mechanism to retrieve the value of this header and to prefer it over other client IP headers (in both cases only if the Cf-Connecting-Ipv6 header exists and is not empty).

* fix: Validate and normalise IP addresses from request headers

getClientIp() used HTTP_CF_CONNECTING_IPV6 and other headers verbatim, allowing malformed values to reach ISP lookups and the offline DB.

Add normalizeCandidateIp() helper that trims whitespace, extracts the first comma-separated token, and validates via filter_var(). Require FILTER_FLAG_IPV6 for the CF header and fall through to the next source on failure.

Written with assistance from OpenCode using Claude Opus 4.6.
2026-03-05 23:52:59 +01:00
sstidl
420be5e72f
Release 5.4 (#645)
* Initial implementation of ipinfo.io offline database

* Removed unnecessary code

* add: download ipinfo db during docker build

* fixed workflow

* rename warning in workflow

* commit to trigger workflow

* Refactor getIP

* Improved UI

* Updated docker version with 5.4 changes

* Updated README.md

* Added fallback in getIP in case the offline db is missing

* Fixed typos

* just md linting

* Removed vscode stuff

* Implemented fallback in getIP for PHP<8 (returns only the IP)

* Updated doc.md

* Fixed comments in telemetry_settings.php

* New quick start video

* Corrected image name in doc_docker.md

* Replaced speedtest with just test in stats.php

* docker documentation update

* typo

---------

Co-authored-by: Federico Dossena <info@fdossena.com>
Co-authored-by: Stefan Stidl <stefan.stidl@ffg.at>
2024-08-04 07:06:27 +00:00
Jeff Bierschbach
afa84968c7
Save correct IP address to database (#457) 2022-01-08 12:16:05 +00:00