diff --git a/apps/speedtest-x/README.md b/apps/speedtest-x/README.md new file mode 100644 index 00000000..ea89cf27 --- /dev/null +++ b/apps/speedtest-x/README.md @@ -0,0 +1,77 @@ + + +![GitHub Actions Build Status](https://img.shields.io/github/workflow/status/badapple9/speedtest-x/Build%20Docker%20Image) ![GitHub last commit](https://img.shields.io/github/last-commit/badapple9/speedtest-x) ![GitHub](https://img.shields.io/github/license/badapple9/speedtest-x) + +本仓库为 [LibreSpeed](https://github.com/librespeed/speedtest) 的延伸项目,LibreSpeed 是一个非常轻巧的网站测速工具。 + +speedtest-x 使用文件数据库来保存来自不同用户的测速结果,方便您查看全国不同地域与运营商的测速效果。 + +[English docs](https://github.com/BadApple9/speedtest-x/blob/master/README.md) + +[加入交流 TG 群](https://t.me/xiaozhu5) + +**❗ 注意**:基于网页测速的原理,程序会生成无用文件供测速者下载来计算真实下行带宽,一定程度上存在被恶意刷流量的风险,在对外分享你的测速页面后,请注意观察服务器流量使用情况,避免流量使用异常。 + +## 扩展细节 + - 用户测速会上传测速记录并保存至网站服务器 + - 不依赖 MySQL,使用文件数据库 + - IP 库改用 [ip.sb](https://ip.sb),运营商记录更为精确 + +## 部署与使用 + +#### 常规部署 (环境要求:PHP 5.6+) + +1、下载本仓库并解压到网站目录,访问 `{域名}/index.html` 进行测速 + +2、打开 `{域名}/results.html` 查看测速记录 + +> Tips:`backend/config.php` 中可定义一些自定义配置: +> +> `MAX_LOG_COUNT = 100`:最大可保存多少条测速记录 +> +> `IP_SERVICE = 'ip.sb'`:使用的 IP 运营商解析服务(ip.sb 或 ipinfo.io) +> +> `SAME_IP_MULTI_LOGS = false`:是否允许同一IP记录多条测速结果 + +#### Docker 部署 (支持平台: amd64 / arm64) + +1、拉取 [Docker 镜像](https://hub.docker.com/r/badapple9/speedtest-x) `docker pull badapple9/speedtest-x` + +2、运行容器 `docker run -d -p 9001:80 -it badapple9/speedtest-x` + +参数解释: +> **-d**:以常驻进程模式启动 +> +> **9001**: 默认容器开放端口,可改为其他端口 +> +> 启动时可指定的环境变量: +> +> **-e WEBPORT=80**: 容器内使用的端口 +> +> **-e MAX_LOG_COUNT=100**: 最大可保存多少条测速记录 +> +> **-e IP_SERVICE=ip.sb**: 使用的 IP 运营商解析服务(ip.sb 或 ipinfo.io) +> +> **-e SAME_IP_MULTI_LOGS=false**: 是否允许同一IP记录多条测速结果 + +> 如果想让 Docker 容器支持 ipv6,可编辑 `/etc/docker/daemon.json` ,加上以下内容:(如果不存在这个文件则直接创建) +> ``` +> { +> "ipv6": true, +> "fixed-cidr-v6": "fd00::/80", +> "experimental": true, +> "ip6tables": true +> } +> ``` + +3、访问 `{IP}:{端口}/index.html` 进行测速 + +## 截图 + +![index](https://raw.githubusercontent.com/BadApple9/images/main/indexdemo.png) +![results](https://raw.githubusercontent.com/BadApple9/images/main/resultsdemo.png) + +## 鸣谢 + - [LibreSpeed](https://github.com/librespeed/speedtest) + - [ip.sb](https://ip.sb) + - [SleekDB](https://github.com/rakibtg/SleekDB) \ No newline at end of file diff --git a/apps/speedtest-x/data.yml b/apps/speedtest-x/data.yml new file mode 100644 index 00000000..22908f5c --- /dev/null +++ b/apps/speedtest-x/data.yml @@ -0,0 +1,20 @@ +name: Speedtest-X +tags: + - 工具 +title: 自托管的速度测试应用程序,提供出色的测试结果数据表 +type: 工具 +description: 自托管的速度测试应用程序,提供出色的测试结果数据表 +additionalProperties: + key: speedtest-x + name: Speedtest-X + tags: + - Tool + shortDescZh: 自托管的速度测试应用程序,提供出色的测试结果数据表 + shortDescEn: A self-hosted speedtest appilication with an awesome test result datasheet + type: tool + crossVersionUpdate: true + limit: 0 + recommend: 0 + website: https://github.com/BadApple9/speedtest-x + github: https://github.com/BadApple9/speedtest-x + document: https://github.com/BadApple9/speedtest-x diff --git a/apps/speedtest-x/latest/.env.sample b/apps/speedtest-x/latest/.env.sample new file mode 100644 index 00000000..b04aab7d --- /dev/null +++ b/apps/speedtest-x/latest/.env.sample @@ -0,0 +1,5 @@ +CONTAINER_NAME="speedtest-x" +PANEL_APP_PORT_HTTP="40190" +MAX_LOG_COUNT="100" +IP_SERVICE="ipinfo.io" +SAME_IP_MULTI_LOGS="false" \ No newline at end of file diff --git a/apps/speedtest-x/latest/data.yml b/apps/speedtest-x/latest/data.yml new file mode 100644 index 00000000..bdcefb28 --- /dev/null +++ b/apps/speedtest-x/latest/data.yml @@ -0,0 +1,31 @@ +additionalProperties: + formFields: + - default: 40190 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: 100 + edit: true + envKey: MAX_LOG_COUNT + labelEn: Maximum results size + labelZh: 测速结果数量 + required: true + type: text + - default: ipinfo.io + edit: true + envKey: IP_SERVICE + labelEn: IP info provider (ip.sb / ipinfo.io) + labelZh: 使用的 IP 运营商解析服务 (ip.sb / ipinfo.io) + required: true + type: text + - default: "false" + edit: true + envKey: SAME_IP_MULTI_LOGS + labelEn: Same IP multi speed test results (true / false) + labelZh: 是否允许同一 IP 记录多条测速结果 (true / false) + required: true + type: text \ No newline at end of file diff --git a/apps/speedtest-x/latest/docker-compose.yml b/apps/speedtest-x/latest/docker-compose.yml new file mode 100644 index 00000000..234e6e62 --- /dev/null +++ b/apps/speedtest-x/latest/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3' +services: + speedtest-x: + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + ports: + - "${PANEL_APP_PORT_HTTP}:${PANEL_APP_PORT_HTTP}" + environment: + - WEBPORT=${PANEL_APP_PORT_HTTP} + - MAX_LOG_COUNT=${MAX_LOG_COUNT} + - IP_SERVICE=${IP_SERVICE} + - SAME_IP_MULTI_LOGS=${SAME_IP_MULTI_LOGS} + image: badapple9/speedtest-x:latest + labels: + createdBy: "Apps" + +networks: + 1panel-network: + external: true diff --git a/apps/speedtest-x/logo.png b/apps/speedtest-x/logo.png new file mode 100644 index 00000000..eb9aec44 Binary files /dev/null and b/apps/speedtest-x/logo.png differ