update-09.28
This commit is contained in:
parent
97eed0841c
commit
ce997339e7
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=aliyundrive-webdav
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_VERSION:=0.3.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
|
|
|
@ -9,11 +9,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=cups
|
||||
PKG_VERSION:=2.3.0
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=2.3.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/apple/cups/releases/download/v$(PKG_VERSION)
|
||||
#PKG_SOURCE_URL:=http://www.cups.org/software/$(PKG_VERSION)
|
||||
PKG_MD5SUM:=skip
|
||||
|
||||
TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
|
||||
|
@ -29,7 +30,7 @@ define Package/cups
|
|||
$(call Package/cups/Default)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libcups +libusb-1.0 +libstdcpp
|
||||
DEPENDS:=+libcups +libcupsmime +libcupscgi +libcupsppdc +libusb-1.0
|
||||
TITLE:=Common UNIX Printing System (daemon)
|
||||
endef
|
||||
|
||||
|
@ -59,7 +60,7 @@ define Package/cups-client
|
|||
$(call Package/cups/Default)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libcups +libcupsimage
|
||||
DEPENDS:=+libcups +libcupsimage +libcupsmime
|
||||
TITLE:=Common UNIX Printing System - Client commands
|
||||
endef
|
||||
|
||||
|
@ -87,7 +88,7 @@ define Package/cups-ppdc
|
|||
$(call Package/cups/Default)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libcups +zlib +libpthread +libpng +libjpeg +libstdcpp
|
||||
DEPENDS:=+libcupsppdc
|
||||
TITLE:=Common UNIX Printing System - PPDC utils
|
||||
endef
|
||||
|
||||
|
@ -106,6 +107,18 @@ endef
|
|||
define Package/libcups/description
|
||||
Common UNIX Printing System - Core library
|
||||
endef
|
||||
|
||||
define Package/libcupscgi
|
||||
$(call Package/cups/Default)
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libcups
|
||||
TITLE:=Common UNIX Printing System - CGI library
|
||||
endef
|
||||
|
||||
define Package/libcupscgi/description
|
||||
Common UNIX Printing System - CGI library
|
||||
endef
|
||||
|
||||
define Package/libcupsimage
|
||||
$(call Package/cups/Default)
|
||||
|
@ -119,6 +132,30 @@ define Package/libcupsimage/description
|
|||
Common UNIX Printing System - Image library
|
||||
endef
|
||||
|
||||
define Package/libcupsmime
|
||||
$(call Package/cups/Default)
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libcups
|
||||
TITLE:=Common UNIX Printing System - MIME library
|
||||
endef
|
||||
|
||||
define Package/libcupsmime/description
|
||||
Common UNIX Printing System - MIME library
|
||||
endef
|
||||
|
||||
define Package/libcupsppdc
|
||||
$(call Package/cups/Default)
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libcups +libstdcpp
|
||||
TITLE:=Common UNIX Printing System - PPDC library
|
||||
endef
|
||||
|
||||
define Package/libcupsppdc/description
|
||||
Common UNIX Printing System - PPDC library
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default, \
|
||||
--with-cups-user="nobody" \
|
||||
|
@ -172,6 +209,10 @@ define Package/cups/install
|
|||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cups/daemon $(1)/usr/lib/cups
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cups/driver $(1)/usr/lib/cups
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cups/monitor $(1)/usr/lib/cups
|
||||
$(INSTALL_DIR) $(1)/usr/lib/cups/filter
|
||||
### $(CP) $(PKG_INSTALL_DIR)/usr/lib/cups/filter/{commandtops,pstops} \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/cups/filter/gziptoany \
|
||||
$(1)/usr/lib/cups/filter
|
||||
$(INSTALL_DIR) $(1)/usr/share/cups/templates
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/cups/templates/*.tmpl \
|
||||
$(1)/usr/share/cups/templates/
|
||||
|
@ -219,14 +260,11 @@ define Package/cups-client/install
|
|||
$(PKG_INSTALL_DIR)/usr/sbin/{lpadmin,lpinfo,lpmove} \
|
||||
$(1)/usr/sbin/
|
||||
(cd $(1)/usr/sbin; ln -sf cupsaccept accept; ln -sf cupsaccept cupsenable; ln -sf cupsaccept cupsdisable; ln -sf cupsaccept reject; ln -sf cupsaccept cupsreject;)
|
||||
$(INSTALL_DIR) $(1)/usr/share/cups/ipptool
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/share/cups/ipptool/* \
|
||||
$(1)/usr/share/cups/ipptool
|
||||
endef
|
||||
|
||||
define Package/cups-filters/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/cups/filter
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cups/filter/{commandtops,gziptoany,pstops,rastertoepson,rastertohp,rastertolabel,rastertopwg} \
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/cups/filter/{rastertoepson,rastertohp,rastertolabel,rastertopwg} \
|
||||
$(1)/usr/lib/cups/filter
|
||||
(cd $(1)/usr/lib/cups/filter; ln -sf rastertolabel rastertodymo;)
|
||||
endef
|
||||
|
@ -240,12 +278,27 @@ endef
|
|||
|
||||
define Package/libcups/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/cups/libcups.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcupscgi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/cgi-bin/libcupscgi.a $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcupsimage/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcupsimage.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/cups/libcupsimage.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcupsmime/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/scheduler/libcupsmime.a $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcupsppdc/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/ppdc/libcupsppdc.a $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
|
@ -254,12 +307,15 @@ define Build/InstallDev
|
|||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/cups $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcups*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/cups/libcups*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,cups))
|
||||
$(eval $(call BuildPackage,libcups))
|
||||
$(eval $(call BuildPackage,libcupscgi))
|
||||
$(eval $(call BuildPackage,libcupsimage))
|
||||
$(eval $(call BuildPackage,libcupsmime))
|
||||
$(eval $(call BuildPackage,libcupsppdc))
|
||||
$(eval $(call BuildPackage,cups-bsd))
|
||||
$(eval $(call BuildPackage,cups-client))
|
||||
$(eval $(call BuildPackage,cups-filters))
|
||||
|
|
|
@ -4,24 +4,16 @@
|
|||
START=50
|
||||
|
||||
start() {
|
||||
enable=$(uci get cupsd.config.enabled 2>/dev/null)
|
||||
if [ $enable -eq 1 ]; then
|
||||
sed -i 's/Port [0-9]*/Port '"$(uci get cupsd.config.port)"'/g' /etc/cups/cupsd.conf
|
||||
mkdir -m 0755 -p /var/cache/cups
|
||||
mkdir -m 0755 -p /var/cups
|
||||
mkdir -m 0755 -p /var/spool/cups/tmp
|
||||
service_start /usr/sbin/cupsd
|
||||
fi
|
||||
mkdir -m 0755 -p /var/cache/cups
|
||||
mkdir -m 0755 -p /var/cups
|
||||
mkdir -m 0755 -p /var/spool/cups/tmp
|
||||
service_start /usr/sbin/cupsd
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/sbin/cupsd
|
||||
kill $(pidof cupsd) >/dev/null 2>&1 || killall -9 cupsd >/dev/null 2>&1
|
||||
}
|
||||
|
||||
reload(){
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
echo "cupsd Server has restarted."
|
||||
reload() {
|
||||
service_reload /usr/sbin/cupsd
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ ServerAlias *
|
|||
<Location />
|
||||
Order Allow,Deny
|
||||
Allow From 127.0.0.1
|
||||
Allow From 192.168.0.0/16
|
||||
Allow From 192.168.1.0/24
|
||||
</Location>
|
||||
|
||||
<Location /admin>
|
||||
|
@ -54,5 +54,5 @@ AuthType Basic
|
|||
AuthClass System
|
||||
Order Allow,Deny
|
||||
Allow From 127.0.0.1
|
||||
Allow From 192.168.0.0/16
|
||||
Allow From 192.168.1.0/24
|
||||
</Location>
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
--- a/config-scripts/cups-directories.m4
|
||||
+++ b/config-scripts/cups-directories.m4
|
||||
@@ -102,7 +102,7 @@ if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
case "$host_os_name" in
|
||||
linux*)
|
||||
if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
|
||||
- libdir="$exec_prefix/lib64"
|
||||
+ libdir="$exec_prefix/lib"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
--- "a/configure"
|
||||
+++ "b/configure"
|
||||
@@ -6188,7 +6188,7 @@ if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
case "$host_os_name" in
|
||||
linux*)
|
||||
if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
|
||||
- libdir="$exec_prefix/lib64"
|
||||
+ libdir="$exec_prefix/lib"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
--- a/cups-config.in
|
||||
+++ b/cups-config.in
|
||||
@@ -48,7 +48,7 @@ else
|
||||
CFLAGS="$CFLAGS -I$includedir"
|
||||
fi
|
||||
|
||||
- if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
|
||||
+ if test $libdir != /usr/lib -a $libdir != /usr/lib -a $libdir != /usr/lib; then
|
||||
LDFLAGS="$LDFLAGS -L$libdir"
|
||||
fi
|
||||
fi
|
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-aliyundrive-webdav
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_VERSION:=0.3.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=luci-app-netspeedtest
|
||||
PKG_VERSION:=1.6
|
||||
PKG_RELEASE:=20210415
|
||||
PKG_RELEASE:=20210511
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_MAINTAINER:=sirpdboy
|
||||
|
||||
|
@ -19,20 +19,15 @@ define Package/$(PKG_NAME)
|
|||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=LuCI Support for netspeedtest
|
||||
DEPENDS:=+python3 +iperf3
|
||||
DESCRIPTION:=LuCI support Network speed test intranet and Extranet
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+python3 +iperf3
|
||||
DESCRIPTION:=LuCI support Network speed test intranet and Extranet
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Luci Support for netspeedtest.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(foreach po,$(wildcard ${CURDIR}/po/zh-cn/*.po), \
|
||||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
|
@ -46,10 +41,8 @@ define Package/$(PKG_NAME)/install
|
|||
$(INSTALL_DIR) $(1)/
|
||||
cp -pR ./root/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/netspeedtest.lmo $(1)/usr/lib/lua/luci/i18n/
|
||||
po2lmo ./po/zh-cn/netspeedtest.po $(1)/usr/lib/lua/luci/i18n/netspeedtest.lmo
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
|
|
|
@ -15,18 +15,18 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
import re
|
||||
import csv
|
||||
import sys
|
||||
import math
|
||||
import datetime
|
||||
import errno
|
||||
import math
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import signal
|
||||
import socket
|
||||
import timeit
|
||||
import datetime
|
||||
import platform
|
||||
import sys
|
||||
import threading
|
||||
import timeit
|
||||
import xml.parsers.expat
|
||||
|
||||
try:
|
||||
|
@ -36,7 +36,7 @@ except ImportError:
|
|||
gzip = None
|
||||
GZIP_BASE = object
|
||||
|
||||
__version__ = '2.1.3'
|
||||
__version__ = '2.1.4b1'
|
||||
|
||||
|
||||
class FakeShutdownEvent(object):
|
||||
|
@ -49,6 +49,8 @@ class FakeShutdownEvent(object):
|
|||
"Dummy method to always return false"""
|
||||
return False
|
||||
|
||||
is_set = isSet
|
||||
|
||||
|
||||
# Some global variables we use
|
||||
DEBUG = False
|
||||
|
@ -56,6 +58,7 @@ _GLOBAL_DEFAULT_TIMEOUT = object()
|
|||
PY25PLUS = sys.version_info[:2] >= (2, 5)
|
||||
PY26PLUS = sys.version_info[:2] >= (2, 6)
|
||||
PY32PLUS = sys.version_info[:2] >= (3, 2)
|
||||
PY310PLUS = sys.version_info[:2] >= (3, 10)
|
||||
|
||||
# Begin import game to handle Python 2 and Python 3
|
||||
try:
|
||||
|
@ -266,17 +269,6 @@ else:
|
|||
write(arg)
|
||||
write(end)
|
||||
|
||||
if PY32PLUS:
|
||||
etree_iter = ET.Element.iter
|
||||
elif PY25PLUS:
|
||||
etree_iter = ET_Element.getiterator
|
||||
|
||||
if PY26PLUS:
|
||||
thread_is_alive = threading.Thread.is_alive
|
||||
else:
|
||||
thread_is_alive = threading.Thread.isAlive
|
||||
|
||||
|
||||
# Exception "constants" to support Python 2 through Python 3
|
||||
try:
|
||||
import ssl
|
||||
|
@ -293,6 +285,23 @@ except ImportError:
|
|||
ssl = None
|
||||
HTTP_ERRORS = (HTTPError, URLError, socket.error, BadStatusLine)
|
||||
|
||||
if PY32PLUS:
|
||||
etree_iter = ET.Element.iter
|
||||
elif PY25PLUS:
|
||||
etree_iter = ET_Element.getiterator
|
||||
|
||||
if PY26PLUS:
|
||||
thread_is_alive = threading.Thread.is_alive
|
||||
else:
|
||||
thread_is_alive = threading.Thread.isAlive
|
||||
|
||||
|
||||
def event_is_set(event):
|
||||
try:
|
||||
return event.is_set()
|
||||
except AttributeError:
|
||||
return event.isSet()
|
||||
|
||||
|
||||
class SpeedtestException(Exception):
|
||||
"""Base exception for this module"""
|
||||
|
@ -769,7 +778,7 @@ def print_dots(shutdown_event):
|
|||
status
|
||||
"""
|
||||
def inner(current, total, start=False, end=False):
|
||||
if shutdown_event.isSet():
|
||||
if event_is_set(shutdown_event):
|
||||
return
|
||||
|
||||
sys.stdout.write('.')
|
||||
|
@ -808,7 +817,7 @@ class HTTPDownloader(threading.Thread):
|
|||
try:
|
||||
if (timeit.default_timer() - self.starttime) <= self.timeout:
|
||||
f = self._opener(self.request)
|
||||
while (not self._shutdown_event.isSet() and
|
||||
while (not event_is_set(self._shutdown_event) and
|
||||
(timeit.default_timer() - self.starttime) <=
|
||||
self.timeout):
|
||||
self.result.append(len(f.read(10240)))
|
||||
|
@ -864,7 +873,7 @@ class HTTPUploaderData(object):
|
|||
|
||||
def read(self, n=10240):
|
||||
if ((timeit.default_timer() - self.start) <= self.timeout and
|
||||
not self._shutdown_event.isSet()):
|
||||
not event_is_set(self._shutdown_event)):
|
||||
chunk = self.data.read(n)
|
||||
self.total.append(len(chunk))
|
||||
return chunk
|
||||
|
@ -902,7 +911,7 @@ class HTTPUploader(threading.Thread):
|
|||
request = self.request
|
||||
try:
|
||||
if ((timeit.default_timer() - self.starttime) <= self.timeout and
|
||||
not self._shutdown_event.isSet()):
|
||||
not event_is_set(self._shutdown_event)):
|
||||
try:
|
||||
f = self._opener(request)
|
||||
except TypeError:
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"luci-app-netspeedtest": {
|
||||
"description": "Grant UCI access for luci-app-netspeedtest",
|
||||
"read": {
|
||||
"uci": [ "netspeedtest" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "netspeedtest" ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,9 +6,9 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=4.35
|
||||
PKG_VERSION:=4.36
|
||||
PKG_RELEASE:=1
|
||||
#20210921
|
||||
#20210928
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Brook \
|
||||
|
|
|
@ -43,7 +43,13 @@ local function get_new_port()
|
|||
return new_port
|
||||
end
|
||||
|
||||
function gen_outbound(node, tag, is_proxy, proxy_tag)
|
||||
function gen_outbound(node, tag, proxy_table)
|
||||
local proxy = 0
|
||||
local proxy_tag = "nil"
|
||||
if proxy_table ~= nil and type(proxy_table) == "table" then
|
||||
proxy = proxy_table.proxy or 0
|
||||
proxy_tag = proxy_table.tag or "nil"
|
||||
end
|
||||
local result = nil
|
||||
if node and node ~= "nil" then
|
||||
local node_id = node[".name"]
|
||||
|
@ -52,8 +58,8 @@ function gen_outbound(node, tag, is_proxy, proxy_tag)
|
|||
end
|
||||
|
||||
if node.type == "V2ray" or node.type == "Xray" then
|
||||
is_proxy = nil
|
||||
if proxy_tag then
|
||||
proxy = 0
|
||||
if proxy_tag ~= "nil" then
|
||||
node.proxySettings = {
|
||||
tag = proxy_tag,
|
||||
transportLayer = true
|
||||
|
@ -78,7 +84,7 @@ function gen_outbound(node, tag, is_proxy, proxy_tag)
|
|||
"127.0.0.1", --bind
|
||||
new_port, --socks port
|
||||
string.format("/var/etc/%s/v2_%s_%s_%s.json", appname, node_type, node_id, new_port), --config file
|
||||
(is_proxy and is_proxy == "1" and relay_port) and tostring(relay_port) or "" --relay port
|
||||
(proxy == 1 and proxy_tag ~= "nil" and relay_port) and tostring(relay_port) or "" --relay port
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -98,7 +104,8 @@ function gen_outbound(node, tag, is_proxy, proxy_tag)
|
|||
|
||||
result = {
|
||||
_flag_tag = node_id,
|
||||
_flag_is_proxy = (is_proxy and is_proxy == "1") and "1" or "0",
|
||||
_flag_proxy = proxy,
|
||||
_flag_proxy_tag = proxy_tag,
|
||||
tag = tag,
|
||||
proxySettings = node.proxySettings or nil,
|
||||
protocol = node.protocol,
|
||||
|
@ -286,7 +293,7 @@ if node_section then
|
|||
else
|
||||
local default_node = uci:get_all(appname, default_node_id)
|
||||
local main_node_id = node.main_node or "nil"
|
||||
local is_proxy = "0"
|
||||
local proxy = 0
|
||||
local proxy_tag
|
||||
if main_node_id ~= "nil" then
|
||||
local main_node = uci:get_all(appname, main_node_id)
|
||||
|
@ -294,7 +301,7 @@ if node_section then
|
|||
local main_node_outbound = gen_outbound(main_node, "main")
|
||||
if main_node_outbound then
|
||||
table.insert(outbounds, main_node_outbound)
|
||||
is_proxy = "1"
|
||||
proxy = 1
|
||||
proxy_tag = "main"
|
||||
if default_node.type ~= "V2ray" and default_node.type ~= "Xray" then
|
||||
proxy_tag = nil
|
||||
|
@ -321,7 +328,7 @@ if node_section then
|
|||
end
|
||||
end
|
||||
if default_node and api.is_normal_node(default_node) then
|
||||
local default_outbound = gen_outbound(default_node, "default", is_proxy, proxy_tag)
|
||||
local default_outbound = gen_outbound(default_node, "default", { proxy = proxy, tag = proxy_tag })
|
||||
if default_outbound then
|
||||
table.insert(outbounds, default_outbound)
|
||||
default_outboundTag = "default"
|
||||
|
@ -332,7 +339,7 @@ if node_section then
|
|||
uci:foreach(appname, "shunt_rules", function(e)
|
||||
local name = e[".name"]
|
||||
local _node_id = node[name] or "nil"
|
||||
local is_proxy = node[name .. "_proxy"] or "0"
|
||||
local proxy_tag = node[name .. "_proxy_tag"] or "nil"
|
||||
local outboundTag
|
||||
if _node_id == "_direct" then
|
||||
outboundTag = "direct"
|
||||
|
@ -344,20 +351,20 @@ if node_section then
|
|||
if _node_id ~= "nil" then
|
||||
local _node = uci:get_all(appname, _node_id)
|
||||
if _node and api.is_normal_node(_node) then
|
||||
local has_outbound
|
||||
local new_outbound
|
||||
for index, value in ipairs(outbounds) do
|
||||
if value["_flag_tag"] == _node_id and value["_flag_is_proxy"] == is_proxy then
|
||||
has_outbound = api.clone(value)
|
||||
if value["_flag_tag"] == _node_id and value["_flag_proxy_tag"] == proxy_tag then
|
||||
new_outbound = api.clone(value)
|
||||
break
|
||||
end
|
||||
end
|
||||
if has_outbound then
|
||||
has_outbound["tag"] = name
|
||||
table.insert(outbounds, has_outbound)
|
||||
if new_outbound then
|
||||
new_outbound["tag"] = name
|
||||
table.insert(outbounds, new_outbound)
|
||||
outboundTag = name
|
||||
else
|
||||
if _node.type ~= "V2ray" and _node.type ~= "Xray" then
|
||||
if is_proxy == "1" then
|
||||
if proxy_tag ~= "nil" then
|
||||
new_port = get_new_port()
|
||||
table.insert(inbounds, {
|
||||
tag = "proxy_" .. name,
|
||||
|
@ -374,11 +381,11 @@ if node_section then
|
|||
table.insert(rules, 1, {
|
||||
type = "field",
|
||||
inboundTag = {"proxy_" .. name},
|
||||
outboundTag = "default"
|
||||
outboundTag = proxy_tag
|
||||
})
|
||||
end
|
||||
end
|
||||
local _outbound = gen_outbound(_node, name, is_proxy, (is_proxy == "1" and "default" or nil))
|
||||
local _outbound = gen_outbound(_node, name, { proxy = (proxy_tag ~= "nil") and 1 or 0, tag = (proxy_tag ~= "nil") and proxy_tag or nil })
|
||||
if _outbound then
|
||||
table.insert(outbounds, _outbound)
|
||||
outboundTag = name
|
||||
|
|
|
@ -139,7 +139,7 @@ if (has_v2ray or has_xray) and #nodes_table > 0 then
|
|||
end)
|
||||
|
||||
local id = "default_node"
|
||||
o = s:taboption("Main", ListValue, v.id .. "." .. id, "* " .. translate("Default"))
|
||||
o = s:taboption("Main", ListValue, v.id .. "." .. id, string.format('* <a style="color:red">%s</a>', translate("Default")))
|
||||
o:depends("tcp_node", v.id)
|
||||
o:value("_direct", translate("Direct Connection"))
|
||||
o:value("_blackhole", translate("Blackhole"))
|
||||
|
@ -154,7 +154,7 @@ if (has_v2ray or has_xray) and #nodes_table > 0 then
|
|||
end
|
||||
|
||||
local id = "main_node"
|
||||
o = s:taboption("Main", ListValue, v.id .. "." .. id, "* " .. translate("Default") .. " " .. translate("Preproxy"), translate("When using, localhost will connect this node first and then use this node to connect the default node."))
|
||||
o = s:taboption("Main", ListValue, v.id .. "." .. id, string.format('* <a style="color:red">%s</a>', translate("Default Preproxy")), translate("When using, localhost will connect this node first and then use this node to connect the default node."))
|
||||
o:depends("tcp_node", v.id)
|
||||
o:value("nil", translate("Close"))
|
||||
for k1, v1 in pairs(normal_list) do
|
||||
|
|
|
@ -56,6 +56,10 @@ s.sortable = true
|
|||
s.anonymous = true
|
||||
s.addremove = true
|
||||
|
||||
s.create = function(e, t)
|
||||
TypedSection.create(e, api.gen_uuid())
|
||||
end
|
||||
|
||||
s.remove = function(self, section)
|
||||
for k, v in pairs(self.children) do
|
||||
v.rmempty = true
|
||||
|
|
|
@ -141,12 +141,15 @@ uci:foreach(appname, "shunt_rules", function(e)
|
|||
o:depends("protocol", "_shunt")
|
||||
|
||||
if #nodes_table > 0 then
|
||||
_proxy = s:option(Flag, e[".name"] .. "_proxy", translate(e.remarks) .. translate("Preproxy"), translate("Use the default node for the transit."))
|
||||
_proxy.default = 0
|
||||
_proxy_tag = s:option(ListValue, e[".name"] .. "_proxy_tag", string.format('* <a style="color:red">%s</a>', translate(e.remarks) .. " " .. translate("Preproxy")))
|
||||
_proxy_tag:value("nil", translate("Close"))
|
||||
_proxy_tag:value("default", translate("Default"))
|
||||
_proxy_tag:value("main", translate("Default Preproxy"))
|
||||
_proxy_tag.default = "nil"
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
o:value(v.id, v.remarks)
|
||||
_proxy:depends(e[".name"], v.id)
|
||||
_proxy_tag:depends(e[".name"], v.id)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
@ -158,14 +161,14 @@ shunt_tips.cfgvalue = function(t, n)
|
|||
end
|
||||
shunt_tips:depends("protocol", "_shunt")
|
||||
|
||||
default_node = s:option(ListValue, "default_node", translate("Default") .. " " .. translate("Node"))
|
||||
default_node = s:option(ListValue, "default_node", string.format('* <a style="color:red">%s</a>', translate("Default")))
|
||||
default_node:value("_direct", translate("Direct Connection"))
|
||||
default_node:value("_blackhole", translate("Blackhole"))
|
||||
for k, v in pairs(nodes_table) do default_node:value(v.id, v.remarks) end
|
||||
default_node:depends("protocol", "_shunt")
|
||||
|
||||
if #nodes_table > 0 then
|
||||
o = s:option(ListValue, "main_node", translate("Default") .. " " .. translate("Node") .. translate("Preproxy"), translate("When using, localhost will connect this node first and then use this node to connect the default node."))
|
||||
o = s:option(ListValue, "main_node", string.format('* <a style="color:red">%s</a>', translate("Default Preproxy")), translate("When using, localhost will connect this node first and then use this node to connect the default node."))
|
||||
o:value("nil", translate("Close"))
|
||||
for k, v in pairs(nodes_table) do
|
||||
o:value(v.id, v.remarks)
|
||||
|
@ -177,6 +180,7 @@ domainStrategy = s:option(ListValue, "domainStrategy", translate("Domain Strateg
|
|||
domainStrategy:value("AsIs")
|
||||
domainStrategy:value("IPIfNonMatch")
|
||||
domainStrategy:value("IPOnDemand")
|
||||
domainStrategy.default = "IPOnDemand"
|
||||
domainStrategy.description = "<br /><ul><li>" .. translate("'AsIs': Only use domain for routing. Default value.")
|
||||
.. "</li><li>" .. translate("'IPIfNonMatch': When no rule matches current domain, resolves it into IP addresses (A or AAAA records) and try all rules again.")
|
||||
.. "</li><li>" .. translate("'IPOnDemand': As long as there is a IP-based rule, resolves the domain into IP immediately.")
|
||||
|
|
|
@ -2,7 +2,7 @@ local api = require "luci.model.cbi.passwall.api.api"
|
|||
local appname = api.appname
|
||||
local datatypes = api.datatypes
|
||||
|
||||
m = Map(appname, "V2ray/Xray" .. translate("Shunt") .. translate("Rule"))
|
||||
m = Map(appname, "V2ray/Xray " .. translate("Shunt Rule"))
|
||||
m.redirect = api.url()
|
||||
|
||||
s = m:section(NamedSection, arg[1], "shunt_rules", "")
|
||||
|
|
|
@ -29,7 +29,7 @@ local ssr_obfs_list = {
|
|||
}
|
||||
|
||||
local v_ss_encrypt_method_list = {
|
||||
"aes-128-cfb", "aes-256-cfb", "aes-128-gcm", "aes-256-gcm", "chacha20", "chacha20-ietf", "chacha20-poly1305", "chacha20-ietf-poly1305"
|
||||
"aes-128-gcm", "aes-256-gcm", "chacha20-poly1305"
|
||||
}
|
||||
|
||||
local header_type_list = {
|
||||
|
|
|
@ -445,8 +445,8 @@ msgstr "直连"
|
|||
msgid "Blackhole"
|
||||
msgstr "黑洞"
|
||||
|
||||
msgid "Use the default node for the transit."
|
||||
msgstr "使用默认节点代理转发。"
|
||||
msgid "Default Preproxy"
|
||||
msgstr "默认前置代理"
|
||||
|
||||
msgid "No shunt rules? Click me to go to add."
|
||||
msgstr "没有分流规则?点我前往去添加。"
|
||||
|
|
|
@ -84,17 +84,23 @@ config nodes '696cd32c1d5149ee95fd1b3accbad6df'
|
|||
option remarks '分流总节点'
|
||||
option type 'Xray'
|
||||
option protocol '_shunt'
|
||||
option youtube 'nil'
|
||||
option netflix 'nil'
|
||||
option TVB 'nil'
|
||||
option AD '_direct'
|
||||
option BT '_direct'
|
||||
option Telegram 'nil'
|
||||
option YouTube 'nil'
|
||||
option Netflix 'nil'
|
||||
option TVB 'nil'
|
||||
option China 'nil'
|
||||
option default_node 'nil'
|
||||
option default_proxy '0'
|
||||
option domainStrategy 'IPIfNonMatch'
|
||||
|
||||
config shunt_rules 'ads'
|
||||
config shunt_rules 'AD'
|
||||
option remarks 'AD'
|
||||
option domain_list 'geosite:category-ads'
|
||||
|
||||
config shunt_rules 'BT'
|
||||
option remarks 'BT'
|
||||
option protocol 'bittorrent'
|
||||
|
||||
config shunt_rules 'Telegram'
|
||||
option remarks 'Telegram'
|
||||
|
@ -104,8 +110,8 @@ config shunt_rules 'Telegram'
|
|||
109.239.140.0/24
|
||||
67.198.55.0/24'
|
||||
|
||||
config shunt_rules 'youtube'
|
||||
option remarks 'youtube'
|
||||
config shunt_rules 'YouTube'
|
||||
option remarks 'YouTube'
|
||||
option domain_list 'youtube
|
||||
youtube.com
|
||||
youtu.be
|
||||
|
@ -113,7 +119,7 @@ googlevideo.com
|
|||
ytimg.com
|
||||
gvt2.com'
|
||||
|
||||
config shunt_rules 'netflix'
|
||||
config shunt_rules 'Netflix'
|
||||
option remarks 'Netflix'
|
||||
option domain_list 'fast.com
|
||||
netflix
|
||||
|
|
|
@ -841,24 +841,28 @@ local function select_node(nodes, config)
|
|||
end
|
||||
end
|
||||
end
|
||||
-- 第一优先级 cfgid
|
||||
if not server then
|
||||
for index, node in pairs(nodes) do
|
||||
if node[".name"] == config.currentNode['.name'] then
|
||||
if config.log == nil or config.log == true then
|
||||
log('更新【' .. config.remarks .. '】第一匹配节点:' .. node.remarks)
|
||||
end
|
||||
server = node[".name"]
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
-- 第二优先级 类型 + IP + 端口
|
||||
-- 第一优先级 类型 + IP + 端口
|
||||
if not server then
|
||||
for index, node in pairs(nodes) do
|
||||
if config.currentNode.type and config.currentNode.address and config.currentNode.port then
|
||||
if node.type and node.address and node.port then
|
||||
if node.type == config.currentNode.type and (node.address .. ':' .. node.port == config.currentNode.address .. ':' .. config.currentNode.port) then
|
||||
if config.log == nil or config.log == true then
|
||||
log('更新【' .. config.remarks .. '】第一匹配节点:' .. node.remarks)
|
||||
end
|
||||
server = node[".name"]
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- 第二优先级 IP + 端口
|
||||
if not server then
|
||||
for index, node in pairs(nodes) do
|
||||
if config.currentNode.address and config.currentNode.port then
|
||||
if node.address and node.port then
|
||||
if node.address .. ':' .. node.port == config.currentNode.address .. ':' .. config.currentNode.port then
|
||||
if config.log == nil or config.log == true then
|
||||
log('更新【' .. config.remarks .. '】第二匹配节点:' .. node.remarks)
|
||||
end
|
||||
|
@ -869,12 +873,12 @@ local function select_node(nodes, config)
|
|||
end
|
||||
end
|
||||
end
|
||||
-- 第三优先级 IP + 端口
|
||||
-- 第三优先级 IP
|
||||
if not server then
|
||||
for index, node in pairs(nodes) do
|
||||
if config.currentNode.address and config.currentNode.port then
|
||||
if node.address and node.port then
|
||||
if node.address .. ':' .. node.port == config.currentNode.address .. ':' .. config.currentNode.port then
|
||||
if config.currentNode.address then
|
||||
if node.address then
|
||||
if node.address == config.currentNode.address then
|
||||
if config.log == nil or config.log == true then
|
||||
log('更新【' .. config.remarks .. '】第三匹配节点:' .. node.remarks)
|
||||
end
|
||||
|
@ -885,30 +889,14 @@ local function select_node(nodes, config)
|
|||
end
|
||||
end
|
||||
end
|
||||
-- 第四优先级 IP
|
||||
if not server then
|
||||
for index, node in pairs(nodes) do
|
||||
if config.currentNode.address then
|
||||
if node.address then
|
||||
if node.address == config.currentNode.address then
|
||||
if config.log == nil or config.log == true then
|
||||
log('更新【' .. config.remarks .. '】第四匹配节点:' .. node.remarks)
|
||||
end
|
||||
server = node[".name"]
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- 第五优先级备注
|
||||
-- 第四优先级备注
|
||||
if not server then
|
||||
for index, node in pairs(nodes) do
|
||||
if config.currentNode.remarks then
|
||||
if node.remarks then
|
||||
if node.remarks == config.currentNode.remarks then
|
||||
if config.log == nil or config.log == true then
|
||||
log('更新【' .. config.remarks .. '】第五匹配节点:' .. node.remarks)
|
||||
log('更新【' .. config.remarks .. '】第四匹配节点:' .. node.remarks)
|
||||
end
|
||||
server = node[".name"]
|
||||
break
|
||||
|
@ -966,8 +954,7 @@ local function update_node(manual)
|
|||
|
||||
if next(CONFIG) then
|
||||
local nodes = {}
|
||||
local uci2 = luci.model.uci.cursor()
|
||||
uci2:foreach(appname, "nodes", function(node)
|
||||
uci:foreach(appname, "nodes", function(node)
|
||||
nodes[#nodes + 1] = node
|
||||
end)
|
||||
|
||||
|
|
|
@ -57,8 +57,8 @@ menu "Include libustream-ssl"
|
|||
select PACKAGE_libustream-openssl
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_libustream-mbedtls
|
||||
depends Include !(PACKAGE_$(PKG_NAME)_INCLUDE_libustream-wolfssl || PACKAGE_$(PKG_NAME)_INCLUDE_libustream-openssl)
|
||||
bool "Use libustream-mbedtls"
|
||||
depends on !(PACKAGE_$(PKG_NAME)_INCLUDE_libustream-wolfssl || PACKAGE_$(PKG_NAME)_INCLUDE_libustream-openssl)
|
||||
bool "Include libustream-mbedtls"
|
||||
default y if DEFAULT_libustream-mbedtls
|
||||
select PACKAGE_libustream-mbedtls
|
||||
|
||||
|
|
Loading…
Reference in New Issue