diff --git a/openwrt-app-actions/applications/luci-app-lanraragi/Makefile b/openwrt-app-actions/applications/luci-app-lanraragi/Makefile index bc3f710c0..797c12e98 100644 --- a/openwrt-app-actions/applications/luci-app-lanraragi/Makefile +++ b/openwrt-app-actions/applications/luci-app-lanraragi/Makefile @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-lanraragi/luasrc/model/lanraragi.lua b/openwrt-app-actions/applications/luci-app-lanraragi/luasrc/model/lanraragi.lua index 7697b0652..1c459419f 100644 --- a/openwrt-app-actions/applications/luci-app-lanraragi/luasrc/model/lanraragi.lua +++ b/openwrt-app-actions/applications/luci-app-lanraragi/luasrc/model/lanraragi.lua @@ -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" diff --git a/openwrt-app-actions/applications/luci-app-navidrome/Makefile b/openwrt-app-actions/applications/luci-app-navidrome/Makefile index 87bb6de60..9977dc432 100644 --- a/openwrt-app-actions/applications/luci-app-navidrome/Makefile +++ b/openwrt-app-actions/applications/luci-app-navidrome/Makefile @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-navidrome/luasrc/model/navidrome.lua b/openwrt-app-actions/applications/luci-app-navidrome/luasrc/model/navidrome.lua index e15ab7ec0..baaab3de0 100644 --- a/openwrt-app-actions/applications/luci-app-navidrome/luasrc/model/navidrome.lua +++ b/openwrt-app-actions/applications/luci-app-navidrome/luasrc/model/navidrome.lua @@ -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" diff --git a/openwrt-app-actions/applications/luci-app-owntone/Makefile b/openwrt-app-actions/applications/luci-app-owntone/Makefile new file mode 100644 index 000000000..ede50896f --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/Makefile @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-owntone/luasrc/controller/owntone.lua b/openwrt-app-actions/applications/luci-app-owntone/luasrc/controller/owntone.lua new file mode 100755 index 000000000..e26ba5512 --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/luasrc/controller/owntone.lua @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-owntone/luasrc/model/cbi/owntone.lua b/openwrt-app-actions/applications/luci-app-owntone/luasrc/model/cbi/owntone.lua new file mode 100644 index 000000000..63eae7d10 --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/luasrc/model/cbi/owntone.lua @@ -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:") .. ' https://owntone.github.io/owntone-server/') + +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").."*", 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").."*") +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").."*") +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 diff --git a/openwrt-app-actions/applications/luci-app-owntone/luasrc/model/owntone.lua b/openwrt-app-actions/applications/luci-app-owntone/luasrc/model/owntone.lua new file mode 100644 index 000000000..ab93c5195 --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/luasrc/model/owntone.lua @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-owntone/luasrc/view/owntone/status.htm b/openwrt-app-actions/applications/luci-app-owntone/luasrc/view/owntone/status.htm new file mode 100644 index 000000000..cc120ece7 --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/luasrc/view/owntone/status.htm @@ -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" +-%> +
+ +
+ <% if container_running then %> + + <% else %> + + <% end %> +
+
+<% +if container_running then + local port=util.trim(util.exec("/usr/libexec/istorec/owntone.sh port")) + if port == "" then + port="3689" + end +-%> +
+ +
+ + +
+
+<% end %> diff --git a/openwrt-app-actions/applications/luci-app-owntone/po/zh-cn/owntone.po b/openwrt-app-actions/applications/luci-app-owntone/po/zh-cn/owntone.po new file mode 100644 index 000000000..b8da24342 --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/po/zh-cn/owntone.po @@ -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 网络" diff --git a/openwrt-app-actions/applications/luci-app-owntone/root/etc/config/owntone b/openwrt-app-actions/applications/luci-app-owntone/root/etc/config/owntone new file mode 100644 index 000000000..e2ddf09db --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/root/etc/config/owntone @@ -0,0 +1,5 @@ +config main + option 'image_name' 'lscr.io/linuxserver/daapd:latest' + option 'config_path' '' + option 'music_path' '' + diff --git a/openwrt-app-actions/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh b/openwrt-app-actions/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh new file mode 100755 index 000000000..9c0d47474 --- /dev/null +++ b/openwrt-app-actions/applications/luci-app-owntone/root/usr/libexec/istorec/owntone.sh @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-penpot/Makefile b/openwrt-app-actions/applications/luci-app-penpot/Makefile index 1778fb5b4..0b8ca41d5 100644 --- a/openwrt-app-actions/applications/luci-app-penpot/Makefile +++ b/openwrt-app-actions/applications/luci-app-penpot/Makefile @@ -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 diff --git a/openwrt-app-actions/applications/luci-app-systools/luasrc/controller/systools.lua b/openwrt-app-actions/applications/luci-app-systools/luasrc/controller/systools.lua index 5f615ca61..d62d08f46 100755 --- a/openwrt-app-actions/applications/luci-app-systools/luasrc/controller/systools.lua +++ b/openwrt-app-actions/applications/luci-app-systools/luasrc/controller/systools.lua @@ -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() diff --git a/openwrt-app-actions/applications/luci-app-systools/luasrc/view/systools/main.htm b/openwrt-app-actions/applications/luci-app-systools/luasrc/view/systools/main.htm index 04c2882f6..cdeb35eed 100644 --- a/openwrt-app-actions/applications/luci-app-systools/luasrc/view/systools/main.htm +++ b/openwrt-app-actions/applications/luci-app-systools/luasrc/view/systools/main.htm @@ -12,7 +12,7 @@