update 2026-08-27 14:50:16

This commit is contained in:
action
2026-08-27 14:50:16 +08:00
parent 377119697a
commit 9a3f194de9
10 changed files with 223 additions and 26 deletions
+2 -2
View File
@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dae
PKG_VERSION:=2026.08.26
PKG_VERSION:=2026.08.27
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=04137361d599099d9b1aa390785137adec72e372
PKG_SOURCE_VERSION:=bc8b33524b959af90b6fe2d56df4ebbdab1eea8c
PKG_SOURCE_URL:=https://github.com/olicesx/dae.git
PKG_MIRROR_HASH:=skip
+18
View File
@@ -0,0 +1,18 @@
#
# Copyright (C) 2026 LinkEase Contributors
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Docker Manager
LUCI_DEPENDS:=+dockermanager +luci-lib-linkeaseauth
LUCI_PKGARCH:=all
PKG_VERSION:=0.1.1
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,129 @@
module("luci.controller.dockermanager", package.seeall)
local APPS_PROXY_PREFIX = "/apps=http://127.0.0.1:19290"
function index()
entry({"admin", "services", "dockermanager_status"}, call("dockermanager_status"))
local open = entry({"admin", "services", "dockermanager", "open"}, call("dockermanager_open"))
open.leaf = true
open.dependent = false
open.sysauth = "root"
open.sysauth_authenticator = "htmlauth"
if not nixio.fs.access("/etc/config/dockermanager") then
return
end
entry({"admin", "services", "dockermanager"}, cbi("dockermanager"), _("Docker Manager"), 22).dependent = true
end
local function uhttpd_has_apps_proxy_prefix()
local uci = require "luci.model.uci".cursor()
local mappings = uci:get_list("uhttpd", "main", "proxy_prefix") or {}
for _, mapping in ipairs(mappings) do
if mapping == APPS_PROXY_PREFIX then
return true
end
end
return false
end
local function uhttpd_supports_proxy_prefix()
local sys = require "luci.sys"
return sys.call("grep -qr 'proxy_prefix' /etc/init.d/uhttpd /lib/functions /usr/share/uhttpd 2>/dev/null") == 0
end
local function uhttpd_apps_proxy_available()
return uhttpd_supports_proxy_prefix() and uhttpd_has_apps_proxy_prefix()
end
local function normalized_base_path(path)
path = path or "/apps/dockermanager/"
if path:sub(1, 1) ~= "/" then
path = "/" .. path
end
if path:sub(-1) ~= "/" then
path = path .. "/"
end
return path
end
local function cookie_encode(value)
return tostring(value or ""):gsub("([^A-Za-z0-9._~-])", function(char)
return string.format("%%%02X", char:byte())
end)
end
local function authority_host(authority)
if not authority or authority == "" then
return ""
end
if authority:sub(1, 1) == "[" then
return authority:match("^%[([^%]]+)%]") or ""
end
return authority:match("^([^:]+)") or authority
end
local function url_authority(host, port)
if not host or host == "" then
host = "127.0.0.1"
end
if host:find(":") and host:sub(1, 1) ~= "[" then
host = "[" .. host .. "]"
end
return host .. ":" .. tostring(port)
end
local function request_or_lan_host()
local http = require "luci.http"
local uci = require "luci.model.uci".cursor()
local host = authority_host(http.getenv("HTTP_HOST") or "")
if host ~= "" then
return host
end
return uci:get("network", "lan", "ipaddr") or "127.0.0.1"
end
local function linkease_auth_url(name)
local dispatcher = require "luci.dispatcher"
return dispatcher.build_url("admin", "services", "linkease_auth", name)
end
local function dockermanager_config()
local uci = require "luci.model.uci".cursor()
local port = uci:get_first("dockermanager", "dockermanager", "port") or "8192"
local base_path = normalized_base_path(uci:get_first("dockermanager", "dockermanager", "base_path"))
return port, base_path
end
local function dockermanager_entry_url()
local port, base_path = dockermanager_config()
if uhttpd_apps_proxy_available() then
return base_path
end
return "http://" .. url_authority(request_or_lan_host(), port) .. base_path
end
function dockermanager_status()
local sys = require "luci.sys"
local uci = require "luci.model.uci".cursor()
local port, base_path = dockermanager_config()
local status = {
running = (sys.call("pidof docker-manager >/dev/null") == 0),
port = port,
base_path = base_path,
lan_ip = uci:get("network", "lan", "ipaddr") or "",
proxy_prefix_supported = uhttpd_supports_proxy_prefix(),
proxy_prefix_enabled = uhttpd_apps_proxy_available()
}
luci.http.prepare_content("application/json")
luci.http.write_json(status)
end
function dockermanager_open()
local http = require "luci.http"
http.redirect(linkease_auth_url("auth") .. "?return=" .. cookie_encode(dockermanager_entry_url()))
end
@@ -0,0 +1,28 @@
local m, s
m = Map("dockermanager", translate("Docker Manager"), translate("Docker Manager provides a LinkEase Desktop web module and HTTP API for Docker management."))
m:section(SimpleSection).template = "dockermanager_status"
s = m:section(TypedSection, "dockermanager", translate("Global settings"))
s.addremove = false
s.anonymous = true
s:option(Flag, "enabled", translate("Enable")).rmempty = false
local data_dir = s:option(Value, "data_dir", translate("Data directory"))
data_dir.rmempty = false
local port = s:option(Value, "port", translate("Listen port"))
port.default = "8192"
port.rmempty = false
port.datatype = "port"
local bind_addr = s:option(Value, "bind_addr", translate("Bind address"))
bind_addr.default = "0.0.0.0"
bind_addr.rmempty = false
local base_path = s:option(Value, "base_path", translate("Base path"))
base_path.default = "/apps/dockermanager/"
base_path.rmempty = false
return m
@@ -0,0 +1,28 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(5, '<%=url("admin/services/dockermanager_status")%>', null,
function(x, st)
{
var tb = document.getElementById('dockermanager_status');
if (st && tb)
{
var status = st.running
? '<br/><em style=\"color:green\"><%:The Docker Manager service is running.%></em>'
: '<br/><em style=\"color:red\"><%:The Docker Manager service is not running.%></em>';
tb.innerHTML = status;
if (st.running)
{
tb.innerHTML = tb.innerHTML
+ "<br/><br/><input class=\"btn cbi-button cbi-button-apply\" type=\"button\" value=\" <%:Open Docker Manager%> \" onclick=\"window.open('<%=url("admin/services/dockermanager/open")%>')\"/>";
}
}
}
);
//]]></script>
<fieldset class="cbi-section">
<legend><%:Docker Manager Status%></legend>
<p id="dockermanager_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>
@@ -1,16 +1,13 @@
local api = require "luci.passwall.api"
local fs = api.fs
local sys = api.sys
local uci = api.uci
local datatypes = api.datatypes
local path = string.format("/usr/share/%s/rules/", api.c_config)
local gfwlist_path = "/usr/share/passwall/rules/gfwlist"
local chnlist_path = "/usr/share/passwall/rules/chnlist"
local chnroute_path = "/usr/share/passwall/rules/chnroute"
local path = string.format("/usr/share/%s/rules/", api.appname)
local gfwlist_path = path .. "gfwlist"
local chnlist_path = path .. "chnlist"
local chnroute_path = path .. "chnroute"
api.set_default_cbi()
m = Map()
m = Map(api.appname)
function clean_text(text)
local nbsp = string.char(0xC2, 0xA0) -- 不间断空格(U+00A0
@@ -317,7 +314,7 @@ if fs.access(chnroute_path) then
]], translate("Read List"))
end
m:appendTemplate("/rule_list/js")
m:append(Template(api.appname .. "/rule_list/js"))
local geo_dir = (api.uci_get_c("@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/")
local geosite_path = geo_dir .. "/geosite.dat"
@@ -327,7 +324,7 @@ if api.finded_com("geoview") and fs.access(geosite_path) and fs.access(geoip_pat
s:tab("geoview", translate("Geo View"))
o = s:taboption("geoview", DummyValue, "_geoview_fieldset")
o.rawhtml = true
o.template = m:template_path("/rule_list/geoview")
o.template = api.appname .. "/rule_list/geoview"
end
end
@@ -335,4 +332,4 @@ m.on_before_save = function(self)
m:set("@global[0]", "flush_set", "1")
end
return api.return_map(m)
return m
@@ -20,7 +20,6 @@ local map = self.map
});
</script>
<% if luci.http.formvalue("cbi.apply") == "1" and map.is_js_luci then -%>
<script type="text/javascript">
document.addEventListener("luci-loaded", function() {
@@ -1,6 +1,5 @@
<%
local map = self.map
local api = map.api
local api = require "luci.passwall.api"
-%>
<style>
@@ -1,6 +1,5 @@
<%
local map = self.map
local api = map.api
local api = require "luci.passwall.api"
-%>
<script type="text/javascript">
//<![CDATA[
+8 -8
View File
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=shadowsocks-rust
PKG_VERSION:=1.24.0
PKG_VERSION:=1.25.0
PKG_RELEASE:=1
PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
@@ -21,29 +21,29 @@ endif
ifeq ($(ARCH),aarch64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=e00b6551f40bb2d61adb2503909e0df6550c022372c812f3f34350510797ef2f
PKG_HASH:=2c24915b56a05effdab5898848bacfbcb625bc277b18febafc7a3aa45f87f3b0
else ifeq ($(ARCH),arm)
# Referred to golang/golang-values.mk
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
ifeq ($(ARM_CPU_FEATURES),)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabi.$(PKG_SOURCE_FOOTER)
PKG_HASH:=b00694ac484eaf994408c874c70e1d3392d1654cf3d9391ddf2b589bbee9106c
PKG_HASH:=80046853981d19b442a02c93e45de57d0d036c6ed34c443ce101061206f755bf
else
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER)
PKG_HASH:=db56c8e64ce3651907c31fe6a585a68e4c4576c8379f50d82be31d79ba8d00ad
PKG_HASH:=0e2b73a6cebda5703212bd051913ed28750b52dd89be2aad04fa65fac4353d23
endif
else ifeq ($(ARCH),i386)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=a9aabb4209a8f29afabddb2aaaa8a38d8f604fd0075250d61bd594bb10ae38c7
PKG_HASH:=ef64e54a36ad87ac1912c67ff5eb73bef3913912b42154d04d4e42afc6267c03
else ifeq ($(ARCH),x86_64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=0d84f5f350ec99396867d718f146fc3810975b2a7cd06192f158d96bdef460e7
PKG_HASH:=8439bf43c324b0fc273e663d0b1f8926fd8f666cbd1e0fd59b35096f0e778e92
else ifeq ($(ARCH),mips)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=40319c20934121e8d5df90e54cd2b41e064a3487f180f6924ac42ba3cbcebe4f
PKG_HASH:=feeaa9d7a4f6f84d96a30cf039a09334f0a48140b0f50952b8f1e1cbec38f360
else ifeq ($(ARCH),mipsel)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=d51792a5b4f6a28bb2e8b07e2f39a60535d1ede9d1973a257c5751a991e26ac8
PKG_HASH:=ed8d5410d9b931c7ce311b6962c9336dd01d6c5bee1a9b828992212e4055e38b
# Set the default value to make OpenWrt Package Checker happy
else
PKG_SOURCE:=dummy