From 4075b8caa2a6e57e43310f726903f888c5613709 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Sat, 13 Dec 2025 00:30:06 +0800 Subject: [PATCH] update 2025-12-13 00:30:06 --- dockerd/Makefile | 2 +- luci-app-fileassistant/Makefile | 6 +- .../luci-static/resources/fileassistant/fb.js | 74 +------------------ .../luasrc/controller/fileassistant.lua | 45 ++--------- .../luasrc/view/fileassistant.htm | 5 +- .../rpcd/acl.d/luci-app-fileassistant.json | 11 +++ .../luasrc/model/cbi/shadowsocksr/status.lua | 5 ++ .../root/etc/init.d/shadowsocksr | 10 ++- 8 files changed, 40 insertions(+), 118 deletions(-) create mode 100644 luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json diff --git a/dockerd/Makefile b/dockerd/Makefile index ba39db97e..06095d9b5 100644 --- a/dockerd/Makefile +++ b/dockerd/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dockerd -PKG_VERSION:=29.1.2 +PKG_VERSION:=29.1.3 PKG_RELEASE:=1 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/luci-app-fileassistant/Makefile b/luci-app-fileassistant/Makefile index eba8e2bca..a36a8b9d9 100644 --- a/luci-app-fileassistant/Makefile +++ b/luci-app-fileassistant/Makefile @@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Fileassistant LUCI_PKGARCH:=all -PKG_VERSION:=1.0-5 -PKG_RELEASE:=7 +PKG_VERSION:=1.0 +PKG_RELEASE:=8 include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js b/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js index 616919d24..2e3addef8 100644 --- a/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js +++ b/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js @@ -91,40 +91,6 @@ String.prototype.replaceAll = function(search, replacement) { } } - function chmodPath(filename, isdir) { - var newmod = prompt('请输入新的权限位(支持八进制权限位或者a+x格式):', isdir === "1" ? "0755" : "0644"); - if (newmod) { - iwxhr.get('/cgi-bin/luci/admin/nas/fileassistant/chmod', - { - filepath: concatPath(currentPath, filename), - newmod: newmod - }, - function (x, res) { - if (res.ec === 0) { - refresh_list(res.data, currentPath); - } - } - ); - } - } - - function chownPath(filename) { - var newown = prompt('请输入新的用户名(支持用户名或用户名:群组格式):', "root"); - if (newown) { - iwxhr.get('/cgi-bin/luci/admin/nas/fileassistant/chown', - { - filepath: concatPath(currentPath, filename), - newown: newown - }, - function (x, res) { - if (res.ec === 0) { - refresh_list(res.data, currentPath); - } - } - ); - } - } - function openpath(filename, dirname) { dirname = dirname || currentPath; window.open('/cgi-bin/luci/admin/nas/fileassistant/open?path=' @@ -164,13 +130,6 @@ String.prototype.replaceAll = function(search, replacement) { else if (targetElem.className.indexOf('cbi-button-edit') > -1) { renamePath(targetElem.parentNode.parentNode.dataset['filename']); } - else if (targetElem.className.indexOf('cbi-button-chmod') > -1) { - infoElem = targetElem.parentNode.parentNode; - chmodPath(infoElem.dataset['filename'] , infoElem.dataset['isdir']); - } - else if (targetElem.className.indexOf('cbi-button-chown') > -1) { - chownPath(targetElem.parentNode.parentNode.dataset['filename']); - } else if (targetElem = getFileElem(targetElem)) { if (targetElem.className.indexOf('parent-icon') > -1) { update_list(currentPath.replace(/\/[^/]+($|\/$)/, '')); @@ -197,14 +156,7 @@ String.prototype.replaceAll = function(search, replacement) { } } function refresh_list(filenames, path) { - var listHtml = '' - +'' - +'' - +'' - +'' - +'' - +'' - +''; + var listHtml = '
文件所有者修改时间大小权限操作
'; if (path !== '/') { listHtml += ''; } @@ -244,9 +196,7 @@ String.prototype.replaceAll = function(search, replacement) { + '' + '' + ''; @@ -320,26 +270,6 @@ String.prototype.replaceAll = function(search, replacement) { } }; - document.getElementById('mkdir-toggle').onclick = function() { - var dirname = null; - if (dirname = prompt("请输入文件夹名称:")) { - var formData = new FormData(); - formData.append('path', currentPath); - formData.append('dirname', dirname); - var xhr = new XMLHttpRequest(); - xhr.open("POST", "/cgi-bin/luci/admin/nas/fileassistant/mkdir", true); - xhr.onload = function() { - if (xhr.status == 200) { - var res = JSON.parse(xhr.responseText); - refresh_list(res.data, currentPath); - } - else { - alert('创建失败,请稍后再试...'); - } - }; - xhr.send(formData); - } - }; document.addEventListener('DOMContentLoaded', function(evt) { var initPath = '/'; if (/path=([/\w]+)/.test(location.search)) { diff --git a/luci-app-fileassistant/luasrc/controller/fileassistant.lua b/luci-app-fileassistant/luasrc/controller/fileassistant.lua index 4c4bcb591..7b8801363 100644 --- a/luci-app-fileassistant/luasrc/controller/fileassistant.lua +++ b/luci-app-fileassistant/luasrc/controller/fileassistant.lua @@ -6,6 +6,7 @@ function index() page = entry({"admin", "system", "fileassistant"}, template("fileassistant"), _("文件管理"), 50) page.i18n = "base" page.dependent = true + page.acl_depends = { "luci-app-fileassistant" } page = entry({"admin", "nas", "fileassistant", "list"}, call("fileassistant_list"), nil) page.leaf = true @@ -25,14 +26,6 @@ function index() page = entry({"admin", "nas", "fileassistant", "install"}, call("fileassistant_install"), nil) page.leaf = true - page = entry({"admin", "nas", "fileassistant", "mkdir"}, call("fileassistant_mkdir"), nil) - page.leaf = true - - page = entry({"admin", "nas", "fileassistant", "chmod"}, call("fileassistant_chmod"), nil) - page.leaf = true - - page = entry({"admin", "nas", "fileassistant", "chown"}, call("fileassistant_chown"), nil) - page.leaf = true end function list_response(path, success) @@ -116,18 +109,15 @@ function installIPK(filepath) end function fileassistant_upload() + local filecontent = luci.http.formvalue("upload-file") + local filename = luci.http.formvalue("upload-filename") + local uploaddir = luci.http.formvalue("upload-dir") + local filepath = uploaddir..filename + local fp - -- MUST setfilehandler before formvalue, - -- beacuse formvalue will parse form and write body to /tmp if filehandler not present luci.http.setfilehandler( function(meta, chunk, eof) if not fp and meta and meta.name == "upload-file" then - local filename = luci.http.formvalue("upload-filename") - local uploaddir = luci.http.formvalue("upload-dir") - if not uploaddir or not filename then - error("uploaddir or filename is nil") - end - local filepath = uploaddir..filename fp = io.open(filepath, "w") end if fp and chunk then @@ -139,28 +129,7 @@ function fileassistant_upload() end ) - list_response(luci.http.formvalue("upload-dir"), true) -end - -function fileassistant_mkdir() - local path = luci.http.formvalue("path") - local dirname = luci.http.formvalue("dirname") - local success = os.execute('sh -c \'cd "'..path..'" && mkdir -p "'..dirname..'"\'') - list_response(path, success) -end - -function fileassistant_chmod() - local path = luci.http.formvalue("filepath") - local newmod = luci.http.formvalue("newmod") - local success = os.execute('chmod '..newmod..' "'..path..'"') - list_response(nixio.fs.dirname(path), success) -end - -function fileassistant_chown() - local path = luci.http.formvalue("filepath") - local newown = luci.http.formvalue("newown") - local success = os.execute('chown '..newown..' "'..path..'"') - list_response(nixio.fs.dirname(path), success) + list_response(uploaddir, true) end function scandir(directory) diff --git a/luci-app-fileassistant/luasrc/view/fileassistant.htm b/luci-app-fileassistant/luasrc/view/fileassistant.htm index 3d760b40a..15f069b95 100644 --- a/luci-app-fileassistant/luasrc/view/fileassistant.htm +++ b/luci-app-fileassistant/luasrc/view/fileassistant.htm @@ -1,13 +1,12 @@ <%+header%> - +

文件助手

文件列表
-
@@ -16,6 +15,6 @@
- + <%+footer%> diff --git a/luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json b/luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json new file mode 100644 index 000000000..8db4ea32f --- /dev/null +++ b/luci-app-fileassistant/root/usr/share/rpcd/acl.d/luci-app-fileassistant.json @@ -0,0 +1,11 @@ +{ + "luci-app-fileassistant": { + "description": "Grant UCI access for luci-app-fileassistant", + "read": { + "uci": [ "fileassistant" ] + }, + "write": { + "uci": [ "fileassistant" ] + } + } +} diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua index 4f52aab19..4931c211f 100644 --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua @@ -82,6 +82,11 @@ if Process_list:find("local.ssr.retcp") then sock5_run = 1 end +if Process_list:find("local.nft.ssr.retcp") then + redir_run = 1 + sock5_run = 1 +end + if Process_list:find("local.udp.ssr.retcp") then reudp_run = 1 redir_run = 1 diff --git a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 95e03a6b8..4a1e2b863 100755 --- a/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -1040,7 +1040,15 @@ Start_Run() { if [ "$_local" == "1" ]; then local socks_port=$(uci_get_by_type socks5_proxy local_port) tcp_config_file=$TMP_PATH/local-ssr-retcp.json - [ "$mode" == "tcp,udp" ] && tcp_config_file=$TMP_PATH/local-udp-ssr-retcp.json + [ "$mode" == "tcp,udp" ] && { + if command -v nft >/dev/null 2>&1; then + # nftables / fw4 + tcp_config_file=$TMP_PATH/local-nft-ssr-retcp.json + else + # iptables / fw3 + tcp_config_file=$TMP_PATH/local-udp-ssr-retcp.json + fi + } fi local tcp_port=$(uci_get_by_name $GLOBAL_SERVER local_port) local type=$(uci_get_by_name $GLOBAL_SERVER type)
..
'+o.perms+'\ \ - \ - \ - ' + ' + install_btn + '