Add a disable getIP.php option for backend

未关闭 适合新手
#880 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript, php
领域
backend, frontend

调研方向

从仓库根目录的 getIP.php 开始,客户端 IP 在那里被解析并返回,同时查看其他可选功能是如何读取环境变量的(搜索现有的 getenv/$_ENV 用法以匹配该模式)。添加一个默认为 false 的 DISABLE_SHOW_IP 标志,并在返回任何 IP 之前短路。然后找到前端请求该 endpoint 的位置(在 results/telemetry 的 JS 中),当响应中没有地址时跳过 IP 显示或将其留空。完成意味着两条路径都被覆盖:标志开启时不返回任何可用的内容,标志关闭时行为与之前完全一致。

由索引模型根据 Issue 内容生成。

描述

Description

In some case the getIP.php info only return a private IP when the application is inside a reverse proxy. This show internal infrastructure networking information that is exposed to Internet.

Why it should be implemented

Improve internal infrastructure privacy when the application is running inside a private network and allow to disable the getIP.php when is not usable.

Implementation suggestions

  • Create a DISABLE_SHOW_IP env var option with default false to allow disable the getIP.php information and evaluate it in the getIP.php before return the information
  • Hide the IP from frontend when the server doesn't return a result o return 404 or a disable code substitution.
主要语言
JavaScript
星标
15.3k
派生
2.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

librespeed/speedtest 的其他 Issue

查看 librespeed/speedtest 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。