From d0fd007ea9faa88ebecf9b9885edf70550b72d16 Mon Sep 17 00:00:00 2001 From: YGAS Date: Wed, 29 Sep 2021 21:52:27 +0800 Subject: [PATCH] add ddnsto and linkease --- applications/ddnsto/Makefile | 64 +++++++++ applications/ddnsto/files/ddnsto.config | 3 + applications/ddnsto/files/ddnsto.init | 26 ++++ applications/ddnsto/files/ddnsto.uci-default | 12 ++ applications/linkease/Makefile | 65 +++++++++ applications/linkease/files/aria2.sh | 134 ++++++++++++++++++ applications/linkease/files/linkease.config | 3 + applications/linkease/files/linkease.init | 23 +++ .../linkease/files/linkease.uci-default | 22 +++ applications/luci-app-ddnsto/Makefile | 17 +++ .../luasrc/controller/ddnsto.lua | 22 +++ .../luasrc/model/cbi/ddnsto.lua | 23 +++ .../luasrc/view/admin_status/index/ddnsto.htm | 1 + .../luasrc/view/ddnsto_status.htm | 26 ++++ .../luci-app-ddnsto/po/zh-cn/ddnsto.po | 32 +++++ .../root/etc/uci-defaults/50_luci-ddnsto | 4 + applications/luci-app-linkease/Makefile | 17 +++ .../luasrc/controller/linkease.lua | 25 ++++ .../luasrc/model/cbi/linkease.lua | 20 +++ .../view/admin_status/index/linkease.htm | 1 + .../luasrc/view/linkease_status.htm | 27 ++++ .../luci-app-linkease/po/zh-cn/linkease.po | 27 ++++ .../root/etc/uci-defaults/50_luci-linkease | 4 + .../luasrc/controller/nextcloud.lua | 1 - 24 files changed, 598 insertions(+), 1 deletion(-) create mode 100755 applications/ddnsto/Makefile create mode 100755 applications/ddnsto/files/ddnsto.config create mode 100755 applications/ddnsto/files/ddnsto.init create mode 100755 applications/ddnsto/files/ddnsto.uci-default create mode 100755 applications/linkease/Makefile create mode 100755 applications/linkease/files/aria2.sh create mode 100755 applications/linkease/files/linkease.config create mode 100755 applications/linkease/files/linkease.init create mode 100755 applications/linkease/files/linkease.uci-default create mode 100755 applications/luci-app-ddnsto/Makefile create mode 100755 applications/luci-app-ddnsto/luasrc/controller/ddnsto.lua create mode 100755 applications/luci-app-ddnsto/luasrc/model/cbi/ddnsto.lua create mode 100755 applications/luci-app-ddnsto/luasrc/view/admin_status/index/ddnsto.htm create mode 100755 applications/luci-app-ddnsto/luasrc/view/ddnsto_status.htm create mode 100755 applications/luci-app-ddnsto/po/zh-cn/ddnsto.po create mode 100755 applications/luci-app-ddnsto/root/etc/uci-defaults/50_luci-ddnsto create mode 100755 applications/luci-app-linkease/Makefile create mode 100755 applications/luci-app-linkease/luasrc/controller/linkease.lua create mode 100755 applications/luci-app-linkease/luasrc/model/cbi/linkease.lua create mode 100755 applications/luci-app-linkease/luasrc/view/admin_status/index/linkease.htm create mode 100755 applications/luci-app-linkease/luasrc/view/linkease_status.htm create mode 100755 applications/luci-app-linkease/po/zh-cn/linkease.po create mode 100755 applications/luci-app-linkease/root/etc/uci-defaults/50_luci-linkease diff --git a/applications/ddnsto/Makefile b/applications/ddnsto/Makefile new file mode 100755 index 0000000..08cb391 --- /dev/null +++ b/applications/ddnsto/Makefile @@ -0,0 +1,64 @@ +# +# 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_DDNSTO:=$(ARCH) + +PKG_NAME:=ddnsto +PKG_VERSION:=0.3.0 +PKG_RELEASE:=2 +PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://firmware.koolshare.cn/binary/ddnsto/ +PKG_HASH:=cefd2494cb1c21e2c1616290f715dd6415cd460aafc107c38bb9910c13f42448 + +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:=DDNS.to - the reverse proxy + DEPENDS:= + URL:=https://www.ddnsto.com/ +endef + +define Package/$(PKG_NAME)/description + DDNS.to is a reverse proxy +endef + +define Package/$(PKG_NAME)/conffiles +/etc/config/ddnsto +endef + +define Package/$(PKG_NAME)/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + [ -f /etc/uci-defaults/ddnsto ] && /etc/uci-defaults/ddnsto && rm -f /etc/uci-defaults/ddnsto +fi +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ddnsto.$(PKG_ARCH_DDNSTO) $(1)/usr/sbin/ddnsto + $(INSTALL_CONF) ./files/ddnsto.config $(1)/etc/config/ddnsto + $(INSTALL_BIN) ./files/ddnsto.init $(1)/etc/init.d/ddnsto + $(INSTALL_BIN) ./files/ddnsto.uci-default $(1)/etc/uci-defaults/ddnsto +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/applications/ddnsto/files/ddnsto.config b/applications/ddnsto/files/ddnsto.config new file mode 100755 index 0000000..61f6456 --- /dev/null +++ b/applications/ddnsto/files/ddnsto.config @@ -0,0 +1,3 @@ +config ddnsto + option 'token' '' + option 'enabled' '0' diff --git a/applications/ddnsto/files/ddnsto.init b/applications/ddnsto/files/ddnsto.init new file mode 100755 index 0000000..25e4547 --- /dev/null +++ b/applications/ddnsto/files/ddnsto.init @@ -0,0 +1,26 @@ +#!/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 0 + config_get token $1 token +} + +start_service() { + config_load ddnsto + config_foreach get_config ddnsto + [ $enabled != 1 ] && return 1 + if [ -z "$token" ]; then + logger -t ddnsto -p warn "token not set" + return 1 + fi + + procd_open_instance + procd_set_param command /usr/sbin/ddnsto -u "$token" + [ "$logger" == 1 ] && procd_set_param stderr 1 + procd_set_param respawn + procd_close_instance +} diff --git a/applications/ddnsto/files/ddnsto.uci-default b/applications/ddnsto/files/ddnsto.uci-default new file mode 100755 index 0000000..9fda075 --- /dev/null +++ b/applications/ddnsto/files/ddnsto.uci-default @@ -0,0 +1,12 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@ddnsto[-1] + add ucitrack ddnsto + set ucitrack.@ddnsto[-1].init=ddnsto + commit ucitrack +EOF + +/etc/init.d/ddnsto enable + +exit 0 \ No newline at end of file diff --git a/applications/linkease/Makefile b/applications/linkease/Makefile new file mode 100755 index 0000000..062d6d5 --- /dev/null +++ b/applications/linkease/Makefile @@ -0,0 +1,65 @@ +# +# 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.3.66 +PKG_RELEASE:=2 +PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://firmware.koolshare.cn/binary/LinkEase/LinuxStorage/ +PKG_HASH:=162046d8a31e175b74ca326d32d648240893fb712b4098f889a8cde43704c78f + +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:= + 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) ./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))) diff --git a/applications/linkease/files/aria2.sh b/applications/linkease/files/aria2.sh new file mode 100755 index 0000000..73626c3 --- /dev/null +++ b/applications/linkease/files/aria2.sh @@ -0,0 +1,134 @@ +#!/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 diff --git a/applications/linkease/files/linkease.config b/applications/linkease/files/linkease.config new file mode 100755 index 0000000..77dca48 --- /dev/null +++ b/applications/linkease/files/linkease.config @@ -0,0 +1,3 @@ +config linkease + option 'port' '8897' + option 'enabled' '1' diff --git a/applications/linkease/files/linkease.init b/applications/linkease/files/linkease.init new file mode 100755 index 0000000..5224920 --- /dev/null +++ b/applications/linkease/files/linkease.init @@ -0,0 +1,23 @@ +#!/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 +} diff --git a/applications/linkease/files/linkease.uci-default b/applications/linkease/files/linkease.uci-default new file mode 100755 index 0000000..716c58e --- /dev/null +++ b/applications/linkease/files/linkease.uci-default @@ -0,0 +1,22 @@ +#!/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 \ No newline at end of file diff --git a/applications/luci-app-ddnsto/Makefile b/applications/luci-app-ddnsto/Makefile new file mode 100755 index 0000000..8adc4ad --- /dev/null +++ b/applications/luci-app-ddnsto/Makefile @@ -0,0 +1,17 @@ +# 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 ddnsto +LUCI_DEPENDS:=+ddnsto +LUCI_PKGARCH:=all +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/applications/luci-app-ddnsto/luasrc/controller/ddnsto.lua b/applications/luci-app-ddnsto/luasrc/controller/ddnsto.lua new file mode 100755 index 0000000..ccae6ca --- /dev/null +++ b/applications/luci-app-ddnsto/luasrc/controller/ddnsto.lua @@ -0,0 +1,22 @@ +module("luci.controller.ddnsto", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/ddnsto") then + return + end + + entry({"admin", "services", "ddnsto"}, cbi("ddnsto"), _("DDNS.to"), 20).dependent = true + + entry({"admin", "services", "ddnsto_status"}, call("ddnsto_status")) +end + +function ddnsto_status() + local sys = require "luci.sys" + + local status = { + running = (sys.call("pidof ddnsto >/dev/null") == 0) + } + + luci.http.prepare_content("application/json") + luci.http.write_json(status) +end diff --git a/applications/luci-app-ddnsto/luasrc/model/cbi/ddnsto.lua b/applications/luci-app-ddnsto/luasrc/model/cbi/ddnsto.lua new file mode 100755 index 0000000..60b427c --- /dev/null +++ b/applications/luci-app-ddnsto/luasrc/model/cbi/ddnsto.lua @@ -0,0 +1,23 @@ +--wulishui ,20200911 +--jjm2473 ,20210127 + +local m, s + +m = Map("ddnsto", translate("DDNS.to"), translate("DDNS.to is a reverse proxy.") + .. " " + .. translate("Official Website") + .. "") + +m:section(SimpleSection).template = "ddnsto_status" + +s=m:section(TypedSection, "ddnsto", translate("Global settings")) +s.addremove=false +s.anonymous=true + +s:option(Flag, "enabled", translate("Enable")).rmempty=false + +s:option(Value, "token", translate("Token")).rmempty=false + +return m + + diff --git a/applications/luci-app-ddnsto/luasrc/view/admin_status/index/ddnsto.htm b/applications/luci-app-ddnsto/luasrc/view/admin_status/index/ddnsto.htm new file mode 100755 index 0000000..718be04 --- /dev/null +++ b/applications/luci-app-ddnsto/luasrc/view/admin_status/index/ddnsto.htm @@ -0,0 +1 @@ +<%+ddnsto_status%> diff --git a/applications/luci-app-ddnsto/luasrc/view/ddnsto_status.htm b/applications/luci-app-ddnsto/luasrc/view/ddnsto_status.htm new file mode 100755 index 0000000..98b51a7 --- /dev/null +++ b/applications/luci-app-ddnsto/luasrc/view/ddnsto_status.htm @@ -0,0 +1,26 @@ + + +
+ <%:DDNS.to Status%> +

