diff --git a/filebrowser-q/Makefile b/filebrowser-q/Makefile index 81d57543..4df58d73 100644 --- a/filebrowser-q/Makefile +++ b/filebrowser-q/Makefile @@ -1,47 +1,43 @@ -# -# Copyright (C) 2017-2024 -# -# This is free software, licensed under the GNU General Public License v2. -# - include $(TOPDIR)/rules.mk PKG_NAME:=filebrowser-q PKG_VERSION:=1.5.6-stable -PKG_RELEASE=1 +PKG_RELEASE:=1 -ifeq ($(ARCH),aarch64) - PKG_ARCH:=arm64 - PKG_HASH:=skip -else ifeq ($(ARCH),arm) - PKG_ARCH:=armv7 - PKG_HASH:=skip -else ifeq ($(ARCH),x86_64) - PKG_ARCH:=amd64 - PKG_HASH:=skip -endif +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/gtsteffaniak/filebrowser/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=skip +PKG_BUILD_DIR:=$(BUILD_DIR)/filebrowser-$(PKG_VERSION) + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=kiddin9 + +PKG_BUILD_DEPENDS:=golang/host node/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/gtsteffaniak/filebrowser/backend +GO_PKG_BUILD_DIR:=$(PKG_BUILD_DIR)/backend +GO_PKG_LDFLAGS_X:= \ + $(GO_PKG)/internal/version.Version=v$(PKG_VERSION) \ + $(GO_PKG)/internal/version.CommitSHA=$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk define Package/filebrowser-q - SECTION:=net - CATEGORY:=Network - DEPENDS:=@(arm||aarch64||x86_64) - TITLE:=FileBrowser Quantum + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + TITLE:=FileBrowser Quantum - Modern Web File Manager + URL:=https://github.com/gtsteffaniak/filebrowser + DEPENDS:=$(GO_ARCH_DEPENDS) endef define Package/filebrowser-q/description - The best free self-hosted web-based file manager. -endef - -PKG_SOURCE:=linux-$(PKG_ARCH)-filebrowser -PKG_SOURCE_URL:=https://github.com/gtsteffaniak/filebrowser/releases/download/v$(PKG_VERSION) - -define Build/Prepare - $(call Build/Prepare/Default) -endef - -define Build/Compile + FileBrowser Quantum provides a modern, responsive web-based file management + interface with multi-source, real-time search, and enhanced preview features. endef define Package/filebrowser-q/conffiles @@ -49,13 +45,34 @@ define Package/filebrowser-q/conffiles /etc/config/filebrowser-q endef +define Build/Prepare + $(call Build/Prepare/Default) +endef + +define Build/Compile + ( \ + pushd $(PKG_BUILD_DIR)/frontend && \ + npm install && \ + npm run build ; \ + ) + ( \ + cd $(PKG_BUILD_DIR)/backend && \ + $(GO_PKG_VARS) \ + go build \ + -trimpath \ + -ldflags="-w -s" \ + -o $(PKG_BUILD_DIR)/filebrowser . ; \ + ) +endef + define Package/filebrowser-q/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) $(CURDIR)/files/filebrowser.init $(1)/etc/init.d/filebrowser-q + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/filebrowser $(1)/usr/bin/filebrowser-q + $(INSTALL_DIR) $(1)/etc/config $(INSTALL_CONF) $(CURDIR)/files/filebrowser.config $(1)/etc/config/filebrowser-q - $(INSTALL_DIR) $(1)/usr/bin/ - $(INSTALL_BIN) $(DL_DIR)/linux-$(PKG_ARCH)-filebrowser $(1)/usr/bin/filebrowser-q + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/filebrowser.init $(1)/etc/init.d/filebrowser-q endef $(eval $(call BuildPackage,filebrowser-q)) diff --git a/filebrowser-q/files/filebrowser.init b/filebrowser-q/files/filebrowser.init index a91522a4..89182565 100644 --- a/filebrowser-q/files/filebrowser.init +++ b/filebrowser-q/files/filebrowser.init @@ -16,7 +16,7 @@ start() { [ "$enabled" -eq "1" ] || return 1 local listen_port root_path root_name - config_get listen_port "config" "listen_port" "8989" + config_get listen_port "config" "listen_port" "8787" config_get root_path "config" "root_path" "/" # 路径为 / 时 name 设为 root,否则留空 @@ -43,9 +43,9 @@ userDefaults: EOF else grep -q " name:" "$CONF_PATH" || sed -i "s,.*- path:.*,&\n name: \"\"," "$CONF_PATH" - sed -e "s/.*port:.*/ port: $listen_port/" \ - -e "s,.*- path:.*, - path: \"$root_path\"," \ - -e "s/.*name:.*/ name: \"$root_name\"/" \ + sed -e "s/ port:.*/ port: $listen_port/" \ + -e "s, - path:.*, - path: \"$root_path\"," \ + -e "s/ name: \".*\"/ name: \"$root_name\"/" \ -i "$CONF_PATH" fi diff --git a/luci-app-filebrowser-q/htdocs/luci-static/resources/view/filebrowser-q.js b/luci-app-filebrowser-q/htdocs/luci-static/resources/view/filebrowser-q.js index aa126971..0aec6c30 100644 --- a/luci-app-filebrowser-q/htdocs/luci-static/resources/view/filebrowser-q.js +++ b/luci-app-filebrowser-q/htdocs/luci-static/resources/view/filebrowser-q.js @@ -76,7 +76,7 @@ return view.extend({ o = s.option(form.Value, 'listen_port', _('Listen port')); o.datatype = 'port'; - o.default = '8989'; + o.default = '8787'; o.rmempty = false; o = s.option(form.Value, 'root_path', _('Root directory')); diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua index 57c79078..f4ce5fb6 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/acl_config.lua @@ -272,9 +272,17 @@ o = s:option(ListValue, "remote_dns_protocol", translate("Remote DNS Protocol")) o:value("tcp", "TCP") o:value("doh", "DoH") o:value("udp", "UDP") -o:value("tls", "TLS(DoT)", { _is_singbox = "1" }) -o:value("quic", "QUIC(DoQ)", { _is_singbox = "1" }) -o:value("http3", "HTTP3(DoH3)", { _is_singbox = "1" }) +if m.is_js_luci then + if current_node.type == "sing-box" then + o:value("tls", "TLS(DoT)") + o:value("quic", "QUIC(DoQ)") + o:value("http3", "HTTP3(DoH3)") + end +else + o:value("tls", "TLS(DoT)", { _is_singbox = "1" }) + o:value("quic", "QUIC(DoQ)", { _is_singbox = "1" }) + o:value("http3", "HTTP3(DoH3)", { _is_singbox = "1" }) +end o:depends("_show_dns_option", "1") ---- DNS over TCP or UDP or TLS (DoT) or QUIC (DoQ) @@ -382,9 +390,8 @@ for k, v in pairs(nodes_table) do end end ---m:appendTemplate("/acl/options", {section = arg[1]}) - --- Shunt Start +--[[ +-- Shunt if current_node.protocol == "_shunt" then local shunt_lua = loadfile("/usr/lib/lua/luci/model/cbi/passwall2/client/include/shunt_options.lua") setfenv(shunt_lua, getfenv(1))(m, s, { @@ -396,5 +403,6 @@ if current_node.protocol == "_shunt" then end m:appendTemplate("/acl/shunt", { shunt_list = api.jsonc.stringify(shunt_list), section = s.section }) +]]-- return api.return_map(m) diff --git a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua index b0308093..7b6c1e0b 100644 --- a/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua +++ b/luci-app-passwall2/luasrc/model/cbi/passwall2/client/global.lua @@ -201,9 +201,17 @@ o = s:taboption("DNS", ListValue, "remote_dns_protocol", translate("Remote DNS P o:value("tcp", "TCP") o:value("doh", "DoH") o:value("udp", "UDP") -o:value("tls", "TLS(DoT)", { _is_singbox = "1" }) -o:value("quic", "QUIC(DoQ)", { _is_singbox = "1" }) -o:value("http3", "HTTP3(DoH3)", { _is_singbox = "1" }) +if m.is_js_luci then + if current_node.type == "sing-box" then + o:value("tls", "TLS(DoT)") + o:value("quic", "QUIC(DoQ)") + o:value("http3", "HTTP3(DoH3)") + end +else + o:value("tls", "TLS(DoT)", { _is_singbox = "1" }) + o:value("quic", "QUIC(DoQ)", { _is_singbox = "1" }) + o:value("http3", "HTTP3(DoH3)", { _is_singbox = "1" }) +end ---- DNS over TCP or UDP or TLS (DoT) or QUIC (DoQ) o = s:taboption("DNS", Value, "remote_dns", translate("Remote DNS")) @@ -259,11 +267,10 @@ o:value("UseIP") o:value("UseIPv4") o:value("UseIPv6") -if current_node.type == "sing-box" then - o = s:taboption("DNS", Value, "remote_rewrite_ttl", translate("Remote DNS") .. " TTL") - o.datatype = "min(1)" - o.default = "30" -end +o = s:taboption("DNS", Value, "remote_rewrite_ttl", translate("Remote DNS") .. " TTL") +o.datatype = "min(1)" +o.default = "30" +o:depends("_is_singbox", "1") o = s:taboption("DNS", TextValue, "dns_hosts", translate("Domain Override")) o.rows = 5 diff --git a/luci-app-passwall2/luasrc/view/passwall2/acl/options.htm b/luci-app-passwall2/luasrc/view/passwall2/acl/options.htm deleted file mode 100644 index e8610a40..00000000 --- a/luci-app-passwall2/luasrc/view/passwall2/acl/options.htm +++ /dev/null @@ -1,56 +0,0 @@ -<% -local map = self.map -local api = map.api -local config = map.config -local section = self.section --%> - \ No newline at end of file diff --git a/luci-app-passwall2/luasrc/view/passwall2/node_list/node_list.htm b/luci-app-passwall2/luasrc/view/passwall2/node_list/node_list.htm index 0dc59b23..32652d93 100644 --- a/luci-app-passwall2/luasrc/view/passwall2/node_list/node_list.htm +++ b/luci-app-passwall2/luasrc/view/passwall2/node_list/node_list.htm @@ -1507,15 +1507,17 @@ table td, .table .td { //Node list option saving logic document.addEventListener("DOMContentLoaded", function () { - function onChange(option, value) { + function onChange(option, value, refresh) { ajax.abortAll(); XHR.get('<%=api.url("save_node_list_opt")%>', { option: option, value: value }, function(x) { if (x && x.status == 200) { - document.getElementById("node_list").innerHTML = ""; - loadNodeList(); + if (refresh) { + document.getElementById("node_list").innerHTML = ""; + loadNodeList(); + } } else { alert("<%:Error%>"); } @@ -1527,7 +1529,7 @@ table td, .table .td { el.addEventListener("change", () => { el.blur(); show_node_info = el.checked ? "1" : "0"; - onChange("show_node_info", show_node_info); + onChange("show_node_info", show_node_info, true); }); }); @@ -1535,32 +1537,47 @@ table td, .table .td { el.addEventListener("change", () => { el.blur(); auto_detection_time = el.value; - onChange("auto_detection_time", auto_detection_time); + onChange("auto_detection_time", auto_detection_time, true); }); }); - waitForElement('select[id*="<%=appname%>"][id*="url_test_url"]', function(el) { - el.addEventListener("change", () => { - if (el.value) { - onChange("url_test_url", el.value); - } + <% if api.is_js_luci() then -%> + waitForElement('div[id*="cbid.<%=appname%>"][id*="url_test_url"]', function(el) { + el.addEventListener("cbi-dropdown-change", () => { + if (el.value && (!el.new_val || el.new_val != el.value)) { + onChange("url_test_url", el.value, false); + el.new_val = el.value; + } + }); + }); + <% else -%> + waitForElement('select[id*="<%=appname%>"][id*="url_test_url"]', function(el) { + el.addEventListener("change", () => { + if (el.value && (!el.new_val || el.new_val != el.value)) { + onChange("url_test_url", el.value, false); + el.new_val = el.value; + } + }); }); - }); - waitForElement('input[id*="<%=appname%>"][id*="url_test_url"]', function(el) { - el.addEventListener("change", () => { - if (el.value) { - onChange("url_test_url", el.value); - } + waitForElement('input[id*="<%=appname%>"][id*="url_test_url"]', function(el) { + el.addEventListener("change", () => { + if (el.value && (!el.new_val || el.new_val != el.value)) { + onChange("url_test_url", el.value, false); + el.new_val = el.value; + } + }); }); - }); + <% end -%> } - const ori_cbi_d_update = cbi_d_update; - cbi_d_update = function() { - ori_cbi_d_update(); - dom_event(); - }; + <% if not api.is_js_luci() then -%> + const ori_cbi_d_update = cbi_d_update; + cbi_d_update = function() { + ori_cbi_d_update(); + dom_event(); + }; + <% end -%> dom_event(); const links = document.querySelectorAll('a'); diff --git a/luci-app-syncthing b/luci-app-syncthing new file mode 160000 index 00000000..b7a197a9 --- /dev/null +++ b/luci-app-syncthing @@ -0,0 +1 @@ +Subproject commit b7a197a93c549992e9bc47f59d0690b6bb967bcd diff --git a/luci-app-syncthing/Makefile b/luci-app-syncthing/Makefile deleted file mode 100644 index 2219fcb2..00000000 --- a/luci-app-syncthing/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2020 Gyj1109 -# 适配 OpenWrt 25.12 修改版 - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-syncthing -PKG_VERSION:=1.0 -PKG_RELEASE:=3 - -LUCI_TITLE:=LuCI support for Syncthing -LUCI_PKGARCH:=all -# 适配 25.12:确保安装了 syncthing 后,LuCI 界面能正确拉起 -LUCI_DEPENDS:=+syncthing - -include $(TOPDIR)/feeds/luci/luci.mk - -# 明确定义配置文件的归属,这对 25.12 的 apk 管理器非常重要 -define Package/$(PKG_NAME)/conffiles -/etc/config/syncthing -endef - -$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/luci-app-syncthing/README.md b/luci-app-syncthing/README.md deleted file mode 100644 index b07298c1..00000000 --- a/luci-app-syncthing/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# luci-app-syncthing -在Potat0000源码基础上进行了汉化优化,官方openwrt23.05.3编译后可使用 diff --git a/luci-app-syncthing/luasrc/controller/syncthing.lua b/luci-app-syncthing/luasrc/controller/syncthing.lua deleted file mode 100644 index ee2ca7ef..00000000 --- a/luci-app-syncthing/luasrc/controller/syncthing.lua +++ /dev/null @@ -1,17 +0,0 @@ -module("luci.controller.syncthing", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/syncthing") then - return - end - - entry({"admin", "services", "syncthing"}, cbi("syncthing"), _("文件同步"), 10).dependent = true - entry({"admin", "services", "syncthing", "status"}, call("act_status")).leaf = true -end - -function act_status() - local e = {} - e.running = luci.sys.call("pgrep syncthing >/dev/null") == 0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/luci-app-syncthing/luasrc/model/cbi/syncthing.lua b/luci-app-syncthing/luasrc/model/cbi/syncthing.lua deleted file mode 100644 index 324ea054..00000000 --- a/luci-app-syncthing/luasrc/model/cbi/syncthing.lua +++ /dev/null @@ -1,48 +0,0 @@ -require("nixio.fs") - -m = Map("syncthing", translate("Syncthing同步工具")) - -m:section(SimpleSection).template = "syncthing/syncthing_status" - -s = m:section(TypedSection, "syncthing") - -s.anonymous = true - -o = s:option(Flag, "enabled", translate("启用")) -o.default = 0 -o.rmempty = false - -gui_address = s:option(Value, "gui_address", translate("GUI访问地址")) -gui_address.description = translate("使用0.0.0.0以监控所有访问。") -gui_address.default = "http://0.0.0.0:8384" -gui_address.placeholder = "http://0.0.0.0:8384" -gui_address.rmempty = false - -home = s:option(Value, "home", translate("配置文件目录")) -home.description = translate("只有保存在/etc/syncthing中的配置会自动备份!") -home.default = "/etc/syncthing" -home.placeholder = "/etc/syncthing" -home.rmempty = false - -user = s:option(ListValue, "user", translate("用户")) -user.description = translate("默认是syncthing,但这可能会导致权限被拒绝。Syncthing官方不建议以root身份运行。") -user:value("", translate("syncthing")) -for u in luci.util.execi("cat /etc/passwd | cut -d ':' -f1") do - user:value(u) -end - -macprocs = s:option(Value, "macprocs", translate("线程限制")) -macprocs.description = translate("0表示匹配CPU数量(默认),>0表示显式指定并发数。") -macprocs.default = "0" -macprocs.placeholder = "0" -macprocs.datatype = "range(0,32)" -macprocs.rmempty = false - -nice = s:option(Value, "nice", translate("优先级")) -nice.description = translate("显式指定优先级值。0是最高,19是最低。(暂时不允许设置负值)") -nice.default = "19" -nice.placeholder = "19" -nice.datatype = "range(0,19)" -nice.rmempty = false - -return m diff --git a/luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm b/luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm deleted file mode 100644 index 566cc020..00000000 --- a/luci-app-syncthing/luasrc/view/syncthing/syncthing_status.htm +++ /dev/null @@ -1,27 +0,0 @@ - - -
-

