diff --git a/.github/workflows/luci.patch b/.github/workflows/luci.patch index 609b311..83a1346 100644 --- a/.github/workflows/luci.patch +++ b/.github/workflows/luci.patch @@ -1,18 +1,17 @@ -From 72f06f906ad22be173a25c3f50b61f9b1a33a16c Mon Sep 17 00:00:00 2001 +From 55db7a1f7f650f965e783301387246f9f62fa1ec Mon Sep 17 00:00:00 2001 From: Liangbin Lian -Date: Fri, 11 Mar 2022 19:16:05 +0800 -Subject: [PATCH] i18n compatible with old luci sources +Date: Wed, 11 Dec 2024 11:20:45 +0800 +Subject: [PATCH] luci.mk: postinst compat openwrt 23 -Signed-off-by: Liangbin Lian --- - luci.mk | 2 ++ - 1 file changed, 2 insertions(+) + luci.mk | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/luci.mk b/luci.mk -index b331ebe1c5e..7e9a823b8bd 100644 +index aca52e08cd..b28284c892 100644 --- a/luci.mk +++ b/luci.mk -@@ -50,6 +50,8 @@ LUCI_LANG.uk=Українська (Ukrainian) +@@ -53,6 +53,8 @@ LUCI_LANG.uk=Українська (Ukrainian) LUCI_LANG.vi=Tiếng Việt (Vietnamese) LUCI_LANG.zh_Hans=简体中文 (Chinese Simplified) LUCI_LANG.zh_Hant=繁體中文 (Chinese Traditional) @@ -21,3 +20,26 @@ index b331ebe1c5e..7e9a823b8bd 100644 # Submenu titles LUCI_MENU.col=1. Collections +@@ -211,8 +213,8 @@ endef + ifndef Package/$(PKG_NAME)/postinst + define Package/$(PKG_NAME)/postinst + [ -n "$${IPKG_INSTROOT}" ] || {$(foreach script,$(LUCI_DEFAULTS), +- (. /etc/uci-defaults/$(script)) && rm -f /etc/uci-defaults/$(script)) +- rm -f /tmp/luci-indexcache ++ [ -f /etc/uci-defaults/$(script) ] && (. /etc/uci-defaults/$(script)) && rm -f /etc/uci-defaults/$(script)) ++ rm -f /tmp/luci-indexcache /tmp/luci-indexcache.* + rm -rf /tmp/luci-modulecache/ + killall -HUP rpcd 2>/dev/null + exit 0 +@@ -325,7 +327,7 @@ define LuciTranslation + + define Package/luci-i18n-$(LUCI_BASENAME)-$(1)/postinst + [ -n "$$$${IPKG_INSTROOT}" ] || { +- (. /etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-$(1)) && rm -f /etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-$(1) ++ [ -f /etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-$(1) ] && (. /etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-$(1)) && rm -f /etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-$(1) + exit 0 + } + endef +-- +2.46.0 + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb9cecd..709aa33 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,11 +64,13 @@ jobs: DEBIAN_FRONTEND: noninteractive run: | sudo swapoff -a || true - sudo rm -rf /swapfile /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc + sudo find /etc/apt/sources.list.d ! -name 'ubuntu.sources' -type f -exec rm -f {} + sudo -E apt-get -qq update sudo -E apt-get -qq install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf rsync sudo -E apt-get -qq autoremove --purge sudo -E apt-get -qq clean + sudo ln -s /usr/bin/python3 /usr/bin/python3.10 || true sudo timedatectl set-timezone "$TZ" # curl -fsSL https://raw.githubusercontent.com/P3TERX/dotfiles/master/.bashrc >> ~/.bashrc diff --git a/applications/luci-app-ap-modem/Makefile b/applications/luci-app-ap-modem/Makefile index 49a18f1..6f7cefb 100644 --- a/applications/luci-app-ap-modem/Makefile +++ b/applications/luci-app-ap-modem/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.4-20230408 +PKG_VERSION:=1.0.5-20241208 PKG_RELEASE:= PKG_MAINTAINER:=jjm2473 diff --git a/applications/luci-app-ap-modem/root/etc/init.d/ap_modem b/applications/luci-app-ap-modem/root/etc/init.d/ap_modem index 0a445ea..78ff7a8 100644 --- a/applications/luci-app-ap-modem/root/etc/init.d/ap_modem +++ b/applications/luci-app-ap-modem/root/etc/init.d/ap_modem @@ -111,14 +111,15 @@ EOF [[ "`uci -q get network.lan.proto`" = "static" ]] && { local lan_ip="`uci -q get network.lan.ipaddr`" if [[ -n "$lan_ip" ]]; then - if echo "$lan_ip" | grep -Fq '/'; then - for bip in $lan_ip; do - eval "$(ipcalc.sh ${bip/\// } )";black_ip="$black_ip $IP/$PREFIX" - done - else - local netmask="`uci -q get network.lan.netmask`" - eval "$(ipcalc.sh "$lan_ip" "$netmask" )";black_ip="$black_ip $IP/$PREFIX" - fi + local netmask="`uci -q get network.lan.netmask`" + [[ -n "$netmask" ]] || netmask=255.255.255.255 + for bip in $lan_ip; do + if [[ "$bip" = "*/*" ]]; then + eval "$(ipcalc.sh $bip )";black_ip="$black_ip $IP/$PREFIX" + else + eval "$(ipcalc.sh $bip $netmask )";black_ip="$black_ip $IP/$PREFIX" + fi + done fi } @@ -133,32 +134,31 @@ EOF local vif for vif in lan wan; do config_get ipaddr $vif ipaddr - [[ -z "$ipaddr" ]] || { - for vip in $ipaddr; do - ok=1 - eval "$(ipcalc.sh ${vip/\// } )";vip="$IP";vip_p="$PREFIX" - [[ "$vip_p" = 32 ]] && { + [[ -n "$ipaddr" ]] || continue + for vip in $ipaddr; do + ok=1 + [[ "$vip" = "*/*" ]] || vip="$vip/24" + eval "$(ipcalc.sh $vip )";vip="$IP";vip_p="$PREFIX" + [[ "$vip_p" = 32 ]] && { + logger -t 'ap_modem' -p DEBUG "vap_$vif skip $vip/$vip_p" + break + } + for bip in $black_ip; do + eval "$(ipcalc.sh "$bip" )";bip="$IP"; + [[ "$PREFIX" -le "$vip_p" ]] || PREFIX=$vip_p + eval "$(ipcalc.sh "$vip/$PREFIX" )";vnet="$NETWORK"; + eval "$(ipcalc.sh "$bip/$PREFIX" )";bnet="$NETWORK"; + if [[ "$vnet" = "$bnet" ]]; then logger -t 'ap_modem' -p DEBUG "vap_$vif skip $vip/$vip_p" + ok=0 break - } - [[ "$vip_p" = 0 ]] && vip_p=24 - for bip in $black_ip; do - eval "$(ipcalc.sh "$bip" )";bip="$IP"; - [[ "$PREFIX" -le "$vip_p" ]] || PREFIX=$vip_p - eval "$(ipcalc.sh "$vip" "$PREFIX" )";vnet="$NETWORK"; - eval "$(ipcalc.sh "$bip" "$PREFIX" )";bnet="$NETWORK"; - if [[ "$vnet" = "$bnet" ]]; then - logger -t 'ap_modem' -p DEBUG "vap_$vif skip $vip/$vip_p" - ok=0 - break - fi - done - [[ "$ok" = 1 ]] && { - uci add_list "network.vap_$vif.ipaddr=$vip/$vip_p" - black_ip="$black_ip $vip/$vip_p" - } + fi done - } + [[ "$ok" = 1 ]] && { + uci add_list "network.vap_$vif.ipaddr=$vip/$vip_p" + black_ip="$black_ip $vip/$vip_p" + } + done done uci commit network diff --git a/applications/luci-app-arcadia/Makefile b/applications/luci-app-arcadia/Makefile new file mode 100644 index 0000000..dfba4d1 --- /dev/null +++ b/applications/luci-app-arcadia/Makefile @@ -0,0 +1,19 @@ + + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=0.0.2-1 +PKG_RELEASE:= + +LUCI_TITLE:=LuCI support for arcadia +LUCI_PKGARCH:=all +LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd + +define Package/luci-app-arcadia/conffiles +/etc/config/arcadia +endef + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/applications/luci-app-arcadia/luasrc/controller/arcadia.lua b/applications/luci-app-arcadia/luasrc/controller/arcadia.lua new file mode 100644 index 0000000..7da8415 --- /dev/null +++ b/applications/luci-app-arcadia/luasrc/controller/arcadia.lua @@ -0,0 +1,7 @@ + +module("luci.controller.arcadia", package.seeall) + +function index() + entry({"admin", "services", "arcadia"}, alias("admin", "services", "arcadia", "config"), _("Arcadia"), 30).dependent = true + entry({"admin", "services", "arcadia", "config"}, cbi("arcadia")) +end diff --git a/applications/luci-app-arcadia/luasrc/model/arcadia.lua b/applications/luci-app-arcadia/luasrc/model/arcadia.lua new file mode 100644 index 0000000..e1ca5c1 --- /dev/null +++ b/applications/luci-app-arcadia/luasrc/model/arcadia.lua @@ -0,0 +1,55 @@ +local util = require "luci.util" +local jsonc = require "luci.jsonc" + +local arcadia = {} + +arcadia.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 + +arcadia.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 + +arcadia.find_paths = function(blocks, home_dirs, path_name) + local default_path = '' + local configs = {} + + default_path = home_dirs[path_name] .. "/Arcadia" + if #blocks == 0 then + table.insert(configs, default_path) + else + for _, val in pairs(blocks) do + table.insert(configs, val .. "/" .. path_name .. "/Arcadia") + end + local without_conf_dir = "/root/" .. path_name .. "/Arcadia" + if default_path == without_conf_dir then + default_path = configs[1] + end + end + + return configs, default_path +end + +return arcadia diff --git a/applications/luci-app-arcadia/luasrc/model/cbi/arcadia.lua b/applications/luci-app-arcadia/luasrc/model/cbi/arcadia.lua new file mode 100644 index 0000000..7f09d82 --- /dev/null +++ b/applications/luci-app-arcadia/luasrc/model/cbi/arcadia.lua @@ -0,0 +1,55 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local taskd = require "luci.model.tasks" +local arcadia_model = require "luci.model.arcadia" +local m, s, o + +m = taskd.docker_map("arcadia", "arcadia", "/usr/libexec/istorec/arcadia.sh", + translate("Arcadia"), + translate("Arcadia one-stop code operation and maintenance platform.") + .. translate("Official website:") .. ' https://arcadia.cool' + .. "
" .. translate("Arcadia is mainly aimed at scripting language programming and is suitable for development and operation environments of small and medium-sized teams and individuals.") .. "
" + .. "
" .. translate("In addition to code maintenance, Arcadia is also a powerful scheduled task maintenance platform with a comprehensive file system and underlying CLI command design.") .. "
" + .. "
" .. translate("The initial username and password are 'useradmin' and 'passwd' respectively.") .. "
" + .. "
") + +s = m:section(SimpleSection, translate("Service Status"), translate("Arcadia status:")) +s:append(Template("arcadia/status")) + +s = m:section(TypedSection, "arcadia", translate("Setup"), + translate("The initial installation of Arcadia requires at least 2GB of space, please make sure that the Docker data directory has enough space. It is recommended to migrate Docker to a hard drive before installing Arcadia.") + .. "
" .. translate("The following parameters will only take effect during installation or upgrade:")) +s.addremove=false +s.anonymous=true + +o = s:option(Value, "image", translate("Image")) +o.datatype = "string" +o:value("", translate("Default")) +o:value("supermanito/arcadia:beta", "supermanito/arcadia:beta") +o:value("registry.cn-hangzhou.aliyuncs.com/supermanito/arcadia:beta", "registry.cn-hangzhou.aliyuncs.com/supermanito/arcadia:beta") + +o = s:option(Flag, "hostnet", translate("Host network"), translate("Arcadia running in host network, port is always 5678 if enabled")) +o.default = 0 +o.rmempty = false + +o = s:option(Value, "port", translate("Port").."*") +o.default = "5678" +o.datatype = "port" +o:depends("hostnet", 0) + +local blocks = arcadia_model.blocks() +local home = arcadia_model.home() + +o = s:option(Value, "config_path", translate("Config path").."*") +o.rmempty = false +o.datatype = "string" + +local paths, default_path = arcadia_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-arcadia/luasrc/view/arcadia/status.htm b/applications/luci-app-arcadia/luasrc/view/arcadia/status.htm new file mode 100644 index 0000000..8701018 --- /dev/null +++ b/applications/luci-app-arcadia/luasrc/view/arcadia/status.htm @@ -0,0 +1,31 @@ +<% +local util = require "luci.util" +local container_status = util.trim(util.exec("/usr/libexec/istorec/arcadia.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/arcadia.sh port")) + if port == "" then + port="5678" + end +-%> +
+ +
+ + +
+
+<% end %> \ No newline at end of file diff --git a/applications/luci-app-arcadia/po/zh-cn/arcadia.po b/applications/luci-app-arcadia/po/zh-cn/arcadia.po new file mode 100644 index 0000000..37eb7df --- /dev/null +++ b/applications/luci-app-arcadia/po/zh-cn/arcadia.po @@ -0,0 +1,62 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Official website:" +msgstr "官方网站:" + +msgid "Arcadia one-stop code operation and maintenance platform." +msgstr "Arcadia 一站式代码运维平台。" + +msgid "Arcadia is mainly aimed at scripting language programming and is suitable for development and operation environments of small and medium-sized teams and individuals." +msgstr "Arcadia 主要面向于脚本语言编程,适用于中小型团队与个人的开发与运维环境。" + +msgid "In addition to code maintenance, Arcadia is also a powerful scheduled task maintenance platform with a comprehensive file system and underlying CLI command design." +msgstr "除了代码运维外 Arcadia 还是一个强大的定时任务运维平台,并且有着完善的文件系统和底层CLI命令设计。" + +msgid "The initial username and password are 'useradmin' and 'passwd' respectively." +msgstr "初始的用户名和密码分别是'useradmin'和'passwd'。" + +msgid "Image" +msgstr "镜像" + +msgid "Default" +msgstr "默认" + +msgid "Config path" +msgstr "配置文件路径" + +msgid "Port" +msgstr "端口" + +msgid "Host network" +msgstr "宿主网络" + +msgid "Arcadia running in host network, port is always 5678 if enabled" +msgstr "在宿主网络运行 Arcadia,如果启用则端口固定为5678" + +msgid "Service Status" +msgstr "服务状态" + +msgid "Arcadia status:" +msgstr "Arcadia 的状态信息如下:" + +msgid "Setup" +msgstr "安装配置" + +msgid "The initial installation of Arcadia requires at least 2GB of space, please make sure that the Docker data directory has enough space. It is recommended to migrate Docker to a hard drive before installing Arcadia." +msgstr "初次安装 Arcadia 至少需要2GB空间,请确保 Docker 数据目录有足够空间。建议安装 Arcadia 前将 Docker 迁移到硬盘上。" + +msgid "The following parameters will only take effect during installation or upgrade:" +msgstr "以下参数只在安装或者升级时才会生效:" + +msgid "Status" +msgstr "状态" + +msgid "Arcadia is running" +msgstr "Arcadia 运行中" + +msgid "Arcadia is not running" +msgstr "Arcadia 未运行" + +msgid "Open Arcadia" +msgstr "打开 Arcadia" diff --git a/applications/luci-app-arcadia/root/etc/config/arcadia b/applications/luci-app-arcadia/root/etc/config/arcadia new file mode 100644 index 0000000..d9b33a1 --- /dev/null +++ b/applications/luci-app-arcadia/root/etc/config/arcadia @@ -0,0 +1,5 @@ +config arcadia + option 'hostnet' '0' + option 'port' '5678' +# option 'image' 'default' +# option 'config_path' '' diff --git a/applications/luci-app-arcadia/root/usr/libexec/istorec/arcadia.sh b/applications/luci-app-arcadia/root/usr/libexec/istorec/arcadia.sh new file mode 100644 index 0000000..bce7677 --- /dev/null +++ b/applications/luci-app-arcadia/root/usr/libexec/istorec/arcadia.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# Author jjm2473@gmail.com +# Author Xiaobao(xiaobao@linkease.com) + +ACTION=${1} +shift 1 + +ARCH="default" +IMAGE_NAME='default' + +get_image() { + IMAGE_NAME=`uci get arcadia.@arcadia[0].image 2>/dev/null` + if [ -z "$IMAGE_NAME" -o "$IMAGE_NAME" == "default" ]; then + IMAGE_NAME="supermanito/arcadia:beta" + fi +} + +do_install() { + get_image + echo "docker pull ${IMAGE_NAME}" + docker pull ${IMAGE_NAME} + docker rm -f arcadia + + do_install_detail +} + +do_install_detail() { + local hostnet=`uci get arcadia.@arcadia[0].hostnet 2>/dev/null` + local config=`uci get arcadia.@arcadia[0].config_path 2>/dev/null` + local port=`uci get arcadia.@arcadia[0].port 2>/dev/null` + local dev + + if [ -z "$config" ]; then + echo "config path is empty!" + exit 1 + fi + + [ -z "$port" ] && port=5678 + + local cmd="docker run --restart=unless-stopped -d -v \"$config/config:/arcadia/config\" -v \"$config/log:/arcadia/log\" -v \"$config/scripts:/arcadia/scripts\" -v \"$config/repo:/arcadia/repo\" -v \"$config/raw:/arcadia/raw\" -v \"$config/tgbot:/arcadia/tgbot\" " + if [ "$hostnet" = 1 ]; then + cmd="$cmd\ + --dns=127.0.0.1 \ + --network=host " + else + cmd="$cmd\ + --dns=172.17.0.1 \ + -p $port:5678 " + fi + + 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 arcadia \"$IMAGE_NAME\"" + + echo "$cmd" + eval "$cmd" + +} + +usage() { + echo "usage: $0 sub-command" + echo "where sub-command is one of:" + echo " install Install the arcadia" + echo " upgrade Upgrade the arcadia" + echo " rm/start/stop/restart Remove/Start/Stop/Restart the arcadia" + echo " status Arcadia status" + echo " port Arcadia port" +} + +case ${ACTION} in + "install") + do_install + ;; + "upgrade") + do_install + ;; + "rm") + docker rm -f arcadia + ;; + "start" | "stop" | "restart") + docker ${ACTION} arcadia + ;; + "status") + docker ps --all -f 'name=^/arcadia$' --format '{{.State}}' + ;; + "port") + docker ps --all -f 'name=^/arcadia$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->5678/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + ;; + *) + usage + exit 1 + ;; +esac diff --git a/applications/luci-app-bmtedge/Makefile b/applications/luci-app-bmtedge/Makefile index 6c73c48..8b7effd 100644 --- a/applications/luci-app-bmtedge/Makefile +++ b/applications/luci-app-bmtedge/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20231208 +PKG_VERSION:=1.0.2-20241211 PKG_RELEASE:= LUCI_TITLE:=LuCI support for bmtedge @@ -13,6 +13,14 @@ define Package/luci-app-bmtedge/conffiles /etc/config/bmtedge endef +# prerm +# postrm +define Package/luci-app-bmtedge/prerm +#!/bin/sh +/root/usr/libexec/istorec/bmtedge.sh rm +exit 0 +endef + include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-bmtedge/luasrc/model/bmtedge.lua b/applications/luci-app-bmtedge/luasrc/model/bmtedge.lua index 8b2372f..e5243ab 100644 --- a/applications/luci-app-bmtedge/luasrc/model/bmtedge.lua +++ b/applications/luci-app-bmtedge/luasrc/model/bmtedge.lua @@ -23,10 +23,12 @@ bmtedge.blocks = function() end bmtedge.default_image = function() + local dockeramd64 = "registry.cn-shanghai.aliyuncs.com/nsp-prod-1/public1:lsy-iaas-amd64-latest" + local dockerarm64 = "registry.cn-shanghai.aliyuncs.com/nsp-prod-1/public1:lsy-iaas-arm64-latest" if string.find(nixio.uname().machine, "x86_64") then - return "jinshanyun/jinshan-x86_64" + return dockeramd64 else - return "jinshanyun/jinshan-arm64" + return dockerarm64 end end diff --git a/applications/luci-app-bmtedge/luasrc/model/cbi/bmtedge.lua b/applications/luci-app-bmtedge/luasrc/model/cbi/bmtedge.lua index 2ed78d6..173aad9 100644 --- a/applications/luci-app-bmtedge/luasrc/model/cbi/bmtedge.lua +++ b/applications/luci-app-bmtedge/luasrc/model/cbi/bmtedge.lua @@ -21,10 +21,10 @@ local default_image = bmtedge_model.default_image() o = s:option(Value, "image_name", translate("Image").."*") o.rmempty = false o.datatype = "string" -o:value("jinshanyun/jinshan-x86_64", "jinshanyun/jinshan-x86_64") -o:value("jinshanyun/jinshan-arm64", "jinshanyun/jinshan-arm64") -o:value("jinshanyun/jinshan-x86_64:v1.2", "jinshanyun/jinshan-x86_64:v1.2") -o:value("jinshanyun/jinshan-arm64:v2.2", "jinshanyun/jinshan-arm64:v2.2") +local dockeramd64 = "registry.cn-shanghai.aliyuncs.com/nsp-prod-1/public1:lsy-iaas-amd64-latest" +local dockerarm64 = "registry.cn-shanghai.aliyuncs.com/nsp-prod-1/public1:lsy-iaas-arm64-latest" +o:value(dockeramd64, dockeramd64) +o:value(dockerarm64, dockerarm64) o.default = default_image local default_uid = bmtedge_model.default_uid() diff --git a/applications/luci-app-bmtedge/luasrc/view/bmtedge/status.htm b/applications/luci-app-bmtedge/luasrc/view/bmtedge/status.htm index bfcd0d8..b125aaa 100644 --- a/applications/luci-app-bmtedge/luasrc/view/bmtedge/status.htm +++ b/applications/luci-app-bmtedge/luasrc/view/bmtedge/status.htm @@ -50,7 +50,7 @@ local uid = uci:get_first("bmtedge", "bmtedge", "uid", "") return; } shown = true; - new QRCode(document.getElementById("qrimage"), "lsyK17032_"+"<%=uid%>"); + new QRCode(document.getElementById("qrimage"), "lsyK18000_"+"<%=uid%>"); document.getElementById("winContainer").style.removeProperty('display'); }; diff --git a/applications/luci-app-bmtedge/root/usr/libexec/istorec/bmtedge.sh b/applications/luci-app-bmtedge/root/usr/libexec/istorec/bmtedge.sh index f314ffe..27bb6b7 100644 --- a/applications/luci-app-bmtedge/root/usr/libexec/istorec/bmtedge.sh +++ b/applications/luci-app-bmtedge/root/usr/libexec/istorec/bmtedge.sh @@ -25,17 +25,15 @@ do_install() { docker rm -f bmtedge local cmd="docker run --restart=unless-stopped -d \ + --init \ --privileged \ --network=host \ --dns=127.0.0.1 \ --dns=223.5.5.5 \ - --tmpfs /run \ - --tmpfs /tmp \ - -v \"$path:/data/ksc1\" \ - -v \"$path/containerd:/var/lib/containerd\" \ - -e ksc_datadir=\"/data/ksc1\" \ + -v \"$path:/data/lsy_cloud\" \ + -e ksc_datadir=\"/data/lsy_cloud\" \ -e ksc_net=\"$netdev\" \ - -e ksc_machine_code=\"lsyK17032_$uid\" " + -e ksc_machine_code=\"lsyK18000_$uid\" " local tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`" [ -z "$tz" ] || cmd="$cmd -e TZ=$tz" @@ -90,10 +88,10 @@ EOF docker ${ACTION} bmtedge ;; "status") - docker ps --all -f 'name=bmtedge' --format '{{.State}}' + docker ps --all -f 'name=^/bmtedge$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=bmtedge' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/bmtedge$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-chinesesubfinder/Makefile b/applications/luci-app-chinesesubfinder/Makefile index 17a08e9..bb7ec19 100644 --- a/applications/luci-app-chinesesubfinder/Makefile +++ b/applications/luci-app-chinesesubfinder/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.3-20240113 +PKG_VERSION:=1.0.3-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for ChineseSubFinder diff --git a/applications/luci-app-chinesesubfinder/root/usr/libexec/istorec/chinesesubfinder.sh b/applications/luci-app-chinesesubfinder/root/usr/libexec/istorec/chinesesubfinder.sh index 531fc6c..31729ea 100644 --- a/applications/luci-app-chinesesubfinder/root/usr/libexec/istorec/chinesesubfinder.sh +++ b/applications/luci-app-chinesesubfinder/root/usr/libexec/istorec/chinesesubfinder.sh @@ -66,7 +66,7 @@ case ${ACTION} in docker ${ACTION} chinesesubfinder ;; "status") - docker ps --all -f 'name=chinesesubfinder' --format '{{.State}}' + docker ps --all -f 'name=^/chinesesubfinder$' --format '{{.State}}' ;; "port") uci -q get chinesesubfinder.@main[0].http_port 2>/dev/null diff --git a/applications/luci-app-clouddrive2/Makefile b/applications/luci-app-clouddrive2/Makefile index 99fa39e..54e7326 100644 --- a/applications/luci-app-clouddrive2/Makefile +++ b/applications/luci-app-clouddrive2/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20240117 +PKG_VERSION:=1.0.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for CloudDrive2 diff --git a/applications/luci-app-clouddrive2/root/usr/libexec/istorec/clouddrive2.sh b/applications/luci-app-clouddrive2/root/usr/libexec/istorec/clouddrive2.sh index dc54b09..1e598e6 100644 --- a/applications/luci-app-clouddrive2/root/usr/libexec/istorec/clouddrive2.sh +++ b/applications/luci-app-clouddrive2/root/usr/libexec/istorec/clouddrive2.sh @@ -93,10 +93,10 @@ case ${ACTION} in docker ${ACTION} clouddrive2 ;; "status") - docker ps --all -f 'name=clouddrive2' --format '{{.State}}' + docker ps --all -f 'name=^/clouddrive2$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=clouddrive2' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->19798/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/clouddrive2$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->19798/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-codeserver/Makefile b/applications/luci-app-codeserver/Makefile index e7c7ce7..edcd4d2 100644 --- a/applications/luci-app-codeserver/Makefile +++ b/applications/luci-app-codeserver/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20231208 +PKG_VERSION:=1.0.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for CodeServer diff --git a/applications/luci-app-codeserver/root/usr/libexec/istorec/codeserver.sh b/applications/luci-app-codeserver/root/usr/libexec/istorec/codeserver.sh index 86543af..7e7b1c2 100644 --- a/applications/luci-app-codeserver/root/usr/libexec/istorec/codeserver.sh +++ b/applications/luci-app-codeserver/root/usr/libexec/istorec/codeserver.sh @@ -72,10 +72,10 @@ case ${ACTION} in docker ${ACTION} codeserver ;; "status") - docker ps --all -f 'name=codeserver' --format '{{.State}}' + docker ps --all -f 'name=^/codeserver$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=codeserver' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/codeserver$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; "git-config") docker exec codeserver git config --global user.name "${1}" diff --git a/applications/luci-app-drawio/Makefile b/applications/luci-app-drawio/Makefile index d9c7eef..a9718f2 100644 --- a/applications/luci-app-drawio/Makefile +++ b/applications/luci-app-drawio/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.0-20221212 +PKG_VERSION:=1.0.0-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for DrawIO diff --git a/applications/luci-app-drawio/root/usr/libexec/istorec/drawio.sh b/applications/luci-app-drawio/root/usr/libexec/istorec/drawio.sh index 4ab80af..20e1176 100644 --- a/applications/luci-app-drawio/root/usr/libexec/istorec/drawio.sh +++ b/applications/luci-app-drawio/root/usr/libexec/istorec/drawio.sh @@ -59,10 +59,10 @@ case ${ACTION} in cd $config && docker-compose ${ACTION} ;; "status") - docker ps --all -f 'name=linkease-drawio_drawio_1' --format '{{.State}}' + docker ps --all -f 'name=^/linkease-drawio_drawio_1$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=linkease-drawio_drawio_1' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/linkease-drawio_drawio_1$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-emby/Makefile b/applications/luci-app-emby/Makefile index 7b62aa5..c24dcab 100644 --- a/applications/luci-app-emby/Makefile +++ b/applications/luci-app-emby/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.3-20231208 +PKG_VERSION:=1.0.3-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Emby diff --git a/applications/luci-app-emby/root/usr/libexec/istorec/emby.sh b/applications/luci-app-emby/root/usr/libexec/istorec/emby.sh index e5df501..3158092 100644 --- a/applications/luci-app-emby/root/usr/libexec/istorec/emby.sh +++ b/applications/luci-app-emby/root/usr/libexec/istorec/emby.sh @@ -81,10 +81,10 @@ case ${ACTION} in docker ${ACTION} emby ;; "status") - docker ps --all -f 'name=emby' --format '{{.State}}' + docker ps --all -f 'name=^/emby$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=emby' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8096/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/emby$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8096/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-excalidraw/Makefile b/applications/luci-app-excalidraw/Makefile index 6add2f6..7e3109b 100644 --- a/applications/luci-app-excalidraw/Makefile +++ b/applications/luci-app-excalidraw/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.0-20221212 +PKG_VERSION:=1.0.0-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Excalidraw diff --git a/applications/luci-app-excalidraw/root/usr/libexec/istorec/excalidraw.sh b/applications/luci-app-excalidraw/root/usr/libexec/istorec/excalidraw.sh index 5edea42..8f1aaa2 100644 --- a/applications/luci-app-excalidraw/root/usr/libexec/istorec/excalidraw.sh +++ b/applications/luci-app-excalidraw/root/usr/libexec/istorec/excalidraw.sh @@ -60,10 +60,10 @@ case ${ACTION} in cd $config && docker-compose ${ACTION} ;; "status") - docker ps --all -f 'name=linkease-excalidraw_frontend_1' --format '{{.State}}' + docker ps --all -f 'name=^/linkease-excalidraw_frontend_1$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=linkease-excalidraw_frontend_1' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/linkease-excalidraw_frontend_1$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-feishuvpn/Makefile b/applications/luci-app-feishuvpn/Makefile index 73d3965..7e7e47a 100644 --- a/applications/luci-app-feishuvpn/Makefile +++ b/applications/luci-app-feishuvpn/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for FeiShuVpn diff --git a/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh b/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh index 0ba2e80..9918f36 100644 --- a/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh +++ b/applications/luci-app-feishuvpn/root/usr/libexec/istorec/feishuvpn.sh @@ -62,7 +62,7 @@ case ${ACTION} in docker ${ACTION} feishuvpn ;; "status") - docker ps --all -f 'name=feishuvpn' --format '{{.State}}' + docker ps --all -f 'name=^/feishuvpn$' --format '{{.State}}' ;; "port") echo 9091 diff --git a/applications/luci-app-gogs/Makefile b/applications/luci-app-gogs/Makefile index 4fdf100..79b6468 100644 --- a/applications/luci-app-gogs/Makefile +++ b/applications/luci-app-gogs/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.3-20240304 +PKG_VERSION:=1.0.3-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Gogs diff --git a/applications/luci-app-gogs/root/usr/libexec/istorec/gogs.sh b/applications/luci-app-gogs/root/usr/libexec/istorec/gogs.sh index 78abb93..263c629 100644 --- a/applications/luci-app-gogs/root/usr/libexec/istorec/gogs.sh +++ b/applications/luci-app-gogs/root/usr/libexec/istorec/gogs.sh @@ -67,7 +67,7 @@ case ${ACTION} in docker ${ACTION} gogs ;; "status") - docker ps --all -f 'name=gogs' --format '{{.State}}' + docker ps --all -f 'name=^/gogs$' --format '{{.State}}' ;; "port") uci -q get gogs.@main[0].http_port 2>/dev/null diff --git a/applications/luci-app-heimdall/Makefile b/applications/luci-app-heimdall/Makefile index ee37b8a..3e0525d 100644 --- a/applications/luci-app-heimdall/Makefile +++ b/applications/luci-app-heimdall/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.2-20240105 +PKG_VERSION:=1.1.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for heimdall diff --git a/applications/luci-app-heimdall/root/usr/libexec/istorec/heimdall.sh b/applications/luci-app-heimdall/root/usr/libexec/istorec/heimdall.sh index dda3f61..a68bc40 100644 --- a/applications/luci-app-heimdall/root/usr/libexec/istorec/heimdall.sh +++ b/applications/luci-app-heimdall/root/usr/libexec/istorec/heimdall.sh @@ -73,13 +73,13 @@ case ${ACTION} in docker ${ACTION} heimdall ;; "status") - docker ps --all -f 'name=heimdall' --format '{{.State}}' + docker ps --all -f 'name=^/heimdall$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=heimdall' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->80/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/heimdall$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->80/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; "https_port") - docker ps --all -f 'name=heimdall' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->443/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/heimdall$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->443/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-homeassistant/Makefile b/applications/luci-app-homeassistant/Makefile index a7c5a17..41c93d3 100644 --- a/applications/luci-app-homeassistant/Makefile +++ b/applications/luci-app-homeassistant/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.2-20231208 +PKG_VERSION:=1.1.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for homeassistant diff --git a/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh b/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh index 2fe6a99..d91d40d 100644 --- a/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh +++ b/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh @@ -74,10 +74,10 @@ case ${ACTION} in docker ${ACTION} homeassistant ;; "status") - docker ps --all -f 'name=homeassistant' --format '{{.State}}' + docker ps --all -f 'name=^/homeassistant$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=homeassistant' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/homeassistant$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; "hacs-install") do_hacs_install diff --git a/applications/luci-app-htreader/Makefile b/applications/luci-app-htreader/Makefile index 6884f6f..ff8575b 100644 --- a/applications/luci-app-htreader/Makefile +++ b/applications/luci-app-htreader/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for HTReader diff --git a/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh b/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh index 48e2a65..f6dc438 100644 --- a/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh +++ b/applications/luci-app-htreader/root/usr/libexec/istorec/htreader.sh @@ -74,10 +74,10 @@ case ${ACTION} in docker ${ACTION} htreader ;; "status") - docker ps --all -f 'name=htreader' --format '{{.State}}' + 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/' + 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 diff --git a/applications/luci-app-istoredup/Makefile b/applications/luci-app-istoredup/Makefile new file mode 100644 index 0000000..9e511fa --- /dev/null +++ b/applications/luci-app-istoredup/Makefile @@ -0,0 +1,24 @@ + + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=1.1.7-20241211 +PKG_RELEASE:= + +LUCI_TITLE:=LuCI support for istoredup +LUCI_PKGARCH:=all +LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +vmease + +define Package/luci-app-istoredup/conffiles +/etc/config/istoredup +endef + +define Package/luci-app-istoredup/prerm +#!/bin/sh +/usr/libexec/istorec/istoredup.sh stop +exit 0 +endef + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-istoredup/luasrc/controller/istoredup.lua b/applications/luci-app-istoredup/luasrc/controller/istoredup.lua new file mode 100644 index 0000000..15d6bd2 --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/controller/istoredup.lua @@ -0,0 +1,9 @@ + +module("luci.controller.istoredup", package.seeall) + +function index() + entry({"admin", "services", "istoredup"}, alias("admin", "services", "istoredup", "config"), _("iStoreDup"), 30).dependent = true + entry({"admin", "services", "istoredup", "config"}, cbi("istoredup/config"), _("Config"), 10).leaf = true + entry({"admin", "services", "istoredup", "tool"}, form("istoredup/tool"), _("Tool"), 30).leaf = true + entry({"admin", "services", "istoredup", "console"}, form("istoredup/console"), _("Console"), 50).leaf = true +end diff --git a/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/config.lua b/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/config.lua new file mode 100644 index 0000000..008e274 --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/config.lua @@ -0,0 +1,49 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local taskd = require "luci.model.tasks" +local docker = require "luci.docker" +local istoredup_model = require "luci.model.istoredup" +local m, s, o + +m = taskd.docker_map("istoredup", "istoredup", "/usr/libexec/istorec/istoredup.sh", + translate("iStoreDup"), + translate("A duplica of iStoreOS.") + .. translate("Official website:") .. ' https://www.istoreos.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("iStoreDup status:")) +s:append(Template("istoredup/status")) + +s = m:section(TypedSection, "istoredup", 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, "image_name", translate("Image").."*") +o.rmempty = false +o.datatype = "string" +o:value("linkease/istoreduprk35xx:latest", "linkease/istoreduprk35xx:latest") +o:value("linkease/istoredupx86_64:latest", "linkease/istoredupx86_64:latest") +if "x86_64" == docker_info.Architecture then + o.default = "linkease/istoredupx86_64:latest" +else + o.default = "linkease/istoreduprk35xx:latest" +end + +o = s:option(Value, "time_zone", translate("Timezone")) +o.datatype = "string" +o:value("Asia/Shanghai", "Asia/Shanghai") + +return m diff --git a/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/console.lua b/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/console.lua new file mode 100644 index 0000000..25a3f3b --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/console.lua @@ -0,0 +1,116 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + + +require "luci.util" + +local docker = require "luci.model.docker" +local dk = docker.new() + +local container_name = "istoredup" + +local m, s, o +local images, networks, container_info, res + +res = dk.containers:inspect({name = container_name}) +if res.code < 300 then + container_info = res.body +else + return +end + +local cmd_docker = luci.util.exec("command -v docker"):match("^.+docker") or nil +local cmd_ttyd = luci.util.exec("command -v ttyd"):match("^.+ttyd") or nil + +if cmd_docker and cmd_ttyd and container_info.State.Status == "running" then + local cmd = "/bin/bash" + local uid + + m=SimpleForm("Console", "", translate("Only works in LAN")) + m.submit = false + m.reset = false + s = m:section(SimpleSection) + + o = s:option(Value, "command", translate("Command")) + o:value("/bin/sh", "/bin/sh") + o:value("/bin/ash", "/bin/ash") + o:value("/bin/bash", "/bin/bash") + o.default = "/bin/bash" + o.forcewrite = true + o.write = function(self, section, value) + cmd = value + end + + o = s:option(Value, "uid", translate("UID")) + o.forcewrite = true + o.write = function(self, section, value) + uid = value + end + + o = s:option(Button, "connect") + o.render = function(self, section, scope) + self.inputstyle = "add" + self.title = " " + self.inputtitle = translate("Connect") + Button.render(self, section, scope) + end + o.write = function(self, section) + local cmd_docker = luci.util.exec("command -v docker"):match("^.+docker") or nil + local cmd_ttyd = luci.util.exec("command -v ttyd"):match("^.+ttyd") or nil + + if not cmd_docker or not cmd_ttyd or cmd_docker:match("^%s+$") or cmd_ttyd:match("^%s+$")then + return + end + + local pid = luci.util.trim(luci.util.exec("netstat -lnpt | grep :7682 | grep ttyd | tr -s ' ' | cut -d ' ' -f7 | cut -d'/' -f1")) + if pid and pid ~= "" then + luci.util.exec("kill -9 " .. pid) + end + + local hosts + local uci = require "luci.model.uci".cursor() + local remote = uci:get_bool("dockerd", "globals", "remote_endpoint") or false + local host = nil + local port = nil + local socket = nil + + if remote then + host = uci:get("dockerd", "globals", "remote_host") or nil + port = uci:get("dockerd", "globals", "remote_port") or nil + else + socket = uci:get("dockerd", "globals", "socket_path") or "/var/run/docker.sock" + end + + if remote and host and port then + hosts = host .. ':'.. port + elseif socket then + hosts = socket + else + return + end + + if uid and uid ~= "" then + uid = "-u " .. uid + else + uid = "" + end + + local start_cmd = string.format('%s -d 2 --once -p 7682 %s -H "unix://%s" exec -it %s %s %s&', cmd_ttyd, cmd_docker, hosts, uid, container_name, cmd) + + os.execute(start_cmd) + + m.children[#m.children] = nil + s = m:section(SimpleSection) + o = s:option(DummyValue, "console") + o.container_id = container_id + o.template = container_name .. "/console" + end +else + m=SimpleForm("Console", "", translate("iStoreDup is not running")) + m.submit = false + m.reset = false + s = m:section(SimpleSection) +end + +return m diff --git a/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/tool.lua b/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/tool.lua new file mode 100644 index 0000000..2407b31 --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/model/cbi/istoredup/tool.lua @@ -0,0 +1,41 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local http = require 'luci.http' + +m=SimpleForm("Tools") +m.submit = false +m.reset = false + +s = m:section(SimpleSection) + +o = s:option(Value, "action", translate("Action").."*") +o.rmempty = false +o.datatype = "string" +o:value("show-ip", "show-ip") +o.default = "show-ip" + +local t=Template("istoredup/tool") +m:append(t) + +local btn_do = s:option(Button, "_do") +btn_do.render = function(self, section, scope) + self.inputstyle = "add" + self.title = " " + self.inputtitle = translate("Execute") + Button.render(self, section, scope) +end + +btn_do.write = function(self, section, value) + local action = m:get(section, "action") + if action == "show-ip" then + local cmd = string.format("/usr/libexec/istorec/istoredup.sh %s", action) + cmd = "/etc/init.d/tasks task_add istoredup " .. luci.util.shellquote(cmd) .. " >/dev/null 2>&1" + os.execute(cmd) + t.show_log_taskid = "istoredup" + end +end + +return m + diff --git a/applications/luci-app-istoredup/luasrc/model/istoredup.lua b/applications/luci-app-istoredup/luasrc/model/istoredup.lua new file mode 100644 index 0000000..214b3ab --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/model/istoredup.lua @@ -0,0 +1,55 @@ +local util = require "luci.util" +local jsonc = require "luci.jsonc" + +local emby = {} + +emby.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 + +emby.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 + +emby.find_paths = function(blocks, home_dirs, path_name) + local default_path = '' + local configs = {} + + default_path = home_dirs[path_name] .. "/iStoreDup" + if #blocks == 0 then + table.insert(configs, default_path) + else + for _, val in pairs(blocks) do + table.insert(configs, val .. "/" .. path_name .. "/iStoreDup") + end + local without_conf_dir = "/root/" .. path_name .. "/iStoreDup" + if default_path == without_conf_dir then + default_path = configs[1] + end + end + + return configs, default_path +end + +return emby diff --git a/applications/luci-app-istoredup/luasrc/view/istoredup/console.htm b/applications/luci-app-istoredup/luasrc/view/istoredup/console.htm new file mode 100644 index 0000000..cf12aa7 --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/view/istoredup/console.htm @@ -0,0 +1,6 @@ +
+ +
+ diff --git a/applications/luci-app-istoredup/luasrc/view/istoredup/status.htm b/applications/luci-app-istoredup/luasrc/view/istoredup/status.htm new file mode 100644 index 0000000..174ee93 --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/view/istoredup/status.htm @@ -0,0 +1,31 @@ +<% +local util = require "luci.util" +local container_status = util.trim(util.exec("/usr/libexec/istorec/istoredup.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/istoredup.sh port")) + if port == "" then + port="error" + end +-%> +
+ +
+ + +
+
+<% end %> diff --git a/applications/luci-app-istoredup/luasrc/view/istoredup/tool.htm b/applications/luci-app-istoredup/luasrc/view/istoredup/tool.htm new file mode 100644 index 0000000..8ab8bdc --- /dev/null +++ b/applications/luci-app-istoredup/luasrc/view/istoredup/tool.htm @@ -0,0 +1,11 @@ +<%+tasks/embed%> + + + diff --git a/applications/luci-app-istoredup/po/zh-cn/istoredup.po b/applications/luci-app-istoredup/po/zh-cn/istoredup.po new file mode 100644 index 0000000..5b34f15 --- /dev/null +++ b/applications/luci-app-istoredup/po/zh-cn/istoredup.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Official website:" +msgstr "官方网站:" + +msgid "A duplica of iStoreOS." +msgstr "iStoreOS 的分身,可以把风险高的软件安装到分身里面,出问题不影响到主系统。" + +msgid "Service Status" +msgstr "服务状态" + +msgid "iStoreDup status:" +msgstr "iStoreDup 的状态信息如下:" + +msgid "Setup" +msgstr "安装配置" + +msgid "The following parameters will only take effect during installation or upgrade:" +msgstr "以下参数只在安装或者升级时才会生效:" + +msgid "Status" +msgstr "状态" + +msgid "iStoreDup is running" +msgstr "iStoreDup 运行中" + +msgid "iStoreDup is not running" +msgstr "iStoreDup 未运行" + +msgid "Open the iStoreDup" +msgstr "打开 iStoreDup" + +msgid "Tool" +msgstr "操作" + +msgid "Console" +msgstr "控制台" + +msgid "Only works in LAN" +msgstr "只在内网环境下工作。" + +msgid "Execute" +msgstr "执行" + +msgid "Timezone" +msgstr "时区" + diff --git a/applications/luci-app-istoredup/root/etc/config/istoredup b/applications/luci-app-istoredup/root/etc/config/istoredup new file mode 100644 index 0000000..c67f467 --- /dev/null +++ b/applications/luci-app-istoredup/root/etc/config/istoredup @@ -0,0 +1 @@ +config istoredup diff --git a/applications/luci-app-istoredup/root/usr/libexec/istorec/istoredup.sh b/applications/luci-app-istoredup/root/usr/libexec/istorec/istoredup.sh new file mode 100644 index 0000000..2a3d2ee --- /dev/null +++ b/applications/luci-app-istoredup/root/usr/libexec/istorec/istoredup.sh @@ -0,0 +1,98 @@ +#!/bin/sh + +ACTION=${1} +shift 1 + +do_install() { + local IMAGE_NAME=`uci get istoredup.@istoredup[0].image_name 2>/dev/null` + local arch=`uname -m` + if [ "$arch" = "x86_64" -o "$arch" = "aarch64" ]; then + echo "${arch} supported" + else + echo "Unsupported ${arch} NOW" + sleep 10 + exit 1 + fi + + if [ -z ${IMAGE_NAME} ]; then + if [ "$arch" = "x86_64" ]; then + IMAGE_NAME=linkease/istoredupx86_64:latest + else + IMAGE_NAME=linkease/istoreduprk35xx:latest + fi + fi + + echo "docker pull ${IMAGE_NAME}" + docker pull ${IMAGE_NAME} + docker rm -f istoredup + + local hasvlan=`docker network inspect dsm-net -f '{{.Name}}' 2>/dev/null` + if [ ! "$hasvlan" = "dsm-net" ]; then + docker network create -o com.docker.network.bridge.name=dsm-br --driver=bridge dsm-net + fi + local mask=`ubus call network.interface.lan status | jsonfilter -e '@["ipv4-address"][0].mask'` + + local cmd="docker run --restart=unless-stopped -d \ + -h iStoreDuplica \ + -v /var/run/vmease:/host/run/vmease \ + --privileged \ + --net=dsm-net \ + --sysctl net.netfilter.nf_conntrack_acct=1 \ + --sysctl net.ipv4.conf.all.forwarding=1 \ + --dns=172.17.0.1 " + + cmd="$cmd -v /mnt:/mnt" + mountpoint -q /mnt && cmd="$cmd:rslave" + cmd="$cmd --stop-timeout 120 --name istoredup \"$IMAGE_NAME\"" + + echo "$cmd" + eval "$cmd" + echo "wait running" + sleep 5 + echo "done" +} + +usage() { + echo "usage: $0 sub-command" + echo "where sub-command is one of:" + echo " install Install the istoredup" + echo " upgrade Upgrade the istoredup" + echo " rm/start/stop/restart Remove/Start/Stop/Restart the istoredup" + echo " status iStoreDup status" + echo " port iStoreDup port" +} + +case ${ACTION} in + "install") + do_install + ;; + "upgrade") + do_install + ;; + "rm") + docker rm -f istoredup + ;; + "start" | "stop" | "restart") + docker ${ACTION} istoredup + ;; + "status") + docker ps --all -f 'name=^/istoredup$' --format '{{.State}}' + ;; + "port") + docker exec istoredup ip -f inet addr show br-lan|sed -En -e 's/.*inet ([0-9.]+).*/\1/p' + ;; + "show-ip") + IP=`docker exec istoredup ip -f inet addr show br-lan|sed -En -e 's/.*inet ([0-9.]+).*/\1/p'` + if [ -z "$IP" ]; then + echo "reset ip" + docker exec istoredup /etc/init.d/setupvmease start + sleep 5 + IP=`docker exec istoredup ip -f inet addr show br-lan|sed -En -e 's/.*inet ([0-9.]+).*/\1/p'` + fi + echo $IP + ;; + *) + usage + exit 1 + ;; +esac diff --git a/applications/luci-app-istorepanel/Makefile b/applications/luci-app-istorepanel/Makefile new file mode 100644 index 0000000..4ae4297 --- /dev/null +++ b/applications/luci-app-istorepanel/Makefile @@ -0,0 +1,18 @@ + + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=1.0.6-20240822 +PKG_RELEASE:= + +LUCI_TITLE:=LuCI support for 1Panel +LUCI_PKGARCH:=all +LUCI_DEPENDS:=+lsblk +zoneinfo-asia +docker +luci-lib-taskd +luci-lib-docker + +define Package/luci-app-istorepanel/conffiles +/etc/config/istorepanel +endef + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-istorepanel/luasrc/controller/istorepanel.lua b/applications/luci-app-istorepanel/luasrc/controller/istorepanel.lua new file mode 100644 index 0000000..b9c54ab --- /dev/null +++ b/applications/luci-app-istorepanel/luasrc/controller/istorepanel.lua @@ -0,0 +1,7 @@ + +module("luci.controller.istorepanel", package.seeall) + +function index() + entry({"admin", "services", "istorepanel"}, alias("admin", "services", "istorepanel", "config"), _("1Panel"), 30).dependent = true + entry({"admin", "services", "istorepanel", "config"}, cbi("istorepanel")) +end diff --git a/applications/luci-app-istorepanel/luasrc/model/cbi/istorepanel.lua b/applications/luci-app-istorepanel/luasrc/model/cbi/istorepanel.lua new file mode 100644 index 0000000..dbfe441 --- /dev/null +++ b/applications/luci-app-istorepanel/luasrc/model/cbi/istorepanel.lua @@ -0,0 +1,76 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local taskd = require "luci.model.tasks" +local docker = require "luci.docker" +local istorepanel_model = require "luci.model.istorepanel" +local m, s, o + +m = taskd.docker_map("istorepanel", "istorepanel", "/usr/libexec/istorec/istorepanel.sh", + translate("1Panel"), + translate("1Panel is the new generation Linux server maintenance panel.") + .. translate("Official website:") .. ' https://1panel.cn/') + +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("1Panel status:")) +s:append(Template("istorepanel/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, "username", "username") +o.datatype = "string" +o.default = '1panel' + +o = s:option(Value, "password", "password") +o.password = true +o.datatype = "string" +o.default = "password" + +o = s:option(Value, "ver", "version") +o.datatype = "string" +o:value("v1.10.10-lts", "v1.10.10-lts") +o:value("v1.10.11-lts", "v1.10.11-lts") +o.default = 'v1.10.11-lts' + +o = s:option(Value, "image_name", translate("Image").."*") +o.rmempty = false +o.datatype = "string" +o:value("linkease/istorepanel:latest", "linkease/istorepanel:latest") +o.default = "linkease/istorepanel:latest" + +local blocks = istorepanel_model.blocks() +local home = istorepanel_model.home() + +o = s:option(Value, "config_path", translate("Config path").."*") +o.rmempty = false +o.datatype = "string" + +local paths, default_path = istorepanel_model.find_paths(blocks, home, "Configs") +for _, val in pairs(paths) do + o:value(val, val) +end +o.default = default_path + +o = s:option(Flag, "include_host", translate("Include root path")) +o.rmempty = false + +return m diff --git a/applications/luci-app-istorepanel/luasrc/model/istorepanel.lua b/applications/luci-app-istorepanel/luasrc/model/istorepanel.lua new file mode 100644 index 0000000..1af4aa2 --- /dev/null +++ b/applications/luci-app-istorepanel/luasrc/model/istorepanel.lua @@ -0,0 +1,55 @@ +local util = require "luci.util" +local jsonc = require "luci.jsonc" + +local istorepanel = {} + +istorepanel.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 + +istorepanel.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 + +istorepanel.find_paths = function(blocks, home_dirs, path_name) + local default_path = '' + local configs = {} + + default_path = home_dirs[path_name] .. "/1Panel" + if #blocks == 0 then + table.insert(configs, default_path) + else + for _, val in pairs(blocks) do + table.insert(configs, val .. "/" .. path_name .. "/1Panel") + end + local without_conf_dir = "/root/" .. path_name .. "/1Panel" + if default_path == without_conf_dir then + default_path = configs[1] + end + end + + return configs, default_path +end + +return istorepanel diff --git a/applications/luci-app-istorepanel/luasrc/view/istorepanel/status.htm b/applications/luci-app-istorepanel/luasrc/view/istorepanel/status.htm new file mode 100644 index 0000000..0bd864f --- /dev/null +++ b/applications/luci-app-istorepanel/luasrc/view/istorepanel/status.htm @@ -0,0 +1,31 @@ +<% +local util = require "luci.util" +local container_status = util.trim(util.exec("/usr/libexec/istorec/istorepanel.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/istorepanel.sh port")) + if port == "" then + port="10086" + end +-%> +
+ +
+ + +
+
+<% end %> diff --git a/applications/luci-app-istorepanel/po/zh-cn/istorepanel.po b/applications/luci-app-istorepanel/po/zh-cn/istorepanel.po new file mode 100644 index 0000000..0301ecd --- /dev/null +++ b/applications/luci-app-istorepanel/po/zh-cn/istorepanel.po @@ -0,0 +1,44 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Official website:" +msgstr "官方网站:" + +msgid "1Panel is the new generation Linux server maintenance panel." +msgstr "1Panel 是新一代的 Linux 服务器运维管理面板" + +msgid "Config path" +msgstr "配置文件路径" + +msgid "Port" +msgstr "端口" + +msgid "Service Status" +msgstr "服务状态" + +msgid "1Panel status:" +msgstr "1Panel 的状态信息如下:" + +msgid "Setup" +msgstr "安装配置" + +msgid "The following parameters will only take effect during installation or upgrade:" +msgstr "以下参数只在安装或者升级时才会生效:" + +msgid "Status" +msgstr "状态" + +msgid "1Panel is running" +msgstr "1Panel 运行中" + +msgid "1Panel is not running" +msgstr "1Panel 未运行" + +msgid "Open 1Panel" +msgstr "打开 1Panel" + +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-istorepanel/root/etc/config/istorepanel b/applications/luci-app-istorepanel/root/etc/config/istorepanel new file mode 100644 index 0000000..65434f9 --- /dev/null +++ b/applications/luci-app-istorepanel/root/etc/config/istorepanel @@ -0,0 +1,8 @@ +config main + option 'port' '10086' +# option 'config_path' '' +# option 'ver' 'v1.10.10-lts' +# option 'entrance' 'entrance' +# option 'username' '1panel' +# option 'password' 'password' + diff --git a/applications/luci-app-istorepanel/root/usr/libexec/istorec/istorepanel.sh b/applications/luci-app-istorepanel/root/usr/libexec/istorec/istorepanel.sh new file mode 100644 index 0000000..34cdaf4 --- /dev/null +++ b/applications/luci-app-istorepanel/root/usr/libexec/istorec/istorepanel.sh @@ -0,0 +1,124 @@ +#!/bin/sh +# Author Xiaobao(xiaobao@linkease.com) + +ACTION=${1} +shift 1 + +do_install() { + local port=`uci get istorepanel.@main[0].port 2>/dev/null` + local image_name=`uci get istorepanel.@main[0].image_name 2>/dev/null` + local config=`uci get istorepanel.@main[0].config_path 2>/dev/null` + local entrance=`uci get istorepanel.@main[0].entrance 2>/dev/null` + local username=`uci get istorepanel.@main[0].username 2>/dev/null` + local password=`uci get istorepanel.@main[0].password 2>/dev/null` + local ver=`uci get istorepanel.@main[0].ver 2>/dev/null` + local include_host=`uci get istorepanel.@main[0].include_host 2>/dev/null` + + if [ -z "$config" ]; then + echo "config path is empty!" + exit 1 + fi + + [ -z "$port" ] && port=10086 + [ -z "$ver" ] && ver='v1.10.10-lts' + [ -z "$username" ] && username='1panel' + [ -z "$password" ] && password='password' + [ -z "$entrance" ] && entrance='entrance' + + mkdir -p $config + + cat > $config/env </dev/null` + ;; + *) + usage + exit 1 + ;; +esac diff --git a/applications/luci-app-ittools/Makefile b/applications/luci-app-ittools/Makefile index 407d899..05c2aa7 100644 --- a/applications/luci-app-ittools/Makefile +++ b/applications/luci-app-ittools/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for ITTools diff --git a/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh b/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh index 353f1f0..9c82f69 100644 --- a/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh +++ b/applications/luci-app-ittools/root/usr/libexec/istorec/ittools.sh @@ -56,10 +56,10 @@ case ${ACTION} in docker ${ACTION} ittools ;; "status") - docker ps --all -f 'name=ittools' --format '{{.State}}' + 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/' + 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 diff --git a/applications/luci-app-jackett/Makefile b/applications/luci-app-jackett/Makefile index 0c4ca25..1eb314c 100644 --- a/applications/luci-app-jackett/Makefile +++ b/applications/luci-app-jackett/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.1-20231208 +PKG_VERSION:=1.1.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for jackett diff --git a/applications/luci-app-jackett/root/usr/libexec/istorec/jackett.sh b/applications/luci-app-jackett/root/usr/libexec/istorec/jackett.sh index b421007..8d181a3 100644 --- a/applications/luci-app-jackett/root/usr/libexec/istorec/jackett.sh +++ b/applications/luci-app-jackett/root/usr/libexec/istorec/jackett.sh @@ -76,10 +76,10 @@ case ${ACTION} in docker ${ACTION} jackett ;; "status") - docker ps --all -f 'name=jackett' --format '{{.State}}' + docker ps --all -f 'name=^/jackett$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=jackett' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/jackett$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-jellyfin/Makefile b/applications/luci-app-jellyfin/Makefile index fa92bbb..6df56eb 100644 --- a/applications/luci-app-jellyfin/Makefile +++ b/applications/luci-app-jellyfin/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.10-20240224 +PKG_VERSION:=1.2.0-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for jellyfin diff --git a/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua b/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua index 7325e86..e24525e 100644 --- a/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua +++ b/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua @@ -10,7 +10,7 @@ m = taskd.docker_map("jellyfin", "jellyfin", "/usr/libexec/istorec/jellyfin.sh", translate("Jellyfin"), translate("Jellyfin is the volunteer-built media solution that puts you in control of your media. Stream to any device from your own server, with no strings attached. Your media, your server, your way.") .. translate("Official website:") .. ' https://jellyfin.org/' - .. "
" .. translate("The following models support hardware transcoding without configuration in Jellyfin:") .. "
" + .. "
" .. translate("When using the default image, the following models support hardware transcoding without configuration in Jellyfin:") .. "
" .. "
- Easepi ARS2
" .. "
- " .. translate("RK35xx series (e.g. R6S, R5S, R68s, R66s, H28K, etc.) with iStoreOS firmware (version 20221123 and above). Other firmwares require MPP and RGA to be turned on, and are not guaranteed to be available.") .. "
" .. "
" .. translate("The following models may support hardware transcoding by referring to the official Jellyfin documentation:") .. "
" @@ -27,6 +27,19 @@ s = m:section(TypedSection, "jellyfin", translate("Setup"), s.addremove=false s.anonymous=true +o = s:option(Value, "image", translate("Image")) +o.datatype = "string" +o:value("", translate("Default")) +if luci.sys.call("grep -q 'rockchip,' /proc/device-tree/compatible 2>/dev/null") == 0 then + o:value("jjm2473/jellyfin-mpp", "jjm2473/jellyfin-mpp") + o:value("nyanmisaka/jellyfin:latest-rockchip", "nyanmisaka/jellyfin:latest-rockchip") +end +o:value("jellyfin/jellyfin", "jellyfin/jellyfin") +o:value("linuxserver/jellyfin", "linuxserver/jellyfin") +if luci.sys.call("uname -m |grep -qw x86_64") == 0 then + o:value("nyanmisaka/jellyfin", "nyanmisaka/jellyfin") +end + o = s:option(Flag, "hostnet", translate("Host network"), translate("Jellyfin running in host network, for DLNA application, port is always 8096 if enabled")) o.default = 0 o.rmempty = false diff --git a/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po b/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po index 1ed0521..6faf28a 100644 --- a/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po +++ b/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po @@ -7,8 +7,8 @@ msgstr "官方网站:" msgid "Jellyfin is the volunteer-built media solution that puts you in control of your media. Stream to any device from your own server, with no strings attached. Your media, your server, your way." msgstr "Jellyfin 是志愿者构建的媒体解决方案,可让您控制自己的电影等媒体,并不受任何限制地让您从各种设备去观看您的媒体。" -msgid "The following models support hardware transcoding without configuration in Jellyfin:" -msgstr "以下机型无需在Jellyfin配置即支持硬件转码:" +msgid "When using the default image, the following models support hardware transcoding without configuration in Jellyfin:" +msgstr "当使用默认镜像时以下机型无需在Jellyfin配置即支持硬件转码:" msgid "RK35xx series (e.g. R6S, R5S, R68s, R66s, H28K, etc.) with iStoreOS firmware (version 20221123 and above). Other firmwares require MPP and RGA to be turned on, and are not guaranteed to be available." msgstr "RK35xx 系列(例如R6S,R5S,R68s,R66s,H28K等)并使用 iStoreOS 固件(版本20221123及以上)。其他固件需开启MPP和RGA,不保证可用。" @@ -22,6 +22,12 @@ msgstr "x86 系列" msgid "Raspberry Pi series" msgstr "树莓派系列" +msgid "Image" +msgstr "镜像" + +msgid "Default" +msgstr "默认" + msgid "Media path" msgstr "媒体路径" diff --git a/applications/luci-app-jellyfin/root/etc/uci-defaults/luci-app-jellyfin b/applications/luci-app-jellyfin/root/etc/uci-defaults/luci-app-jellyfin index b5f3662..61991a5 100644 --- a/applications/luci-app-jellyfin/root/etc/uci-defaults/luci-app-jellyfin +++ b/applications/luci-app-jellyfin/root/etc/uci-defaults/luci-app-jellyfin @@ -2,9 +2,9 @@ image_name=`uci get jellyfin.@jellyfin[0].image 2>/dev/null` -if [ "$image_name" == "jjm2473/jellyfin-rtk:latest" ]; then +if [ "$image_name" == "jjm2473/jellyfin-rtk:latest" -o "$image_name" == "default" ]; then uci -q batch <<-EOF >/dev/null - set jellyfin.@jellyfin[0].image="default" + delete jellyfin.@jellyfin[0].image commit jellyfin EOF fi diff --git a/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh b/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh index e09ac21..adef3fd 100644 --- a/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh +++ b/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh @@ -81,7 +81,7 @@ do_install_detail() { cmd="$cmd\ -t \ --privileged " - for dev in iep rga dri dma_heap mpp_service mpp-service vpu_service vpu-service \ + for dev in iep rga dri dma_heap mali0 mpp_service mpp-service vpu_service vpu-service \ hevc_service hevc-service rkvdec rkvenc avsd vepu h265e ; do [ -e "/dev/$dev" ] && cmd="$cmd --device /dev/$dev" done @@ -139,10 +139,10 @@ case ${ACTION} in docker ${ACTION} jellyfin ;; "status") - docker ps --all -f 'name=jellyfin' --format '{{.State}}' + docker ps --all -f 'name=^/jellyfin$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=jellyfin' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8096/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/jellyfin$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8096/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-kodexplorer/Makefile b/applications/luci-app-kodexplorer/Makefile index 0ec17f5..91f57bd 100644 --- a/applications/luci-app-kodexplorer/Makefile +++ b/applications/luci-app-kodexplorer/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.2.1-20231208 +PKG_VERSION:=1.2.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for kodexplorer diff --git a/applications/luci-app-kodexplorer/root/usr/libexec/istorec/kodexplorer.sh b/applications/luci-app-kodexplorer/root/usr/libexec/istorec/kodexplorer.sh index bf6733b..1a45ec8 100644 --- a/applications/luci-app-kodexplorer/root/usr/libexec/istorec/kodexplorer.sh +++ b/applications/luci-app-kodexplorer/root/usr/libexec/istorec/kodexplorer.sh @@ -73,10 +73,10 @@ case ${ACTION} in docker ${ACTION} kodexplorer ;; "status") - docker ps --all -f 'name=kodexplorer' --format '{{.State}}' + docker ps --all -f 'name=^/kodexplorer$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=kodexplorer' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/kodexplorer$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-lanraragi/Makefile b/applications/luci-app-lanraragi/Makefile index f45de8c..02cdb83 100644 --- a/applications/luci-app-lanraragi/Makefile +++ b/applications/luci-app-lanraragi/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20231208 +PKG_VERSION:=1.0.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for LANraragi diff --git a/applications/luci-app-lanraragi/root/usr/libexec/istorec/lanraragi.sh b/applications/luci-app-lanraragi/root/usr/libexec/istorec/lanraragi.sh index 76d6612..9ffb4e2 100644 --- a/applications/luci-app-lanraragi/root/usr/libexec/istorec/lanraragi.sh +++ b/applications/luci-app-lanraragi/root/usr/libexec/istorec/lanraragi.sh @@ -63,10 +63,10 @@ case ${ACTION} in docker ${ACTION} lanraragi ;; "status") - docker ps --all -f 'name=lanraragi' --format '{{.State}}' + docker ps --all -f 'name=^/lanraragi$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=lanraragi' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/lanraragi$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-memos/Makefile b/applications/luci-app-memos/Makefile index 54fffd3..448ec89 100644 --- a/applications/luci-app-memos/Makefile +++ b/applications/luci-app-memos/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Memos diff --git a/applications/luci-app-memos/root/usr/libexec/istorec/memos.sh b/applications/luci-app-memos/root/usr/libexec/istorec/memos.sh index 8b72b06..6296de3 100644 --- a/applications/luci-app-memos/root/usr/libexec/istorec/memos.sh +++ b/applications/luci-app-memos/root/usr/libexec/istorec/memos.sh @@ -62,10 +62,10 @@ case ${ACTION} in docker ${ACTION} memos ;; "status") - docker ps --all -f 'name=memos' --format '{{.State}}' + docker ps --all -f 'name=^/memos$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=memos' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/memos$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-mtphotos/Makefile b/applications/luci-app-mtphotos/Makefile index 490c09d..ebc384b 100644 --- a/applications/luci-app-mtphotos/Makefile +++ b/applications/luci-app-mtphotos/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for MTPhotos diff --git a/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh b/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh index ce6a99a..8eea91f 100644 --- a/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh +++ b/applications/luci-app-mtphotos/root/usr/libexec/istorec/mtphotos.sh @@ -65,10 +65,10 @@ case ${ACTION} in docker ${ACTION} mtphotos ;; "status") - docker ps --all -f 'name=mtphotos' --format '{{.State}}' + 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/' + 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 diff --git a/applications/luci-app-nastools/Makefile b/applications/luci-app-nastools/Makefile index 0d1a79e..eec8763 100644 --- a/applications/luci-app-nastools/Makefile +++ b/applications/luci-app-nastools/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.3-20231208 +PKG_VERSION:=1.1.3-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for nastools diff --git a/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh b/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh index d460182..b0022ba 100644 --- a/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh +++ b/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh @@ -77,10 +77,10 @@ case ${ACTION} in docker ${ACTION} nastools ;; "status") - docker ps --all -f 'name=nastools' --format '{{.State}}' + docker ps --all -f 'name=^/nastools$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=nastools' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/nastools$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-navidrome/Makefile b/applications/luci-app-navidrome/Makefile index 34b56d4..6930905 100644 --- a/applications/luci-app-navidrome/Makefile +++ b/applications/luci-app-navidrome/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20231208 +PKG_VERSION:=1.0.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Navidrome diff --git a/applications/luci-app-navidrome/root/usr/libexec/istorec/navidrome.sh b/applications/luci-app-navidrome/root/usr/libexec/istorec/navidrome.sh index 1c079c8..31551be 100644 --- a/applications/luci-app-navidrome/root/usr/libexec/istorec/navidrome.sh +++ b/applications/luci-app-navidrome/root/usr/libexec/istorec/navidrome.sh @@ -63,10 +63,10 @@ case ${ACTION} in docker ${ACTION} navidrome ;; "status") - docker ps --all -f 'name=navidrome' --format '{{.State}}' + docker ps --all -f 'name=^/navidrome$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=navidrome' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/navidrome$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-nextcloud/Makefile b/applications/luci-app-nextcloud/Makefile index b7757c2..d9fc848 100644 --- a/applications/luci-app-nextcloud/Makefile +++ b/applications/luci-app-nextcloud/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.1-20231208 +PKG_VERSION:=1.1.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for nextcloud diff --git a/applications/luci-app-nextcloud/root/usr/libexec/istorec/nextcloud.sh b/applications/luci-app-nextcloud/root/usr/libexec/istorec/nextcloud.sh index 4e7f8e8..c210ca5 100644 --- a/applications/luci-app-nextcloud/root/usr/libexec/istorec/nextcloud.sh +++ b/applications/luci-app-nextcloud/root/usr/libexec/istorec/nextcloud.sh @@ -72,10 +72,10 @@ case ${ACTION} in docker ${ACTION} nextcloud ;; "status") - docker ps --all -f 'name=nextcloud' --format '{{.State}}' + docker ps --all -f 'name=^/nextcloud$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=nextcloud' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/nextcloud$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-owntone/Makefile b/applications/luci-app-owntone/Makefile index 7a4b9a0..46d2871 100644 --- a/applications/luci-app-owntone/Makefile +++ b/applications/luci-app-owntone/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Owntone diff --git a/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh b/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh index 89e46fc..304f061 100644 --- a/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh +++ b/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh @@ -60,7 +60,7 @@ case ${ACTION} in docker ${ACTION} owntone ;; "status") - docker ps --all -f 'name=owntone' --format '{{.State}}' + docker ps --all -f 'name=^/owntone$' --format '{{.State}}' ;; "port") echo 3689 diff --git a/applications/luci-app-penpot/Makefile b/applications/luci-app-penpot/Makefile index e5d8643..f54b34e 100644 --- a/applications/luci-app-penpot/Makefile +++ b/applications/luci-app-penpot/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.0-20221122 +PKG_VERSION:=1.0.0-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Penpot diff --git a/applications/luci-app-penpot/root/usr/libexec/istorec/penpot.sh b/applications/luci-app-penpot/root/usr/libexec/istorec/penpot.sh index 93d8a53..5b41ce5 100644 --- a/applications/luci-app-penpot/root/usr/libexec/istorec/penpot.sh +++ b/applications/luci-app-penpot/root/usr/libexec/istorec/penpot.sh @@ -60,7 +60,7 @@ case ${ACTION} in cd $config && docker-compose ${ACTION} ;; "status") - docker ps --all -f 'name=penpot_penpot-frontend_1' --format '{{.State}}' + docker ps --all -f 'name=^/penpot_penpot-frontend_1$' --format '{{.State}}' ;; "port") uci get -q penpot.@main[0].http_port 2>/dev/null diff --git a/applications/luci-app-photoprism/Makefile b/applications/luci-app-photoprism/Makefile index 38ab47b..f4c8706 100644 --- a/applications/luci-app-photoprism/Makefile +++ b/applications/luci-app-photoprism/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.3-20231208 +PKG_VERSION:=1.0.3-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for PhotoPrism diff --git a/applications/luci-app-photoprism/root/usr/libexec/istorec/photoprism.sh b/applications/luci-app-photoprism/root/usr/libexec/istorec/photoprism.sh index cef19ac..fa5adf5 100644 --- a/applications/luci-app-photoprism/root/usr/libexec/istorec/photoprism.sh +++ b/applications/luci-app-photoprism/root/usr/libexec/istorec/photoprism.sh @@ -64,10 +64,10 @@ case ${ACTION} in docker ${ACTION} photoprism ;; "status") - docker ps --all -f 'name=photoprism' --format '{{.State}}' + docker ps --all -f 'name=^/photoprism$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=photoprism' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->2342/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/photoprism$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->2342/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-plex/Makefile b/applications/luci-app-plex/Makefile index d78d7aa..ffec12f 100644 --- a/applications/luci-app-plex/Makefile +++ b/applications/luci-app-plex/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Plex diff --git a/applications/luci-app-plex/root/usr/libexec/istorec/plex.sh b/applications/luci-app-plex/root/usr/libexec/istorec/plex.sh index 29561a2..fbedd9d 100644 --- a/applications/luci-app-plex/root/usr/libexec/istorec/plex.sh +++ b/applications/luci-app-plex/root/usr/libexec/istorec/plex.sh @@ -95,10 +95,10 @@ case ${ACTION} in docker ${ACTION} plex ;; "status") - docker ps --all -f 'name=plex' --format '{{.State}}' + docker ps --all -f 'name=^/plex$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=plex' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->32400/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/plex$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->32400/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-pve/Makefile b/applications/luci-app-pve/Makefile new file mode 100644 index 0000000..a4489c9 --- /dev/null +++ b/applications/luci-app-pve/Makefile @@ -0,0 +1,24 @@ + + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=8.3.2-20250106 +PKG_RELEASE:= + +LUCI_TITLE:=LuCI support for pve +LUCI_PKGARCH:=all +LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +vmease + +define Package/luci-app-pve/conffiles +/etc/config/pve +endef + +define Package/luci-app-pve/prerm +#!/bin/sh +/usr/libexec/istorec/pve.sh stop +exit 0 +endef + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-pve/luasrc/controller/pve.lua b/applications/luci-app-pve/luasrc/controller/pve.lua new file mode 100644 index 0000000..3897838 --- /dev/null +++ b/applications/luci-app-pve/luasrc/controller/pve.lua @@ -0,0 +1,8 @@ + +module("luci.controller.pve", package.seeall) + +function index() + entry({"admin", "services", "pve"}, alias("admin", "services", "pve", "config"), _("PVE"), 30).dependent = true + entry({"admin", "services", "pve", "config"}, cbi("pve/config"), _("Config"), 10).leaf = true + entry({"admin", "services", "pve", "tool"}, form("pve/tool"), _("Tool"), 30).leaf = true +end diff --git a/applications/luci-app-pve/luasrc/model/cbi/pve/config.lua b/applications/luci-app-pve/luasrc/model/cbi/pve/config.lua new file mode 100644 index 0000000..a481f79 --- /dev/null +++ b/applications/luci-app-pve/luasrc/model/cbi/pve/config.lua @@ -0,0 +1,53 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local taskd = require "luci.model.tasks" +local pve_model = require "luci.model.pve" +local m, s, o + +m = taskd.docker_map("pve", "pve", "/usr/libexec/istorec/pve.sh", + translate("Proxmox"), + translate("Proxmox in iStoreOS.") .. " login: root/password. " + .. translate("Official website:") .. ' https://pve.proxmox.com/') + +s = m:section(SimpleSection, translate("Service Status"), translate("PVE status:")) +s:append(Template("pve/status")) + +s = m:section(TypedSection, "pve", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:")) +s.addremove=false +s.anonymous=true + +o = s:option(Value, "http_port", translate("HTTP Port").."*") +o.default = "8006" +o.datatype = "port" + +o = s:option(Value, "image_name", translate("Image").."*") +o.rmempty = false +o.datatype = "string" +o:value("linkease/pve:latest", "linkease/pve:latest") +o:value("linkease/pve:8.3.2", "linkease/pve:8.3.2") +o.default = "linkease/pve:latest" + +local blocks = pve_model.blocks() +local home = pve_model.home() + +o = s:option(Value, "config_path", translate("Config path").."*") +o.rmempty = false +o.datatype = "string" + +local paths, default_path = pve_model.find_paths(blocks, home, "Configs") +for _, val in pairs(paths) do + o:value(val, val) +end +o.default = default_path + +o = s:option(Value, "root_pwd", "ROOT_PASSWORD") +o.password = true +o.datatype = "string" + +o = s:option(Value, "time_zone", translate("Timezone")) +o.datatype = "string" +o:value("Asia/Shanghai", "Asia/Shanghai") + +return m diff --git a/applications/luci-app-pve/luasrc/model/cbi/pve/tool.lua b/applications/luci-app-pve/luasrc/model/cbi/pve/tool.lua new file mode 100644 index 0000000..ce93162 --- /dev/null +++ b/applications/luci-app-pve/luasrc/model/cbi/pve/tool.lua @@ -0,0 +1,41 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local http = require 'luci.http' + +m=SimpleForm("Tools") +m.submit = false +m.reset = false + +s = m:section(SimpleSection) + +o = s:option(Value, "action", translate("Action").."*") +o.rmempty = false +o.datatype = "string" +o:value("gpu-passthrough", "gpu-passthrough") +o.default = "gpu-passthrough" + +local t=Template("pve/tool") +m:append(t) + +local btn_do = s:option(Button, "_do") +btn_do.render = function(self, section, scope) + self.inputstyle = "add" + self.title = " " + self.inputtitle = translate("Execute") + Button.render(self, section, scope) +end + +btn_do.write = function(self, section, value) + local action = m:get(section, "action") + if action == "gpu-passthrough" then + local cmd = string.format("/usr/libexec/istorec/pve.sh %s", action) + cmd = "/etc/init.d/tasks task_add pve " .. luci.util.shellquote(cmd) .. " >/dev/null 2>&1" + os.execute(cmd) + t.show_log_taskid = "pve" + end +end + +return m + diff --git a/applications/luci-app-pve/luasrc/model/pve.lua b/applications/luci-app-pve/luasrc/model/pve.lua new file mode 100644 index 0000000..681d9ba --- /dev/null +++ b/applications/luci-app-pve/luasrc/model/pve.lua @@ -0,0 +1,55 @@ +local util = require "luci.util" +local jsonc = require "luci.jsonc" + +local pve = {} + +pve.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 + +pve.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 + +pve.find_paths = function(blocks, home_dirs, path_name) + local default_path = '' + local configs = {} + + default_path = home_dirs[path_name] .. "/PVE" + if #blocks == 0 then + table.insert(configs, default_path) + else + for _, val in pairs(blocks) do + table.insert(configs, val .. "/" .. path_name .. "/PVE") + end + local without_conf_dir = "/root/" .. path_name .. "/PVE" + if default_path == without_conf_dir then + default_path = configs[1] + end + end + + return configs, default_path +end + +return pve diff --git a/applications/luci-app-pve/luasrc/view/pve/status.htm b/applications/luci-app-pve/luasrc/view/pve/status.htm new file mode 100644 index 0000000..c8dae2a --- /dev/null +++ b/applications/luci-app-pve/luasrc/view/pve/status.htm @@ -0,0 +1,31 @@ +<% +local util = require "luci.util" +local container_status = util.trim(util.exec("/usr/libexec/istorec/pve.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/pve.sh port")) + if port == "" then + port="8123" + end +-%> +
+ +
+ + +
+
+<% end %> diff --git a/applications/luci-app-pve/luasrc/view/pve/tool.htm b/applications/luci-app-pve/luasrc/view/pve/tool.htm new file mode 100644 index 0000000..8ab8bdc --- /dev/null +++ b/applications/luci-app-pve/luasrc/view/pve/tool.htm @@ -0,0 +1,11 @@ +<%+tasks/embed%> + + + diff --git a/applications/luci-app-pve/po/zh-cn/pve.po b/applications/luci-app-pve/po/zh-cn/pve.po new file mode 100644 index 0000000..0bcd0a9 --- /dev/null +++ b/applications/luci-app-pve/po/zh-cn/pve.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Official website:" +msgstr "官方网站:" + +msgid "Proxmox" +msgstr "Proxmox虚拟机(PVE)" + +msgid "Proxmox in iStoreOS." +msgstr "运行在 iStoreOS 上面的 Proxmox(PVE) 虚拟机平台。" + +msgid "Config path" +msgstr "配置文件路径" + +msgid "Service Status" +msgstr "服务状态" + +msgid "PVE status:" +msgstr "PVE 的状态信息如下:" + +msgid "Setup" +msgstr "安装配置" + +msgid "The following parameters will only take effect during installation or upgrade:" +msgstr "以下参数只在安装或者升级时才会生效:" + +msgid "Status" +msgstr "状态" + +msgid "PVE is running" +msgstr "PVE 运行中" + +msgid "PVE is not running" +msgstr "PVE 未运行" + +msgid "Open the PVE" +msgstr "打开 PVE" + +msgid "Tool" +msgstr "操作" + +msgid "Execute" +msgstr "执行" + +msgid "Timezone" +msgstr "时区" + diff --git a/applications/luci-app-pve/root/etc/config/pve b/applications/luci-app-pve/root/etc/config/pve new file mode 100644 index 0000000..22cabfb --- /dev/null +++ b/applications/luci-app-pve/root/etc/config/pve @@ -0,0 +1,4 @@ +config pve + option 'config_path' '' + option 'http_port' '8006' + option 'image_name' 'linkease/pve:latest' diff --git a/applications/luci-app-pve/root/usr/libexec/istorec/pve.sh b/applications/luci-app-pve/root/usr/libexec/istorec/pve.sh new file mode 100644 index 0000000..5c7941f --- /dev/null +++ b/applications/luci-app-pve/root/usr/libexec/istorec/pve.sh @@ -0,0 +1,129 @@ +#!/bin/sh + +ACTION=${1} +shift 1 + +do_install() { + if echo `uname -m` | grep -Eqi 'x86_64'; then + echo "Support x86_64" + else + echo "Not x86_64, only support x86_64, exit" + sleep 3 + exit 1 + fi + + if [ -e /dev/kvm ]; then + echo "/dev/kvm exists" + else + echo "/dev/kvm does not exist" + sleep 3 + exit 2 + fi + + local config=`uci get pve.@pve[0].config_path 2>/dev/null` + local root_pwd=`uci get pve.@pve[0].root_pwd 2>/dev/null` + local IMAGE_NAME=`uci get pve.@pve[0].image_name 2>/dev/null` + local tz=`uci get pve.@pve[0].time_zone 2>/dev/null` + local port=`uci get pve.@pve[0].http_port 2>/dev/null` + + if [ -z "$config" ]; then + echo "config path is empty!" + exit 1 + fi + [ -z "$port" ] && port=8006 + + echo "start vmease" + /etc/init.d/vmease start + sleep 1 + + echo "docker pull ${IMAGE_NAME}" + docker pull ${IMAGE_NAME} + docker rm -f pve + mkdir -p "$config" + + local cmd="docker run --restart=unless-stopped -d \ + --privileged \ + --tmpfs /tmp \ + --tmpfs /run/lock \ + --hostname pve \ + -e "ISTOREOS=1" \ + -v \"/var/run:/host/var/run\" \ + -v \"$config/vz:/var/lib/vz\" \ + -v \"$config/pve-cluster:/var/lib/pve-cluster\" \ + --device /dev/kvm:/dev/kvm \ + -p $port:8006 \ + --dns=172.17.0.1 \ + --dns=223.5.5.5 " + + [ -e "/dev/vfio" ] && cmd="$cmd -v \"/dev/vfio:/dev/vfio\"" + if [ -z "$tz" ]; then + tz="`uci get system.@system[0].zonename | sed 's/ /_/g'`" + fi + [ -z "$tz" ] || cmd="$cmd -e TZ=\"$tz\"" + [ -z "$root_pwd" ] || cmd="$cmd -e root_password=\"$root_pwd\"" + + cmd="$cmd -v /mnt:/mnt" + mountpoint -q /mnt && cmd="$cmd:rslave" + + cmd="$cmd --name pve \"$IMAGE_NAME\"" + + echo "$cmd" + eval "$cmd" + + echo "Waiting" + sleep 8 + echo "Done" +} + +do_gpu_passthrough() { + echo "TODO" + return 0 +} + +usage() { + echo "usage: $0 sub-command" + echo "where sub-command is one of:" + echo " install Install the pve" + echo " upgrade Upgrade the pve" + echo " rm/start/stop/restart Remove/Start/Stop/Restart the pve" + echo " status pve status" + echo " port pve port" +} + +case ${ACTION} in + "install") + do_install + ;; + "upgrade") + do_install + ;; + "rm") + docker rm -f pve + ;; + "start") + /etc/init.d/vmease start + sleep 1 + docker ${ACTION} pve + ;; + "stop") + docker ${ACTION} pve + ;; + "restart") + /etc/init.d/vmease start + sleep 1 + docker ${ACTION} pve + ;; + "status") + docker ps --all -f 'name=^/pve$' --format '{{.State}}' + ;; + "port") + docker ps --all -f 'name=^/pve$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + ;; + "gpu-passthrough") + do_gpu_passthrough + ;; + *) + usage + exit 1 + ;; +esac diff --git a/applications/luci-app-rtbwmon/Makefile b/applications/luci-app-rtbwmon/Makefile index 8db787f..6c4ee92 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 0ce637e..d8a6415 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 05859eb..4785895 100644 --- 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 0000000..c1ac84d --- /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 100644 index 0000000..487e461 --- /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 0000000..896722f --- /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 0000000..109546f --- /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 0000000..1be7e76 --- /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 0000000..f22e965 --- /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 100644 index 0000000..ab0e8ee --- /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-systools/Makefile b/applications/luci-app-systools/Makefile index a3bbb79..78ba59c 100644 --- a/applications/luci-app-systools/Makefile +++ b/applications/luci-app-systools/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.5-20231215 +PKG_VERSION:=1.0.9-20250108 PKG_RELEASE:= LUCI_TITLE:=LuCI support for SysTools diff --git a/applications/luci-app-systools/luasrc/controller/systools.lua b/applications/luci-app-systools/luasrc/controller/systools.lua index d600593..d9f202b 100644 --- a/applications/luci-app-systools/luasrc/controller/systools.lua +++ b/applications/luci-app-systools/luasrc/controller/systools.lua @@ -87,12 +87,32 @@ function main_container(data, extra) required = true, title = "可执行操作", type = "string", - enum = {"turn_off_ipv6", "full_ipv6", "half_ipv6", "reset_rom_pkgs", "qb_reset_password", "disk_power_mode", "speedtest", "openssl-aes256gcm", "openssl-chacha20-poly1305", "istore-reinstall", "disable-wandrop"}, + enum = { + "select_none", + "turn_off_ipv6", + "ipv6_full_1", + "ipv6_full_try_2", + "ipv6_nat_3", + "ipv6_half_4", + "disable-planb", + "reset_rom_pkgs", + "istore-reinstall", + "qb_reset_password", + "disk_power_mode", + "speedtest", + "openssl-aes256gcm", + "openssl-chacha20-poly1305", + }, enumNames = { + lng.translate("Select"), lng.translate("Turn off IPv6"), - lng.translate("Full IPv6"), - lng.translate("Half IPv6 (Only Router)"), + lng.translate("IPv6 Full"), + lng.translate("IPv6 Full try 2"), + lng.translate("IPv6 NAT 3"), + lng.translate("IPv6 Half (Only Router)"), + lng.translate("Disable LAN port keepalive"), lng.translate("Reset rom pkgs"), + lng.translate("Reinstall iStore"), lng.translate("Reset qBittorrent Password"), lng.translate("HDD hibernation Status"), lng.translate("Run SpeedTest"), @@ -152,7 +172,7 @@ function get_data() extra["speedTestServers"] = get_speedtest_servers() end else - tool = "turn_off_ipv6" + tool = "select_none" end local data = { tool = tool, @@ -185,9 +205,9 @@ end function install_execute_systools(req) local cmd if req["tool"] == "speedtest" then - cmd = string.format("/usr/libexec/istorec/systools.sh %s %s", req["tool"], req["speedTestServer"]) + cmd = string.format("/usr/libexec/systools.sh %s %s", req["tool"], req["speedTestServer"]) else - cmd = string.format("/usr/libexec/istorec/systools.sh %s", req["tool"]) + cmd = string.format("/usr/libexec/systools.sh %s", req["tool"]) end cmd = "/etc/init.d/tasks task_add systools " .. luci.util.shellquote(cmd) os.execute(cmd .. " >/dev/null 2>&1") diff --git a/applications/luci-app-systools/po/zh-cn/systools.po b/applications/luci-app-systools/po/zh-cn/systools.po index 50b24fa..13042ef 100644 --- a/applications/luci-app-systools/po/zh-cn/systools.po +++ b/applications/luci-app-systools/po/zh-cn/systools.po @@ -7,6 +7,9 @@ msgstr "执行" msgid "Some convenient tools which can fix some errors." msgstr "一些便利的工具集,方便修复一些问题。" +msgid "Disable LAN port keepalive" +msgstr "禁用 LAN 口保活" + msgid "Reset rom pkgs" msgstr "修复系统软件" diff --git a/applications/luci-app-systools/root/usr/libexec/istorec/systools.sh b/applications/luci-app-systools/root/usr/libexec/istorec/systools.sh deleted file mode 100644 index 8b00a80..0000000 --- a/applications/luci-app-systools/root/usr/libexec/istorec/systools.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# Author Xiaobao(xiaobao@linkease.com) - -ACTION=${1} -shift 1 - -usage() { - echo "usage: $0 sub-command" - echo "where sub-command is one of:" - echo " turn_off_ipv6 Disable IPv6" - echo " full_ipv6 Full IPv6" - echo " half_ipv6 Half IPv6 (Only Router)" - echo " reset_rom_pkgs Reset pkgs from rom" - echo " qb_reset_password Reset qBitorent password" - echo " disk_power_mode Show disk power status" - echo " speedtest Start a speedtest" -} - -case ${ACTION} in - "turn_off_ipv6"|\ - "full_ipv6"|\ - "half_ipv6") - bash "/usr/share/systools/${ACTION}.run" - ;; - "reset_rom_pkgs") - bash "/usr/share/systools/${ACTION}.run" - ;; - "qb_reset_password") - bash "/usr/share/systools/${ACTION}.run" - ;; - "disk_power_mode") - bash "/usr/share/systools/${ACTION}.run" - ;; - "speedtest") - /usr/share/systools/speedtest.run ${1} - ;; - "openssl-aes256gcm") - bash "/usr/share/systools/${ACTION}.run" - ;; - "openssl-chacha20-poly1305") - bash "/usr/share/systools/${ACTION}.run" - ;; - "istore-reinstall") - bash "/usr/share/systools/${ACTION}.run" - ;; - "disable-wandrop") - bash "/usr/share/systools/${ACTION}.run" - ;; - *) - usage - exit 1 - ;; -esac - diff --git a/applications/luci-app-systools/root/usr/libexec/systools.sh b/applications/luci-app-systools/root/usr/libexec/systools.sh new file mode 100644 index 0000000..2190326 --- /dev/null +++ b/applications/luci-app-systools/root/usr/libexec/systools.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Author Xiaobao(xiaobao@linkease.com) + +ACTION=${1} +shift 1 + +usage() { + echo "usage: $0 sub-command" + echo "where sub-command is one of:" + echo " select_none Select action" + echo " turn_off_ipv6 Disable IPv6" + echo " ipv6_full_1 Enable IPv6" + echo " ipv6_full_try_2 Enable IPv6 method 2" + echo " ipv6_nat_3 Enable IPv6 NAT" + echo " half_ipv6 Half IPv6 (Only Router)" + echo " disable-planb Diable planb" + echo " reset_rom_pkgs Reset pkgs from rom" + echo " qb_reset_password Reset qBitorent password" + echo " disk_power_mode Show disk power status" + echo " speedtest Start a speedtest" +} + +case "${ACTION}" in + "speedtest") + /usr/share/systools/speedtest.run ${1} + ;; + *) + if [ -n "${ACTION}" -a -s /usr/share/systools/${ACTION}.run ]; then + bash "/usr/share/systools/${ACTION}.run" + else + usage + exit 1 + fi + ;; +esac + diff --git a/applications/luci-app-systools/root/usr/share/systools/disable-planb.run b/applications/luci-app-systools/root/usr/share/systools/disable-planb.run new file mode 100644 index 0000000..6c166de --- /dev/null +++ b/applications/luci-app-systools/root/usr/share/systools/disable-planb.run @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "x$(uci -q get quickstart.main.disable_dhns)" = x1 ]; then + echo "Already disabled!" +else + echo "Disabling..." + uci set quickstart.main.disable_dhns=1 + uci commit quickstart + /etc/init.d/quickstart restart + echo "Done" +fi diff --git a/applications/luci-app-systools/root/usr/share/systools/firewall.nat6 b/applications/luci-app-systools/root/usr/share/systools/firewall.nat6 new file mode 100644 index 0000000..df5321a --- /dev/null +++ b/applications/luci-app-systools/root/usr/share/systools/firewall.nat6 @@ -0,0 +1,143 @@ +# NAT6 + masquerading firewall script +# https://github.com/akatrevorjay/openwrt-masq6 +# trevorj +# +# You can configure in /etc/config/firewall per zone: +# * IPv4 masquerading +# option masq 1 +# * IPv6 masquerading +# option masq6 1 +# * IPv6 privacy extensions +# option masq6_privacy 1 + +set -e -o pipefail + +. /lib/functions.sh +. /lib/functions/network.sh +. /usr/share/libubox/jshn.sh + +log() { + logger -t nat6 -s "${@}" +} + +get_ula_prefix() { + uci get network.globals.ula_prefix +} + +validate_ula_prefix() { + local ula_prefix="${1}" + if [ $(echo "${ula_prefix}" | grep -c -E -e "^([0-9a-fA-F]{4}):([0-9a-fA-F]{0,4}):") -ne 1 ] ; then + log "Fatal error: IPv6 ULA ula_prefix=\"${ula_prefix}\" seems invalid. Please verify that a ula_prefix is set and valid." + return 1 + fi +} + +ip6t() { + ip6tables "${@}" +} + +ip6t_add() { + if ! ip6t -C "${@}" &> /dev/null; then + ip6t -I "${@}" + fi +} + +nat6_init() { + iptables-save -t nat \ + | sed -e " + /\sMASQUERADE$/d + /\s[DS]NAT\s/d + /\s--match-set\s\S*/s//\06/ + /,BROADCAST\s/s// /" \ + | grep -v FULLCONENAT \ + | ip6tables-restore -T nat +} + +masq6_network() { + # ${config} contains the ID of the current section + local network_name="${1}" + + local device + network_get_device device "${network_name}" || return 0 + + local done_net_dev + for done_net_dev in ${DONE_NETWORK_DEVICES}; do + if [ "${done_net_dev}" = "${device}" ]; then + log "Already configured device=\"${device}\", so leaving as is." + return 0 + fi + done + + log "Found device=\"${device}\" for network_name=\"${network_name}\"." + + if [ "${zone_masq6_privacy}" -eq 1 ]; then + log "Enabling IPv6 temporary addresses for device=\"${device}\"." + + log "Accepting router advertisements on ${device} even if forwarding is enabled (required for temporary addresses)" + echo 2 > "/proc/sys/net/ipv6/conf/${device}/accept_ra" \ + || log "Error: Failed to change router advertisements accept policy on ${device} (required for temporary addresses)" + + log "Using temporary addresses for outgoing connections on interface ${device}" + echo 2 > "/proc/sys/net/ipv6/conf/${device}/use_tempaddr" \ + || log "Error: Failed to enable temporary addresses for outgoing connections on interface ${device}" + fi + + append DONE_NETWORK_DEVICES "${device}" +} + +handle_zone() { + # ${config} contains the ID of the current section + local config="${1}" + + local zone_name + config_get zone_name "${config}" name + + # Enable masquerading via NAT6 + local zone_masq6 + config_get_bool zone_masq6 "${config}" masq6 0 + + log "Firewall config=\"${config}\" zone=\"${zone_name}\" zone_masq6=\"${zone_masq6}\"." + + if [ "${zone_masq6}" -eq 0 ]; then + return 0 + fi + + # IPv6 privacy extensions: Use temporary addrs for outgoing connections? + local zone_masq6_privacy + config_get_bool zone_masq6_privacy "${config}" masq6_privacy 1 + + log "Found firewall zone_name=\"${zone_name}\" with zone_masq6=\"${zone_masq6}\" zone_masq6_privacy=\"${zone_masq6_privacy}\"." + + log "Setting up masquerading nat6 for zone_name=\"${zone_name}\" with zone_masq6_privacy=\"${zone_masq6_privacy}\"" + + local ula_prefix="$(get_ula_prefix)" + validate_ula_prefix "${ula_prefix}" || return 1 + + local postrouting_chain="zone_${zone_name}_postrouting" + log "Ensuring ip6tables chain=\"${postrouting_chain}\" contains our MASQUERADE." + ip6t_add "${postrouting_chain}" -t nat \ + -m comment --comment "!fw3" -j MASQUERADE + + local input_chain="zone_${zone_name}_input" + log "Ensuring ip6tables chain=\"${input_chain}\" contains our permissive DNAT rule." + ip6t_add "${input_chain}" -t filter -m conntrack --ctstate DNAT \ + -m comment --comment "!fw3: Accept port forwards" -j ACCEPT + + local forward_chain="zone_${zone_name}_forward" + log "Ensuring ip6tables chain=\"${forward_chain}\" contains our permissive DNAT rule." + ip6t_add "${forward_chain}" -t filter -m conntrack --ctstate DNAT \ + -m comment --comment "!fw3: Accept port forwards" -j ACCEPT + + local DONE_NETWORK_DEVICES="" + config_list_foreach "${config}" network masq6_network + + log "Done setting up nat6 for zone=\"${zone_name}\" on devices: ${DONE_NETWORK_DEVICES}" +} + +main() { + nat6_init + config_load firewall + config_foreach handle_zone zone +} + +main "${@}" diff --git a/applications/luci-app-systools/root/usr/share/systools/full_ipv6.run b/applications/luci-app-systools/root/usr/share/systools/ipv6_full_1.run similarity index 81% rename from applications/luci-app-systools/root/usr/share/systools/full_ipv6.run rename to applications/luci-app-systools/root/usr/share/systools/ipv6_full_1.run index 56807a7..d046d18 100644 --- a/applications/luci-app-systools/root/usr/share/systools/full_ipv6.run +++ b/applications/luci-app-systools/root/usr/share/systools/ipv6_full_1.run @@ -1,5 +1,15 @@ #!/bin/sh +ipv6_disable_nat() { + NAT6=`uci -q get firewall.nat6.reload` + if [ "$NAT6" = "1" ]; then + uci -q delete network.wan6.sourcefilter + uci -q delete firewall.nat6 + uci commit firewall + /etc/init.d/firewall restart + fi +} + ipv6_disable_lan_server() { uci -q batch <<-EOF >/dev/null del dhcp.lan.ra @@ -51,6 +61,9 @@ is_wan_pppoe() { [ "$(uci -q get network.wan.proto)" = "pppoe" ] } +# disable ipv6 nat +ipv6_disable_nat + if is_lan_gateway; then echo "Single-Port Router (LAN Gateway) mode" ipv6_pppoe_mode @@ -59,7 +72,7 @@ elif is_wan_pppoe; then ipv6_pppoe_mode uci -q delete network.wan.ipv6 else - echo "DHCP-Client mode" + echo "DHCP-Client mode, and use relay mode" ipv6_relay_mode fi diff --git a/applications/luci-app-systools/root/usr/share/systools/ipv6_full_try_2.run b/applications/luci-app-systools/root/usr/share/systools/ipv6_full_try_2.run new file mode 100644 index 0000000..ee01f41 --- /dev/null +++ b/applications/luci-app-systools/root/usr/share/systools/ipv6_full_try_2.run @@ -0,0 +1,70 @@ +#!/bin/sh + +ipv6_disable_nat() { + NAT6=`uci -q get firewall.nat6.reload` + if [ "$NAT6" = "1" ]; then + uci -q delete network.wan6.sourcefilter + uci -q delete firewall.nat6 + uci commit firewall + /etc/init.d/firewall restart + fi +} + +ipv6_disable_lan_server() { + uci -q batch <<-EOF >/dev/null + del dhcp.lan.ra + del dhcp.lan.ra_slaac + del dhcp.lan.ra_flags + del dhcp.lan.dhcpv6 + del dhcp.lan.ndp +EOF +} + +ipv6_dns_on() { + uci -q delete 'dhcp.@dnsmasq[0].filter_aaaa' +} + +ipv6_pppoe_mode() { + ipv6_disable_lan_server + ipv6_dns_on +} + +is_lan_gateway() { + [ "$(uci -q get network.lan.defaultroute)" = "0" ] && return 1 + [ "$(uci -q get network.lan.proto)" = "dhcp" ] && return 0 + [ "$(uci -q get network.lan.proto)" = "static" ] || return 1 + [ -n "$(uci -q get network.lan.gateway)" ] +} + +is_wan_pppoe() { + [ "$(uci -q get network.wan.proto)" = "pppoe" ] +} + +# disable ipv6 nat +ipv6_disable_nat +ipv6_pppoe_mode + +if is_lan_gateway; then + echo "Single-Port Router (LAN Gateway) mode" +elif is_wan_pppoe; then + echo "PPPoE mode" + uci -q delete network.wan.ipv6 +else + echo "DHCP-Client mode, but disable lan server" + # enable ra server + uci -q set dhcp.lan.ra='server' + uci -q add_list dhcp.lan.ra_flags='managed-config' + uci -q add_list dhcp.lan.ra_flags='other-config' + uci -q set dhcp.lan.dhcpv6='server' +fi + +uci -q batch <<-EOF >/dev/null + commit dhcp + commit network +EOF + +/etc/init.d/odhcpd reload +/etc/init.d/dnsmasq reload +/etc/init.d/network reload + +echo "Done" diff --git a/applications/luci-app-systools/root/usr/share/systools/half_ipv6.run b/applications/luci-app-systools/root/usr/share/systools/ipv6_half_4.run similarity index 65% rename from applications/luci-app-systools/root/usr/share/systools/half_ipv6.run rename to applications/luci-app-systools/root/usr/share/systools/ipv6_half_4.run index e23a091..a0f4fe1 100644 --- a/applications/luci-app-systools/root/usr/share/systools/half_ipv6.run +++ b/applications/luci-app-systools/root/usr/share/systools/ipv6_half_4.run @@ -1,5 +1,15 @@ #!/bin/sh +ipv6_disable_nat() { + NAT6=`uci -q get firewall.nat6.reload` + if [ "$NAT6" = "1" ]; then + uci -q delete network.wan6.sourcefilter + uci -q delete firewall.nat6 + uci commit firewall + /etc/init.d/firewall restart + fi +} + ipv6_dns_on() { uci -q delete 'dhcp.@dnsmasq[0].filter_aaaa' } @@ -20,6 +30,9 @@ EOF ipv6_dns_on } +# disable ipv6 nat +ipv6_disable_nat + ipv6_half_mode uci -q batch <<-EOF >/dev/null diff --git a/applications/luci-app-systools/root/usr/share/systools/ipv6_nat_3.run b/applications/luci-app-systools/root/usr/share/systools/ipv6_nat_3.run new file mode 100644 index 0000000..b35226e --- /dev/null +++ b/applications/luci-app-systools/root/usr/share/systools/ipv6_nat_3.run @@ -0,0 +1,65 @@ +#!/bin/sh + +ipv6_enable_nat() { + uci -q delete firewall.nat6 + uci -q set firewall.nat6="include" + uci -q set firewall.nat6.path="/usr/share/systools/firewall.nat6" + uci -q set firewall.nat6.reload="1" + uci -q set firewall.@zone[1].masq6="1" + uci -q set firewall.@zone[1].masq6_privacy="0" +} + +ipv6_disable_lan_server() { + uci -q batch <<-EOF >/dev/null + del dhcp.lan.ra + del dhcp.lan.ra_slaac + del dhcp.lan.ra_flags + del dhcp.lan.dhcpv6 + del dhcp.lan.ndp +EOF +} + +ipv6_dns_on() { + uci -q delete 'dhcp.@dnsmasq[0].filter_aaaa' +} + +ipv6_pppoe_mode() { + ipv6_disable_lan_server + ipv6_dns_on +} + +if opkg list-installed | grep -q "kmod-ipt-nat6"; then + echo "kmod-ipt-nat6 found" +else + echo "kmod-ipt-nat6 not found, installing" + opkg update + opkg install kmod-ipt-nat6 +fi + +echo "IPv6 NAT mode" +ipv6_enable_nat +ipv6_pppoe_mode + +uci set network.globals.ula_prefix="$(uci get network.globals.ula_prefix | sed 's/^./d/')" + +uci -q set network.wan6.reqaddress='try' +uci -q set network.wan6.reqprefix='auto' +uci -q set network.wan6.sourcefilter='0' + +uci -q set dhcp.lan.ra='server' +uci -q add_list dhcp.lan.ra_flags='managed-config' +uci -q add_list dhcp.lan.ra_flags='other-config' +uci -q set dhcp.lan.dhcpv6='server' + +uci -q batch <<-EOF >/dev/null + commit firewall + commit dhcp + commit network +EOF + +/etc/init.d/odhcpd reload +/etc/init.d/dnsmasq reload +/etc/init.d/network reload +/etc/init.d/firewall restart + +echo "Done" diff --git a/applications/luci-app-systools/root/usr/share/systools/istore-reinstall.run b/applications/luci-app-systools/root/usr/share/systools/istore-reinstall.run index 2b230a0..9bd5fce 100644 --- a/applications/luci-app-systools/root/usr/share/systools/istore-reinstall.run +++ b/applications/luci-app-systools/root/usr/share/systools/istore-reinstall.run @@ -1,5 +1,5 @@ #!/bin/sh -ISTORE_REPO=https://istore.linkease.com/repo/all/store +ISTORE_REPO=https://istore.istoreos.com/repo/all/store FCURL="curl --fail --show-error" curl -V >/dev/null 2>&1 || { diff --git a/applications/luci-app-systools/root/usr/share/systools/reset_rom_pkgs.run b/applications/luci-app-systools/root/usr/share/systools/reset_rom_pkgs.run index 20b6de6..7321230 100644 --- a/applications/luci-app-systools/root/usr/share/systools/reset_rom_pkgs.run +++ b/applications/luci-app-systools/root/usr/share/systools/reset_rom_pkgs.run @@ -15,13 +15,12 @@ reset_pkg() { local line local dep local deps - echo "${pkgname}" | grep -q "^kmod-\ -^kernel$\ -^libc$\ -^libgcc1$\ -^libatomic1$\ -^busybox$\ -" && return + echo "${pkgname}" | grep -q '^kmod- +^kernel$ +^libc$ +^libgcc1$ +^libatomic1$ +^busybox$' && return if [ -f /rom/usr/lib/opkg/info/${pkgname}.control -a -e /overlay/upper/usr/lib/opkg/info/${pkgname}.control ]; then echo "reset ${pkgname}" if [ -f /rom/usr/lib/opkg/info/${pkgname}.list ]; then diff --git a/applications/luci-app-systools/root/usr/share/systools/select_none.run b/applications/luci-app-systools/root/usr/share/systools/select_none.run new file mode 100644 index 0000000..e4623e6 --- /dev/null +++ b/applications/luci-app-systools/root/usr/share/systools/select_none.run @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Please select action to run!" + diff --git a/applications/luci-app-systools/root/usr/share/systools/turn_off_ipv6.run b/applications/luci-app-systools/root/usr/share/systools/turn_off_ipv6.run index b1d8b04..20701f9 100644 --- a/applications/luci-app-systools/root/usr/share/systools/turn_off_ipv6.run +++ b/applications/luci-app-systools/root/usr/share/systools/turn_off_ipv6.run @@ -2,6 +2,18 @@ echo "uci settings" +ipv6_disable_nat() { + NAT6=`uci -q get firewall.nat6.reload` + if [ "$NAT6" = "1" ]; then + uci -q delete network.wan6.sourcefilter + uci -q delete firewall.nat6 + uci commit firewall + /etc/init.d/firewall restart + fi +} + +ipv6_disable_nat + uci -q batch <<-EOF del dhcp.lan.ra del dhcp.lan.dhcpv6 diff --git a/applications/luci-app-typecho/Makefile b/applications/luci-app-typecho/Makefile index f44c380..15a3b95 100644 --- a/applications/luci-app-typecho/Makefile +++ b/applications/luci-app-typecho/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20240313 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for TypeCho diff --git a/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh b/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh index ea53918..83b6ddb 100644 --- a/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh +++ b/applications/luci-app-typecho/root/usr/libexec/istorec/typecho.sh @@ -63,10 +63,10 @@ case ${ACTION} in docker ${ACTION} typecho ;; "status") - docker ps --all -f 'name=typecho' --format '{{.State}}' + 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/' + 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 diff --git a/applications/luci-app-ubuntu/Makefile b/applications/luci-app-ubuntu/Makefile index 6f30042..c96b036 100644 --- a/applications/luci-app-ubuntu/Makefile +++ b/applications/luci-app-ubuntu/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.1-20231208 +PKG_VERSION:=1.1.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for ubuntu diff --git a/applications/luci-app-ubuntu/root/usr/libexec/istorec/ubuntu.sh b/applications/luci-app-ubuntu/root/usr/libexec/istorec/ubuntu.sh index 12ef505..58e745a 100644 --- a/applications/luci-app-ubuntu/root/usr/libexec/istorec/ubuntu.sh +++ b/applications/luci-app-ubuntu/root/usr/libexec/istorec/ubuntu.sh @@ -79,10 +79,10 @@ case ${ACTION} in docker ${ACTION} ubuntu ;; "status") - docker ps --all -f 'name=ubuntu' --format '{{.State}}' + docker ps --all -f 'name=^/ubuntu$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=ubuntu' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/ubuntu$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-ubuntu2/Makefile b/applications/luci-app-ubuntu2/Makefile new file mode 100644 index 0000000..da8e4ea --- /dev/null +++ b/applications/luci-app-ubuntu2/Makefile @@ -0,0 +1,24 @@ + + +include $(TOPDIR)/rules.mk + +PKG_VERSION:=1.0.3-20241215 +PKG_RELEASE:= + +LUCI_TITLE:=LuCI support for Ubuntu2 +LUCI_PKGARCH:=all +LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd + +define Package/luci-app-ubuntu2/conffiles +/etc/config/ubuntu2 +endef + +define Package/luci-app-ubuntu2/prerm +#!/bin/sh +/usr/libexec/istorec/ubuntu2.sh stop +exit 0 +endef + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-ubuntu2/luasrc/controller/ubuntu2.lua b/applications/luci-app-ubuntu2/luasrc/controller/ubuntu2.lua new file mode 100644 index 0000000..41eb7c3 --- /dev/null +++ b/applications/luci-app-ubuntu2/luasrc/controller/ubuntu2.lua @@ -0,0 +1,7 @@ + +module("luci.controller.ubuntu2", package.seeall) + +function index() + entry({"admin", "services", "ubuntu2"}, alias("admin", "services", "ubuntu2", "config"), _("Ubuntu2"), 30).dependent = true + entry({"admin", "services", "ubuntu2", "config"}, cbi("ubuntu2")) +end diff --git a/applications/luci-app-ubuntu2/luasrc/model/cbi/ubuntu2.lua b/applications/luci-app-ubuntu2/luasrc/model/cbi/ubuntu2.lua new file mode 100644 index 0000000..754d443 --- /dev/null +++ b/applications/luci-app-ubuntu2/luasrc/model/cbi/ubuntu2.lua @@ -0,0 +1,63 @@ +--[[ +LuCI - Lua Configuration Interface +]]-- + +local taskd = require "luci.model.tasks" +local docker = require "luci.docker" +local ubuntu2_model = require "luci.model.ubuntu2" +local m, s, o + +m = taskd.docker_map("ubuntu2", "ubuntu2", "/usr/libexec/istorec/ubuntu2.sh", + translate("Ubuntu2"), + translate("Ubuntu2 is a high-Performance ubuntu with web remote desktop. [username: abc, password is empty]") + .. translate("Official website:") .. ' https://www.kasmweb.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("Ubuntu2 status:")) +s:append(Template("ubuntu2/status")) + +s = m:section(TypedSection, "main", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:")) +s.addremove=false +s.anonymous=true + +o = s:option(Value, "https_port", translate("HTTPS Port").."*") +o.default = "3001" +o.datatype = "port" + +o = s:option(Value, "image_name", translate("Image").."*") +o.rmempty = false +o.datatype = "string" +o:value("linkease/desktop-ubuntu2-standard-arm64:latest", "Standard-ARM64") +o:value("linkease/desktop-ubuntu2-standard-amd64:latest", "Standard-AMD64") +if "x86_64" == docker_info.Architecture then + o.default = "linkease/desktop-ubuntu2-standard-amd64:latest" +else + o.default = "linkease/desktop-ubuntu2-standard-arm64:latest" +end + +o = s:option(Value, "password", "PASSWORD") +o.password = true +o.datatype = "string" + +local blocks = ubuntu2_model.blocks() +local home = ubuntu2_model.home() + +o = s:option(Value, "config_path", translate("Config path").."*") +o.rmempty = false +o.datatype = "string" + +local paths, default_path = ubuntu2_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-ubuntu2/luasrc/model/ubuntu2.lua b/applications/luci-app-ubuntu2/luasrc/model/ubuntu2.lua new file mode 100644 index 0000000..ca73ae8 --- /dev/null +++ b/applications/luci-app-ubuntu2/luasrc/model/ubuntu2.lua @@ -0,0 +1,55 @@ +local util = require "luci.util" +local jsonc = require "luci.jsonc" + +local ubuntu2 = {} + +ubuntu2.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 + +ubuntu2.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 + +ubuntu2.find_paths = function(blocks, home_dirs, path_name) + local default_path = '' + local configs = {} + + default_path = home_dirs[path_name] .. "/Ubuntu2" + if #blocks == 0 then + table.insert(configs, default_path) + else + for _, val in pairs(blocks) do + table.insert(configs, val .. "/" .. path_name .. "/Ubuntu2") + end + local without_conf_dir = "/root/" .. path_name .. "/Ubuntu2" + if default_path == without_conf_dir then + default_path = configs[1] + end + end + + return configs, default_path +end + +return ubuntu2 diff --git a/applications/luci-app-ubuntu2/luasrc/view/ubuntu2/status.htm b/applications/luci-app-ubuntu2/luasrc/view/ubuntu2/status.htm new file mode 100644 index 0000000..b289018 --- /dev/null +++ b/applications/luci-app-ubuntu2/luasrc/view/ubuntu2/status.htm @@ -0,0 +1,31 @@ +<% +local util = require "luci.util" +local container_status = util.trim(util.exec("/usr/libexec/istorec/ubuntu2.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/ubuntu2.sh port")) + if port == "" then + port="8096" + end +-%> +
+ +
+ + +
+
+<% end %> diff --git a/applications/luci-app-ubuntu2/po/zh-cn/ubuntu2.po b/applications/luci-app-ubuntu2/po/zh-cn/ubuntu2.po new file mode 100644 index 0000000..5f03c09 --- /dev/null +++ b/applications/luci-app-ubuntu2/po/zh-cn/ubuntu2.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Official website:" +msgstr "官方网站:" + +msgid "Ubuntu2 is a high-Performance ubuntu with web remote desktop. [username: abc, password is empty]" +msgstr "Ubuntu2 是带浏览器桌面的高性能 Ubuntu. [用户名: abc, 密码为空]。" + +msgid "Config path" +msgstr "配置文件路径" + +msgid "HTTPS Port" +msgstr "HTTPS 端口" + +msgid "Service Status" +msgstr "服务状态" + +msgid "Ubuntu2 status:" +msgstr "Ubuntu2 的状态信息如下:" + +msgid "Setup" +msgstr "安装配置" + +msgid "The following parameters will only take effect during installation or upgrade:" +msgstr "以下参数只在安装或者升级时才会生效:" + +msgid "Status" +msgstr "状态" + +msgid "Ubuntu2 is running" +msgstr "Ubuntu2 运行中" + +msgid "Ubuntu2 is not running" +msgstr "Ubuntu2 未运行" + +msgid "Open Ubuntu2" +msgstr "打开 Ubuntu2" diff --git a/applications/luci-app-ubuntu2/root/etc/config/ubuntu2 b/applications/luci-app-ubuntu2/root/etc/config/ubuntu2 new file mode 100644 index 0000000..1ef2ec3 --- /dev/null +++ b/applications/luci-app-ubuntu2/root/etc/config/ubuntu2 @@ -0,0 +1,3 @@ +config main + # option 'config_path' '' + diff --git a/applications/luci-app-ubuntu2/root/usr/libexec/istorec/ubuntu2.sh b/applications/luci-app-ubuntu2/root/usr/libexec/istorec/ubuntu2.sh new file mode 100644 index 0000000..5741747 --- /dev/null +++ b/applications/luci-app-ubuntu2/root/usr/libexec/istorec/ubuntu2.sh @@ -0,0 +1,87 @@ +#!/bin/sh +# Author Xiaobao(xiaobao@linkease.com) + +ACTION=${1} +shift 1 + +do_install() { + local https_port=`uci get ubuntu2.@main[0].https_port 2>/dev/null` + local image_name=`uci get ubuntu2.@main[0].image_name 2>/dev/null` + local config=`uci get ubuntu2.@main[0].config_path 2>/dev/null` + if [ -z ${IMAGE_NAME} ]; then + local arch=`uname -m` + if [ "$arch" = "x86_64" ]; then + IMAGE_NAME=linkease/desktop-ubuntu2-standard-amd64:latest + else + IMAGE_NAME=linkease/desktop-ubuntu2-standard-arm64:latest + fi + fi + + echo "docker pull ${image_name}" + docker pull ${image_name} + docker rm -f ubuntu2 + + if [ -z "$config" ]; then + echo "config path is empty!" + exit 1 + fi + + # not conflict with jellyfin + [ -z "$https_port" ] && https_port=3001 + + local cmd="docker run --restart=unless-stopped -d --user 0:0 -e START_DOCKER=false -v \"$config:/config\" \ + --privileged --device /dev/fuse --security-opt apparmor=unconfined --shm-size=512m \ + -v /var/run/docker.sock:/var/run/docker.sock \ + --dns=172.17.0.1 \ + -p $https_port:3001 " + + if [ -d /dev/dri ]; then + cmd="$cmd\ + --device /dev/dri:/dev/dri " + fi + + 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 ubuntu2 \"$image_name\"" + + echo "$cmd" + eval "$cmd" +} + +usage() { + echo "usage: $0 sub-command" + echo "where sub-command is one of:" + echo " install Install the ubuntu2" + echo " upgrade Upgrade the ubuntu2" + echo " rm/start/stop/restart Remove/Start/Stop/Restart the ubuntu2" + echo " status Ubuntu2 status" + echo " port Ubuntu2 port" +} + +case ${ACTION} in + "install") + do_install + ;; + "upgrade") + do_install + ;; + "rm") + docker rm -f ubuntu2 + ;; + "start" | "stop" | "restart") + docker ${ACTION} ubuntu2 + ;; + "status") + docker ps --all -f 'name=^/ubuntu2$' --format '{{.State}}' + ;; + "port") + docker ps --all -f 'name=^/ubuntu2$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->3001/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + ;; + *) + usage + exit 1 + ;; +esac diff --git a/applications/luci-app-unifi/Makefile b/applications/luci-app-unifi/Makefile index 3956cd0..92f6ea3 100644 --- a/applications/luci-app-unifi/Makefile +++ b/applications/luci-app-unifi/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for UnifiController diff --git a/applications/luci-app-unifi/root/usr/libexec/istorec/unifi.sh b/applications/luci-app-unifi/root/usr/libexec/istorec/unifi.sh index 9fd3308..a955fec 100644 --- a/applications/luci-app-unifi/root/usr/libexec/istorec/unifi.sh +++ b/applications/luci-app-unifi/root/usr/libexec/istorec/unifi.sh @@ -72,10 +72,10 @@ case ${ACTION} in docker ${ACTION} unifi ;; "status") - docker ps --all -f 'name=unifi' --format '{{.State}}' + docker ps --all -f 'name=^/unifi$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=unifi' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8443/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/unifi$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8443/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/luci-app-vaultwarden/Makefile b/applications/luci-app-vaultwarden/Makefile index 47c5653..acbc16b 100644 --- a/applications/luci-app-vaultwarden/Makefile +++ b/applications/luci-app-vaultwarden/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20231208 +PKG_VERSION:=1.0.1-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Vaultwarden diff --git a/applications/luci-app-vaultwarden/root/usr/libexec/istorec/vaultwarden.sh b/applications/luci-app-vaultwarden/root/usr/libexec/istorec/vaultwarden.sh index 1f52a1d..af29cf0 100644 --- a/applications/luci-app-vaultwarden/root/usr/libexec/istorec/vaultwarden.sh +++ b/applications/luci-app-vaultwarden/root/usr/libexec/istorec/vaultwarden.sh @@ -72,7 +72,7 @@ case ${ACTION} in docker ${ACTION} vaultwarden ;; "status") - docker ps --all -f 'name=vaultwarden' --format '{{.State}}' + docker ps --all -f 'name=^/vaultwarden$' --format '{{.State}}' ;; "port") uci get -q vaultwarden.@main[0].http_port 2>/dev/null diff --git a/applications/luci-app-webvirtcloud/Makefile b/applications/luci-app-webvirtcloud/Makefile index b33855e..334ef9d 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-20230323-1 +PKG_VERSION:=0.8.5-20241221-1 PKG_RELEASE:= LUCI_TITLE:=LuCI support for webvirtcloud @@ -13,6 +13,12 @@ define Package/luci-app-webvirtcloud/conffiles /etc/config/webvirtcloud endef +define Package/luci-app-webvirtcloud/prerm +#!/bin/sh +/usr/libexec/istorec/webvirtcloud.sh stop +exit 0 +endef + include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-webvirtcloud/luasrc/model/cbi/webvirtcloud/config.lua b/applications/luci-app-webvirtcloud/luasrc/model/cbi/webvirtcloud/config.lua index 6d5f7d2..87257d1 100644 --- a/applications/luci-app-webvirtcloud/luasrc/model/cbi/webvirtcloud/config.lua +++ b/applications/luci-app-webvirtcloud/luasrc/model/cbi/webvirtcloud/config.lua @@ -26,6 +26,7 @@ o = s:option(Value, "image_name", translate("Image").."*") o.rmempty = false o.datatype = "string" o:value("linkease/webvirtcloud:latest", "linkease/webvirtcloud:latest") +o:value("linkease/webvirtcloud:0.8.5", "linkease/webvirtcloud:0.8.5") o:value("linkease/webvirtcloud:0.3.6", "linkease/webvirtcloud:0.3.6") o.default = "linkease/webvirtcloud:latest" 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 98b6e6f..3d8c3b8 100644 --- a/applications/luci-app-webvirtcloud/root/usr/libexec/istorec/webvirtcloud.sh +++ b/applications/luci-app-webvirtcloud/root/usr/libexec/istorec/webvirtcloud.sh @@ -54,7 +54,7 @@ do_install() { echo "$cmd" eval "$cmd" - sleep 5 + sleep 8 echo "Running status:" /usr/sbin/vmeasedaemon runningStatus --pretty } @@ -98,10 +98,10 @@ case ${ACTION} in docker ${ACTION} webvirtcloud ;; "status") - docker ps --all -f 'name=webvirtcloud' --format '{{.State}}' + docker ps --all -f 'name=^/webvirtcloud$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=webvirtcloud' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/webvirtcloud$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; "gpu-passthrough") do_gpu_passthrough diff --git a/applications/luci-app-wxedge/Makefile b/applications/luci-app-wxedge/Makefile index f56785d..df61d96 100644 --- a/applications/luci-app-wxedge/Makefile +++ b/applications/luci-app-wxedge/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.3-20231208 +PKG_VERSION:=1.1.4-20241208 PKG_RELEASE:= LUCI_TITLE:=LuCI support for wxedge @@ -13,6 +13,14 @@ define Package/luci-app-wxedge/conffiles /etc/config/wxedge endef +# prerm +# postrm +define Package/luci-app-wxedge/prerm +#!/bin/sh +docker rm -f wxedge +exit 0 +endef + include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-wxedge/luasrc/model/cbi/wxedge.lua b/applications/luci-app-wxedge/luasrc/model/cbi/wxedge.lua index 507ec65..d87e03a 100644 --- a/applications/luci-app-wxedge/luasrc/model/cbi/wxedge.lua +++ b/applications/luci-app-wxedge/luasrc/model/cbi/wxedge.lua @@ -17,15 +17,12 @@ s = m:section(TypedSection, "wxedge", translate("Setup"), translate("The followi s.addremove=false s.anonymous=true -local default_image = wxedge_model.default_image() o = s:option(Value, "image_name", translate("Image").."*") o.rmempty = false o.datatype = "string" o:value("onething1/wxedge", "onething1/wxedge") -o:value("onething1/wxedge:2.4.3", "onething1/wxedge:2.4.3") o:value("registry.hub.docker.com/onething1/wxedge", "registry.hub.docker.com/onething1/wxedge") -o:value("registry.hub.docker.com/onething1/wxedge:2.4.3", "registry.hub.docker.com/onething1/wxedge:2.4.3") -o.default = default_image +o.default = "onething1/wxedge" local blks = wxedge_model.blocks() local dir diff --git a/applications/luci-app-wxedge/luasrc/model/wxedge.lua b/applications/luci-app-wxedge/luasrc/model/wxedge.lua index 22f3c2f..3d82d68 100644 --- a/applications/luci-app-wxedge/luasrc/model/wxedge.lua +++ b/applications/luci-app-wxedge/luasrc/model/wxedge.lua @@ -22,13 +22,5 @@ wxedge.blocks = function() return vals end -wxedge.default_image = function() - if string.find(nixio.uname().machine, "x86_64") then - return "onething1/wxedge" - else - return "onething1/wxedge:2.4.3" - end -end - return wxedge diff --git a/applications/luci-app-wxedge/root/etc/config/wxedge b/applications/luci-app-wxedge/root/etc/config/wxedge index 43df205..12585a9 100644 --- a/applications/luci-app-wxedge/root/etc/config/wxedge +++ b/applications/luci-app-wxedge/root/etc/config/wxedge @@ -1,3 +1,3 @@ config wxedge - option 'cache_path' '' - option 'image_name' '' +# option 'cache_path' '' +# option 'image_name' '' diff --git a/applications/luci-app-wxedge/root/usr/libexec/istorec/wxedge.sh b/applications/luci-app-wxedge/root/usr/libexec/istorec/wxedge.sh index f615d35..4049892 100644 --- a/applications/luci-app-wxedge/root/usr/libexec/istorec/wxedge.sh +++ b/applications/luci-app-wxedge/root/usr/libexec/istorec/wxedge.sh @@ -78,10 +78,10 @@ EOF docker ${ACTION} wxedge ;; "status") - docker ps --all -f 'name=wxedge' --format '{{.State}}' + docker ps --all -f 'name=^/wxedge$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=wxedge' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/wxedge$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-xteve/Makefile b/applications/luci-app-xteve/Makefile index 751f1bf..74a0021 100644 --- a/applications/luci-app-xteve/Makefile +++ b/applications/luci-app-xteve/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.2-20231208 +PKG_VERSION:=1.0.2-20240822 PKG_RELEASE:= LUCI_TITLE:=LuCI support for Xteve diff --git a/applications/luci-app-xteve/root/usr/libexec/istorec/xteve.sh b/applications/luci-app-xteve/root/usr/libexec/istorec/xteve.sh index fda794f..9558b99 100644 --- a/applications/luci-app-xteve/root/usr/libexec/istorec/xteve.sh +++ b/applications/luci-app-xteve/root/usr/libexec/istorec/xteve.sh @@ -71,10 +71,10 @@ case ${ACTION} in docker ${ACTION} xteve ;; "status") - docker ps --all -f 'name=xteve' --format '{{.State}}' + docker ps --all -f 'name=^/xteve$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=xteve' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' + docker ps --all -f 'name=^/xteve$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://' ;; *) usage diff --git a/applications/luci-app-xunlei/Makefile b/applications/luci-app-xunlei/Makefile index fe3e2bc..a91ac09 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-20240822 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 68ebf30..d785a93 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 @@ if container_running then
- +
<% end %> diff --git a/applications/luci-app-xunlei/root/usr/libexec/istorec/xunlei.sh b/applications/luci-app-xunlei/root/usr/libexec/istorec/xunlei.sh index bd94dee..04dd179 100644 --- a/applications/luci-app-xunlei/root/usr/libexec/istorec/xunlei.sh +++ b/applications/luci-app-xunlei/root/usr/libexec/istorec/xunlei.sh @@ -70,10 +70,10 @@ case ${ACTION} in docker ${ACTION} xunlei ;; "status") - docker ps --all -f 'name=xunlei' --format '{{.State}}' + docker ps --all -f 'name=^/xunlei$' --format '{{.State}}' ;; "port") - docker ps --all -f 'name=xunlei' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->2345/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' + docker ps --all -f 'name=^/xunlei$' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->2345/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/' ;; *) usage diff --git a/applications/sunpanel/Makefile b/applications/sunpanel/Makefile index 244bfe7..5e22a7b 100644 --- a/applications/sunpanel/Makefile +++ b/applications/sunpanel/Makefile @@ -11,7 +11,7 @@ PKG_ARCH_sunpanel:=$(ARCH) PKG_NAME:=sunpanel PKG_VERSION:=1.3.1 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/linkease/istore-packages/releases/download/prebuilt/ PKG_HASH:=3ce70530fad9788c4ce0a2969cffc5b80f010406c7a0185b9a40616e3e67f201 @@ -44,6 +44,7 @@ define Package/$(PKG_NAME)/postinst #!/bin/sh if [ -z "$${IPKG_INSTROOT}" ]; then [ -f /etc/uci-defaults/sunpanel ] && /etc/uci-defaults/sunpanel && rm -f /etc/uci-defaults/sunpanel + exit 0 fi endef diff --git a/applications/vmease/Makefile b/applications/vmease/Makefile index c91bb47..025d240 100644 --- a/applications/vmease/Makefile +++ b/applications/vmease/Makefile @@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk PKG_ARCH_VMEASE:=$(ARCH) PKG_NAME:=vmease -PKG_VERSION:=0.5.1 -PKG_RELEASE:=$(PKG_ARCH_VMEASE)-2 +PKG_VERSION:=0.8.7 +PKG_RELEASE:=$(PKG_ARCH_VMEASE)-1 PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://fw0.koolcenter.com/binary/vmease/ -PKG_HASH:=2ca2b8b276702a239f7f937363fcec925e93f687831e0494d231e642a0cd1d4b +PKG_HASH:=d2f457c7179324584a7c0dcd1dfe60096eb14a0995544fd91d28a9573db1e73e PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION) @@ -44,6 +44,7 @@ define Package/$(PKG_NAME)/postinst #!/bin/sh if [ -z "$${IPKG_INSTROOT}" ]; then [ -f /etc/uci-defaults/vmease ] && /etc/uci-defaults/vmease && rm -f /etc/uci-defaults/vmease + exit 0 fi endef diff --git a/applications/xunyou/Makefile b/applications/xunyou/Makefile index fdc9330..86d727a 100644 --- a/applications/xunyou/Makefile +++ b/applications/xunyou/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xunyou -PKG_VERSION:=2.0.4.5 +PKG_VERSION:=2.0.6.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://partnerdownload.xunyou.com/routerplugin/koolshare/ -PKG_HASH:=00d8dfd34dc4033c53f7e751edc2f7e266f951c4dca0f22a6e77cbe6d813ddab +PKG_HASH:=b287def32b580b98665c9f9da9afb343233d067df3c40c826275cfb5097fe5cf PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_v$(PKG_VERSION)