diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..a7f45702
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+
+forkapp/forkapp
+tools/forkapp
+forkapp/forkapp.exe
+tools/forkapp.exe
diff --git a/README.md b/README.md
index 2734ba65..5d53626a 100644
--- a/README.md
+++ b/README.md
@@ -7,3 +7,9 @@
3. 等待编译完成,点击任务进入详情页
4. 在详情页下载插件压缩包![image](https://user-images.githubusercontent.com/1214708/153843272-81843b45-6dc8-4945-871f-a9a467f63c33.png)
+
+## ForkApp
+
+1. ./forkapp forkapp -from ../applications/luci-app-plex -to ../applications/luci-app-demo
+2. ./forkapp upload -ip 192.168.100.1 -pwd "password" -from ../applications/luci-app-demo -to /root/
+3. ./forkapp upload -ip 192.168.100.1 -pwd "password" -from ../applications/luci-app-demo -to /root/ -script ../tools/simple-install.sh -install
diff --git a/applications/luci-app-feishuvpn/Makefile b/applications/luci-app-feishuvpn/Makefile
new file mode 100644
index 00000000..73d39652
--- /dev/null
+++ b/applications/luci-app-feishuvpn/Makefile
@@ -0,0 +1,18 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.2-20231208
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for FeiShuVpn
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +luci-lib-docker
+
+define Package/luci-app-feishuvpn/conffiles
+/etc/config/feishuvpn
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-feishuvpn/luasrc/controller/feishuvpn.lua b/applications/luci-app-feishuvpn/luasrc/controller/feishuvpn.lua
new file mode 100755
index 00000000..fcea53a5
--- /dev/null
+++ b/applications/luci-app-feishuvpn/luasrc/controller/feishuvpn.lua
@@ -0,0 +1,12 @@
+-- 定义luci.controller.feishuvpn模块
+module("luci.controller.feishuvpn", package.seeall)
+
+-- index函数:配置FeiShuVpn的管理界面入口
+function index()
+ -- 创建admin/services/feishuvpn目录下的入口,重定向到config页面
+ -- dependent = true表示该入口依赖于其他服务
+ entry({"admin", "services", "feishuvpn"}, alias("admin", "services", "feishuvpn", "config"), _("FeiShuVpn"), 30).dependent = true
+
+ -- 创建admin/services/feishuvpn/config页面,用于配置FeiShuVpn
+ entry({"admin", "services", "feishuvpn", "config"}, cbi("feishuvpn"))
+end
\ No newline at end of file
diff --git a/applications/luci-app-feishuvpn/luasrc/model/cbi/feishuvpn.lua b/applications/luci-app-feishuvpn/luasrc/model/cbi/feishuvpn.lua
new file mode 100644
index 00000000..ce3c2732
--- /dev/null
+++ b/applications/luci-app-feishuvpn/luasrc/model/cbi/feishuvpn.lua
@@ -0,0 +1,57 @@
+--[[
+LuCI - Lua Configuration Interface
+]]--
+
+local taskd = require "luci.model.tasks"
+local docker = require "luci.docker"
+local feishuvpn_model = require "luci.model.feishuvpn"
+local m, s, o
+
+m = taskd.docker_map("feishuvpn", "feishuvpn", "/usr/libexec/istorec/feishuvpn.sh",
+ translate("FeiShuVpn"),
+ translate("FeiShuVpn is p2p vpn client.")
+ .. translate("Official website:") .. ' https://wiki.feishuwg.com/')
+
+local dk = docker.new({socket_path="/var/run/docker.sock"})
+local dockerd_running = dk:_ping().code == 200
+local docker_info = dockerd_running and dk:info().body or {}
+local docker_aspace = 0
+if docker_info.DockerRootDir then
+ local statvfs = nixio.fs.statvfs(docker_info.DockerRootDir)
+ docker_aspace = statvfs and (statvfs.bavail * statvfs.bsize) or 0
+end
+
+s = m:section(SimpleSection, translate("Service Status"), translate("FeiShuVpn status:"))
+s:append(Template("feishuvpn/status"))
+
+s = m:section(TypedSection, "main", translate("Setup"),
+ (docker_aspace < 2147483648 and
+ (translate("The free space of Docker is less than 2GB, which may cause the installation to fail.")
+ .. " ") or "") .. translate("The following parameters will only take effect during installation or upgrade:"))
+s.addremove=false
+s.anonymous=true
+
+o = s:option(Value, "port", translate("Port").."*")
+o.default = "9091"
+o.datatype = "port"
+
+o = s:option(Value, "image_name", translate("Image").."*")
+o.rmempty = false
+o.datatype = "string"
+o.default = "registry.cn-qingdao.aliyuncs.com/feishuwg/p2p:v2.2"
+o:value("registry.cn-qingdao.aliyuncs.com/feishuwg/p2p:v2.2", "registry.cn-qingdao.aliyuncs.com/feishuwg/p2p:v2.2")
+
+local blocks = feishuvpn_model.blocks()
+local home = feishuvpn_model.home()
+
+o = s:option(Value, "config_path", translate("Config path").."*")
+o.rmempty = false
+o.datatype = "string"
+
+local paths, default_path = feishuvpn_model.find_paths(blocks, home, "Configs")
+for _, val in pairs(paths) do
+ o:value(val, val)
+end
+o.default = default_path
+
+return m
diff --git a/applications/luci-app-feishuvpn/luasrc/model/feishuvpn.lua b/applications/luci-app-feishuvpn/luasrc/model/feishuvpn.lua
new file mode 100644
index 00000000..73233bc1
--- /dev/null
+++ b/applications/luci-app-feishuvpn/luasrc/model/feishuvpn.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local feishuvpn = {}
+
+feishuvpn.blocks = function()
+ local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
+ local vals = {}
+ if f then
+ local ret = f:read("*all")
+ f:close()
+ local obj = jsonc.parse(ret)
+ for _, val in pairs(obj["blockdevices"]) do
+ local fsize = val["fssize"]
+ if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
+ -- fsize > 1G
+ vals[#vals+1] = val["mountpoint"]
+ end
+ end
+ end
+ return vals
+end
+
+feishuvpn.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
+ home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
+ home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
+ home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
+ return home_dirs
+end
+
+feishuvpn.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/FeiShuVpn"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/FeiShuVpn")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/FeiShuVpn"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return feishuvpn
diff --git a/applications/luci-app-feishuvpn/luasrc/view/feishuvpn/status.htm b/applications/luci-app-feishuvpn/luasrc/view/feishuvpn/status.htm
new file mode 100644
index 00000000..adaeec78
--- /dev/null
+++ b/applications/luci-app-feishuvpn/luasrc/view/feishuvpn/status.htm
@@ -0,0 +1,31 @@
+<%
+local util = require "luci.util"
+local container_status = util.trim(util.exec("/usr/libexec/istorec/feishuvpn.sh status"))
+local container_install = (string.len(container_status) > 0)
+local container_running = container_status == "running"
+-%>
+
+
+
+ <% if container_running then %>
+
+ <% else %>
+
+ <% end %>
+
+
+<%
+if container_running then
+ local port=util.trim(util.exec("/usr/libexec/istorec/feishuvpn.sh port"))
+ if port == "" then
+ port="9091"
+ end
+-%>
+
+
+
+
+
+
+
+<% end %>
diff --git a/applications/luci-app-feishuvpn/po/zh-cn/feishuvpn.po b/applications/luci-app-feishuvpn/po/zh-cn/feishuvpn.po
new file mode 100644
index 00000000..14ba3bb9
--- /dev/null
+++ b/applications/luci-app-feishuvpn/po/zh-cn/feishuvpn.po
@@ -0,0 +1,50 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "FeiShuVpn"
+msgstr "飞鼠组网"
+
+msgid "Official website:"
+msgstr "官方网站:"
+
+msgid "FeiShuVpn is p2p vpn client."
+msgstr "飞鼠组网是一个点对点的组网工具。"
+
+msgid "Config path"
+msgstr "配置文件路径"
+
+msgid "Port"
+msgstr "端口"
+
+msgid "Service Status"
+msgstr "服务状态"
+
+msgid "FeiShuVpn status:"
+msgstr "飞鼠组网的状态信息如下:"
+
+msgid "Setup"
+msgstr "安装配置"
+
+msgid "The following parameters will only take effect during installation or upgrade:"
+msgstr "以下参数只在安装或者升级时才会生效:"
+
+msgid "Status"
+msgstr "状态"
+
+msgid "FeiShuVpn is running"
+msgstr "飞鼠组网运行中"
+
+msgid "FeiShuVpn is not running"
+msgstr "飞鼠组网未运行"
+
+msgid "Open FeiShuVpn"
+msgstr "打开飞鼠组网"
+
+msgid "Not required, all disk will be mounted under %s"
+msgstr "可不填,所有硬盘都会挂载到 %s 下"
+
+msgid "The free space of Docker is less than 2GB, which may cause the installation to fail."
+msgstr "Docker 可用空间已不足2GB,可能导致安装失败。"
+
+msgid "Please make sure there has enough space"
+msgstr "请确保有足够空间"
diff --git a/applications/luci-app-feishuvpn/root/etc/config/feishuvpn b/applications/luci-app-feishuvpn/root/etc/config/feishuvpn
new file mode 100644
index 00000000..ce673778
--- /dev/null
+++ b/applications/luci-app-feishuvpn/root/etc/config/feishuvpn
@@ -0,0 +1,3 @@
+config main
+ option 'config_path' ''
+
diff --git a/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh b/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh
new file mode 100755
index 00000000..0ba2e807
--- /dev/null
+++ b/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+# Author Xiaobao(xiaobao@linkease.com)
+
+ACTION=${1}
+shift 1
+
+do_install() {
+ local image_name=`uci get feishuvpn.@main[0].image_name 2>/dev/null`
+ local config=`uci get feishuvpn.@main[0].config_path 2>/dev/null`
+
+ if [ -z "$config" ]; then
+ echo "config path is empty!"
+ exit 1
+ fi
+
+ [ -z "$image_name" ] && image_name="registry.cn-qingdao.aliyuncs.com/feishuwg/p2p:v2.2"
+ echo "docker pull ${image_name}"
+ docker pull ${image_name}
+ docker rm -f feishuvpn
+
+ local cmd="docker run --restart=unless-stopped -d -h FeiShuVpnServer -v \"$config:/data/conf\" "
+
+ cmd="$cmd\
+ --cap-add=ALL \
+ --privileged=true \
+ --device=/dev/net/tun \
+ --dns=127.0.0.1 \
+ --network=host "
+
+ # local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`"
+ # [ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
+
+ cmd="$cmd -v /mnt:/mnt"
+ mountpoint -q /mnt && cmd="$cmd:rslave"
+ cmd="$cmd --name feishuvpn \"$image_name\""
+
+ echo "$cmd"
+ eval "$cmd"
+}
+
+usage() {
+ echo "usage: $0 sub-command"
+ echo "where sub-command is one of:"
+ echo " install Install the feishuvpn"
+ echo " upgrade Upgrade the feishuvpn"
+ echo " rm/start/stop/restart Remove/Start/Stop/Restart the feishuvpn"
+ echo " status FeiShuVpn status"
+ echo " port FeiShuVpn port"
+}
+
+case ${ACTION} in
+ "install")
+ do_install
+ ;;
+ "upgrade")
+ do_install
+ ;;
+ "rm")
+ docker rm -f feishuvpn
+ ;;
+ "start" | "stop" | "restart")
+ docker ${ACTION} feishuvpn
+ ;;
+ "status")
+ docker ps --all -f 'name=feishuvpn' --format '{{.State}}'
+ ;;
+ "port")
+ echo 9091
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/applications/luci-app-htreader/Makefile b/applications/luci-app-htreader/Makefile
new file mode 100644
index 00000000..6884f6f6
--- /dev/null
+++ b/applications/luci-app-htreader/Makefile
@@ -0,0 +1,18 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.2-20231208
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for HTReader
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +luci-lib-docker
+
+define Package/luci-app-htreader/conffiles
+/etc/config/htreader
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-htreader/luasrc/controller/htreader.lua b/applications/luci-app-htreader/luasrc/controller/htreader.lua
new file mode 100755
index 00000000..92233c17
--- /dev/null
+++ b/applications/luci-app-htreader/luasrc/controller/htreader.lua
@@ -0,0 +1,7 @@
+
+module("luci.controller.htreader", package.seeall)
+
+function index()
+ entry({"admin", "services", "htreader"}, alias("admin", "services", "htreader", "config"), _("HTReader"), 30).dependent = true
+ entry({"admin", "services", "htreader", "config"}, cbi("htreader"))
+end
diff --git a/applications/luci-app-htreader/luasrc/model/cbi/htreader.lua b/applications/luci-app-htreader/luasrc/model/cbi/htreader.lua
new file mode 100644
index 00000000..e797b469
--- /dev/null
+++ b/applications/luci-app-htreader/luasrc/model/cbi/htreader.lua
@@ -0,0 +1,69 @@
+--[[
+LuCI - Lua Configuration Interface
+]]--
+
+local taskd = require "luci.model.tasks"
+local docker = require "luci.docker"
+local htreader_model = require "luci.model.htreader"
+local m, s, o
+
+m = taskd.docker_map("htreader", "htreader", "/usr/libexec/istorec/htreader.sh",
+ translate("HTReader"),
+ translate("HTReader is book reader in web.")
+ .. translate("Official website:") .. ' https://github.com/XIU2/Yuedu')
+
+local dk = docker.new({socket_path="/var/run/docker.sock"})
+local dockerd_running = dk:_ping().code == 200
+local docker_info = dockerd_running and dk:info().body or {}
+local docker_aspace = 0
+if docker_info.DockerRootDir then
+ local statvfs = nixio.fs.statvfs(docker_info.DockerRootDir)
+ docker_aspace = statvfs and (statvfs.bavail * statvfs.bsize) or 0
+end
+
+s = m:section(SimpleSection, translate("Service Status"), translate("HTReader status:"))
+s:append(Template("htreader/status"))
+
+s = m:section(TypedSection, "main", translate("Setup"),
+ (docker_aspace < 2147483648 and
+ (translate("The free space of Docker is less than 2GB, which may cause the installation to fail.")
+ .. " ") or "") .. translate("The following parameters will only take effect during installation or upgrade:"))
+s.addremove=false
+s.anonymous=true
+
+o = s:option(Value, "port", translate("Port").."*")
+o.default = "9060"
+o.datatype = "port"
+
+o = s:option(Flag, "multiuser", translate("Multiple user version"))
+o.default = 0
+o.rmempty = false
+
+o = s:option(Value, "password", translate("password"))
+o.datatype = "string"
+o:depends("multiuser", 1)
+
+o = s:option(Value, "active_code", translate("Active code"))
+o.datatype = "string"
+o:depends("multiuser", 1)
+
+o = s:option(Value, "image_name", translate("Image").."*")
+o.rmempty = false
+o.datatype = "string"
+o.default = "hectorqin/reader"
+o:value("hectorqin/reader", "hectorqin/reader")
+
+local blocks = htreader_model.blocks()
+local home = htreader_model.home()
+
+o = s:option(Value, "config_path", translate("Config path").."*")
+o.rmempty = false
+o.datatype = "string"
+
+local paths, default_path = htreader_model.find_paths(blocks, home, "Configs")
+for _, val in pairs(paths) do
+ o:value(val, val)
+end
+o.default = default_path
+
+return m
diff --git a/applications/luci-app-htreader/luasrc/model/htreader.lua b/applications/luci-app-htreader/luasrc/model/htreader.lua
new file mode 100644
index 00000000..2e62528d
--- /dev/null
+++ b/applications/luci-app-htreader/luasrc/model/htreader.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local htreader = {}
+
+htreader.blocks = function()
+ local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
+ local vals = {}
+ if f then
+ local ret = f:read("*all")
+ f:close()
+ local obj = jsonc.parse(ret)
+ for _, val in pairs(obj["blockdevices"]) do
+ local fsize = val["fssize"]
+ if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
+ -- fsize > 1G
+ vals[#vals+1] = val["mountpoint"]
+ end
+ end
+ end
+ return vals
+end
+
+htreader.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
+ home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
+ home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
+ home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
+ return home_dirs
+end
+
+htreader.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/HTReader"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/HTReader")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/HTReader"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return htreader
diff --git a/applications/luci-app-htreader/luasrc/view/htreader/status.htm b/applications/luci-app-htreader/luasrc/view/htreader/status.htm
new file mode 100644
index 00000000..b4a239f3
--- /dev/null
+++ b/applications/luci-app-htreader/luasrc/view/htreader/status.htm
@@ -0,0 +1,31 @@
+<%
+local util = require "luci.util"
+local container_status = util.trim(util.exec("/usr/libexec/istorec/htreader.sh status"))
+local container_install = (string.len(container_status) > 0)
+local container_running = container_status == "running"
+-%>
+
+
+
+ <% if container_running then %>
+
+ <% else %>
+
+ <% end %>
+
+
+<%
+if container_running then
+ local port=util.trim(util.exec("/usr/libexec/istorec/htreader.sh port"))
+ if port == "" then
+ port="9060"
+ end
+-%>
+
+
+
+
+
+
+
+<% end %>
diff --git a/applications/luci-app-htreader/po/zh-cn/htreader.po b/applications/luci-app-htreader/po/zh-cn/htreader.po
new file mode 100644
index 00000000..0a37d418
--- /dev/null
+++ b/applications/luci-app-htreader/po/zh-cn/htreader.po
@@ -0,0 +1,44 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Official website:"
+msgstr "官方网站:"
+
+msgid "HTReader is book reader in web."
+msgstr "HTReader 是一个网页版本在线读书。"
+
+msgid "Config path"
+msgstr "配置文件路径"
+
+msgid "Port"
+msgstr "端口"
+
+msgid "Service Status"
+msgstr "服务状态"
+
+msgid "HTReader status:"
+msgstr "HTReader 的状态信息如下:"
+
+msgid "Setup"
+msgstr "安装配置"
+
+msgid "The following parameters will only take effect during installation or upgrade:"
+msgstr "以下参数只在安装或者升级时才会生效:"
+
+msgid "Status"
+msgstr "状态"
+
+msgid "HTReader is running"
+msgstr "HTReader 运行中"
+
+msgid "HTReader is not running"
+msgstr "HTReader 未运行"
+
+msgid "Open HTReader"
+msgstr "打开 HTReader"
+
+msgid "The free space of Docker is less than 2GB, which may cause the installation to fail."
+msgstr "Docker 可用空间已不足2GB,可能导致安装失败。"
+
+msgid "Please make sure there has enough space"
+msgstr "请确保有足够空间"
diff --git a/applications/luci-app-htreader/root/etc/config/htreader b/applications/luci-app-htreader/root/etc/config/htreader
new file mode 100644
index 00000000..a4bb805c
--- /dev/null
+++ b/applications/luci-app-htreader/root/etc/config/htreader
@@ -0,0 +1,4 @@
+config main
+ option 'port' '9060'
+ option 'multiuser' '0'
+
diff --git a/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh b/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh
new file mode 100755
index 00000000..48e2a656
--- /dev/null
+++ b/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+# Author Xiaobao(xiaobao@linkease.com)
+
+ACTION=${1}
+shift 1
+
+do_install() {
+ local port=`uci get htreader.@main[0].port 2>/dev/null`
+ local multiuser=`uci get htreader.@main[0].multiuser 2>/dev/null`
+ local active_code=`uci get htreader.@main[0].active_code 2>/dev/null`
+ local password=`uci get htreader.@main[0].password 2>/dev/null`
+ local image_name=`uci get htreader.@main[0].image_name 2>/dev/null`
+ local config=`uci get htreader.@main[0].config_path 2>/dev/null`
+
+ if [ -z "$config" ]; then
+ echo "config path is empty!"
+ exit 1
+ fi
+
+ [ -z "$image_name" ] && image_name="hectorqin/reader"
+ echo "docker pull ${image_name}"
+ docker pull ${image_name}
+ docker rm -f htreader
+
+ [ -z "$port" ] && port=9060
+
+ mkdir -p $config/storage
+ mkdir -p $config/logs
+ local cmd="docker run --restart=unless-stopped -d -h HTReaderServer \
+ -e \"SPRING_PROFILES_ACTIVE=prod\" \
+ -v \"$config/logs:/logs\" \
+ -v \"$config/storage:/storage\" "
+
+ if [ "$multiuser" = "1" ]; then
+ cmd="$cmd -e \"READER_APP_SECUREKEY=$password\" -e \"READER_APP_INVITECODE=$active_code\" "
+ fi
+
+ cmd="$cmd\
+ --dns=172.17.0.1 \
+ -p $port:8080 "
+
+ local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`"
+ [ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
+
+ cmd="$cmd -v /mnt:/mnt"
+ mountpoint -q /mnt && cmd="$cmd:rslave"
+ cmd="$cmd --name htreader \"$image_name\""
+
+ echo "$cmd"
+ eval "$cmd"
+}
+
+usage() {
+ echo "usage: $0 sub-command"
+ echo "where sub-command is one of:"
+ echo " install Install the htreader"
+ echo " upgrade Upgrade the htreader"
+ echo " rm/start/stop/restart Remove/Start/Stop/Restart the htreader"
+ echo " status HTReader status"
+ echo " port HTReader port"
+}
+
+case ${ACTION} in
+ "install")
+ do_install
+ ;;
+ "upgrade")
+ do_install
+ ;;
+ "rm")
+ docker rm -f htreader
+ ;;
+ "start" | "stop" | "restart")
+ docker ${ACTION} htreader
+ ;;
+ "status")
+ docker ps --all -f 'name=htreader' --format '{{.State}}'
+ ;;
+ "port")
+ docker ps --all -f 'name=htreader' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->9060/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/applications/luci-app-ittools/Makefile b/applications/luci-app-ittools/Makefile
new file mode 100644
index 00000000..407d8990
--- /dev/null
+++ b/applications/luci-app-ittools/Makefile
@@ -0,0 +1,18 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.2-20231208
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for ITTools
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +luci-lib-docker
+
+define Package/luci-app-ittools/conffiles
+/etc/config/ittools
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-ittools/luasrc/controller/ittools.lua b/applications/luci-app-ittools/luasrc/controller/ittools.lua
new file mode 100755
index 00000000..5e31f0b7
--- /dev/null
+++ b/applications/luci-app-ittools/luasrc/controller/ittools.lua
@@ -0,0 +1,7 @@
+
+module("luci.controller.ittools", package.seeall)
+
+function index()
+ entry({"admin", "services", "ittools"}, alias("admin", "services", "ittools", "config"), _("ITTools"), 30).dependent = true
+ entry({"admin", "services", "ittools", "config"}, cbi("ittools"))
+end
diff --git a/applications/luci-app-ittools/luasrc/model/cbi/ittools.lua b/applications/luci-app-ittools/luasrc/model/cbi/ittools.lua
new file mode 100644
index 00000000..79eaef81
--- /dev/null
+++ b/applications/luci-app-ittools/luasrc/model/cbi/ittools.lua
@@ -0,0 +1,45 @@
+--[[
+LuCI - Lua Configuration Interface
+]]--
+
+local taskd = require "luci.model.tasks"
+local docker = require "luci.docker"
+local m, s, o
+
+m = taskd.docker_map("ittools", "ittools", "/usr/libexec/istorec/ittools.sh",
+ translate("ITTools"),
+ translate("ITTools is useful tools for developer and people working in IT.")
+ .. translate("Official website:") .. ' https://it-tools.tech/')
+
+local dk = docker.new({socket_path="/var/run/docker.sock"})
+local dockerd_running = dk:_ping().code == 200
+local docker_info = dockerd_running and dk:info().body or {}
+local docker_aspace = 0
+if docker_info.DockerRootDir then
+ local statvfs = nixio.fs.statvfs(docker_info.DockerRootDir)
+ docker_aspace = statvfs and (statvfs.bavail * statvfs.bsize) or 0
+end
+
+s = m:section(SimpleSection, translate("Service Status"), translate("ITTools status:"))
+s:append(Template("ittools/status"))
+
+s = m:section(TypedSection, "main", translate("Setup"),
+ (docker_aspace < 2147483648 and
+ (translate("The free space of Docker is less than 2GB, which may cause the installation to fail.")
+ .. " ") or "") .. translate("The following parameters will only take effect during installation or upgrade:"))
+s.addremove=false
+s.anonymous=true
+
+o = s:option(Value, "port", translate("Port").."*")
+o.default = "9070"
+o.datatype = "port"
+o:depends("hostnet", 0)
+
+o = s:option(Value, "image_name", translate("Image").."*")
+o.rmempty = false
+o.datatype = "string"
+o.default = "corentinth/it-tools:latest"
+o:value("corentinth/it-tools:latest", "corentinth/it-tools:latest")
+o:value("ghcr.io/corentinth/it-tools:latest", "ghcr.io/corentinth/it-tools:latest")
+
+return m
diff --git a/applications/luci-app-ittools/luasrc/model/ittools.lua b/applications/luci-app-ittools/luasrc/model/ittools.lua
new file mode 100644
index 00000000..f1f6ef5e
--- /dev/null
+++ b/applications/luci-app-ittools/luasrc/model/ittools.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local ittools = {}
+
+ittools.blocks = function()
+ local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
+ local vals = {}
+ if f then
+ local ret = f:read("*all")
+ f:close()
+ local obj = jsonc.parse(ret)
+ for _, val in pairs(obj["blockdevices"]) do
+ local fsize = val["fssize"]
+ if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
+ -- fsize > 1G
+ vals[#vals+1] = val["mountpoint"]
+ end
+ end
+ end
+ return vals
+end
+
+ittools.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
+ home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
+ home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
+ home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
+ return home_dirs
+end
+
+ittools.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/ITTools"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/ITTools")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/ITTools"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return ittools
diff --git a/applications/luci-app-ittools/luasrc/view/ittools/status.htm b/applications/luci-app-ittools/luasrc/view/ittools/status.htm
new file mode 100644
index 00000000..79c0bee4
--- /dev/null
+++ b/applications/luci-app-ittools/luasrc/view/ittools/status.htm
@@ -0,0 +1,31 @@
+<%
+local util = require "luci.util"
+local container_status = util.trim(util.exec("/usr/libexec/istorec/ittools.sh status"))
+local container_install = (string.len(container_status) > 0)
+local container_running = container_status == "running"
+-%>
+
+
+
+ <% if container_running then %>
+
+ <% else %>
+
+ <% end %>
+
+
+<%
+if container_running then
+ local port=util.trim(util.exec("/usr/libexec/istorec/ittools.sh port"))
+ if port == "" then
+ port="9070"
+ end
+-%>
+
+
+
+
+
+
+
+<% end %>
diff --git a/applications/luci-app-ittools/po/zh-cn/ittools.po b/applications/luci-app-ittools/po/zh-cn/ittools.po
new file mode 100644
index 00000000..d1d9c5cc
--- /dev/null
+++ b/applications/luci-app-ittools/po/zh-cn/ittools.po
@@ -0,0 +1,44 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "ITTools"
+msgid "开发工具集"
+
+msgid "Official website:"
+msgstr "官方网站:"
+
+msgid "ITTools is useful tools for developer and people working in IT."
+msgstr "开发工具集是集成了很多有用的网页工具。"
+
+msgid "Port"
+msgstr "端口"
+
+msgid "Service Status"
+msgstr "服务状态"
+
+msgid "ITTools status:"
+msgstr "ITTools 的状态信息如下:"
+
+msgid "Setup"
+msgstr "安装配置"
+
+msgid "The following parameters will only take effect during installation or upgrade:"
+msgstr "以下参数只在安装或者升级时才会生效:"
+
+msgid "Status"
+msgstr "状态"
+
+msgid "ITTools is running"
+msgstr "ITTools 运行中"
+
+msgid "ITTools is not running"
+msgstr "ITTools 未运行"
+
+msgid "Open ITTools"
+msgstr "打开 ITTools"
+
+msgid "The free space of Docker is less than 2GB, which may cause the installation to fail."
+msgstr "Docker 可用空间已不足2GB,可能导致安装失败。"
+
+msgid "Please make sure there has enough space"
+msgstr "请确保有足够空间"
diff --git a/applications/luci-app-ittools/root/etc/config/ittools b/applications/luci-app-ittools/root/etc/config/ittools
new file mode 100644
index 00000000..26043d63
--- /dev/null
+++ b/applications/luci-app-ittools/root/etc/config/ittools
@@ -0,0 +1,3 @@
+config main
+ option 'port' '9070'
+
diff --git a/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh b/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh
new file mode 100755
index 00000000..353f1f0f
--- /dev/null
+++ b/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Author Xiaobao(xiaobao@linkease.com)
+
+ACTION=${1}
+shift 1
+
+do_install() {
+ local port=`uci get ittools.@main[0].port 2>/dev/null`
+ local image_name=`uci get ittools.@main[0].image_name 2>/dev/null`
+
+ [ -z "$image_name" ] && image_name="linuxserver/ittools:latest"
+ echo "docker pull ${image_name}"
+ docker pull ${image_name}
+ docker rm -f ittools
+
+ [ -z "$port" ] && port=9070
+
+ local cmd="docker run --restart=unless-stopped -d -h ITToolsServer "
+
+ cmd="$cmd\
+ --dns=172.17.0.1 \
+ -p $port:80 "
+
+ local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`"
+ [ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
+
+ cmd="$cmd -v /mnt:/mnt"
+ mountpoint -q /mnt && cmd="$cmd:rslave"
+ cmd="$cmd --name ittools \"$image_name\""
+
+ echo "$cmd"
+ eval "$cmd"
+}
+
+usage() {
+ echo "usage: $0 sub-command"
+ echo "where sub-command is one of:"
+ echo " install Install the ittools"
+ echo " upgrade Upgrade the ittools"
+ echo " rm/start/stop/restart Remove/Start/Stop/Restart the ittools"
+ echo " status ITTools status"
+ echo " port ITTools port"
+}
+
+case ${ACTION} in
+ "install")
+ do_install
+ ;;
+ "upgrade")
+ do_install
+ ;;
+ "rm")
+ docker rm -f ittools
+ ;;
+ "start" | "stop" | "restart")
+ docker ${ACTION} ittools
+ ;;
+ "status")
+ docker ps --all -f 'name=ittools' --format '{{.State}}'
+ ;;
+ "port")
+ docker ps --all -f 'name=ittools' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->9070/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/applications/luci-app-mtphotos/Makefile b/applications/luci-app-mtphotos/Makefile
new file mode 100644
index 00000000..490c09dc
--- /dev/null
+++ b/applications/luci-app-mtphotos/Makefile
@@ -0,0 +1,18 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.2-20231208
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for MTPhotos
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +luci-lib-docker
+
+define Package/luci-app-mtphotos/conffiles
+/etc/config/mtphotos
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-mtphotos/luasrc/controller/mtphotos.lua b/applications/luci-app-mtphotos/luasrc/controller/mtphotos.lua
new file mode 100755
index 00000000..53b15c19
--- /dev/null
+++ b/applications/luci-app-mtphotos/luasrc/controller/mtphotos.lua
@@ -0,0 +1,7 @@
+
+module("luci.controller.mtphotos", package.seeall)
+
+function index()
+ entry({"admin", "services", "mtphotos"}, alias("admin", "services", "mtphotos", "config"), _("MTPhotos"), 30).dependent = true
+ entry({"admin", "services", "mtphotos", "config"}, cbi("mtphotos"))
+end
diff --git a/applications/luci-app-mtphotos/luasrc/model/cbi/mtphotos.lua b/applications/luci-app-mtphotos/luasrc/model/cbi/mtphotos.lua
new file mode 100644
index 00000000..60150181
--- /dev/null
+++ b/applications/luci-app-mtphotos/luasrc/model/cbi/mtphotos.lua
@@ -0,0 +1,73 @@
+--[[
+LuCI - Lua Configuration Interface
+]]--
+
+local taskd = require "luci.model.tasks"
+local docker = require "luci.docker"
+local mtphotos_model = require "luci.model.mtphotos"
+local m, s, o
+
+m = taskd.docker_map("mtphotos", "mtphotos", "/usr/libexec/istorec/mtphotos.sh",
+ translate("MTPhotos"),
+ translate("MTPhotos is a photo manager, made by MTPhotos, Inc.")
+ .. translate("Official website:") .. ' https://mtmt.tech/')
+
+local dk = docker.new({socket_path="/var/run/docker.sock"})
+local dockerd_running = dk:_ping().code == 200
+local docker_info = dockerd_running and dk:info().body or {}
+local docker_aspace = 0
+if docker_info.DockerRootDir then
+ local statvfs = nixio.fs.statvfs(docker_info.DockerRootDir)
+ docker_aspace = statvfs and (statvfs.bavail * statvfs.bsize) or 0
+end
+
+s = m:section(SimpleSection, translate("Service Status"), translate("MTPhotos status:"))
+s:append(Template("mtphotos/status"))
+
+s = m:section(TypedSection, "main", translate("Setup"),
+ (docker_aspace < 2147483648 and
+ (translate("The free space of Docker is less than 2GB, which may cause the installation to fail.")
+ .. " ") or "") .. translate("The following parameters will only take effect during installation or upgrade:"))
+s.addremove=false
+s.anonymous=true
+
+o = s:option(Value, "port", translate("Port").."*")
+o.default = "8063"
+o.datatype = "port"
+o:depends("hostnet", 0)
+
+o = s:option(Value, "image_name", translate("Image").."*")
+o.rmempty = false
+o.datatype = "string"
+o:value("mtphotos/mt-photos:nodb-latest", "mtphotos/mt-photos:nodb-latest")
+o:value("mtphotos/mt-photos:latest", "mtphotos/mt-photos:latest")
+if "x86_64" == docker_info.Architecture then
+ o.default = "mtphotos/mt-photos:latest"
+else
+ o:value("mtphotos/mt-photos:arm-latest", "mtphotos/mt-photos:arm-latest")
+ o.default = "mtphotos/mt-photos:arm-latest"
+end
+
+local blocks = mtphotos_model.blocks()
+local home = mtphotos_model.home()
+
+o = s:option(Value, "config_path", translate("Config path").."*")
+o.rmempty = false
+o.datatype = "string"
+
+local paths, default_path = mtphotos_model.find_paths(blocks, home, "Configs")
+for _, val in pairs(paths) do
+ o:value(val.."/Config", val.."/Config")
+end
+o.default = default_path.."/Config"
+
+o = s:option(Value, "upload_path", translate("Upload path").."*")
+o.rmempty = false
+o.datatype = "string"
+
+for _, val in pairs(paths) do
+ o:value(val.."/Upload", val.."/Upload")
+end
+o.default = default_path.."/Upload"
+
+return m
diff --git a/applications/luci-app-mtphotos/luasrc/model/mtphotos.lua b/applications/luci-app-mtphotos/luasrc/model/mtphotos.lua
new file mode 100644
index 00000000..3aad421b
--- /dev/null
+++ b/applications/luci-app-mtphotos/luasrc/model/mtphotos.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local mtphotos = {}
+
+mtphotos.blocks = function()
+ local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
+ local vals = {}
+ if f then
+ local ret = f:read("*all")
+ f:close()
+ local obj = jsonc.parse(ret)
+ for _, val in pairs(obj["blockdevices"]) do
+ local fsize = val["fssize"]
+ if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
+ -- fsize > 1G
+ vals[#vals+1] = val["mountpoint"]
+ end
+ end
+ end
+ return vals
+end
+
+mtphotos.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
+ home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
+ home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
+ home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
+ return home_dirs
+end
+
+mtphotos.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/MTPhotos"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/MTPhotos")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/MTPhotos"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return mtphotos
diff --git a/applications/luci-app-mtphotos/luasrc/view/mtphotos/status.htm b/applications/luci-app-mtphotos/luasrc/view/mtphotos/status.htm
new file mode 100644
index 00000000..df8fc665
--- /dev/null
+++ b/applications/luci-app-mtphotos/luasrc/view/mtphotos/status.htm
@@ -0,0 +1,31 @@
+<%
+local util = require "luci.util"
+local container_status = util.trim(util.exec("/usr/libexec/istorec/mtphotos.sh status"))
+local container_install = (string.len(container_status) > 0)
+local container_running = container_status == "running"
+-%>
+
+
+
+ <% if container_running then %>
+
+ <% else %>
+
+ <% end %>
+
+
+<%
+if container_running then
+ local port=util.trim(util.exec("/usr/libexec/istorec/mtphotos.sh port"))
+ if port == "" then
+ port="8063"
+ end
+-%>
+
+
+
+
+
+
+
+<% end %>
diff --git a/applications/luci-app-mtphotos/po/zh-cn/mtphotos.po b/applications/luci-app-mtphotos/po/zh-cn/mtphotos.po
new file mode 100644
index 00000000..21e90deb
--- /dev/null
+++ b/applications/luci-app-mtphotos/po/zh-cn/mtphotos.po
@@ -0,0 +1,47 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Official website:"
+msgstr "官方网站:"
+
+msgid "MTPhotos is a photo manager, made by MTPhotos, Inc."
+msgstr "MTPhotos 是一个相册管理软件。"
+
+msgid "Config path"
+msgstr "配置文件路径"
+
+msgid "Upload path"
+msgstr "上传文件路径"
+
+msgid "Port"
+msgstr "端口"
+
+msgid "Service Status"
+msgstr "服务状态"
+
+msgid "MTPhotos status:"
+msgstr "MTPhotos 的状态信息如下:"
+
+msgid "Setup"
+msgstr "安装配置"
+
+msgid "The following parameters will only take effect during installation or upgrade:"
+msgstr "以下参数只在安装或者升级时才会生效:"
+
+msgid "Status"
+msgstr "状态"
+
+msgid "MTPhotos is running"
+msgstr "MTPhotos 运行中"
+
+msgid "MTPhotos is not running"
+msgstr "MTPhotos 未运行"
+
+msgid "Open MTPhotos"
+msgstr "打开 MTPhotos"
+
+msgid "The free space of Docker is less than 2GB, which may cause the installation to fail."
+msgstr "Docker 可用空间已不足2GB,可能导致安装失败。"
+
+msgid "Please make sure there has enough space"
+msgstr "请确保有足够空间"
diff --git a/applications/luci-app-mtphotos/root/etc/config/mtphotos b/applications/luci-app-mtphotos/root/etc/config/mtphotos
new file mode 100644
index 00000000..69abbb98
--- /dev/null
+++ b/applications/luci-app-mtphotos/root/etc/config/mtphotos
@@ -0,0 +1,5 @@
+config main
+ option 'port' '8063'
+# option 'config_path' ''
+# option 'upload_path' ''
+
diff --git a/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh b/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh
new file mode 100755
index 00000000..ce6a99a8
--- /dev/null
+++ b/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+# Author Xiaobao(xiaobao@linkease.com)
+
+ACTION=${1}
+shift 1
+
+do_install() {
+ local port=`uci get mtphotos.@main[0].port 2>/dev/null`
+ local image_name=`uci get mtphotos.@main[0].image_name 2>/dev/null`
+ local config=`uci get mtphotos.@main[0].config_path 2>/dev/null`
+ local upload=`uci get mtphotos.@main[0].upload_path 2>/dev/null`
+
+ if [ -z "$config" ]; then
+ echo "config path is empty!"
+ exit 1
+ fi
+
+ [ -z "$image_name" ] && image_name="mtphotos/mt-photos:latest"
+ echo "docker pull ${image_name}"
+ docker pull ${image_name}
+ docker rm -f mtphotos
+
+ [ -z "$port" ] && port=8063
+
+ local cmd="docker run --restart=unless-stopped -d -h MTPhotosServer \
+ -v \"$upload:/upload\" \
+ -v \"$config:/config\" "
+
+ cmd="$cmd\
+ --dns=172.17.0.1 \
+ -p $port:8063 "
+
+ local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`"
+ [ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
+
+ cmd="$cmd -v /mnt:/mnt"
+ mountpoint -q /mnt && cmd="$cmd:rslave"
+ cmd="$cmd --name mtphotos \"$image_name\""
+
+ echo "$cmd"
+ eval "$cmd"
+}
+
+usage() {
+ echo "usage: $0 sub-command"
+ echo "where sub-command is one of:"
+ echo " install Install the mtphotos"
+ echo " upgrade Upgrade the mtphotos"
+ echo " rm/start/stop/restart Remove/Start/Stop/Restart the mtphotos"
+ echo " status MTPhotos status"
+ echo " port MTPhotos port"
+}
+
+case ${ACTION} in
+ "install")
+ do_install
+ ;;
+ "upgrade")
+ do_install
+ ;;
+ "rm")
+ docker rm -f mtphotos
+ ;;
+ "start" | "stop" | "restart")
+ docker ${ACTION} mtphotos
+ ;;
+ "status")
+ docker ps --all -f 'name=mtphotos' --format '{{.State}}'
+ ;;
+ "port")
+ docker ps --all -f 'name=mtphotos' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8063/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/applications/luci-app-plex/simple-install.sh b/applications/luci-app-plex/simple-install.sh
deleted file mode 100755
index b0eb2245..00000000
--- a/applications/luci-app-plex/simple-install.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# run in router
-APPNAME=$1
-
-if [ -z "${APPNAME}" ]; then
- APPNAME=plex
-fi
-
-mkdir -p /usr/lib/lua/luci/view/${APPNAME}
-cp ./luasrc/controller/${APPNAME}.lua /usr/lib/lua/luci/controller/
-cp ./luasrc/view/${APPNAME}/* /usr/lib/lua/luci/view/${APPNAME}/
-cp -rf ./luasrc/model/* /usr/lib/lua/luci/model/
-cp -rf ./root/* /
-rm -rf /tmp/luci-*
-
diff --git a/applications/luci-app-rtbwmon/Makefile b/applications/luci-app-rtbwmon/Makefile
index 8db787f7..6c4ee92c 100644
--- a/applications/luci-app-rtbwmon/Makefile
+++ b/applications/luci-app-rtbwmon/Makefile
@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
-PKG_VERSION:=1.0.3-1
+PKG_VERSION:=1.0.4-1
PKG_RELEASE:=
PKG_MAINTAINER:=jjm2473
diff --git a/applications/luci-app-rtbwmon/htdocs/luci-static/rtbwmon/rtbwmon.js b/applications/luci-app-rtbwmon/htdocs/luci-static/rtbwmon/rtbwmon.js
index 0ce637e4..d8a64158 100644
--- a/applications/luci-app-rtbwmon/htdocs/luci-static/rtbwmon/rtbwmon.js
+++ b/applications/luci-app-rtbwmon/htdocs/luci-static/rtbwmon/rtbwmon.js
@@ -511,6 +511,17 @@
let iface_select = document.getElementById('iface_select');
let selected = iface_select.value;
let ifaces = responseText.trimEnd().split('\n').filter(line=>line).map(iface=>{
+ let priority = 0;
+ switch (iface) {
+ case "br-lan":
+ priority = -2;
+ break;
+ case "docker0":
+ priority = -1;
+ break;
+ }
+ return {iface:iface, priority:priority};
+ }).sort((a,b)=>a.priority-b.priority).map(o=>o.iface).map(iface=>{
let option = document.createElement('option');
option.value = iface;
option.innerHTML = iface;
diff --git a/applications/luci-app-rtbwmon/root/usr/libexec/rtbwmon.sh b/applications/luci-app-rtbwmon/root/usr/libexec/rtbwmon.sh
index 05859eb7..4785895e 100755
--- a/applications/luci-app-rtbwmon/root/usr/libexec/rtbwmon.sh
+++ b/applications/luci-app-rtbwmon/root/usr/libexec/rtbwmon.sh
@@ -29,7 +29,7 @@ lookup() {
}
get_wan_iface() {
- tail -n +2 /proc/net/route | sed -n -e 's/^\([^\t]\+\)\t00000000\t[^\t]\+\t[^\t]\+\t[^\t]\+\t[^\t]\+\t[^\t]\+\t00000000\t.*$/\1/p'
+ tail -n +2 /proc/net/route | sed -n -e 's/^\([^\t]\+\)\t00000000\t[^\t]\+\t[^\t]\+\t[^\t]\+\t[^\t]\+\t[^\t]\+\t00000000\t.*$/\1/p' | head -1
}
get_arp_excluded() {
@@ -38,7 +38,7 @@ get_arp_excluded() {
enforce_wan_iface() {
local INTERFACE="$1"
- [[ "$INTERFACE" = "br-lan" ]] && INTERFACE=`uci show network.wan | grep -E 'network\.wan\.(device|ifname)' | sed -n -e "1s/network\\.wan\\.[^=]\\+='\\([^']\\+\\)'\$/\\1/p"`
+ [[ "$INTERFACE" = "br-lan" ]] && INTERFACE=`uci show network.wan | grep -E 'network\.wan\.(device|ifname)=' | sed -n -e "1s/network\\.wan\\.[^=]\\+='\\([^']\\+\\)'\$/\\1/p"`
[ -z "$INTERFACE" ] && INTERFACE="/"
echo "$INTERFACE"
}
@@ -175,7 +175,7 @@ show_ifaces() {
local WAN_INTERFACE=`get_wan_iface`
[ -z "$WAN_INTERFACE" ] && return 1
WAN_INTERFACE="$(enforce_wan_iface "$WAN_INTERFACE")"
- ip addr show scope global up | grep '^ \+inet ' | sed -n -e 's/^.* \([^ ]\+\)$/\1/p' | grep -Fv "$WAN_INTERFACE" | sort -u
+ ip addr show scope global up | grep '^ \+inet ' | sed -n -e 's/^.* \([^ ]\+\)$/\1/p' | grep -Fxv "$WAN_INTERFACE" | sort -u
}
prerm() {
diff --git a/applications/luci-app-runmynas/Makefile b/applications/luci-app-runmynas/Makefile
new file mode 100644
index 00000000..c1ac84d9
--- /dev/null
+++ b/applications/luci-app-runmynas/Makefile
@@ -0,0 +1,20 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.1.1-20231208
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for runmynas
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+docker +luci-lib-iform +luci-lib-taskd
+LUCI_EXTRA_DEPENDS:=luci-lib-iform (>=1.1)
+
+define Package/luci-app-runmynas/conffiles
+/etc/config/runmynas
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
+
diff --git a/applications/luci-app-runmynas/luasrc/controller/runmynas.lua b/applications/luci-app-runmynas/luasrc/controller/runmynas.lua
new file mode 100755
index 00000000..487e461b
--- /dev/null
+++ b/applications/luci-app-runmynas/luasrc/controller/runmynas.lua
@@ -0,0 +1,174 @@
+local util = require "luci.util"
+local http = require "luci.http"
+local docker = require "luci.model.docker"
+local iform = require "luci.iform"
+local runmynas_model = require "luci.model.runmynas_disk"
+
+module("luci.controller.runmynas", package.seeall)
+
+function index()
+
+ entry({"admin", "services", "runmynas"}, call("redirect_index"), _("RunMyNAS"), 30).dependent = true
+ entry({"admin", "services", "runmynas", "pages"}, call("runmynas_index")).leaf = true
+ entry({"admin", "services", "runmynas", "form"}, call("runmynas_form"))
+ entry({"admin", "services", "runmynas", "submit"}, call("runmynas_submit"))
+
+end
+
+local appname = "runmynas"
+local page_index = {"admin", "services", "runmynas", "pages"}
+
+function redirect_index()
+ http.redirect(luci.dispatcher.build_url(unpack(page_index)))
+end
+
+function runmynas_index()
+ luci.template.render("runmynas/main", {prefix=luci.dispatcher.build_url(unpack(page_index))})
+end
+
+function runmynas_form()
+ local error = ""
+ local scope = ""
+ local success = 0
+
+ local blocks = runmynas_model.blocks()
+ local home = runmynas_model.home()
+ local paths, default_path = runmynas_model.find_paths(blocks, home, "Configs")
+ local data = get_data(default_path)
+ local result = {
+ data = data,
+ schema = get_schema(data, paths)
+ }
+ local response = {
+ error = error,
+ scope = scope,
+ success = success,
+ result = result,
+ }
+ http.prepare_content("application/json")
+ http.write_json(response)
+end
+
+function get_schema(data, paths)
+ local actions
+ actions = {
+ {
+ name = "build",
+ text = "运行",
+ type = "apply",
+ },
+ }
+ local schema = {
+ actions = actions,
+ containers = get_containers(data, paths),
+ description = "自定义你的 iStoreNAS,本插件只能运行在 X86 平台,可以去定制其他平台的固件。源码地址:https://github.com/linkease/iStoreNAS",
+ title = "RunMyNAS"
+ }
+ return schema
+end
+
+function get_containers(data, paths)
+ local containers = {
+ main_container(data, paths)
+ }
+ return containers
+end
+
+function main_container(data, paths)
+ local names = {}
+ for k, v in pairs(paths) do
+ names[k] = v
+ end
+ local main_c2 = {
+ properties = {
+ {
+ name = "download",
+ required = true,
+ title = "源码下载",
+ type = "string",
+ enum = {"github", "koolcenter"},
+ enumNames = {"Github", "Koolcenter"}
+ },
+ {
+ name = "target",
+ required = true,
+ title = "平台",
+ type = "string",
+ enum = {"x86_64", "rk35xx", "rk33xx"},
+ enumNames = {"x86_64", "rk35xx", "rk33xx"}
+ },
+ {
+ name = "path",
+ required = true,
+ title = "运行路径",
+ type = "string",
+ enum = paths,
+ enumNames = names
+ },
+ },
+ description = "请选择合适的平台运行:",
+ title = "运行操作"
+ }
+ return main_c2
+end
+
+function get_data(default_path)
+ local uci = require "luci.model.uci".cursor()
+ local target = uci:get_first(appname, appname, "target", "x86_64")
+ local download = uci:get_first(appname, appname, "download", "github")
+ local path = uci:get_first(appname, appname, "path", default_path)
+ local data = {
+ target = target,
+ download = download,
+ path = path,
+ }
+ return data
+end
+
+function runmynas_submit()
+ local error = ""
+ local scope = ""
+ local success = 0
+ local result
+
+ local jsonc = require "luci.jsonc"
+ local json_parse = jsonc.parse
+ local content = http.content()
+ local req = json_parse(content)
+ result = runmynas(req)
+ http.prepare_content("application/json")
+ local resp = {
+ error = error,
+ scope = scope,
+ success = success,
+ result = result,
+ }
+ http.write_json(resp)
+end
+
+function runmynas(req)
+ local download = req["download"]
+ local target = req["target"]
+ local path = req["path"]
+
+ -- save config
+ local uci = require "luci.model.uci".cursor()
+ uci:tset(appname, "@"..appname.."[0]", {
+ target = target or "x86_64",
+ download = download or "github",
+ path = path,
+ })
+ uci:save(appname)
+ uci:commit(appname)
+
+ local exec_cmd = string.format("/usr/libexec/istorec/runmynas.sh %s", req["$apply"])
+ exec_cmd = "/etc/init.d/tasks task_add runmynas " .. luci.util.shellquote(exec_cmd)
+ os.execute(exec_cmd .. " >/dev/null 2>&1")
+
+ local result = {
+ async = true,
+ async_state = appname
+ }
+ return result
+end
+
diff --git a/applications/luci-app-runmynas/luasrc/model/runmynas_disk.lua b/applications/luci-app-runmynas/luasrc/model/runmynas_disk.lua
new file mode 100644
index 00000000..896722f6
--- /dev/null
+++ b/applications/luci-app-runmynas/luasrc/model/runmynas_disk.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local runmynas_disk = {}
+
+runmynas_disk.blocks = function()
+ local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
+ local vals = {}
+ if f then
+ local ret = f:read("*all")
+ f:close()
+ local obj = jsonc.parse(ret)
+ for _, val in pairs(obj["blockdevices"]) do
+ local fsize = val["fssize"]
+ if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
+ -- fsize > 1G
+ vals[#vals+1] = val["mountpoint"]
+ end
+ end
+ end
+ return vals
+end
+
+runmynas_disk.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
+ home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
+ home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
+ home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
+ return home_dirs
+end
+
+runmynas_disk.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/RunMyNAS"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/RunMyNAS")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/RunMyNAS"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return runmynas_disk
diff --git a/applications/luci-app-runmynas/luasrc/view/runmynas/main.htm b/applications/luci-app-runmynas/luasrc/view/runmynas/main.htm
new file mode 100644
index 00000000..109546fc
--- /dev/null
+++ b/applications/luci-app-runmynas/luasrc/view/runmynas/main.htm
@@ -0,0 +1,28 @@
+<%+header%>
+
+<%+tasks/embed%>
+
+
+
+
+
+
+
+
+
+<%+footer%>
diff --git a/applications/luci-app-runmynas/po/zh-cn/runmynas.po b/applications/luci-app-runmynas/po/zh-cn/runmynas.po
new file mode 100644
index 00000000..1be7e761
--- /dev/null
+++ b/applications/luci-app-runmynas/po/zh-cn/runmynas.po
@@ -0,0 +1,62 @@
+msgid "runmynas"
+msgstr "runmynas"
+
+msgid "The runmynas service is running."
+msgstr "runmynas已启动"
+
+msgid "The runmynas service is not running."
+msgstr "runmynas服务未启动"
+
+msgid "The runmynas service is not installed."
+msgstr "runmynas服务未安装"
+
+msgid "open runmynas"
+msgstr "打开runmynas"
+
+msgid "stop runmynas"
+msgstr "停止runmynas"
+
+msgid "run runmynas"
+msgstr "启动runmynas"
+
+msgid "uninstall runmynas"
+msgstr "删除runmynas"
+
+msgid "install runmynas"
+msgstr "安装runmynas"
+
+msgid "Collecting data..."
+msgstr "收集数据..."
+
+msgid "storage path"
+msgstr "存储路径(建议插入U盘或硬盘,然后输入路径。例如:/mnt/sda1/runmynas)"
+
+msgid "Storage path could not be empty!"
+msgstr "存储路径不能为空!"
+
+msgid "Version"
+msgstr "系统版本"
+
+msgid "Port (optional)"
+msgstr "端口"
+
+msgid "Password (optional)"
+msgstr "密码"
+
+msgid "standard version"
+msgstr "标准版本"
+
+msgid "full version"
+msgstr "全量版本"
+
+msgid "UserName"
+msgstr "用户名"
+
+msgid "Password"
+msgstr "密码"
+
+msgid "LanAddress"
+msgstr "内网地址"
+
+msgid "WanAddress"
+msgstr "外网地址"
\ No newline at end of file
diff --git a/applications/luci-app-runmynas/root/etc/config/runmynas b/applications/luci-app-runmynas/root/etc/config/runmynas
new file mode 100644
index 00000000..f22e9655
--- /dev/null
+++ b/applications/luci-app-runmynas/root/etc/config/runmynas
@@ -0,0 +1,2 @@
+config runmynas
+ option 'target' ''
diff --git a/applications/luci-app-runmynas/root/usr/libexec/istorec/runmynas.sh b/applications/luci-app-runmynas/root/usr/libexec/istorec/runmynas.sh
new file mode 100755
index 00000000..ab0e8eea
--- /dev/null
+++ b/applications/luci-app-runmynas/root/usr/libexec/istorec/runmynas.sh
@@ -0,0 +1,84 @@
+#!/bin/sh
+# Author Xiaobao(xiaobao@linkease.com)
+
+ACTION=${1}
+shift 1
+
+command_exists() {
+ command -v "$@" >/dev/null 2>&1
+}
+
+Download_Files(){
+ local URL=$1
+ local FileName=$2
+ if command_exists curl; then
+ curl -sSLk ${URL} -o ${FileName}
+ elif command_exists wget; then
+ wget -c --no-check-certificate ${URL} -O ${FileName}
+ fi
+ if [ $? -eq 0 ]; then
+ echo "Download OK"
+ else
+ echo "Download failed"
+ exit 1
+ fi
+}
+
+do_build() {
+ local download=`uci get runmynas.@runmynas[0].download 2>/dev/null`
+ local target=`uci get runmynas.@runmynas[0].target 2>/dev/null`
+ local path=`uci get runmynas.@runmynas[0].path 2>/dev/null`
+ [ ! -z $download ] || download="github"
+ [ ! -z $target ] || target="x86_64"
+
+ if echo `uname -m` | grep -Eqi 'x86_64'; then
+ echo "Support x86_64"
+ else
+ echo "Not x86_64, only support x86_64, exit"
+ exit 1
+ fi
+
+ if [ -z "$path" ]; then
+ echo "path is empty"
+ exit 3
+ fi
+
+ mkdir -p $path
+ if [ ! -f "${path}/runmynas.sh" ]; then
+ if [ "$download" = "github" ]; then
+ DLURL=`curl -s https://api.github.com/repos/linkease/iStoreNAS/releases/latest | grep tarball_url | cut -d '"' -f 4`
+ else
+ DLURL="https://fw0.koolcenter.com/iStoreNAS/runmynas/runmynas.tar.gz"
+ fi
+ echo "download $DLURL"
+ rm -f /tmp/rumynas-source.tar.gz
+ Download_Files ${DLURL} /tmp/rumynas-source.tar.gz
+ tar -C ${path} --strip-components=1 -zxf /tmp/rumynas-source.tar.gz
+ if [ ! -f "${path}/runmynas.sh" ]; then
+ echo "runmynas.sh not found, failed!"
+ exit 2
+ fi
+ rm -f /tmp/rumynas-source.tar.gz
+ fi
+
+ cd ${path}
+ echo "./runmynas.sh $target"
+ ./runmynas.sh $target
+}
+
+usage() {
+ echo "usage: $0 sub-command"
+ echo "where sub-command is one of:"
+ echo " build Build your NAS"
+}
+
+case ${ACTION} in
+ "build")
+ do_build
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
+
diff --git a/applications/luci-app-typecho/Makefile b/applications/luci-app-typecho/Makefile
new file mode 100644
index 00000000..f44c3807
--- /dev/null
+++ b/applications/luci-app-typecho/Makefile
@@ -0,0 +1,18 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.2-20240313
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for TypeCho
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +luci-lib-docker
+
+define Package/luci-app-typecho/conffiles
+/etc/config/typecho
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-typecho/luasrc/controller/typecho.lua b/applications/luci-app-typecho/luasrc/controller/typecho.lua
new file mode 100755
index 00000000..4bfbce9b
--- /dev/null
+++ b/applications/luci-app-typecho/luasrc/controller/typecho.lua
@@ -0,0 +1,7 @@
+
+module("luci.controller.typecho", package.seeall)
+
+function index()
+ entry({"admin", "services", "typecho"}, alias("admin", "services", "typecho", "config"), _("TypeCho"), 30).dependent = true
+ entry({"admin", "services", "typecho", "config"}, cbi("typecho"))
+end
diff --git a/applications/luci-app-typecho/luasrc/model/cbi/typecho.lua b/applications/luci-app-typecho/luasrc/model/cbi/typecho.lua
new file mode 100644
index 00000000..ca3ae6a2
--- /dev/null
+++ b/applications/luci-app-typecho/luasrc/model/cbi/typecho.lua
@@ -0,0 +1,59 @@
+--[[
+LuCI - Lua Configuration Interface
+]]--
+
+local taskd = require "luci.model.tasks"
+local docker = require "luci.docker"
+local typecho_model = require "luci.model.typecho"
+local m, s, o
+
+m = taskd.docker_map("typecho", "typecho", "/usr/libexec/istorec/typecho.sh",
+ translate("TypeCho"),
+ translate("TypeCho is a lightweight blog.")
+ .. translate("Official website:") .. ' https://typecho.org/')
+
+local dk = docker.new({socket_path="/var/run/docker.sock"})
+local dockerd_running = dk:_ping().code == 200
+local docker_info = dockerd_running and dk:info().body or {}
+local docker_aspace = 0
+if docker_info.DockerRootDir then
+ local statvfs = nixio.fs.statvfs(docker_info.DockerRootDir)
+ docker_aspace = statvfs and (statvfs.bavail * statvfs.bsize) or 0
+end
+
+s = m:section(SimpleSection, translate("Service Status"), translate("TypeCho status:"))
+s:append(Template("typecho/status"))
+
+s = m:section(TypedSection, "main", translate("Setup"),
+ (docker_aspace < 2147483648 and
+ (translate("The free space of Docker is less than 2GB, which may cause the installation to fail.")
+ .. " ") or "") .. translate("The following parameters will only take effect during installation or upgrade:"))
+s.addremove=false
+s.anonymous=true
+
+o = s:option(Value, "port", translate("Port").."*")
+o.default = "9080"
+o.datatype = "port"
+
+o = s:option(Value, "image_name", translate("Image").."*")
+o.rmempty = false
+o.datatype = "string"
+o.default = "joyqi/typecho:nightly-php7.4"
+--if "x86_64" == docker_info.Architecture then
+--end
+o:value("joyqi/typecho:nightly-php7.4", "joyqi/typecho:nightly-php7.4")
+
+local blocks = typecho_model.blocks()
+local home = typecho_model.home()
+
+o = s:option(Value, "config_path", translate("Config path").."*")
+o.rmempty = false
+o.datatype = "string"
+
+local paths, default_path = typecho_model.find_paths(blocks, home, "Configs")
+for _, val in pairs(paths) do
+ o:value(val, val)
+end
+o.default = default_path
+
+return m
diff --git a/applications/luci-app-typecho/luasrc/model/typecho.lua b/applications/luci-app-typecho/luasrc/model/typecho.lua
new file mode 100644
index 00000000..420c8643
--- /dev/null
+++ b/applications/luci-app-typecho/luasrc/model/typecho.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local typecho = {}
+
+typecho.blocks = function()
+ local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
+ local vals = {}
+ if f then
+ local ret = f:read("*all")
+ f:close()
+ local obj = jsonc.parse(ret)
+ for _, val in pairs(obj["blockdevices"]) do
+ local fsize = val["fssize"]
+ if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
+ -- fsize > 1G
+ vals[#vals+1] = val["mountpoint"]
+ end
+ end
+ end
+ return vals
+end
+
+typecho.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/Configs")
+ home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
+ home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
+ home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
+ return home_dirs
+end
+
+typecho.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/TypeCho"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/TypeCho")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/TypeCho"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return typecho
diff --git a/applications/luci-app-typecho/luasrc/view/typecho/status.htm b/applications/luci-app-typecho/luasrc/view/typecho/status.htm
new file mode 100644
index 00000000..7dc1d4d6
--- /dev/null
+++ b/applications/luci-app-typecho/luasrc/view/typecho/status.htm
@@ -0,0 +1,31 @@
+<%
+local util = require "luci.util"
+local container_status = util.trim(util.exec("/usr/libexec/istorec/typecho.sh status"))
+local container_install = (string.len(container_status) > 0)
+local container_running = container_status == "running"
+-%>
+
+
+
+ <% if container_running then %>
+
+ <% else %>
+
+ <% end %>
+
+
+<%
+if container_running then
+ local port=util.trim(util.exec("/usr/libexec/istorec/typecho.sh port"))
+ if port == "" then
+ port="9080"
+ end
+-%>
+
+
+
+
+
+
+
+<% end %>
diff --git a/applications/luci-app-typecho/po/zh-cn/typecho.po b/applications/luci-app-typecho/po/zh-cn/typecho.po
new file mode 100644
index 00000000..57e92d77
--- /dev/null
+++ b/applications/luci-app-typecho/po/zh-cn/typecho.po
@@ -0,0 +1,44 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Official website:"
+msgstr "官方网站:"
+
+msgid "TypeCho is a lightweight blog."
+msgstr "TypeCho 是一个轻量级博客。"
+
+msgid "Config path"
+msgstr "配置文件路径"
+
+msgid "Port"
+msgstr "端口"
+
+msgid "Service Status"
+msgstr "服务状态"
+
+msgid "TypeCho status:"
+msgstr "TypeCho 的状态信息如下:"
+
+msgid "Setup"
+msgstr "安装配置"
+
+msgid "The following parameters will only take effect during installation or upgrade:"
+msgstr "以下参数只在安装或者升级时才会生效:"
+
+msgid "Status"
+msgstr "状态"
+
+msgid "TypeCho is running"
+msgstr "TypeCho 运行中"
+
+msgid "TypeCho is not running"
+msgstr "TypeCho 未运行"
+
+msgid "Open TypeCho"
+msgstr "打开 TypeCho"
+
+msgid "The free space of Docker is less than 2GB, which may cause the installation to fail."
+msgstr "Docker 可用空间已不足2GB,可能导致安装失败。"
+
+msgid "Please make sure there has enough space"
+msgstr "请确保有足够空间"
diff --git a/applications/luci-app-typecho/root/etc/config/typecho b/applications/luci-app-typecho/root/etc/config/typecho
new file mode 100644
index 00000000..8feb9f5f
--- /dev/null
+++ b/applications/luci-app-typecho/root/etc/config/typecho
@@ -0,0 +1,4 @@
+config main
+ option 'port' '9080'
+ option 'config_path' ''
+
diff --git a/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh b/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh
new file mode 100755
index 00000000..ea539188
--- /dev/null
+++ b/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+# Author Xiaobao(xiaobao@linkease.com)
+
+ACTION=${1}
+shift 1
+
+do_install() {
+ local port=`uci get typecho.@main[0].port 2>/dev/null`
+ local image_name=`uci get typecho.@main[0].image_name 2>/dev/null`
+ local config=`uci get typecho.@main[0].config_path 2>/dev/null`
+
+ if [ -z "$config" ]; then
+ echo "config path is empty!"
+ exit 1
+ fi
+ [ -z "$image_name" ] && image_name="joyqi/typecho:nightly-php7.4"
+ echo "docker pull ${image_name}"
+ docker pull ${image_name}
+ docker rm -f typecho
+
+ [ -z "$port" ] && port=9080
+
+ mkdir -p $config
+ chmod 777 $config
+ local cmd="docker run --restart=unless-stopped -d -h TypeChoServer -v \"$config:/app/usr\" "
+
+ cmd="$cmd\
+ --dns=172.17.0.1 \
+ -p $port:80 "
+
+ local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`"
+ [ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
+
+ cmd="$cmd -v /mnt:/mnt"
+ mountpoint -q /mnt && cmd="$cmd:rslave"
+ cmd="$cmd --name typecho \"$image_name\""
+
+ echo "$cmd"
+ eval "$cmd"
+}
+
+usage() {
+ echo "usage: $0 sub-command"
+ echo "where sub-command is one of:"
+ echo " install Install the typecho"
+ echo " upgrade Upgrade the typecho"
+ echo " rm/start/stop/restart Remove/Start/Stop/Restart the typecho"
+ echo " status TypeCho status"
+ echo " port TypeCho port"
+}
+
+case ${ACTION} in
+ "install")
+ do_install
+ ;;
+ "upgrade")
+ do_install
+ ;;
+ "rm")
+ docker rm -f typecho
+ ;;
+ "start" | "stop" | "restart")
+ docker ${ACTION} typecho
+ ;;
+ "status")
+ docker ps --all -f 'name=typecho' --format '{{.State}}'
+ ;;
+ "port")
+ docker ps --all -f 'name=typecho' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->9080/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/applications/luci-app-ubuntu/simple-install.sh b/applications/luci-app-ubuntu/simple-install.sh
deleted file mode 100755
index f8281c0f..00000000
--- a/applications/luci-app-ubuntu/simple-install.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-# run in router
-APPNAME=$1
-
-if [ -z "${APPNAME}" ]; then
- APPNAME=ubuntu
-fi
-
-mkdir -p /usr/lib/lua/luci/view/${APPNAME}
-cp ./luasrc/controller/${APPNAME}.lua /usr/lib/lua/luci/controller/
-cp ./luasrc/view/${APPNAME}/* /usr/lib/lua/luci/view/${APPNAME}/
-cp -rf ./root/* /
-rm -rf /tmp/luci-*
-
diff --git a/applications/luci-app-webvirtcloud/Makefile b/applications/luci-app-webvirtcloud/Makefile
index 6137ed76..b33855e2 100644
--- a/applications/luci-app-webvirtcloud/Makefile
+++ b/applications/luci-app-webvirtcloud/Makefile
@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
-PKG_VERSION:=0.3.8-20231208-1
+PKG_VERSION:=0.3.8-20230323-1
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for webvirtcloud
diff --git a/applications/luci-app-webvirtcloud/root/usr/libexec/istorec/webvirtcloud.sh b/applications/luci-app-webvirtcloud/root/usr/libexec/istorec/webvirtcloud.sh
index 6bc3408c..98b6e6fb 100755
--- a/applications/luci-app-webvirtcloud/root/usr/libexec/istorec/webvirtcloud.sh
+++ b/applications/luci-app-webvirtcloud/root/usr/libexec/istorec/webvirtcloud.sh
@@ -22,6 +22,9 @@ do_install() {
echo "docker pull ${IMAGE_NAME}"
docker pull ${IMAGE_NAME}
docker rm -f webvirtcloud
+ mkdir -p "$config"
+ rm -rf "$config/vmwebvirt"
+ cp /usr/sbin/vmeasedaemon "$config/vmwebvirt"
local cmd="docker run --restart=unless-stopped -d \
--cgroupns=host \
@@ -31,7 +34,7 @@ do_install() {
-v \"$config/dbconfig:/srv/webvirtcloud/dbconfig\" \
-v \"$config/libvirt:/etc/libvirt\" \
-v \"$config/images:/var/lib/libvirt/images\" \
- -v /usr/sbin/vmeasedaemon:/usr/sbin/vmwebvirt \
+ -v \"$config/vmwebvirt:/usr/sbin/vmwebvirt\" \
-v /var/run/vmease:/srv/vmease \
-p $port:80 \
--privileged \
@@ -87,7 +90,6 @@ case ${ACTION} in
docker ${ACTION} webvirtcloud
;;
"stop")
- /etc/init.d/vmease stop
docker ${ACTION} webvirtcloud
;;
"restart")
diff --git a/applications/luci-app-xunlei/Makefile b/applications/luci-app-xunlei/Makefile
index fe3e2bc5..d65d2043 100644
--- a/applications/luci-app-xunlei/Makefile
+++ b/applications/luci-app-xunlei/Makefile
@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
-PKG_VERSION:=1.0.2-20231208
+PKG_VERSION:=1.0.3-20240523
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for Xunlei
diff --git a/applications/luci-app-xunlei/luasrc/view/xunlei/status.htm b/applications/luci-app-xunlei/luasrc/view/xunlei/status.htm
index 68ebf304..d785a935 100644
--- a/applications/luci-app-xunlei/luasrc/view/xunlei/status.htm
+++ b/applications/luci-app-xunlei/luasrc/view/xunlei/status.htm
@@ -25,7 +25,7 @@