Commit graph

17 commits

Author SHA1 Message Date
sstidl
8f0323c4a7 update geoip phar and db 2026-04-18 22:29:36 +02:00
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
Copilot
734a35f89c
Fix PHP version check for geoip2.phar compatibility (#754)
* Initial plan

* Fix PHP version check to require PHP 8.1.0+ for geoip2.phar

Changed from PHP_MAJOR_VERSION >= 8 to PHP_VERSION_ID >= 80100 to match
the actual requirement of geoip2.phar which needs PHP 8.1.0 or higher.
This prevents HTTP 500 errors on PHP 8.0.x installations.

Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
2026-01-31 21:45:28 +01:00
Federico Dossena
89c8e2fc5d Updated ipinfo offline db 2024-09-26 06:40:24 +02:00
HedgehogInTheCPP
c9fdd2f693
Update getIP.php return the ability to do online check for IP location on older PHP version (#651)
This patch is returns the ability to do online check for IP location on older PHP version
2024-08-16 11:45:28 +00: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
sstidl
3034bf2b2d
Merge pull request #617 from zypA13510/revert-487-patch-1
fix: download speed is 0 on certain platform
2024-05-18 22:18:59 +02:00
Yuping Zuo
ea25001e42
Revert "Use random_bytes when available (#487)"
This reverts commit fa0ac8cd23.
2024-05-05 22:25:19 +08:00
redpine
d949663649 Added IPv6 ULA match 2023-12-05 14:48:43 -06:00
sstidl
e5f54fbd78
Release 5.3.0 (#587)
* Update README.md

Added simple manual instructions

* Link to docker documentation

* Add basic docker compose example

* add descriptive alt-text to GIF

* Fix some typos and formatting

* Updated Docker to use php8.2-apache as the upstream image.

* Clean up apt lists after installation in Dockerfile

* Update Dockerfile

Co-authored-by: Quentame <polletquentin74@me.com>

* fix typo

* doc: sqlite db persistance explained

* Create docker-publish.yml

* Update docker-publish.yml

* Update docker-publish.yml

* fix action

* switch docker image location

* without image signing

* remove signing

* switch units to Mbit/s

* move examples to folder

* fix ipinfo parsing

* fix regression on getIpinfo

* removed trailing whitespaces

* integrate ios favicon

closes #400

* set single-server-full as index

---------

Co-authored-by: Les W <30345058+leswaters@users.noreply.github.com>
Co-authored-by: bt90 <btom1990@googlemail.com>
Co-authored-by: An | Anton Röhm <18481195+AnTheMaker@users.noreply.github.com>
Co-authored-by: 0kyn <0kyn.dev@gmail.com>
Co-authored-by: Marc Zampetti <zampettim@users.noreply.github.com>
Co-authored-by: Peter Dave Hello <hsu@peterdavehello.org>
Co-authored-by: Quentame <polletquentin74@me.com>
Co-authored-by: Stefan STIDL <stefan.stidl@ffg.at>
2023-11-26 12:46:27 +01:00
Pavel Djundik
fa0ac8cd23
Use random_bytes when available (#487) 2022-06-24 06:53:21 +00:00
Jeff Bierschbach
afa84968c7
Save correct IP address to database (#457) 2022-01-08 12:16:05 +00:00
dosse91
8be8aba5ed Fixed typo in results/index.php 2021-04-13 10:27:36 +02:00
Bernd Stellwag
fb7575b67b
Refactor results/ PHP code (#369)
* put code to insert and query data from database into separate file

* simplify obfuscation salt file handling

* use new DB interaction functions in telemetry.php

* use new DB interaction functions in stats.php

and fix indentation levels

* format telemetry settings file

* use new function for interacting with DB in index.php

* move drawing of the image into function and try to comment each section with what it does

* reorder lines for parts of the image to align with the order they appear on the image

* bugfix: display obfuscated and deobfuscated id in stats if id obfuscation is enabled

* improve error handling

* add missing PHPDocs to functions

* imageftbbox returns an array on success and false on failure so to check if the font is usable, check if we got an array

* fix dsn for postgres

* fix limit sql statement for postgresql

* remove obsolete require statement

* use require instead of require_once since the settings file might need to be loaded multiple times

because it just contains plain variables which will just get loaded into the current scope

* move require statements to the top of the file

* make sure files are readable before requiring them

* add constant to refer to the telemetry settings file and check if it is readable before loading it

* return null if no speedtest result was found for the given id and show according message to the user instead of just exiting

* use existing constant instead of string for telemetry settings file name

* uniformly use single quotes instead of double quotes as most code places already used single quotes

* somehow some tabs sneaked in, replace them to uniformly use spaces

* mysql now uses pdo, too, reflect that in the requirements documentation

* pass username and password as constructor parameters instead of via DSN
2020-10-20 07:43:48 +02:00
Bernd Stellwag
4f9e1a9342
use correct name for accessing the X-Real-IP header via $_SERVER variable (#365) 2020-10-10 18:41:06 +02:00
Bernd Stellwag
a69a70f5f4
Refactor backend PHP code (#362)
* refactor getIP.php moving functionality into separate functions

* add some error checks

* remove closing php tags

* uniformly use single quotes for strings

most strings already used single quotes, some used double quotes

* refactor garbage moving functionality into functions
2020-10-10 07:08:17 +02:00
dosse91
c3e576ddba Major project restructuring and unification with mpot branch 2019-06-30 07:03:06 +02:00