Optionally show ISP info for private LAN clients using the server's public IP

オープン
#877 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, php

調査の方向性

Read backend/getIP_ipInfo_apikey.php and backend/getIP_serverPublicIp.php, then trace how getIP.php handles private client addresses and calls the existing ipinfo API and offline database fallback. Check the option and its Docker environment variable, plus the documentation in doc.md and doc_docker.md. Done means private LAN clients can optionally see the server public IP's ISP while keeping their own IP displayed, with the existing behavior preserved when disabled or lookup fails.

索引モデルが issue の本文から書いたものです。

説明

Closes #862

Before: when a client on the same LAN as the server opens the speed test (e.g. 192.168.1.23), getIP.php sees a private IP and skips ISP detection, so it only shows "Private IPv4 access".

After: if $USE_SERVER_PUBLIC_IP_FOR_PRIVATE_CLIENTS = true; is set in backend/getIP_ipInfo_apikey.php (or USE_SERVER_PUBLIC_IP_FOR_PRIVATE_CLIENTS=true in Docker), private clients get the ISP info of the server's public IP, shown with their own IP. It's off by default, so nothing changes unless you turn it on.

How: the server gets its public IP from ipinfo.io/ip (using the API token if one is set) and caches it for an hour in backend/getIP_serverPublicIp.php, which is gitignored. The lookup then goes through the existing ipinfo API, with the offline db as a fallback. I pulled the API-then-offline-db chain into a small getIspInfo() helper so both paths use it. If the public IP can't be fetched, the response is the same as before. I also documented the option in doc.md and doc_docker.md.

I tested it locally with PHP 8.3 and the offline db. It's unchanged when off, public clients are unchanged too, private clients get ISP info when on, and it falls back cleanly when the lookup fails. I used Claude to help write this.

主要言語
JavaScript
スター
15.3k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

librespeed/speedtest のほかの issue

librespeed/speedtest の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。