update 2022-11-25 20:20:58

This commit is contained in:
github-actions[bot] 2022-11-25 20:20:58 +08:00
parent 1dddf0f798
commit 507e775fcf
21 changed files with 293 additions and 35 deletions

View File

@ -16,7 +16,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-amlogic
PKG_VERSION:=3.1.141
PKG_VERSION:=3.1.142
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0 License

View File

@ -76,7 +76,9 @@ luci.sys.exec("echo '' > /tmp/amlogic/amlogic_check_kernel.log && sync >/dev/nul
--SimpleForm for Update OpenWrt firmware/kernel
b = SimpleForm("upload", nil)
b.title = translate("Upload")
b.description = translate("After uploading [Firmware], [Kernel], [IPK] or [Backup Config], the operation buttons will be displayed.")
local des_content = translate("Update plugins first, then update the kernel or firmware.")
local des_content = des_content .. "<br />" .. translate("After uploading [Firmware], [Kernel], [IPK] or [Backup Config], the operation buttons will be displayed.")
b.description = des_content
b.reset = false
b.submit = false

View File

@ -5,7 +5,7 @@
<table width="100%" class="NewsTdHeight">
<tr><td width="100%" colspan="2">
<p align="center">
<%:The OpenWrt and kernel will be downloaded and updated according to the options filled in [Plugin Settings].%> <span id="_openwrt_mainline_version"></span>
<%:Update plugins first, then update the kernel or firmware. More options can be configured in [Plugin Settings].%> <span id="_openwrt_mainline_version"></span>
</p>
</td></tr>
<tr><td width="35%" align="right"><input type="button" class="cbi-button cbi-button-reload" value="<%:Only update Amlogic Service%>" onclick="return b_check_plugin(this)"/></td><td width="65%" align="left"><span id="_current_plugin_version"><%:Collecting data...%></span> <span id="_check_plugin"></span></td></tr>

View File

@ -74,6 +74,9 @@ msgstr "上传文件列表中有内核文件,你可以升级内核。"
msgid "There are openwrt firmware file in the upload directory, and you can update the openwrt."
msgstr "上传文件列表中有 OpenWrt 固件文件,你可以升级 OpenWrt。"
msgid "Update plugins first, then update the kernel or firmware."
msgstr "首先更新插件,再更新内核或固件。"
msgid "After uploading [Firmware], [Kernel], [IPK] or [Backup Config], the operation buttons will be displayed."
msgstr "当上传 [固件文件][内核文件][IPK文件][配置文件] 后,将自动显示相关操作按钮。"
@ -500,8 +503,8 @@ msgstr "当前设备:"
msgid "If the current device shows (Unknown device), please report to github."
msgstr "如果当前设备显示无法识别Unknown device请到 github 反馈。"
msgid "The OpenWrt and kernel will be downloaded and updated according to the options filled in [Plugin Settings]."
msgstr "将根据在 [插件设置] 里面填写的选项进行 OpenWrt 固件和内核的下载与更新。"
msgid "Update plugins first, then update the kernel or firmware. More options can be configured in [Plugin Settings]."
msgstr "首先更新插件,再更新内核或固件。更多选项可以在插件设置中配置。"
msgid "Collecting data..."
msgstr "正在收集数据…"

View File

@ -11,13 +11,13 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17)
LUCI_PKGARCH:=all
PKG_VERSION:=0.1.12-8
PKG_VERSION:=0.1.12-9
# PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:=
ISTORE_UI_VERSION:=0.1.12
ISTORE_UI_RELEASE:=4
PKG_HASH:=501ba105bcd60030f8f99768b76b0ca083027ef44f7f5b99c039174472fe5c5a
ISTORE_UI_RELEASE:=5
PKG_HASH:=23279d9fa532bbe6a66c4523cfee617d098a6e9a797e4c7e5c07c52b04434047
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE)

File diff suppressed because one or more lines are too long

View File

@ -2456,7 +2456,7 @@ body:not(.Interfaces) .cbi-rowstyle-2:first-child {
.cbi-progressbar {
position: relative;
min-width: 11rem;
height: 1.5rem;
height: 1.5rem !important;
margin: 0 0;
border: thin solid #999;
background: #eee;
@ -2473,8 +2473,8 @@ body:not(.Interfaces) .cbi-rowstyle-2:first-child {
}
.cbi-progressbar::after {
font-family: monospace;
font-size: 1em;
font-family: var(--font-family-monospace);
font-size: 0.75rem;
font-weight: bold;
font-size-adjust: .38;
line-height: 1.5rem;

View File

@ -129,7 +129,7 @@
<div class="login-form">
<!-- Logo Start -->
<a class="brand" href="/"><img src="<%=media%>/img/argon.svg" class="icon">
<span class="brand-text"><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %></span>
<span class="brand-text"><%=striptags( (boardinfo.hostname or "?") ) %></span>
</a>
<!-- Logo End -->
<!-- Login Form Start -->

View File

@ -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 "执行"

View File

@ -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

View File

@ -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

View File

@ -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").."<b>*</b>")
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").."<b>*</b>")
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

View File

@ -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

View File

@ -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").."<b>*</b>")
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

View File

@ -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 "时区"

View File

@ -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' ''

View File

@ -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

View File

@ -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

View File

@ -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:") .. ' <a href=\"https://jellyfin.org/\" target=\"_blank\">https://jellyfin.org/</a>')
.. translate("Official website:") .. ' <a href=\"https://jellyfin.org/\" target=\"_blank\">https://jellyfin.org/</a>'
.. "<dl><dt>" .. translate("The following models support hardware transcoding without configuration in Jellyfin:") .. "</dt>"
.. "<dd>- Easepi ARS2</dd>"
.. "<dd>- " .. 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.") .. "</dd>"
.. "<dt>" .. translate("The following models may support hardware transcoding by referring to the official Jellyfin documentation:") .. "</dt>"
.. "<dd>- " .. translate("x86 series") .. "</dd>"
.. "<dd>- " .. translate("Raspberry Pi series") .. "</dd>"
.. "</dl>")
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.")
.. "<br>" .. translate("The following parameters will only take effect during installation or upgrade:"))
s.addremove=false
s.anonymous=true

View File

@ -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 系列例如R5SR68sR66s等并使用 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 "以下参数只在安装或者升级时才会生效:"

View File

@ -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 \