- <%:正在收集数据...%> -

-
diff --git a/luci-app-syncthing/root/etc/uci-defaults/luci-syncthing b/luci-app-syncthing/root/etc/uci-defaults/luci-syncthing deleted file mode 100644 index 3adb7997..00000000 --- a/luci-app-syncthing/root/etc/uci-defaults/luci-syncthing +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -touch /etc/config/syncthing - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@syncthing[-1] - add ucitrack syncthing - set ucitrack.@syncthing[-1].exec='/etc/init.d/syncthing stop && /etc/init.d/syncthing start' - commit ucitrack -EOF -# remove LuCI cache -rm -f /tmp/luci* -exit 0 diff --git a/luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json b/luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json deleted file mode 100644 index 9fc9cc54..00000000 --- a/luci-app-syncthing/root/usr/share/rpcd/acl.d/luci-app-syncthing.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "luci-app-syncthing": { - "description": "Grant UCI access for luci-app-syncthing", - "read": { - "uci": [ "syncthing" ] - }, - "write": { - "uci": [ "syncthing" ] - } - } -} diff --git a/shortcut-fe/fast-classifier/src/fast-classifier.c b/shortcut-fe/fast-classifier/src/fast-classifier.c index 3b5ba8cf..03337520 100644 --- a/shortcut-fe/fast-classifier/src/fast-classifier.c +++ b/shortcut-fe/fast-classifier/src/fast-classifier.c @@ -1767,6 +1767,9 @@ static int __init fast_classifier_init(void) printk(KERN_ALERT "fast-classifier: starting up\n"); DEBUG_INFO("SFE CM init\n"); + /* Initialize state before registering callbacks that can use it. */ + spin_lock_init(&sc->lock); + hash_init(fc_conn_ht); /* @@ -1882,8 +1885,6 @@ static int __init fast_classifier_init(void) printk(KERN_ALERT "fast-classifier: registered\n"); - spin_lock_init(&sc->lock); - /* * Hook the receive path in the network stack. */ @@ -2005,4 +2006,3 @@ module_exit(fast_classifier_exit) MODULE_DESCRIPTION("Shortcut Forwarding Engine - Connection Manager"); MODULE_LICENSE("Dual BSD/GPL"); -