Repository navigation
Fix ISP fallback and add approximate IP location metadata - #887
billmcilhargey wants to merge 24 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
PR Summary by QodoFix ISP fallback and add approximate IP location
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved findings include a critical proxy-header flaw that enables spoofed lookup targets and telemetry attribution, plus inconsistent geographic and cached metadata and duplicate lookups that delay startup.
5 open issues
Select the first untrusted IP in the forwarded chain · New Prevent merging incompatible country names and codes · New Restore request-specific fields on provider cache hits · New Discard raw geographic fields that conflict with the selected location · New Avoid duplicate server-location lookups for offline metadata · New
What changed in this PR
This PR addresses unknown ISP results by expanding PHP metadata lookup and displaying approximate IP-derived location in the classic and modern interfaces, without collecting browser or device GPS data.
Changes:
- Adds configurable provider fallback, offline database support, caching, cooldowns, and trusted-proxy handling.
- Passes structured ISP/location metadata through the worker and UIs, with telemetry redaction.
- Adds regression coverage, deployment support, and operator documentation.
| File | Description |
|---|---|
tests/php/getIP_test.php |
Adds backend normalization, fallback, cache, proxy, and redaction tests. |
tests/e2e/worker-lifecycle.spec.js |
Tests structured metadata forwarding. |
tests/e2e/classic-standalone-regression.spec.js |
Tests metadata display in both UIs. |
speedtest_worker.js |
Includes ISP/location metadata in status and telemetry. |
results/telemetry.php |
Applies metadata redaction and clears logs when redacting. |
results/telemetry_redaction.php |
Adds structured telemetry sanitization. |
README.md |
Updates PHP requirements and links hosting guidance. |
package.json |
Adds a PHP test command and packages registry files. |
ip-providers.schema.json |
Defines the provider registry schema. |
ip-providers.json |
Configures provider order, timeouts, and cache settings. |
index-modern.html |
Updates external-lookup privacy disclosures. |
index-classic.html |
Displays ISP/location metadata and updates disclosures. |
HOSTING.md |
Adds proposed public-host onboarding and operating guidance. |
frontend/javascript/index.js |
Renders ISP, place, and coordinates in the modern UI. |
frontend/index.html |
Updates external-lookup privacy disclosures. |
Dockerfile.alpine |
Includes provider registry files in the Alpine image. |
Dockerfile |
Includes provider registry files in the standard image. |
docker/entrypoint.sh |
Installs registry files for supported backend modes. |
doc.md |
Documents lookup behavior, databases, proxies, and installation. |
doc_docker.md |
Documents metadata and proxy environment settings. |
backend/ip-providers.json |
Supplies the registry for backend-only installations. |
backend/getIP.php |
Implements provider selection, normalization, merging, caching, and distance handling. |
backend/getIP_util.php |
Adds address canonicalization, public-IP filtering, and proxy trust checks. |
.gitignore |
Adds cache-related ignore patterns. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved findings allow spoofed client IPs and telemetry attribution, merge conflicting country data, and make an offline-dependent test fail when its reader or database is unavailable.
6 open issues
Select the first untrusted IP in the forwarded chain Avoid requiring offline GeoIP data in this test · New Avoid duplicate server-location lookups for offline metadata Discard raw geographic fields that conflict with the selected location Restore request-specific fields on provider cache hits Prevent merging incompatible country names and codes
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Stored telemetry logs still expose location data when IP redaction is enabled, and proxy-trust documentation omits important default behavior and configuration requirements.
2 open issues
6 resolved since last review
Select the first untrusted IP in the forwarded chain Avoid requiring offline GeoIP data in this test Avoid duplicate server-location lookups for offline metadata Discard raw geographic fields that conflict with the selected location Restore request-specific fields on provider cache hits Prevent merging incompatible country names and codes
Review effort: Balanced
|
Addressed the full Qodo review in
Final verification: All 8 inline review threads are resolved. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Final review pass complete at Fixes applied:
Verification: |
There was a problem hiding this comment.
🟡 Changes recommended
Malformed provider registry entries can crash get-IP instead of returning fallback metadata, while incorrect non-POSIX UID handling can disable caches and provider cooldowns.
2 open issues
2 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Final additional-review pass complete at Fixes applied:
Verification at final head: |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Resolved the latest cache-disabled test thread in Fixes applied:
Verification: normal |
There was a problem hiding this comment.
🟡 Changes recommended
The distance lookup bypasses configured provider endpoints and sends tokens directly to ipinfo.io, while tests can leave provider-disabling registry files behind and expose test policy to concurrent requests.
2 open issues
1 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Telemetry redaction still preserves arbitrary string-valued rawIspInfo and malformed ispinfo payloads, allowing city and coordinate data to persist even when IP-address redaction is enabled.
2 open issues
2 resolved since last review
Review effort: Balanced
|
Additional review pass complete at Latest fixes:
Verification at final head: normal and |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Latest review pass complete at Fixes applied:
Verification: normal and |
|
Looks like someone has too many tokens. |



Summary
processedString/rawIspInfofields.locationobject and display it in classic/modern UIs.server_location_url.Verification
php tests/php/getIP_test.phpand theposix_geteuid-disabled run pass at final head5ec4190d1a30cc08eb89805f9fa2595068e4861e.php -lchecks, provider schema JSON parsing, andgit diff --checkpass.npm run lintexits 0 (0 errors, 21 existing warnings).npm run format:checkstill stops on four Prettier baseline failures reproduced identically on upstream base and PR head; no JavaScript files changed by the review-fix passes.Context
Fixes #881.
Recovery note: this PR supersedes #882 after the original source fork was deleted and recreated. The latest review follow-up is
5ec4190; approved endpoint/test-fixture isolation is in3ef0199; all preceding cache, registry, proxy, privacy, and redaction fixes remain on this branch. All inline review threads are resolved, and the separate Qodo review has a consolidated response.