This commit is contained in:
SirPdboy 2023-01-12 10:35:14 +08:00 committed by GitHub
parent 96d803e834
commit 10a1c8904c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 0 additions and 3495 deletions

View File

@ -1,151 +0,0 @@
## luci-app-netspeedtest
### 访问数:[![](https://visitor-badge.glitch.me/badge?page_id=sirpdboy-visitor-badge)] [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg)
luci-app-netspeedtest 网络速度诊断测试包括内网网页版测速、内网iperf3吞吐测速、外网speedtest.net网速测试、特定服务器的端口延迟测速
[luci-app-netspeedtest 网络速度诊断测试](https://github.com/sirpdboy/netspeedtest)
**认真阅读完毕** 本页面,本页面包含注意事项和如何使用。
## 写在前面
- 一直在找OPENWRT上测试速度的插件苦寻不到于是有了它! 此插件可进行内外和外网网络速度测试。
- TG群友说插件2年没更新了花了几天时间结合时下需要将网络测试功能升级到2.0版本。
<!-- TOC -->
## [菜单向导](#luci-app-netspeedtest)
- [功能说明](#功能说明)
- [注意事项](#iperf3吞吐测试注意事项)
- [版本说明](#版本说明)
- [使用方法](#使用方法)
- [源码说明](#源码说明)
- [界面](#界面)
- [其它](#其它)
- [感谢](#感谢)
- [捐助](#捐助)
<!-- /TOC -->
## 功能说明
- 内网网页版测速插件 基于speedtest-web网页版启用后再点start进行测速。网页版启动后程序会驻留内存不测速建议不启用服务。
- 内网iperf3吞吐测试 服务端路由器如果没有安装请先安装此iperf3插件。
- 外网测速使用speedtest.net测速内核基于speedtest-cli,需要有python3才能执行。
- 特定服务器的端口延迟测速,是测试指定服务器的端口的延迟情况。
## iperf3吞吐测试注意事项
- 测速的终端使用机器必须和测速服务器在同一个局域网络中!
- 客户端使用步骤:启动测速服务器端-->下载测试客户端-->运行测速客户端-->输入服务端IP地址-->查看结果。
- 客户端运行国内端下载中有“iperf3测速客户端”运行它输入服务器IP即可。
国外原版,需要手动进入 CMD命令模式再输入命令iperf3.exe -c 服务器IP
- 网络测速iperf3客户端下载地址https://sipdboy.lanzoui.com/b01c3esih 密码:cpd6
- 需要依赖: python3 iperf3 speedtest-web
## 版本说明
### 2022.10.23 网速测试V2.0.4
- 代码基本重写和优化。
- Iperf3可实时体现服务状态。
- 增加内网测试网页版。
- 外网测速,加入更详细测试报告。
### 2021.3.2 网速测试V1.6
- 升级宽带测试带2.13内核。
- 解决1.806以上版本不能编译问题。
## 使用方法
将NetSpeedTest 主题添加至 LEDE/OpenWRT 源码的方法。
### 下载源码方法一:
- 编辑源码文件夹根目录feeds.conf.default并加入如下内容:
```Brach
# feeds获取源码
src-git netspeedtest https://github.com/sirpdboy/netspeedtest
```
```Brach
# 更新feeds并安装主题
scripts/feeds update netspeedtest
scripts/feeds install netspeedtest
```
### 下载源码方法二:
```Brach
# 下载源码
git clone https://github.com/sirpdboy/netspeedtest.git package/netspeedtest
make menuconfig
```
### 配置菜单
```Brach
make menuconfig
# 找到 LuCI -> Applications, 选择 luci-app-netspeedtest, 保存后退出。
```
### 编译
```Brach
# 编译固件
make package/netspeedtest/luci-app-netspeedtest/compile V=s
```
## 源码说明
- 源码来源和依赖:
- luci-app-netspeedtesthttps://github.com/sirpdboy/netspeedtest
- speedtest-webhttps://github.com/ZeaKyX/speedtest-web
- speedtest-clhttps://github.com/sivel/speedtest-cli
- 你可以随意使用其中的源码,但请注明出处。
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg)
## 界面
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest1.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest2.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest3.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest4.jpg)
## 其它
- 我的其它项目:
- 网络速度测试 https://github.com/sirpdboy/NetSpeedTest
- 定时设置插件 : https://github.com/sirpdboy/luci-app-autotimeset
- 关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice
- btmob 主题: https://github.com/sirpdboy/luci-theme-btmob
- 系统高级设置 : https://github.com/sirpdboy/luci-app-advanced
- ddns-go动态域名: https://github.com/sirpdboy/luci-app-ddns-go
- Lucky(大吉): https://github.com/sirpdboy/luci-app-lucky
## 感谢
感谢superspeed、user1121114685、ZeaKyX、佐须之男、lean等。因为有你们珠玉在前
## 捐助
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明3.jpg)
| <img src="https://img.shields.io/badge/-支付宝-F5F5F5.svg" href="#赞助支持本项目-" height="25" alt="图飞了😂"/> | <img src="https://img.shields.io/badge/-微信-F5F5F5.svg" height="25" alt="图飞了😂" href="#赞助支持本项目-"/> |
| :-----------------: | :-------------: |
|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) |
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-orange.svg" alt="图飞了😂" title="返回顶部" align="right"/>
</a>

View File

@ -1,21 +0,0 @@
# Copyright (C) 2020-2021 sirpdboy <herboy2008@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-netspeedtest
LUCI_TITLE:=LuCI Support for netspeedtest
LUCI_DEPENDS:=+python3 +iperf3 +speedtest-web +netperf
LUCI_PKGARCH:=all
PKG_VERSION:=2.0.5
PKG_RELEASE:=20221030
PKG_MAINTAINER:=<https://github.com/sirpdboy/netspeedtest>
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -1,151 +0,0 @@
## luci-app-netspeedtest
### 访问数:[![](https://visitor-badge.glitch.me/badge?page_id=sirpdboy-visitor-badge)] [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg)
luci-app-netspeedtest 网络速度诊断测试包括内网网页版测速、内网iperf3吞吐测速、外网speedtest.net网速测试、特定服务器的端口延迟测速
[luci-app-netspeedtest 网络速度诊断测试](https://github.com/sirpdboy/netspeedtest)
**认真阅读完毕** 本页面,本页面包含注意事项和如何使用。
## 写在前面
- 一直在找OPENWRT上测试速度的插件苦寻不到于是有了它! 此插件可进行内外和外网网络速度测试。
- TG群友说插件2年没更新了花了几天时间结合时下需要将网络测试功能升级到2.0版本。
<!-- TOC -->
## [菜单向导](#luci-app-netspeedtest)
- [功能说明](#功能说明)
- [注意事项](#iperf3吞吐测试注意事项)
- [版本说明](#版本说明)
- [使用方法](#使用方法)
- [源码说明](#源码说明)
- [界面](#界面)
- [其它](#其它)
- [感谢](#感谢)
- [捐助](#捐助)
<!-- /TOC -->
## 功能说明
- 内网网页版测速插件 基于speedtest-web网页版启用后再点start进行测速。网页版启动后程序会驻留内存不测速建议不启用服务。
- 内网iperf3吞吐测试 服务端路由器如果没有安装请先安装此iperf3插件。
- 外网测速使用speedtest.net测速内核基于speedtest-cli,需要有python3才能执行。
- 特定服务器的端口延迟测速,是测试指定服务器的端口的延迟情况。
## iperf3吞吐测试注意事项
- 测速的终端使用机器必须和测速服务器在同一个局域网络中!
- 客户端使用步骤:启动测速服务器端-->下载测试客户端-->运行测速客户端-->输入服务端IP地址-->查看结果。
- 客户端运行国内端下载中有“iperf3测速客户端”运行它输入服务器IP即可。
国外原版,需要手动进入 CMD命令模式再输入命令iperf3.exe -c 服务器IP
- 网络测速iperf3客户端下载地址https://sipdboy.lanzoui.com/b01c3esih 密码:cpd6
- 需要依赖: python3 iperf3 speedtest-web
## 版本说明
### 2022.10.18 网速测试V2.0.2
- 代码基本重写和优化。
- Iperf3可实时体现服务状态。
- 增加内网测试网页版。
- 外网测速,加入更详细测试报告。
### 2021.3.2 网速测试V1.6
- 升级宽带测试带2.13内核。
- 解决1.806以上版本不能编译问题。
## 使用方法
将NetSpeedTest 主题添加至 LEDE/OpenWRT 源码的方法。
### 下载源码方法一:
- 编辑源码文件夹根目录feeds.conf.default并加入如下内容:
```Brach
# feeds获取源码
src-git netspeedtest https://github.com/sirpdboy/netspeedtest
```
```Brach
# 更新feeds并安装主题
scripts/feeds update netspeedtest
scripts/feeds install netspeedtest
```
### 下载源码方法二:
```Brach
# 下载源码
git clone https://github.com/sirpdboy/netspeedtest.git package/netspeedtest
make menuconfig
```
### 配置菜单
```Brach
make menuconfig
# 找到 LuCI -> Applications, 选择 luci-app-netspeedtest, 保存后退出。
```
### 编译
```Brach
# 编译固件
make package/netspeedtest/luci-app-netspeedtest/compile V=s
```
## 源码说明
- 源码来源和依赖:
- luci-app-netspeedtesthttps://github.com/sirpdboy/netspeedtest
- speedtest-webhttps://github.com/ZeaKyX/speedtest-web
- speedtest-clhttps://github.com/sivel/speedtest-cli
- 你可以随意使用其中的源码,但请注明出处。
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg)
## 界面
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest1.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest2.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest3.jpg)
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/netspeedtest4.jpg)
## 其它
- 我的其它项目:
- 网络速度测试 https://github.com/sirpdboy/NetSpeedTest
- 定时设置插件 : https://github.com/sirpdboy/luci-app-autotimeset
- 关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice
- btmob 主题: https://github.com/sirpdboy/luci-theme-btmob
- 系统高级设置 : https://github.com/sirpdboy/luci-app-advanced
- ddns-go动态域名: https://github.com/sirpdboy/luci-app-ddns-go
- Lucky(大吉): https://github.com/sirpdboy/luci-app-lucky
## 感谢
感谢superspeed、user1121114685、ZeaKyX、佐须之男、lean等。因为有你们珠玉在前
## 捐助
![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明3.jpg)
| <img src="https://img.shields.io/badge/-支付宝-F5F5F5.svg" href="#赞助支持本项目-" height="25" alt="图飞了😂"/> | <img src="https://img.shields.io/badge/-微信-F5F5F5.svg" height="25" alt="图飞了😂" href="#赞助支持本项目-"/> |
| :-----------------: | :-------------: |
|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) |
<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-orange.svg" alt="图飞了😂" title="返回顶部" align="right"/>
</a>

View File

@ -1,89 +0,0 @@
-- Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
module("luci.controller.netspeedtest", package.seeall)
local fs=require"nixio.fs"
function index()
entry({"admin","network","netspeedtest"},alias("admin", "network", "netspeedtest", "speedtestweb"),_("Net Speedtest"), 90).dependent = true
entry({"admin","network","netspeedtest","speedtestweb"},cbi("netspeedtest/speedtestweb"),_("Lan Speedtest Web"),20).leaf = true
entry({"admin","network","netspeedtest","speedtestiperf3"},cbi("netspeedtest/speedtestiperf3", {hideapplybtn=true, hidesavebtn=true, hideresetbtn=true}),_("Lan Speedtest Iperf3"),30).leaf = true
entry({"admin","network","netspeedtest","speedtestwan"},cbi("netspeedtest/speedtestwan", {hideapplybtn=true, hidesavebtn=true, hideresetbtn=true}),_("Wan Speedtest"), 40).leaf = true
entry({"admin","network","netspeedtest","netperftestwan"},cbi("netspeedtest/netperftestwan", {hideapplybtn=true, hidesavebtn=true, hideresetbtn=true}),_("Netperf Speedtest"), 40).leaf = true
entry({"admin", "network", "netspeedtest", "checknet"}, call("check_net"))
entry({"admin", "network", "speedtestweb_status"}, call("speedtestweb_status"))
entry({"admin", "network", "iperf3_status"}, call("iperf3_status"))
entry({"admin", "network","test_iperf0"}, post("test_iperf0"), nil).leaf = true
entry({"admin", "network","test_iperf1"}, post("test_iperf1"), nil).leaf = true
entry({"admin","network","netspeedtest", "speedtestrun"}, call("speedtestrun"))
entry({"admin","network","netspeedtest", "netperfrun"}, call("netperfrun"))
entry({"admin", "network", "netspeedtest", "realtime_log"}, call("get_log"))
entry({"admin", "network", "netspeedtest", "dellog"},call("dellog"))
end
function speedtestweb_status()
local e={}
e.run=luci.sys.call("pgrep speedtest-web >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function iperf3_status()
local e={}
e.run=luci.sys.call("pgrep iperf3 >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function testout(cmd, addr)
luci.http.prepare_content("text/plain")
local util = io.popen(cmd)
if util then
while true do
local ln = util:read("*l")
if not ln then break end
luci.http.write(ln)
luci.http.write("\n")
end
util:close()
end
end
function test_iperf0(addr)
luci.sys.call("pgrep -f unblockneteasemusic | xargs kill -9 >/dev/null 2>&1 ")
luci.sys.call("/etc/init.d/unblockneteasemusic stop ")
luci.sys.call("/etc/init.d/unblockmusic stop ")
testout("iperf3 -s ", addr)
end
function test_iperf1(addr)
luci.sys.call("pgrep -f iperf3 | xargs kill -9 >/dev/null 2>&1 ")
luci.sys.call("/etc/init.d/unblockneteasemusic restart")
luci.sys.call("/etc/init.d/unblockmusic restart")
end
function get_log()
local e = {}
e.running = luci.sys.call("busybox ps -w | grep netspeedtest | grep -v grep >/dev/null") == 0
e.log = fs.readfile("/var/log/netspeedtest.log") or ""
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function dellog()
fs.writefile("/var/log/netspeedtest.log","")
http.prepare_content("application/json")
http.write('')
end
function speedtestrun()
testout("/etc/init.d/netspeedtest nstest ")
end
function netperfrun()
testout("sh /usr/bin/netperftest")
end

View File

@ -1,18 +0,0 @@
-- Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
require("luci.util")
local o,t,e
o = Map("netspeedtest", "<font color='green'>" .. translate("Net Speedtest") .."</font>",translate( "Network speed diagnosis test (including intranet and extranet)<br/>For specific usage, see:") ..translate("<a href=\'https://github.com/sirpdboy/netspeedtest.git' target=\'_blank\'>GitHub @sirpdboy/netspeedtest</a>") )
t=o:section(TypedSection,"wanspeedtest",translate("Netperf Speedtest"))
t.anonymous=true
e = t:option(DummyValue, '', '')
e.rawhtml = true
e.template ='netspeedtest/netperftestwan'
e =t:option(DummyValue, '', '')
e.rawhtml = true
e.template = 'netspeedtest/log'
return o

View File

@ -1,18 +0,0 @@
-- Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
require("luci.util")
local o,s,e
o = Map("netspeedtest", "<font color='green'>" .. translate("Net Speedtest") .."</font>",translate( "Network speed diagnosis test (including intranet and extranet)<br/>For specific usage, see:") ..translate("<a href=\'https://github.com/sirpdboy/netspeedtest.git' target=\'_blank\'>GitHub @sirpdboy/netspeedtest</a>") )
o:section(SimpleSection).template = "netspeedtest/speedtestiperf3_status"
s = o:section(TypedSection, "speedtestiperf3", translate('Lan Speedtest Iperf3'))
s.addremove=false
s.anonymous=true
e = s:option(DummyValue, '', '')
e.rawhtml = true
e.template ='netspeedtest/speedtestiperf3'
return o

View File

@ -1,18 +0,0 @@
-- Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
require("luci.util")
local o,t,e
o = Map("netspeedtest", "<font color='green'>" .. translate("Net Speedtest") .."</font>",translate( "Network speed diagnosis test (including intranet and extranet)<br/>For specific usage, see:") ..translate("<a href=\'https://github.com/sirpdboy/netspeedtest.git' target=\'_blank\'>GitHub @sirpdboy/netspeedtest</a>") )
t=o:section(TypedSection,"wanspeedtest",translate("Wan Speedtest"))
t.anonymous=true
e = t:option(DummyValue, '', '')
e.rawhtml = true
e.template ='netspeedtest/speedtestwan'
e =t:option(DummyValue, '', '')
e.rawhtml = true
e.template = 'netspeedtest/log'
return o

View File

@ -1,24 +0,0 @@
-- Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
local m, s ,o
m = Map("netspeedtest", "<font color='green'>" .. translate("Net Speedtest") .."</font>",translate( "Network speed diagnosis test (including intranet and extranet)<br/>For specific usage, see:") ..translate("<a href=\'https://github.com/sirpdboy/netspeedtest.git' target=\'_blank\'>GitHub @sirpdboy/netspeedtest</a>") )
-- m:section(SimpleSection).template = "netspeedtest/speedtestweb_status"
s = m:section(TypedSection, "speedtestweb", translate('Lan Speedtest Web'))
s.addremove=false
s.anonymous=true
o=s:option(Flag,"enabled",translate("Enable"))
o.default=0
o = s:option(DummyValue, '', '')
o.rawhtml = true
o.template ='netspeedtest/speedtestweb'
local o=luci.http.formvalue("cbi.apply")
if o then
io.popen("/etc/init.d/netspeedtest start")
end
return m

View File

@ -1,16 +0,0 @@
<%+cbi/valueheader%>
<textarea id="logview.list" class="cbi-input-textarea" style="width: 100%" rows="20" readonly="readonly"></textarea>
<script type="text/javascript">
const LOG_URL = '<%=luci.dispatcher.build_url("admin", "network", "netspeedtest","realtime_log")%>';
XHR.poll(1, LOG_URL, null, (x, d) => {
let logview = document.getElementById("logview.list");
if (!d.running) {
XHR.halt();
}
logview.value = d.log;
logview.scrollTop = logview.scrollHeight;
});
</script>
<%+cbi/valuefooter%>

View File

@ -1,54 +0,0 @@
<%#
Copyright 2020-2022 sirpdboy Wich <sirpdboy@qq.com>
https://github.com/sirpdboy/netspeedtest
Licensed to the public under the Apache License 2.0.
-%>
<%
local fs = require "nixio.fs"
local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6")
%>
<%+cbi/valueheader%>
<input class="cbi-button cbi-button-apply" id="netperf_service" type="button" onclick="netperf()" value="<%= translate('Perform Netperf Speedtest') %>" />
<fieldset class="cbi-section" style="display:none">
<legend id="netperftest-legend">
<%:Collecting data...%>
</legend>
<span id="netperftest-output"></span>
</fieldset>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<script type="text/javascript">//<![CDATA[
const RUN_URL = '<%=luci.dispatcher.build_url("admin", "network", "netspeedtest","netperfrun")%>';
const S_URL = '<%=luci.dispatcher.build_url("admin","network","netspeedtest","netperftestwan")%>';
function netperf(s) {
var legend = document.getElementById('netperftest-legend');
var output = document.getElementById('netperftest-output');
output.innerHTML =
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
'<%:Network speed test, please wait...%>'
;
legend.parentNode.style.display = 'block';
legend.style.display = 'inline';
XHR.get(RUN_URL, null,
function(x)
{
if (x.responseText)
{
legend.style.display = 'none';
output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
}
else
{
legend.style.display = 'none';
output.innerHTML ='</p><%:Operation execution complete%></p>';
}
setTimeout(() => { window.location = S_URL }, 5000);
}
);
return false;
}
</script>
<%+cbi/valuefooter%>

View File

@ -1,76 +0,0 @@
<%#
Copyright 2020-2022 sirpdboy Wich <sirpdboy@qq.com>
https://github.com/sirpdboy/netspeedtest
Licensed to the public under the Apache License 2.0.
-%>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=1.1"></script>
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
var stxhr = new XHR();
function update_status(field, proto)
{
var tool = field.name;
var addr = field.value;
var protocol = proto ;
var legend = document.getElementById('test-iperf-legend');
var output = document.getElementById('test-iperf-output');
if (legend && output)
{
output.innerHTML =
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
'<%:Waiting for command to complete...%>'
;
legend.parentNode.style.display = 'block';
legend.style.display = 'inline';
stxhr.post('<%=url('admin/network')%>/test_' + tool + protocol + '/' + addr, { token: '<%=token%>' },
function(x)
{
if (x.responseText)
{
legend.style.display = 'none';
output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
}
else
{
legend.style.display = 'none';
output.innerHTML ='</p> <%:Operation execution complete%></p>';
}
}
);
}
}
//]]></script>
<form method="post" action="<%=url('admin/network/netspeedtest')%>">
<table>
<tr><td class="cbi-value-title" ><input style="margin: 5px 0" type="hidden" value="" name="iperf" />
<select name="iperf_to" style="width:auto">
<option value="0" selected="selected"><%:iperfstart%></option>
<option value="1"><%:iperfstop%></option>
</select></td>
<td class="cbi-value-field" style="width:100%;" >
<input type="button" value="<%:Perform operation%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.iperf,this.form.iperf_to.selectedIndex)" /></td>
</tr>
<tr><td class="cbi-value-title" ><%:iperf3 instructions%></td>
<td class="cbi-value-field" ><%:The speed measurement terminal must be in the same LAN as the router that starts the speed measurement%><br /><%:Operation steps: start router speed measurement service download test client run speed measurement client input IP address of router speed measurement service%></td>
</tr>
<tr>
<td class="cbi-value-title"><%:Iperf3 speed measurement software download%></td>
<td class="cbi-value-field" >
<input type="button" class="cbi-button cbi-input-reload" value="<%:Domestic download password:%>cpd6" onclick="javascript:window.open('https://sipdboy.lanzoui.com/b01c3esih','target');" />
<input type="button" class="cbi-button cbi-input-reload" value="<%:Download from foreign official websites%>" onclick="javascript:window.open('https://iperf.fr/iperf-download.php','target');" /></td>
</tr>
</table>
<fieldset class="cbi-section" style="display:none">
<legend id="test-iperf-legend">
<%:Collecting data...%>
</legend>
<span id="test-iperf-output"></span>
</fieldset>
</form>
<%+cbi/valuefooter%>

View File

@ -1,27 +0,0 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[network]], [[iperf3_status]])%>', null,
function(x, data) {
var tb = document.getElementById('iperf3_status');
if (data && tb)
{
if (data.run)
{
tb.innerHTML = '<br/><em style=\"color:green\"><%:The Iperf3 service is running.%></em>';
}
else
{
tb.innerHTML = '<br/><em style=\"color:red\"><%:The Iperf3 service is not running.%></em>';
}
}
}
);
//]]></script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<legend><%:Iperf3 Status%></legend>
<p id="iperf3_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -1,79 +0,0 @@
<%#
Copyright 2020-2022 sirpdboy Wich <sirpdboy@qq.com>
https://github.com/sirpdboy/netspeedtest
Licensed to the public under the Apache License 2.0.
-%>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=1.1"></script>
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
var stxhr = new XHR();
function update_status(field, proto)
{
var tool = field.name;
var addr = field.value;
var protocol = proto ;
var legend = document.getElementById('test-iperf-legend');
var output = document.getElementById('test-iperf-output');
if (legend && output)
{
output.innerHTML =
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
'<%:Waiting for command to complete...%>'
;
legend.parentNode.style.display = 'block';
legend.style.display = 'inline';
stxhr.post('<%=url('admin/network')%>/test_' + tool + protocol + '/' + addr, { token: '<%=token%>' },
function(x)
{
if (x.responseText)
{
legend.style.display = 'none';
output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
}
else
{
legend.style.display = 'none';
output.innerHTML ='</p> <%:Operation execution complete%></p>';
}
}
);
}
}
//]]></script>
<form method="post" action="<%=url('admin/network/netspeedtest')%>">
<table>
<tr><td class="cbi-value-title" ><input style="margin: 5px 0" type="hidden" value="" name="iperf" />
<select name="iperf_to" style="width:auto">
<option value="0" selected="selected"><%:iperfstart%></option>
<option value="1"><%:iperfstop%></option>
</select></td>
<td class="cbi-value-field" style="width:100%;" >
<input type="button" value="<%:Perform operation%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.iperf,this.form.iperf_to.selectedIndex)" /></td>
</tr>
<tr><td class="cbi-value-title" ><%:iperf3 instructions%></td>
<td class="cbi-value-field" ><%:The speed measurement terminal must be in the same LAN as the router that starts the speed measurement%><br /><%:Operation steps: start router speed measurement service download test client run speed measurement client input IP address of router speed measurement service%></td>
</tr>
<tr>
<td class="cbi-value-title"><%:Iperf3 speed measurement software download%></td>
<td class="cbi-value-field" >
<input type="button" class="cbi-button cbi-input-reload" value="<%:Domestic download password:%>cpd6" onclick="javascript:window.open('https://sipdboy.lanzoui.com/b01c3esih','target');" />
<input type="button" class="cbi-button cbi-input-reload" value="<%:Download from foreign official websites%>" onclick="javascript:window.open('https://iperf.fr/iperf-download.php','target');" /></td>
</tr>
</table>
<fieldset class="cbi-section" style="display:none">
<legend id="test-iperf-legend">
<%:Collecting data...%>
</legend>
<span id="test-iperf-output"></span>
</fieldset>
</form>
<%+cbi/valuefooter%>

View File

@ -1,51 +0,0 @@
<%#
Copyright 2020-2022 sirpdboy Wich <sirpdboy@qq.com>
https://github.com/sirpdboy/netspeedtest
Licensed to the public under the Apache License 2.0.
-%>
<%+cbi/valueheader%>
<input class="cbi-button cbi-button-apply" id="update_service" type="button" onclick="run()" value="<%= translate('Perform Wan Speedtest') %>" />
<fieldset class="cbi-section" style="display:none">
<legend id="wanspeedtest-legend">
<%:Collecting data...%>
</legend>
<span id="wanspeedtest-output"></span>
</fieldset>
<script type="text/javascript">
const RUN_URL = '<%=luci.dispatcher.build_url("admin", "network", "netspeedtest","speedtestrun")%>';
function run(s) {
var legend = document.getElementById('wanspeedtest-legend');
var output = document.getElementById('wanspeedtest-output');
output.innerHTML =
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
'<%:Network speed test, please wait...%>'
;
legend.parentNode.style.display = 'block';
legend.style.display = 'inline';
XHR.get(RUN_URL, null,
function(x)
{
if (x.responseText)
{
legend.style.display = 'none';
output.innerHTML = String.format('<img src=%h height="300" style="vertical-align:middle" />', x.responseText);
}
else
{
legend.style.display = 'none';
output.innerHTML ='</p><%:Operation execution complete%></p>';
}
}
);
return false;
}
</script>
<%+cbi/valuefooter%>

View File

@ -1,18 +0,0 @@
<%#
Copyright 2020-2022 sirpdboy Wich <sirpdboy@qq.com>
https://github.com/sirpdboy/netspeedtest
Licensed to the public under the Apache License 2.0.
-%>
<%+cbi/valueheader%>
<div class="cbi-map">
<iframe id="speedtest-web" style="width: 90%; min-height: 500px; border: none; border-radius: 3px;"></iframe>
</div>
<script type="text/javascript">
document.getElementById("speedtest-web").src = window.location.protocol + "//" + window.location.hostname + ":8989";
document.getElementById("speedtest-web").height = document.documentElement.clientHeight;
window.onresize = function(){
document.getElementById("speedtest-web").height = document.documentElement.clientHeight;
}
</script>
<%+cbi/valuefooter%>

View File

@ -1,28 +0,0 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[network]], [[speedtestweb_status]])%>', null,
function(x, data) {
var tb = document.getElementById('speedtestweb_status');
if (data && tb)
{
if (data.run)
{
tb.innerHTML = '<br/><em style=\"color:green\"><%:The Speedtestweb service is running.%></em>';
}
else
{
tb.innerHTML = '<br/><em style=\"color:red\"><%:The Speedtestweb service is not running.%></em>';
}
}
}
);
//]]></script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<legend><%:Speedtestweb Status%></legend>
<p id="speedtestweb_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -1,102 +0,0 @@
#
# Copyright (C) 2020-2022 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/netspeedtest
# This is free software, licensed under the GNU General Public License v3.
#
msgid ""
msgstr ""
"Project-Id-Version: LuCi Chinese Translation\n"
"Report-Msgid-Bugs-To: \n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Pootle 2.0.6\n"
msgid "Net Speedtest"
msgstr "网速测试"
msgid "Network speed diagnosis test (including intranet and extranet)<br/>For specific usage, see:"
msgstr "网络速度诊断测试(包括内网、外网、特定端口服务器测速)<br/>使用说明见:"
msgid "Lan Speedtest Iperf3"
msgstr "内网iperf3吞吐测速"
msgid "Lan Speedtest Web"
msgstr "内网测速网页版"
msgid "Running state"
msgstr "运行状态"
msgid "The Iperf3 service is running."
msgstr "iperf3服务已启动"
msgid "The Iperf3 service is not running."
msgstr "iperf3服务未启动"
msgid "Iperf3 Status"
msgstr "iperf3服务状态"
msgid "The Speedtestweb service is running."
msgstr "网页测速服务已启动"
msgid "The Speedtestweb service is not running."
msgstr "网页测速服务未启动"
msgid "Speedtestweb Status"
msgstr "网页测速服务状态"
msgid "</br>For specific usage, see:"
msgstr "</br>具体使用方法参见:"
msgid "iperfstart"
msgstr "iperf服务启动"
msgid "iperfstop"
msgstr "iperf服务停止"
msgid "Perform operation"
msgstr "执行操作"
msgid "iperf3 instructions"
msgstr "iperf3使用说明"
msgid "Test speed service started"
msgstr "测试速度服务已经启动"
msgid "The speed measurement terminal must be in the same LAN as the router that starts the speed measurement"
msgstr "测速终端机必须与启动测速的路由器在同一局域网内"
msgid "Operation steps: start router speed measurement service download test client run speed measurement client input IP address of router speed measurement service"
msgstr "使用步骤A.启动路由器测速服务 B.下载测试客户端 C.运行测速客户端 D.输入路由器测速服务IP地址。 "
msgid "Domestic download password:"
msgstr "国内下密码:"
msgid "Iperf3 speed measurement software download"
msgstr "iperf3测速软件下载"
msgid "Wan Speedtest"
msgstr "Speedtest宽带测速"
msgid "Perform Wan Speedtest"
msgstr "执行Speedtest宽带测速"
msgid "Netperf Speedtest"
msgstr "Netperf宽带测速"
msgid "Perform Netperf Speedtest"
msgstr "执行Netperf宽带测速"
msgid "Operation execution complete"
msgstr "操作执行完毕"
msgid "Network speed test, please wait..."
msgstr "网速测试中,请稍侯..."
msgid "Download from foreign official websites"
msgstr "国外官网"
msgid "Server Port Speedtest"
msgstr "端口延迟测试"

View File

@ -1 +0,0 @@
zh-cn

View File

@ -1,10 +0,0 @@
config speedtestweb 'speedtestweb'
option enabled '0'
option port '8989'
option logger '1'
config speedtestiperf3 'speedtestiperf3'
option enabled '0'
config wanspeedtest 'wanspeedtest'
option surl ' '

View File

@ -1,89 +0,0 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
# This is free software, licensed under the Apache License, Version 2.0 .
#
START=99
USE_PROCD=1
PROG=/usr/bin/speedtest-web
EXTRA_COMMANDS="nstest"
TMP_T=/var/netspeedtest.tmp
LOCK=/var/lock/netspeedtest.lock
LOG=/var/log/netspeedtest.log
limit_log() {
local logf=$1
[ ! -f "$logf" ] && return
local sc=100
[ -n "$2" ] && sc=$2
local count=$(grep -c "" $logf)
if [ $count -gt $sc ];then
let count=count-$sc
sed -i "1,$count d" $logf
fi
}
init_env() {
[ ! -f "$LOG" ] && echo "" > $LOG
echo 1 > $TMP_T
}
nstest() {
[ -f $LOCK ] && exit
limit_log $LOG 200
init_env
touch $LOCK
echo -ne "\n speedtest测速" | tee -a $LOG
/usr/bin/speedtest --share > $TMP_T
echo -ne "\n 测服信息:$(cat $TMP_T | grep 'Hosted by'| cut -c10- | awk -F: '{printf $1}') 延时:$(cat $TMP_T | grep 'Hosted by' | awk -F: '{printf $2}')" >> $LOG
echo -ne "\n 下行速率:$(cat $TMP_T | grep 'Download:' |awk -F: '{printf $2}' )" >> $LOG
echo -ne " ---- 上行速率:$(cat $TMP_T | grep 'Upload:' |awk -F: '{printf $2}' )" >> $LOG
echo -ne "\n 测试时间: " >> $LOG
echo $(date +%Y-%m-%d" "%H:%M:%S) >> $LOG
echo -ne " ————————————————————————————\n" >> $LOG
echo -ne $(cat $TMP_T | grep 'results:' | cut -c16- )
rm -f $LOCK
}
get_config() {
config_get_bool enabled $1 enabled 1
config_get_bool logger $1 logger 1
config_get port $1 port 8989
}
speedtestweb_prepare() {
pgrep -f speedtest-web | xargs kill -9 >/dev/null 2>&1
logger -t netspeedtest -p warn "Netspeedtest speedtest-web is stop."
}
stop_service() {
speedtestweb_prepare
echo "Netspeedtest speedtest-web is stop."
}
start_service() {
speedtestweb_prepare
config_load netspeedtest
config_foreach get_config speedtestweb
[ x$enabled == x1 ] || return 1
logger -t netspeedtest -p warn "Netspeedtest speedtest-web is start."
echo "Netspeedtest speedtest-web is start."
procd_open_instance
procd_set_param command $PROG --listen_port "${port}"
[ "x$logger" == x1 ] && procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger "netspeedtest"
}

View File

@ -1,5 +0,0 @@
#!/bin/sh
chmod +x /etc/init.d/netspeedtest /usr/bin/*test >/dev/null 2>&1
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
exit 0

View File

@ -1,167 +0,0 @@
#! /bin/sh
# Netperfrunner.sh - a shell script that runs several netperf commands simultaneously.
# This mimics the stress test of Flent (www.flent.org - formerly, "netperf-wrapper")
# from Toke <toke@toke.dk> but doesn't have the nice GUI result.
# This can live in /usr/lib/OpenWrtScripts
#
# When you start this script, it concurrently uploads and downloads multiple
# streams (files) to a server on the Internet. This places a heavy load
# on the bottleneck link of your network (probably your connection to the
# Internet). It also starts a ping to a well-connected host. It displays:
#
# a) total bandwidth available
# b) the distribution of ping latency
# Usage: sh netperfrunner.sh [ -4 -6 ] [ -H netperf-server ] [ -t duration ] [ -t host-to-ping ] [ -n simultaneous-streams ]
# Options: If options are present:
#
# -H | --host: DNS or Address of a netperf server (default - netperf.bufferbloat.net)
# Alternate servers are netperf-east (east coast US), netperf-west (California),
# and netperf-eu (Denmark)
# -4 | -6: IPv4 or IPv6
# -t | --time: Duration for how long each direction's test should run - (default - 60 seconds)
# -p | --ping: Host to ping to measure latency (default - gstatic.com)
# -n | --number: Number of simultaneous sessions (default - 5 sessions)
# Copyright (c) 2014-2022 - Rich Brown rich.brown@blueberryhillsoftware.com
# GPLv2
# Process the ping times from the passed-in file, and summarize the results
# grep to keep lines that have "time=", then sed to isolate the time stamps, and sort them
# Use awk to build an array of those values, and print first & last (which are min, max)
# and compute average.
# If the number of samples is >= 10, also compute median, and 10th and 90th percentile readings
# Display the values as:
# Latency: (in msec, 11 pings, 8.33% packet loss)
# Min: 16.556
# 10pct: 16.561
# Median: 22.370
# Avg: 21.203
# 90pct: 23.202
# Max: 23.394
# ------- Start of the main routine --------
# Usage: sh betterspeedtest.sh [ -H netperf-server ] [ -t duration ] [ -p host-to-ping ]
# “H” and “host” DNS or IP address of the netperf server host (default: netperf.bufferbloat.net)
# “t” and “time” Time to run the test in each direction (default: 60 seconds)
# “p” and “ping” Host to ping for latency measurements (default: gstatic.com)
# "n" and "number" Number of simultaneous upload or download sessions (default: 4 sessions;
# 4 sessions chosen to match default of RRUL test)
# set an initial values for defaults
TESTHOST="netperf.bufferbloat.net"
TESTDUR="60"
PING4=ping
command -v ping4 > /dev/null 2>&1 && PING4=ping4
PING6=ping6
PINGHOST="netperf.bufferbloat.net"
MAXSESSIONS=4
TESTPROTO=-4
# Create temp files for netperf up/download results
ULFILE=`mktemp /tmp/netperfUL.XXXXXX` || exit 1
DLFILE=`mktemp /tmp/netperfDL.XXXXXX` || exit 1
PINGFILE=`mktemp /tmp/measurepings.XXXXXX` || exit 1
# echo $ULFILE $DLFILE $PINGFILE
# read the options
# extract options and their arguments into variables.
while [ $# -gt 0 ]
do
case "$1" in
-4|-6) TESTPROTO=$1; shift 1 ;;
-H|--host)
case "$2" in
"") echo "Missing hostname" ; exit 1 ;;
*) TESTHOST=$2 ; shift 2 ;;
esac ;;
-t|--time)
case "$2" in
"") echo "Missing duration" ; exit 1 ;;
*) TESTDUR=$2 ; shift 2 ;;
esac ;;
-p|--ping)
case "$2" in
"") echo "Missing ping host" ; exit 1 ;;
*) PINGHOST=$2 ; shift 2 ;;
esac ;;
-n|--number)
case "$2" in
"") echo "Missing number of simultaneous sessions" ; exit 1 ;;
*) MAXSESSIONS=$2 ; shift 2 ;;
esac ;;
--) shift ; break ;;
*) echo "Usage: sh Netperfrunner.sh [ -H netperf-server ] [ -t duration ] [ -p host-to-ping ] [ -n simultaneous-streams ]" ; exit 1 ;;
esac
done
# Start main test
if [ $TESTPROTO -eq "-4" ]
then
PROTO="ipv4"
else
PROTO="ipv6"
fi
DATE=`date "+%Y-%m-%d %H:%M:%S"`
LOG=/var/log/netspeedtest.log
echo -ne "\n netperf测速" | tee -a $LOG
echo -ne "\n 测服信息:$TESTHOST 协议:($PROTO) 线程:$MAXSESSIONS " | tee -a $LOG
# Start Ping
if [ $TESTPROTO -eq "-4" ]
then
"${PING4}" $PINGHOST > $PINGFILE &
else
"${PING6}" $PINGHOST > $PINGFILE &
fi
ping_pid=$!
# echo "Ping PID: $ping_pid"
# Start $MAXSESSIONS upload datastreams from netperf client to the netperf server
# netperf writes the sole output value (in Mbps) to stdout when completed
for i in $( seq $MAXSESSIONS )
do
netperf $TESTPROTO -H $TESTHOST -t TCP_STREAM -l $TESTDUR -v 0 -P 0 >> $ULFILE &
# echo "Starting upload #$i $!"
done
# Start $MAXSESSIONS download datastreams from netperf server to the client
for i in $( seq $MAXSESSIONS )
do
netperf $TESTPROTO -H $TESTHOST -t TCP_MAERTS -l $TESTDUR -v 0 -P 0 >> $DLFILE &
# echo "Starting download #$i $!"
done
# Wait until each of the background netperf processes completes
# echo "Process is $$"
# echo `pgrep -P $$ netperf `
for i in `pgrep -P $$ netperf` # get a list of PIDs for child processes named 'netperf'
do
# echo "Waiting for $i"
wait $i
done
# Stop the pings after the netperf's are all done
kill -9 $ping_pid
wait $ping_pid 2>/dev/null
echo -ne "\n 下行速率:" `awk '{s+=$1} END {print s}' $DLFILE` Mbps | tee -a $LOG
echo -ne " ---- 上行速率:" `awk '{s+=$1} END {print s}' $ULFILE` Mbps | tee -a $LOG
echo -ne "\n 测试时间: " | tee -a $LOG
echo $(date +%Y-%m-%d" "%H:%M:%S) | tee -a $LOG
echo -ne " ————————————————————————————\n" | tee -a $LOG
# Clean up
rm $PINGFILE
rm $DLFILE
rm $ULFILE

File diff suppressed because it is too large Load Diff

View File

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,75 +0,0 @@
#
# Copyright (C) 2021 ZeakyX
#
include $(TOPDIR)/rules.mk
PKG_NAME:=speedtest-web
PKG_VERSION:=1.1.5
PKG_RELEASE:=$(AUTORELESE)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ZeaKyX/speedtest-go.git
PKG_SOURCE_VERSION:=d8ccc31d3ae0ed2833691e3b8fc6fd1795d1ec13
PKG_MIRROR_HASH:=63dad14ce21c78b37f223aacc4fd4611bbe1f9619afff8d52a38186441cb6a86
PKG_LICENSE:=LGPL-3.0
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS:= \
CONFIG_SPEEDTEST_WEB_COMPRESS_GOPROXY \
CONFIG_SPEEDTEST_WEB_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/librespeed/speedtest
GO_PKG_LDFLAGS:=-s -w
GO_PKG_LDFLAGS_X:=main.VersionString=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/speedtest-web/config
config SPEEDTEST_WEB_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config SPEEDTEST_WEB_COMPRESS_UPX
bool "Compress executable files with UPX"
default y
endef
ifeq ($(CONFIG_SPEEDTEST_WEB_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Package/speedtest-web
SECTION:=net
CATEGORY:=Network
TITLE:=speedtest-web is a Openwrt package for speedtest-go, a Go backend for LibreSpeed
URL:=https://github.com/librespeed/speedtest-go
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
define Package/speedtest-web/description
speedtest-web is a Openwrt package for speedtest-go, a Go backend for LibreSpeed
endef
define Build/Compile
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_SPEEDTEST_WEB_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/speedtest
endif
endef
define Package/speedtest-web/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/speedtest $(1)/usr/bin/$(PKG_NAME)
endef
$(eval $(call GoBinPackage,speedtest-web))
$(eval $(call BuildPackage,speedtest-web))

View File

@ -1,2 +0,0 @@
# Speedtest-Web
OpenWrt package of librespeed [speedtest-go](https://github.com/librespeed/speedtest-go)