+ <%:Collecting data...%> +

+
diff --git a/applications/luci-app-ddnsto/po/zh-cn/ddnsto.po b/applications/luci-app-ddnsto/po/zh-cn/ddnsto.po new file mode 100755 index 0000000..a6ad574 --- /dev/null +++ b/applications/luci-app-ddnsto/po/zh-cn/ddnsto.po @@ -0,0 +1,32 @@ +msgid "DDNS.to" +msgstr "DDNS.to内网穿透" + +msgid "Running state" +msgstr "运行状态" + +msgid "Click to open DDNS.to" +msgstr "点击打开DDNS.to" + +msgid "DDNS.to is a reverse proxy." +msgstr "DDNS.to是一个内网穿透工具。" + +msgid "Official Website" +msgstr "官网" + +msgid "Token" +msgstr "令牌" + +msgid "The DDNS.to service is running." +msgstr "DDNS.to服务已启动" + +msgid "The DDNS.to service is not running." +msgstr "DDNS.to服务未启动" + +msgid "DDNS.to Status" +msgstr "DDNS.to服务状态" + +msgid "Collecting data..." +msgstr "收集数据..." + +msgid "Global settings" +msgstr "全局设置" diff --git a/applications/luci-app-ddnsto/root/etc/uci-defaults/50_luci-ddnsto b/applications/luci-app-ddnsto/root/etc/uci-defaults/50_luci-ddnsto new file mode 100755 index 0000000..d7bfee2 --- /dev/null +++ b/applications/luci-app-ddnsto/root/etc/uci-defaults/50_luci-ddnsto @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/applications/luci-app-linkease/Makefile b/applications/luci-app-linkease/Makefile new file mode 100755 index 0000000..4b04e4a --- /dev/null +++ b/applications/luci-app-linkease/Makefile @@ -0,0 +1,17 @@ +# 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.0 +PKG_RELEASE:=2 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/applications/luci-app-linkease/luasrc/controller/linkease.lua b/applications/luci-app-linkease/luasrc/controller/linkease.lua new file mode 100755 index 0000000..8eec0ab --- /dev/null +++ b/applications/luci-app-linkease/luasrc/controller/linkease.lua @@ -0,0 +1,25 @@ +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 diff --git a/applications/luci-app-linkease/luasrc/model/cbi/linkease.lua b/applications/luci-app-linkease/luasrc/model/cbi/linkease.lua new file mode 100755 index 0000000..2479603 --- /dev/null +++ b/applications/luci-app-linkease/luasrc/model/cbi/linkease.lua @@ -0,0 +1,20 @@ +--wulishui ,20200911 +--jjm2473 ,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 + + diff --git a/applications/luci-app-linkease/luasrc/view/admin_status/index/linkease.htm b/applications/luci-app-linkease/luasrc/view/admin_status/index/linkease.htm new file mode 100755 index 0000000..7ae5dd5 --- /dev/null +++ b/applications/luci-app-linkease/luasrc/view/admin_status/index/linkease.htm @@ -0,0 +1 @@ +<%+linkease_status%> diff --git a/applications/luci-app-linkease/luasrc/view/linkease_status.htm b/applications/luci-app-linkease/luasrc/view/linkease_status.htm new file mode 100755 index 0000000..11062c1 --- /dev/null +++ b/applications/luci-app-linkease/luasrc/view/linkease_status.htm @@ -0,0 +1,27 @@ + + +
+ <%:LinkEase Status%> +

