update 2022-11-19 20:19:18
This commit is contained in:
parent
29ed18ae75
commit
90e889dcdc
|
@ -2,7 +2,7 @@
|
|||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=1.0.0-20221117
|
||||
PKG_VERSION:=1.0.0-20221119
|
||||
PKG_RELEASE:=
|
||||
|
||||
LUCI_TITLE:=LuCI support for LANraragi
|
||||
|
|
|
@ -37,7 +37,7 @@ lanraragi.find_paths = function(blocks, home_dirs, path_name)
|
|||
local configs = {}
|
||||
|
||||
if #blocks == 0 then
|
||||
return
|
||||
return configs, default_path
|
||||
else
|
||||
if path_name == "Public" then
|
||||
appname = "/Comics"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=1.0.0-20221117
|
||||
PKG_VERSION:=1.0.0-20221119
|
||||
PKG_RELEASE:=
|
||||
|
||||
LUCI_TITLE:=LuCI support for Navidrome
|
||||
|
|
|
@ -37,7 +37,7 @@ navidrome.find_paths = function(blocks, home_dirs, path_name)
|
|||
local configs = {}
|
||||
|
||||
if #blocks == 0 then
|
||||
return
|
||||
return configs, default_path
|
||||
else
|
||||
if path_name == "Public" then
|
||||
appname = "/Music"
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=1.0.0-20221119
|
||||
PKG_RELEASE:=
|
||||
|
||||
LUCI_TITLE:=LuCI support for Owntone
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+docker +luci-lib-taskd
|
||||
|
||||
define Package/luci-app-owntone/conffiles
|
||||
/etc/config/owntone
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
module("luci.controller.owntone", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "services", "owntone"}, alias("admin", "services", "owntone", "config"), _("Owntone"), 30).dependent = true
|
||||
entry({"admin", "services", "owntone", "config"}, cbi("owntone"))
|
||||
end
|
|
@ -0,0 +1,50 @@
|
|||
--[[
|
||||
LuCI - Lua Configuration Interface
|
||||
]]--
|
||||
|
||||
local taskd = require "luci.model.tasks"
|
||||
local owntone_model = require "luci.model.owntone"
|
||||
local m, s, o
|
||||
|
||||
m = taskd.docker_map("owntone", "owntone", "/usr/libexec/istorec/owntone.sh",
|
||||
translate("Owntone"),
|
||||
translate("OwnTone is an open source (audio) media server which allows sharing and streaming your media library to iTunes (DAAP1), Roku (RSP), AirPlay devices (multiroom), Chromecast and also supports local playback.")
|
||||
.. translate("Official website:") .. ' <a href=\"https://owntone.github.io/owntone-server/\" target=\"_blank\">https://owntone.github.io/owntone-server/</a>')
|
||||
|
||||
s = m:section(SimpleSection, translate("Service Status"), translate("Owntone status:"))
|
||||
s:append(Template("owntone/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, "image_name", translate("Image").."<b>*</b>", translate("Owntone only works in host network"))
|
||||
o.rmempty = false
|
||||
o.datatype = "string"
|
||||
o:value("lscr.io/linuxserver/daapd:latest", "lscr.io/linuxserver/daapd:latest")
|
||||
o:value("lscr.io/linuxserver/daapd:28.5.20221103", "lscr.io/linuxserver/daapd:28.5.20221103")
|
||||
o.default = "lscr.io/linuxserver/daapd:latest"
|
||||
|
||||
local blocks = owntone_model.blocks()
|
||||
local home = owntone_model.home()
|
||||
|
||||
o = s:option(Value, "config_path", translate("Config path").."<b>*</b>")
|
||||
o.rmempty = false
|
||||
o.datatype = "string"
|
||||
|
||||
local paths, default_path = owntone_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, "music_path", translate("Music path").."<b>*</b>")
|
||||
o.rmempty = false
|
||||
o.datatype = "string"
|
||||
local paths, default_path = owntone_model.find_paths(blocks, home, "Public")
|
||||
for _, val in pairs(paths) do
|
||||
o:value(val, val)
|
||||
end
|
||||
o.default = default_path
|
||||
|
||||
return m
|
|
@ -0,0 +1,54 @@
|
|||
local util = require "luci.util"
|
||||
local jsonc = require "luci.jsonc"
|
||||
|
||||
local owntone = {}
|
||||
|
||||
owntone.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
|
||||
|
||||
owntone.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["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/Caches")
|
||||
return home_dirs
|
||||
end
|
||||
|
||||
owntone.find_paths = function(blocks, home_dirs, path_name)
|
||||
local appname = '/Owntone'
|
||||
local default_path = ''
|
||||
local configs = {}
|
||||
|
||||
if #blocks == 0 then
|
||||
return configs, default_path
|
||||
else
|
||||
if path_name == "Public" then
|
||||
appname = "/Music"
|
||||
end
|
||||
for _, val in pairs(blocks) do
|
||||
table.insert(configs, val .. "/" .. path_name .. appname)
|
||||
end
|
||||
default_path = configs[1]
|
||||
end
|
||||
|
||||
return configs, default_path
|
||||
end
|
||||
|
||||
return owntone
|
|
@ -0,0 +1,31 @@
|
|||
<%
|
||||
local util = require "luci.util"
|
||||
local container_status = util.trim(util.exec("/usr/libexec/istorec/owntone.sh status"))
|
||||
local container_install = (string.len(container_status) > 0)
|
||||
local container_running = container_status == "running"
|
||||
-%>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Status%></label>
|
||||
<div class="cbi-value-field">
|
||||
<% if container_running then %>
|
||||
<button class="cbi-button cbi-button-success" disabled="true"><%:Owntone is running%></button>
|
||||
<% else %>
|
||||
<button class="cbi-button cbi-button-negative" disabled="true"><%:Owntone is not running%></button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
if container_running then
|
||||
local port=util.trim(util.exec("/usr/libexec/istorec/owntone.sh port"))
|
||||
if port == "" then
|
||||
port="3689"
|
||||
end
|
||||
-%>
|
||||
<div class="cbi-value cbi-value-last">
|
||||
<label class="cbi-value-title"> </label>
|
||||
<div class="cbi-value-field">
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open Owntone%>" onclick="window.open('http://'+location.hostname+':<%=port%>', '_blank')">
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,38 @@
|
|||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
msgid "Official website:"
|
||||
msgstr "官方网站:"
|
||||
|
||||
msgid "OwnTone is an open source (audio) media server which allows sharing and streaming your media library to iTunes (DAAP1), Roku (RSP), AirPlay devices (multiroom), Chromecast and also supports local playback."
|
||||
msgstr "Owntone 是一个支持 iTunes, AirPlay, Chromecast 等的音乐串流平台。"
|
||||
|
||||
msgid "Config path"
|
||||
msgstr "配置文件路径"
|
||||
|
||||
msgid "Service Status"
|
||||
msgstr "服务状态"
|
||||
|
||||
msgid "Owntone status:"
|
||||
msgstr "Owntone 的状态信息如下:"
|
||||
|
||||
msgid "Setup"
|
||||
msgstr "安装配置"
|
||||
|
||||
msgid "The following parameters will only take effect during installation or upgrade:"
|
||||
msgstr "以下参数只在安装或者升级时才会生效:"
|
||||
|
||||
msgid "Status"
|
||||
msgstr "状态"
|
||||
|
||||
msgid "Owntone is running"
|
||||
msgstr "Owntone 运行中"
|
||||
|
||||
msgid "Owntone is not running"
|
||||
msgstr "Owntone 未运行"
|
||||
|
||||
msgid "Open Owntone"
|
||||
msgstr "打开 Owntone"
|
||||
|
||||
msgid "Owntone only works in host network"
|
||||
msgstr "Owntone 只工作在 Host 网络"
|
|
@ -0,0 +1,5 @@
|
|||
config main
|
||||
option 'image_name' 'lscr.io/linuxserver/daapd:latest'
|
||||
option 'config_path' ''
|
||||
option 'music_path' ''
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
#!/bin/sh
|
||||
# Author Xiaobao(xiaobao@linkease.com)
|
||||
|
||||
ACTION=${1}
|
||||
shift 1
|
||||
|
||||
do_install() {
|
||||
local image_name=`uci get owntone.@main[0].image_name 2>/dev/null`
|
||||
local config=`uci get owntone.@main[0].config_path 2>/dev/null`
|
||||
local media=`uci get owntone.@main[0].music_path 2>/dev/null`
|
||||
|
||||
[ -z "$image_name" ] && image_name="lscr.io/linuxserver/daapd:latest"
|
||||
echo "docker pull ${image_name}"
|
||||
docker pull ${image_name}
|
||||
docker rm -f owntone
|
||||
|
||||
if [ -z "$config" ]; then
|
||||
echo "config path is empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local cmd="docker run --restart=unless-stopped -d \
|
||||
-v \"$config:/config\" \
|
||||
-v \"$media:/music\" \
|
||||
--dns=127.0.0.1 \
|
||||
--network=host "
|
||||
|
||||
local tz="`cat /tmp/TZ`"
|
||||
[ -z "$tz" ] || cmd="$cmd -e TZ=$tz"
|
||||
|
||||
cmd="$cmd -v /mnt:/mnt"
|
||||
mountpoint -q /mnt && cmd="$cmd:rslave"
|
||||
cmd="$cmd --name owntone \"$image_name\""
|
||||
|
||||
echo "$cmd"
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 sub-command"
|
||||
echo "where sub-command is one of:"
|
||||
echo " install Install the owntone"
|
||||
echo " upgrade Upgrade the owntone"
|
||||
echo " rm/start/stop/restart Remove/Start/Stop/Restart the owntone"
|
||||
echo " status Owntone status"
|
||||
echo " port Owntone port"
|
||||
}
|
||||
|
||||
case ${ACTION} in
|
||||
"install")
|
||||
do_install
|
||||
;;
|
||||
"upgrade")
|
||||
do_install
|
||||
;;
|
||||
"rm")
|
||||
docker rm -f owntone
|
||||
;;
|
||||
"start" | "stop" | "restart")
|
||||
docker ${ACTION} owntone
|
||||
;;
|
||||
"status")
|
||||
docker ps --all -f 'name=owntone' --format '{{.State}}'
|
||||
;;
|
||||
"port")
|
||||
echo 3689
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=1.0.0-20221114
|
||||
PKG_VERSION:=1.0.0-20221119
|
||||
PKG_RELEASE:=
|
||||
|
||||
LUCI_TITLE:=LuCI support for Penpot
|
||||
LUCI_PKGARCH:=all
|
||||
LUCI_DEPENDS:=+docker +luci-lib-taskd docker-compose
|
||||
LUCI_DEPENDS:=+docker +luci-lib-taskd +docker-compose
|
||||
|
||||
define Package/luci-app-penpot/conffiles
|
||||
/etc/config/penpot
|
||||
|
|
|
@ -136,6 +136,14 @@ end
|
|||
function get_data()
|
||||
local tool = luci.http.formvalue("tool")
|
||||
local extra = {}
|
||||
|
||||
if not tool then
|
||||
local has = luci.http.formvalue("speedtest")
|
||||
if has and has ~= "" then
|
||||
tool = "speedtest"
|
||||
end
|
||||
end
|
||||
|
||||
if tool then
|
||||
if tool == "speedtest" then
|
||||
extra["speedTestServers"] = get_speedtest_servers()
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<script>
|
||||
window.IstoreosData = {};
|
||||
window.IstoreosFormConfig = {
|
||||
getApi:"/cgi-bin/luci/admin/system/systools/form/",
|
||||
getApi:"/cgi-bin/luci/admin/system/systools/form/" + window.location.search,
|
||||
submitApi:"/cgi-bin/luci/admin/system/systools/submit",
|
||||
logApi:"/cgi-bin/luci/admin/system/systools/log",
|
||||
getHook:function(resp){
|
||||
|
|
Loading…
Reference in New Issue