- <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %>
+ <%=striptags( (boardinfo.hostname or "?") ) %>
diff --git a/openwrt-app-actions/applications/luci-app-codeserver/po/zh-cn/codeserver.po b/openwrt-app-actions/applications/luci-app-codeserver/po/zh-cn/codeserver.po
index a349a80b5..e0ae9a15b 100644
--- a/openwrt-app-actions/applications/luci-app-codeserver/po/zh-cn/codeserver.po
+++ b/openwrt-app-actions/applications/luci-app-codeserver/po/zh-cn/codeserver.po
@@ -37,9 +37,14 @@ msgstr "CodeServer 未运行"
msgid "Open CodeServer"
msgstr "打开 CodeServer"
+msgid "Tool"
+msgstr "操作"
+
msgid "Console"
msgstr "控制台"
msgid "Only works in LAN"
msgstr "只在内网环境下工作。"
+msgid "Execute"
+msgstr "执行"
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/Makefile b/openwrt-app-actions/applications/luci-app-homeassistant/Makefile
index b2a8a69cd..f84084e9f 100644
--- a/openwrt-app-actions/applications/luci-app-homeassistant/Makefile
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/Makefile
@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
-PKG_VERSION:=1.1.0-20220830
+PKG_VERSION:=1.1.0-20221125
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for homeassistant
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/controller/homeassistant.lua b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/controller/homeassistant.lua
index 180d4a663..0975e275a 100755
--- a/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/controller/homeassistant.lua
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/controller/homeassistant.lua
@@ -3,5 +3,7 @@ module("luci.controller.homeassistant", package.seeall)
function index()
entry({"admin", "services", "homeassistant"}, alias("admin", "services", "homeassistant", "config"), _("Home Assistant"), 30).dependent = true
- entry({"admin", "services", "homeassistant", "config"}, cbi("homeassistant"))
+ entry({"admin", "services", "homeassistant", "config"}, cbi("homeassistant/config"), _("Config"), 10).leaf = true
+ entry({"admin", "services", "homeassistant", "tool"}, form("homeassistant/tool"), _("Tool"), 30).leaf = true
+ entry({"admin", "services", "homeassistant", "console"}, form("homeassistant/console"), _("Console"), 50).leaf = true
end
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant.lua b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/config.lua
similarity index 52%
rename from openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant.lua
rename to openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/config.lua
index 9986db7b4..da62cc5e6 100644
--- a/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant.lua
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/config.lua
@@ -3,6 +3,7 @@ LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
+local homeassistant_model = require "luci.model.homeassistant"
local m, s, o
m = taskd.docker_map("homeassistant", "homeassistant", "/usr/libexec/istorec/homeassistant.sh",
@@ -17,9 +18,29 @@ s = m:section(TypedSection, "homeassistant", translate("Setup"), translate("The
s.addremove=false
s.anonymous=true
+o = s:option(Value, "image_name", translate("Image").."
*")
+o.rmempty = false
+o.datatype = "string"
+o:value("homeassistant/home-assistant:latest", "homeassistant/home-assistant:latest")
+o:value("ghcr.io/home-assistant/home-assistant:stable", "ghcr.io/home-assistant/home-assistant:stable")
+o:value("ghcr.io/home-assistant/home-assistant:2022.11.4", "ghcr.io/home-assistant/home-assistant:2022.11.4")
+o.default = "homeassistant/home-assistant:latest"
+
+local blocks = homeassistant_model.blocks()
+local home = homeassistant_model.home()
+
o = s:option(Value, "config_path", translate("Config path").."
*")
o.rmempty = false
-o.default = "/root/homeassistant/config"
o.datatype = "string"
+local paths, default_path = homeassistant_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, "time_zone", translate("Timezone"))
+o.datatype = "string"
+o:value("Asia/Shanghai", "Asia/Shanghai")
+
return m
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/console.lua b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/console.lua
new file mode 100644
index 000000000..67e09ef6e
--- /dev/null
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/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 = "homeassistant"
+
+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("Home Assistant is not running"))
+ m.submit = false
+ m.reset = false
+ s = m:section(SimpleSection)
+end
+
+return m
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/tool.lua b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/tool.lua
new file mode 100644
index 000000000..925653582
--- /dev/null
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/luasrc/model/cbi/homeassistant/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("hacs-install", "hacs-install")
+o.default = "hacs-install"
+
+local t=Template("homeassistant/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 == "hacs-install" then
+ local cmd = string.format("/usr/libexec/istorec/homeassistant.sh %s", action)
+ cmd = "/etc/init.d/tasks task_add homeassistant " .. luci.util.shellquote(cmd) .. " >/dev/null 2>&1"
+ os.execute(cmd)
+ t.show_log_taskid = "homeassistant"
+ end
+end
+
+return m
+
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/po/zh-cn/homeassistant.po b/openwrt-app-actions/applications/luci-app-homeassistant/po/zh-cn/homeassistant.po
index 00ce966e9..78f2166c0 100644
--- a/openwrt-app-actions/applications/luci-app-homeassistant/po/zh-cn/homeassistant.po
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/po/zh-cn/homeassistant.po
@@ -33,3 +33,19 @@ msgstr "Home Assistant 未运行"
msgid "Open the Home Assistant"
msgstr "打开 Home Assistant"
+
+msgid "Tool"
+msgstr "操作"
+
+msgid "Console"
+msgstr "控制台"
+
+msgid "Only works in LAN"
+msgstr "只在内网环境下工作。"
+
+msgid "Execute"
+msgstr "执行"
+
+msgid "Timezone"
+msgstr "时区"
+
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/root/etc/config/homeassistant b/openwrt-app-actions/applications/luci-app-homeassistant/root/etc/config/homeassistant
index ecda8fbcd..e1815d239 100644
--- a/openwrt-app-actions/applications/luci-app-homeassistant/root/etc/config/homeassistant
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/root/etc/config/homeassistant
@@ -1,2 +1,4 @@
config homeassistant
- option 'config_path' '/root/homeassistant/config'
+ option 'config_path' ''
+ option 'image_name' 'homeassistant/home-assistant:latest'
+ option 'time_zone' ''
diff --git a/openwrt-app-actions/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh b/openwrt-app-actions/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh
index 7ec7f64c5..0e141ce6b 100755
--- a/openwrt-app-actions/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh
+++ b/openwrt-app-actions/applications/luci-app-homeassistant/root/usr/libexec/istorec/homeassistant.sh
@@ -3,34 +3,29 @@
ACTION=${1}
shift 1
-get_image() {
- IMAGE_NAME="homeassistant/home-assistant:latest"
-}
-
do_install() {
- get_image
- echo "docker pull ${IMAGE_NAME}"
- docker pull ${IMAGE_NAME}
- docker rm -f homeassistant
-
- do_install_detail
-}
-
-do_install_detail() {
local config=`uci get homeassistant.@homeassistant[0].config_path 2>/dev/null`
+ local IMAGE_NAME=`uci get homeassistant.@homeassistant[0].image_name 2>/dev/null`
+ local tz=`uci get homeassistant.@homeassistant[0].time_zone 2>/dev/null`
if [ -z "$config" ]; then
echo "config path is empty!"
exit 1
fi
+ echo "docker pull ${IMAGE_NAME}"
+ docker pull ${IMAGE_NAME}
+ docker rm -f homeassistant
+
local cmd="docker run --restart=unless-stopped -d \
-v \"$config:/config\" \
--privileged \
--network=host \
--dns=127.0.0.1 "
- local tz="`cat /tmp/TZ`"
+ if [ -z "$tz" ]; then
+ tz="`cat /tmp/TZ`"
+ fi
[ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
cmd="$cmd --name homeassistant \"$IMAGE_NAME\""
@@ -38,6 +33,17 @@ do_install_detail() {
echo "$cmd"
eval "$cmd"
+ RET=$?
+ if [ "$RET" = "0" ]; then
+ do_hacs_install
+ fi
+}
+
+do_hacs_install() {
+ echo "wget -O - https://get.hacs.xyz | bash -" | docker exec -i homeassistant bash -
+ sleep 3
+ echo "restart homeassistant"
+ docker restart homeassistant
}
usage() {
@@ -69,6 +75,9 @@ case ${ACTION} in
"port")
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
+ ;;
*)
usage
exit 1
diff --git a/openwrt-app-actions/applications/luci-app-jellyfin/Makefile b/openwrt-app-actions/applications/luci-app-jellyfin/Makefile
index f9d4e824f..5c9f2ebd6 100644
--- a/openwrt-app-actions/applications/luci-app-jellyfin/Makefile
+++ b/openwrt-app-actions/applications/luci-app-jellyfin/Makefile
@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
-PKG_VERSION:=1.1.5-20221114
+PKG_VERSION:=1.1.6-20221125
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for jellyfin
diff --git a/openwrt-app-actions/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua b/openwrt-app-actions/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua
index 7e016fa93..ae47771fa 100644
--- a/openwrt-app-actions/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua
+++ b/openwrt-app-actions/applications/luci-app-jellyfin/luasrc/model/cbi/jellyfin.lua
@@ -9,12 +9,21 @@ local m, s, o
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("Official website:") .. '
https://jellyfin.org/'
+ .. "
- " .. translate("The following models support hardware transcoding without configuration in Jellyfin:") .. "
"
+ .. "- - Easepi ARS2
"
+ .. "- - " .. translate("RK3568 series (e.g. R5S, R68s, R66s, 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:") .. "
"
+ .. "- - " .. translate("x86 series") .. "
"
+ .. "- - " .. translate("Raspberry Pi series") .. "
"
+ .. "
")
s = m:section(SimpleSection, translate("Service Status"), translate("Jellyfin status:"))
s:append(Template("jellyfin/status"))
-s = m:section(TypedSection, "jellyfin", translate("Setup"), translate("The following parameters will only take effect during installation or upgrade:"))
+s = m:section(TypedSection, "jellyfin", translate("Setup"),
+ translate("The initial installation of Jellyfin 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 Jellyfin.")
+ .. "
" .. translate("The following parameters will only take effect during installation or upgrade:"))
s.addremove=false
s.anonymous=true
diff --git a/openwrt-app-actions/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po b/openwrt-app-actions/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po
index a769e1b53..6f88172fb 100644
--- a/openwrt-app-actions/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po
+++ b/openwrt-app-actions/applications/luci-app-jellyfin/po/zh-cn/jellyfin.po
@@ -5,7 +5,22 @@ msgid "Official website:"
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 是志愿者构建的媒体解决方案,可让您控制自己的电影等媒体,并没带任何条件的让您从各种设备去观看您的媒体。"
+msgstr "Jellyfin 是志愿者构建的媒体解决方案,可让您控制自己的电影等媒体,并不受任何限制地让您从各种设备去观看您的媒体。"
+
+msgid "The following models support hardware transcoding without configuration in Jellyfin:"
+msgstr "以下机型无需在Jellyfin配置即支持硬件转码:"
+
+msgid "RK3568 series (e.g. R5S, R68s, R66s, 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 "RK3568 系列(例如R5S,R68s,R66s等)并使用 iStoreOS 固件(版本20221123及以上)。其他固件需开启MPP和RGA,不保证可用。"
+
+msgid "The following models may support hardware transcoding by referring to the official Jellyfin documentation:"
+msgstr "以下机型参考 Jellyfin 官方文档配置可能支持硬件转码:"
+
+msgid "x86 series"
+msgstr "x86 系列"
+
+msgid "Raspberry Pi series"
+msgstr "树莓派系列"
msgid "Media path"
msgstr "媒体路径"
@@ -37,6 +52,9 @@ msgstr "Jellyfin 的状态信息如下:"
msgid "Setup"
msgstr "安装配置"
+msgid "The initial installation of Jellyfin 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 Jellyfin."
+msgstr "初次安装 Jellyfin 至少需要2GB空间,请确保 Docker 数据目录有足够空间。建议安装 Jellyfin 前将 Docker 迁移到硬盘上。"
+
msgid "The following parameters will only take effect during installation or upgrade:"
msgstr "以下参数只在安装或者升级时才会生效:"
diff --git a/openwrt-app-actions/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh b/openwrt-app-actions/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh
index 56e4f53d3..31af9c7d3 100755
--- a/openwrt-app-actions/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh
+++ b/openwrt-app-actions/applications/luci-app-jellyfin/root/usr/libexec/istorec/jellyfin.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# Author jjm2473@gmail.com
# Author Xiaobao(xiaobao@linkease.com)
ACTION=${1}
@@ -10,6 +11,8 @@ IMAGE_NAME='default'
get_image() {
if grep -Eq ',rtd-?129.$' /proc/device-tree/compatible 2>/dev/null; then
ARCH="rtd129x"
+ elif grep -q 'rockchip,' /proc/device-tree/compatible 2>/dev/null; then
+ ARCH="rockchip"
fi
IMAGE_NAME=`uci get jellyfin.@jellyfin[0].image 2>/dev/null`
if [ -z "$IMAGE_NAME" -o "$IMAGE_NAME" == "default" ]; then
@@ -18,6 +21,8 @@ get_image() {
if uname -r | grep -q '^4\.9\.'; then
IMAGE_NAME="jjm2473/jellyfin-rtk:4.9-latest"
fi
+ elif [ "${ARCH}" = "rockchip" ]; then
+ IMAGE_NAME="jjm2473/jellyfin-mpp:latest"
else
IMAGE_NAME="jellyfin/jellyfin"
fi
@@ -39,6 +44,7 @@ do_install_detail() {
local config=`uci get jellyfin.@jellyfin[0].config_path 2>/dev/null`
local cache=`uci get jellyfin.@jellyfin[0].cache_path 2>/dev/null`
local port=`uci get jellyfin.@jellyfin[0].port 2>/dev/null`
+ local dev
if [ -z "$config" ]; then
echo "config path is empty!"
@@ -71,6 +77,14 @@ do_install_detail() {
-v /sys/class/uio:/sys/class/uio \
-v /var/tmp/vowb:/var/tmp/vowb \
--pid=host "
+ elif [ "${ARCH}" = "rockchip" -a -e "/dev/rga" ]; then
+ cmd="$cmd\
+ -t \
+ --privileged "
+ for dev in iep rga dri dma_heap 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
elif [ -d /dev/dri ]; then
cmd="$cmd\
--device /dev/dri:/dev/dri \