+ <%:Collecting data...%> +

+
diff --git a/applications/luci-app-linkease/po/zh-cn/linkease.po b/applications/luci-app-linkease/po/zh-cn/linkease.po new file mode 100755 index 0000000..3a4462e --- /dev/null +++ b/applications/luci-app-linkease/po/zh-cn/linkease.po @@ -0,0 +1,27 @@ +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 "收集数据..." + diff --git a/applications/luci-app-linkease/root/etc/uci-defaults/50_luci-linkease b/applications/luci-app-linkease/root/etc/uci-defaults/50_luci-linkease new file mode 100755 index 0000000..d7bfee2 --- /dev/null +++ b/applications/luci-app-linkease/root/etc/uci-defaults/50_luci-linkease @@ -0,0 +1,4 @@ +#!/bin/sh + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/applications/luci-app-nextcloud/luasrc/controller/nextcloud.lua b/applications/luci-app-nextcloud/luasrc/controller/nextcloud.lua index 04a7337..a5b2523 100755 --- a/applications/luci-app-nextcloud/luasrc/controller/nextcloud.lua +++ b/applications/luci-app-nextcloud/luasrc/controller/nextcloud.lua @@ -63,7 +63,6 @@ function uninstall_container() local status = container_status() local container_id = status.container_id util.exec("docker container rm '"..container_id.."'") - util.exec("rm -rf /root/usr/share/nextcloud") end -- 总结: