mirror of
https://github.com/kenzok8/openwrt-packages
synced 2025-01-08 11:17:27 +08:00
int
This commit is contained in:
parent
847d577cef
commit
6b4f31d67d
@ -1,67 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
# Copyright (C) 2020 jjm2473@gmail.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_ARCH_LINKEASE:=$(ARCH)
|
||||
|
||||
PKG_NAME:=linkease
|
||||
PKG_VERSION:=0.7.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://fw.koolcenter.com/binary/LinkEase/LinuxStorage/
|
||||
PKG_HASH:=26ebbb22d78fd2ceb009226a0d85a40f100d502595b59c8a43eea5e4394ee292
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=LinkEase - the file cloud
|
||||
DEPENDS:=@(arm||x86_64||aarch64)
|
||||
URL:=https://www.ddnsto.com/linkease/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
LinkEase is a file cloud
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/linkease
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
[ -f /etc/uci-defaults/linkease ] && /etc/uci-defaults/linkease && rm -f /etc/uci-defaults/linkease
|
||||
fi
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin/linkease-plugins $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/linkease.$(PKG_ARCH_LINKEASE) $(1)/usr/sbin/linkease
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/heif-converter.$(PKG_ARCH_LINKEASE) $(1)/usr/sbin/heif-converter
|
||||
$(INSTALL_BIN) ./files/linkease-config.sh $(1)/usr/sbin/linkease-config.sh
|
||||
$(INSTALL_BIN) ./files/aria2.sh $(1)/usr/sbin/linkease-plugins/aria2.sh
|
||||
$(INSTALL_CONF) ./files/linkease.config $(1)/etc/config/linkease
|
||||
$(INSTALL_BIN) ./files/linkease.init $(1)/etc/init.d/linkease
|
||||
$(INSTALL_BIN) ./files/linkease.uci-default $(1)/etc/uci-defaults/linkease
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
@ -1,134 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sh_ver="1.0.0"
|
||||
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/sbin:/bin
|
||||
aria2_conf_dir=/var/etc/aria2/
|
||||
#替换成你设备aria2.conf路径
|
||||
aria2_conf=${aria2_conf_dir}/aria2.conf.main
|
||||
#替换成你设备的aria2c路径
|
||||
aria2c=/usr/bin/aria2c
|
||||
Green_font_prefix="\033[32m"
|
||||
Red_font_prefix="\033[31m"
|
||||
Green_background_prefix="\033[42;37m"
|
||||
Red_background_prefix="\033[41;37m"
|
||||
Font_color_suffix="\033[0m"
|
||||
Info="[${Green_font_prefix}信息${Font_color_suffix}]"
|
||||
Error="[${Red_font_prefix}错误${Font_color_suffix}]"
|
||||
Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
|
||||
error_code=11
|
||||
success_code=0
|
||||
|
||||
return_error(){
|
||||
echo 'Content-Type:application/json;charset=utf-8'
|
||||
echo
|
||||
echo "{
|
||||
"\"success\"":$error_code,
|
||||
"\"error\"":"\"$1\"",
|
||||
"\"result"\":null
|
||||
}"
|
||||
exit 1
|
||||
}
|
||||
return_ok(){
|
||||
echo 'Content-Type:application/json;charset=utf-8'
|
||||
echo
|
||||
echo "{
|
||||
"\"success\"":$success_code,
|
||||
"\"error\"":"\"$1\"",
|
||||
"\"result"\":null
|
||||
}"
|
||||
exit 0
|
||||
}
|
||||
return_result(){
|
||||
echo 'Content-Type:application/json;charset=utf-8'
|
||||
echo
|
||||
echo "{
|
||||
"\"success\"":$success_code,
|
||||
"\"error\"":"\"\"",
|
||||
"\"result"\":$1
|
||||
}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
#进程中是否运行aria2
|
||||
check_pid() {
|
||||
PID=$(ps -ef | grep "aria2c" | grep -v grep | grep -v "aria2.sh" | grep -v "init.d" | grep -v "service" | awk '{print $2}')
|
||||
}
|
||||
|
||||
#aria2是否正在运行
|
||||
aria2_work_status(){
|
||||
check_pid
|
||||
# [[ ! -z ${PID} ]] && echo -e "${Error} Aria2 正在运行,请检查 !" && exit 1
|
||||
[[ ! -z ${PID} ]] && return_ok "Aria2正在运行"
|
||||
return_error "Aria2未运行"
|
||||
}
|
||||
|
||||
#检测设备是否安装aria2
|
||||
check_installed_status() {
|
||||
[[ ! -e ${aria2c} ]] && return_error "Aria2 没有安装,请检查 !"
|
||||
[[ ! -e ${aria2_conf} ]] && return_error "Aria2 配置文件不存在,请检查 !"
|
||||
# return_ok "Aria2已安装"
|
||||
}
|
||||
#读取aria2配置信息
|
||||
read_config() {
|
||||
check_installed_status
|
||||
if [[ ! -e ${aria2_conf} ]]; then
|
||||
return_error "Aria2 配置文件不存在,请检查 !"
|
||||
else
|
||||
conf_text=$(cat ${aria2_conf} | grep -v '#')
|
||||
aria2_dir=$(echo -e "${conf_text}" | grep "^dir=" | awk -F "=" '{print $NF}')
|
||||
aria2_port=$(echo -e "${conf_text}" | grep "^rpc-listen-port=" | awk -F "=" '{print $NF}')
|
||||
aria2_passwd=$(echo -e "${conf_text}" | grep "^rpc-secret=" | awk -F "=" '{print $NF}')
|
||||
aria2_bt_port=$(echo -e "${conf_text}" | grep "^listen-port=" | awk -F "=" '{print $NF}')
|
||||
aria2_dht_port=$(echo -e "${conf_text}" | grep "^dht-listen-port=" | awk -F "=" '{print $NF}')
|
||||
|
||||
return_result "{
|
||||
"\"dir"\":"\"$aria2_dir"\",
|
||||
"\"rpc-listen-port"\":"\"$aria2_port"\",
|
||||
"\"rpc-secret"\":"\"$aria2_passwd"\",
|
||||
"\"listen-port"\":"\"$aria2_bt_port"\",
|
||||
"\"dht-listen-port"\":"\"$aria2_dht_port"\"}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#"Content-Type:text/html;charset=utf-8"
|
||||
#echo
|
||||
|
||||
#SERVER_SOFTWARE = $SERVER_SOFTWARE #服务器软件
|
||||
#SERVER_NAME = $SERVER_NAME #服务器主机名
|
||||
#GATEWAY_INTERFACE = $GATEWAY_INTERFACE #CGI版本
|
||||
#SERVER_PROTOCOL = $SERVER_PROTOCOL #通信使用的协议
|
||||
#SERVER_PORT = $SERVER_PORT #服务器的端口号
|
||||
#REQUEST_METHOD = $REQUEST_METHOD #请求方法(GET/POST/PUT/DELETE..)
|
||||
#HTTP_ACCEPT = $HTTP_ACCEPT #HTTP定义的浏览器能够接受的数据类型
|
||||
#SCRIPT_NAME = $SCRIPT_NAME #当前运行的脚本名称(包含路径)
|
||||
#QUERY_STRING = $QUERY_STRING #地址栏中传的数据(get方式)
|
||||
#REMOTE_ADDR = $REMOTE_ADDR #客户端的ip
|
||||
|
||||
#根据url QUERY调不同方法
|
||||
query(){
|
||||
aria2Query=${QUERY_STRING}
|
||||
parse(){
|
||||
echo $1 | sed 's/.*'$2'=\([[:alnum:]]*\).*/\1/'
|
||||
}
|
||||
value=$(parse $aria2Query "action")
|
||||
|
||||
if [ ! -z = "$value" ]
|
||||
then
|
||||
if [ "$value" = "status" ]
|
||||
then
|
||||
check_installed_status
|
||||
elif [ "$value" = "readConfig" ]
|
||||
then
|
||||
read_config
|
||||
elif [ "$value" = "workStatus" ]
|
||||
then
|
||||
aria2_work_status
|
||||
else
|
||||
echo
|
||||
fi
|
||||
else
|
||||
return_error "action不能为空"
|
||||
fi
|
||||
}
|
||||
query
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
save)
|
||||
if [ ! -z "$2" ]; then
|
||||
uci set linkease.@linkease[0].preconfig=$2
|
||||
uci commit
|
||||
fi
|
||||
;;
|
||||
|
||||
load)
|
||||
if [ -f "/usr/sbin/preconfig.data" ]; then
|
||||
data=`cat /usr/sbin/preconfig.data`
|
||||
uci set linkease.@linkease[0].preconfig=${data}
|
||||
uci commit
|
||||
rm /usr/sbin/preconfig.data
|
||||
else
|
||||
data=`uci get linkease.@linkease[0].preconfig`
|
||||
fi
|
||||
|
||||
if [ -z "${data}" ]; then
|
||||
echo "nil"
|
||||
else
|
||||
echo "${data}"
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
status)
|
||||
echo "TODO"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {save|load|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
@ -1,4 +0,0 @@
|
||||
config linkease
|
||||
option 'port' '8897'
|
||||
option 'preconfig' ''
|
||||
option 'enabled' '1'
|
@ -1,27 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled $1 enabled 1
|
||||
config_get_bool logger $1 logger
|
||||
config_get port $1 port 8897
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load linkease
|
||||
config_foreach get_config linkease
|
||||
[ $enabled != 1 ] && return 1
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/linkease
|
||||
[ -n "$port" ] && procd_append_param command --deviceAddr ":$port"
|
||||
[ "$logger" == 1 ] && procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "linkease"
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@linkease[-1]
|
||||
add ucitrack linkease
|
||||
set ucitrack.@linkease[-1].init=linkease
|
||||
commit ucitrack
|
||||
|
||||
delete firewall.linkease
|
||||
set firewall.linkease=rule
|
||||
set firewall.linkease.name="linkease"
|
||||
set firewall.linkease.target="ACCEPT"
|
||||
set firewall.linkease.src="wan"
|
||||
set firewall.linkease.proto="tcp"
|
||||
set firewall.linkease.dest_port="8897"
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
/etc/init.d/linkease enable
|
||||
/etc/init.d/linkease start
|
||||
|
||||
exit 0
|
@ -1,17 +0,0 @@
|
||||
# Copyright (C) 2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for linkease
|
||||
LUCI_DEPENDS:=+linkease
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=2.1.1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
@ -1,25 +0,0 @@
|
||||
module("luci.controller.linkease", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/linkease") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "linkease"}, cbi("linkease"), _("LinkEase"), 20).dependent = true
|
||||
|
||||
entry({"admin", "services", "linkease_status"}, call("linkease_status"))
|
||||
end
|
||||
|
||||
function linkease_status()
|
||||
local sys = require "luci.sys"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local port = tonumber(uci:get_first("linkease", "linkease", "port"))
|
||||
|
||||
local status = {
|
||||
running = (sys.call("pidof linkease >/dev/null") == 0),
|
||||
port = (port or 8897)
|
||||
}
|
||||
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(status)
|
||||
end
|
@ -1,20 +0,0 @@
|
||||
--wulishui <wulishui@gmail.com> ,20200911
|
||||
--jjm2473 <jjm2473@gmail.com> ,20210127
|
||||
|
||||
local m, s
|
||||
|
||||
m = Map("linkease", translate("LinkEase"), translate("LinkEase is an efficient data transfer tool."))
|
||||
|
||||
m:section(SimpleSection).template = "linkease_status"
|
||||
|
||||
s=m:section(TypedSection, "linkease", translate("Global settings"))
|
||||
s.addremove=false
|
||||
s.anonymous=true
|
||||
|
||||
s:option(Flag, "enabled", translate("Enable")).rmempty=false
|
||||
|
||||
s:option(Value, "port", translate("Port")).rmempty=false
|
||||
|
||||
return m
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
<%+linkease_status%>
|
@ -1,27 +0,0 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(5, '<%=url("admin/services/linkease_status")%>', null,
|
||||
function(x, st)
|
||||
{
|
||||
var tb = document.getElementById('linkease_status');
|
||||
if (st && tb)
|
||||
{
|
||||
if (st.running)
|
||||
{
|
||||
tb.innerHTML = '<br/><em style=\"color:green\"><%:The LinkEase service is running.%></em>'
|
||||
+ "<br/><br/><input class=\"btn cbi-button cbi-button-apply\" type=\"button\" value=\" <%:Click to open LinkEase%> \" onclick=\"window.open('http://" + window.location.hostname + ":" + st.port + "/')\"/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
tb.innerHTML = '<br/><em style=\"color:red\"><%:The LinkEase service is not running.%></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]></script>
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<legend><%:LinkEase Status%></legend>
|
||||
<p id="linkease_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
@ -1,27 +0,0 @@
|
||||
msgid "LinkEase"
|
||||
msgstr "易有云文件管理器"
|
||||
|
||||
msgid "Running state"
|
||||
msgstr "运行状态"
|
||||
|
||||
msgid "Click to open LinkEase"
|
||||
msgstr "点击打开易有云"
|
||||
|
||||
msgid "LinkEase is an efficient data transfer tool."
|
||||
msgstr "易有云是一个微型家庭数据服务中心,主要用于文件的集中存放、读取、备份及日常管理。释放用户终端设备空间,实现个人、家庭文件长久留存;支持家庭相册、视频文件随时随地多终端查看、播放,满足家庭文件的日常管理。"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "端口"
|
||||
|
||||
msgid "The LinkEase service is running."
|
||||
msgstr "易有云服务已启动"
|
||||
|
||||
msgid "The LinkEase service is not running."
|
||||
msgstr "易有云服务未启动"
|
||||
|
||||
msgid "LinkEase Status"
|
||||
msgstr "易有云服务状态"
|
||||
|
||||
msgid "Collecting data..."
|
||||
msgstr "收集数据..."
|
||||
|
@ -1 +0,0 @@
|
||||
zh-cn
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -1,19 +0,0 @@
|
||||
# Copyright (C) 2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for quickstart
|
||||
LUCI_DEPENDS:=+quickstart +shadow-utils +shadow-useradd +luci-app-store +mount-utils
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=0.3.6-1
|
||||
# PKG_RELEASE MUST be empty for luci.mk
|
||||
PKG_RELEASE:=
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
@ -1,175 +0,0 @@
|
||||
-- Copyright 2022 xiaobao <xiaobao@linkease.com>
|
||||
-- Licensed to the public under the MIT License
|
||||
|
||||
local http = require "luci.http"
|
||||
local nixio = require "nixio"
|
||||
local ltn12 = require "luci.ltn12"
|
||||
local table = require "table"
|
||||
local util = require "luci.util"
|
||||
|
||||
module("luci.controller.istore_backend", package.seeall)
|
||||
|
||||
local BLOCKSIZE = 2048
|
||||
local ISTOREOS_PORT = 3038
|
||||
|
||||
function index()
|
||||
entry({"istore"}, call("istore_backend")).leaf=true
|
||||
end
|
||||
|
||||
function sink_socket(sock, io_err)
|
||||
if sock then
|
||||
return function(chunk, err)
|
||||
if not chunk then
|
||||
return 1
|
||||
else
|
||||
return sock:send(chunk)
|
||||
end
|
||||
end
|
||||
else
|
||||
return ltn12.sink.error(io_err or "unable to send socket")
|
||||
end
|
||||
end
|
||||
|
||||
local function session_retrieve(sid, allowed_users)
|
||||
local sdat = util.ubus("session", "get", { ubus_rpc_session = sid })
|
||||
if type(sdat) == "table" and
|
||||
type(sdat.values) == "table" and
|
||||
type(sdat.values.token) == "string" and
|
||||
(not allowed_users or
|
||||
util.contains(allowed_users, sdat.values.username))
|
||||
then
|
||||
return sid, sdat.values
|
||||
end
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
function istore_backend()
|
||||
local sock = nixio.connect("127.0.0.1", ISTOREOS_PORT)
|
||||
if not sock then
|
||||
http.status(500, "connect failed")
|
||||
return
|
||||
end
|
||||
local input = {}
|
||||
input[#input+1] = http.getenv("REQUEST_METHOD") .. " " .. http.getenv("REQUEST_URI") .. " HTTP/1.1"
|
||||
local req = http.context.request
|
||||
local start = "HTTP_"
|
||||
local start_len = string.len(start)
|
||||
local ctype = http.getenv("CONTENT_TYPE")
|
||||
if ctype then
|
||||
input[#input+1] = "Content-Type: " .. ctype
|
||||
end
|
||||
for k, v in pairs(req.message.env) do
|
||||
if string.sub(k, 1, start_len) == start and not string.find(k, "FORWARDED") then
|
||||
input[#input+1] = string.sub(k, start_len+1, string.len(k)) .. ": " .. v
|
||||
end
|
||||
end
|
||||
local sid = http.getcookie("sysauth")
|
||||
if sid then
|
||||
local sid, sdat = session_retrieve(sid, nil)
|
||||
if sdat ~= nil then
|
||||
input[#input+1] = "X-Forwarded-Sid: " .. sid
|
||||
input[#input+1] = "X-Forwarded-Token: " .. sdat.token
|
||||
end
|
||||
end
|
||||
-- input[#input+1] = "X-Forwarded-For: " .. http.getenv("REMOTE_HOST") ..":".. http.getenv("REMOTE_PORT")
|
||||
local num = tonumber(http.getenv("CONTENT_LENGTH")) or 0
|
||||
input[#input+1] = "Content-Length: " .. tostring(num)
|
||||
input[#input+1] = "\r\n"
|
||||
local source = ltn12.source.cat(ltn12.source.string(table.concat(input, "\r\n")), http.source())
|
||||
local ret = ltn12.pump.all(source, sink_socket(sock, "write sock error"))
|
||||
if ret ~= 1 then
|
||||
sock:close()
|
||||
http.status(500, "proxy error")
|
||||
return
|
||||
end
|
||||
|
||||
local linesrc = sock:linesource()
|
||||
local line, code, error = linesrc()
|
||||
if not line then
|
||||
sock:close()
|
||||
http.status(500, "response parse failed")
|
||||
return
|
||||
end
|
||||
|
||||
local protocol, status, msg = line:match("^([%w./]+) ([0-9]+) (.*)")
|
||||
if not protocol then
|
||||
sock:close()
|
||||
http.status(500, "response protocol error")
|
||||
return
|
||||
end
|
||||
num = tonumber(status) or 0
|
||||
http.status(num, msg)
|
||||
|
||||
local chunked = 0
|
||||
line = linesrc()
|
||||
while line and line ~= "" do
|
||||
local key, val = line:match("^([%w-]+)%s?:%s?(.*)")
|
||||
if key and key ~= "Status" then
|
||||
if key == "Transfer-Encoding" and val == "chunked" then
|
||||
chunked = 1
|
||||
end
|
||||
if key ~= "Connection" and key ~= "Transfer-Encoding" then
|
||||
http.header(key, val)
|
||||
end
|
||||
end
|
||||
line = linesrc()
|
||||
end
|
||||
if not line then
|
||||
sock:close()
|
||||
http.status(500, "parse header failed")
|
||||
return
|
||||
end
|
||||
|
||||
local body_buffer = linesrc(true)
|
||||
if chunked == 1 then
|
||||
ltn12.pump.all(chunksource(sock, body_buffer), http.write)
|
||||
else
|
||||
local body_source = ltn12.source.cat(ltn12.source.string(body_buffer), sock:blocksource())
|
||||
ltn12.pump.all(body_source, http.write)
|
||||
end
|
||||
|
||||
sock:close()
|
||||
end
|
||||
|
||||
function chunksource(sock, buffer)
|
||||
buffer = buffer or ""
|
||||
return function()
|
||||
local output
|
||||
local _, endp, count = buffer:find("^([0-9a-fA-F]+);?.-\r\n")
|
||||
while not count and #buffer <= 1024 do
|
||||
local newblock, code = sock:recv(1024 - #buffer)
|
||||
if not newblock then
|
||||
return nil, code
|
||||
end
|
||||
buffer = buffer .. newblock
|
||||
_, endp, count = buffer:find("^([0-9a-fA-F]+);?.-\r\n")
|
||||
end
|
||||
count = tonumber(count, 16)
|
||||
if not count then
|
||||
return nil, -1, "invalid encoding"
|
||||
elseif count == 0 then
|
||||
return nil
|
||||
elseif count + 2 <= #buffer - endp then
|
||||
output = buffer:sub(endp+1, endp+count)
|
||||
buffer = buffer:sub(endp+count+3)
|
||||
return output
|
||||
else
|
||||
output = buffer:sub(endp+1, endp+count)
|
||||
buffer = ""
|
||||
if count - #output > 0 then
|
||||
local remain, code = sock:recvall(count-#output)
|
||||
if not remain then
|
||||
return nil, code
|
||||
end
|
||||
output = output .. remain
|
||||
count, code = sock:recvall(2)
|
||||
else
|
||||
count, code = sock:recvall(count+2-#buffer+endp)
|
||||
end
|
||||
if not count then
|
||||
return nil, code
|
||||
end
|
||||
return output
|
||||
end
|
||||
end
|
||||
end
|
@ -1,39 +0,0 @@
|
||||
local http = require "luci.http"
|
||||
|
||||
module("luci.controller.quickstart", package.seeall)
|
||||
|
||||
local page_index = {"admin", "quickstart", "pages"}
|
||||
|
||||
function index()
|
||||
if luci.sys.call("pgrep quickstart >/dev/null") == 0 then
|
||||
entry({"admin", "quickstart"}, call("redirect_index"), _("QuickStart"), 1)
|
||||
entry({"admin", "network_guide"}, call("networkguide_index"), _("NetworkGuide"), 2)
|
||||
entry({"admin", "quickstart", "pages"}, call("quickstart_index")).leaf = true
|
||||
if nixio.fs.access("/usr/lib/lua/luci/view/quickstart/main_dev.htm") then
|
||||
entry({"admin", "quickstart", "dev"}, call("quickstart_dev")).leaf = true
|
||||
end
|
||||
else
|
||||
entry({"admin", "quickstart"})
|
||||
entry({"admin", "quickstart", "pages"}, call("redirect_fallback")).leaf = true
|
||||
end
|
||||
end
|
||||
|
||||
function networkguide_index()
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","quickstart","pages","network"))
|
||||
end
|
||||
|
||||
function redirect_index()
|
||||
luci.http.redirect(luci.dispatcher.build_url(unpack(page_index)))
|
||||
end
|
||||
|
||||
function redirect_fallback()
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","status"))
|
||||
end
|
||||
|
||||
function quickstart_index()
|
||||
luci.template.render("quickstart/main", {prefix=luci.dispatcher.build_url(unpack(page_index))})
|
||||
end
|
||||
|
||||
function quickstart_dev()
|
||||
luci.template.render("quickstart/main_dev", {prefix=luci.dispatcher.build_url(unpack({"admin", "quickstart", "dev"}))})
|
||||
end
|
@ -1,16 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; url=<%=url('admin/quickstart/pages')%>" />
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
setTimeout(function(){
|
||||
localtion.href="<%=url('admin/quickstart/pages')%>";
|
||||
document.body.style.display='block';
|
||||
},1000);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body style="display:none" onload="onload">
|
||||
Landing to <a href="<%=url('admin/quickstart/pages')%>">main page</a>
|
||||
</body>
|
||||
</html>
|
@ -1,12 +0,0 @@
|
||||
<%+header%>
|
||||
<script>
|
||||
(function(){
|
||||
var vue_prefix="<%=prefix%>";
|
||||
window.vue_base = vue_prefix + '/';
|
||||
})();
|
||||
</script>
|
||||
<div id="app">
|
||||
</div>
|
||||
<script type="module" crossorigin src="/luci-static/quickstart/index.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<link rel="stylesheet" href="/luci-static/quickstart/style.css<%# ?v=PKG_VERSION %>">
|
||||
<%+footer%>
|
@ -1,7 +0,0 @@
|
||||
msgid "NetworkGuide"
|
||||
msgstr "网络向导"
|
||||
|
||||
msgid "QuickStart"
|
||||
msgstr "首页"
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
zh-cn
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"admin/quickstart": {
|
||||
"title": "QuickStart",
|
||||
"order": 1,
|
||||
"action": {
|
||||
"type": "template",
|
||||
"path": "quickstart/landing"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,61 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
# Copyright (C) 2020 jjm2473@gmail.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_ARCH_quickstart:=$(ARCH)
|
||||
|
||||
PKG_NAME:=quickstart
|
||||
PKG_VERSION:=0.3.6
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://fw.koolcenter.com/binary/quickstart/
|
||||
PKG_HASH:=ff807b6927a6f3e858c0734cb55105ac60ebdb8ffe694436101ace0ed80c1dd9
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=Quickstart, the quick start.
|
||||
DEPENDS:=@(x86_64||aarch64)
|
||||
URL:=https://easepi.linkease.com/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Quickstart is a dashboard & user guide
|
||||
endef
|
||||
|
||||
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
[ -f /etc/uci-defaults/quickstart ] && /etc/uci-defaults/quickstart && rm -f /etc/uci-defaults/quickstart
|
||||
fi
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/quickstart.$(PKG_ARCH_quickstart) $(1)/usr/sbin/quickstart
|
||||
$(INSTALL_BIN) ./files/quickstart.init $(1)/etc/init.d/quickstart
|
||||
$(INSTALL_BIN) ./files/quickstart.uci-default $(1)/etc/uci-defaults/quickstart
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
@ -1,13 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=92
|
||||
USE_PROCD=1
|
||||
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/quickstart serve
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
/etc/init.d/quickstart enable
|
||||
/etc/init.d/quickstart start
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user