2023-11-25 02:51:58 Auto Sync
@ -1,81 +0,0 @@
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adguardhome
|
||||
PKG_VERSION:=0.107.41
|
||||
PKG_RELEASE:=110
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/AdGuardHome/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/AdGuardHome-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-3.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE.txt
|
||||
PKG_MAINTAINER:=Dobroslaw Kijowski <dobo90@gmail.com>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
GO_PKG:=github.com/AdguardTeam/AdGuardHome
|
||||
GO_PKG_BUILD_PKG:=$(GO_PKG)
|
||||
|
||||
AGH_BUILD_TIME:=$(shell date -d @$(SOURCE_DATE_EPOCH) +%FT%TZ%z)
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
$(GO_PKG)/internal/version.channel=release \
|
||||
$(GO_PKG)/internal/version.version=v$(PKG_VERSION) \
|
||||
$(GO_PKG)/internal/version.buildtime=$(AGH_BUILD_TIME) \
|
||||
$(GO_PKG)/internal/version.goarm=$(GO_ARM) \
|
||||
$(GO_PKG)/internal/version.gomips=$(GO_MIPS)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/adguardhome
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Network-wide ads and trackers blocking DNS server
|
||||
URL:=https://github.com/AdguardTeam/AdGuardHome
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Package/adguardhome/conffiles
|
||||
/etc/adguardhome.yaml
|
||||
/etc/config/adguardhome
|
||||
endef
|
||||
|
||||
define Package/adguardhome/description
|
||||
Free and open source, powerful network-wide ads and trackers blocking DNS server.
|
||||
endef
|
||||
|
||||
FRONTEND_FILE:=$(PKG_NAME)-frontend-$(PKG_VERSION).tar.gz
|
||||
define Download/adguardhome-frontend
|
||||
URL:=https://github.com/AdguardTeam/AdGuardHome/releases/download/v$(PKG_VERSION)/
|
||||
URL_FILE:=AdGuardHome_frontend.tar.gz
|
||||
FILE:=$(FRONTEND_FILE)
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
|
||||
gzip -dc $(DL_DIR)/$(FRONTEND_FILE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/ $(TAR_OPTIONS)
|
||||
endef
|
||||
|
||||
define Package/adguardhome/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/adguardhome.init $(1)/etc/init.d/adguardhome
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/adguardhome.config $(1)/etc/config/adguardhome
|
||||
endef
|
||||
|
||||
$(eval $(call Download,adguardhome-frontend))
|
||||
$(eval $(call GoBinPackage,adguardhome))
|
||||
$(eval $(call BuildPackage,adguardhome))
|
@ -1,4 +0,0 @@
|
||||
config adguardhome config
|
||||
option enabled '0'
|
||||
# Where to store persistent data by AdGuard Home
|
||||
option workdir /var/adguardhome
|
@ -1,25 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
PROG=/usr/bin/AdGuardHome
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
# starts just after network starts to avoid some network race conditions
|
||||
START=25
|
||||
# stops before networking stops
|
||||
STOP=89
|
||||
|
||||
start_service() {
|
||||
config_load adguardhome
|
||||
config_get_bool enabled config enabled
|
||||
config_get WORK_DIR config workdir
|
||||
|
||||
[ "$enabled" -eq "1" ] || return 1
|
||||
[ -d "$WORK_DIR" ] || mkdir -m 0755 -p "$WORK_DIR"
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -c /etc/adguardhome.yaml -w "$WORK_DIR" --no-check-update
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -1,6 +1,8 @@
|
||||
module github.com/AdguardTeam/AdGuardHome
|
||||
|
||||
-go 1.20
|
||||
+go 1.21
|
||||
+
|
||||
+toolchain go1.21.3
|
||||
|
||||
require (
|
||||
github.com/AdguardTeam/dnsproxy v0.56.2
|
||||
@@ -10,7 +12,6 @@ require (
|
||||
github.com/ameshkov/dnscrypt/v2 v2.2.7
|
||||
github.com/bluele/gcache v0.0.2
|
||||
github.com/digineo/go-ipset/v2 v2.2.1
|
||||
- github.com/dimfeld/httptreemux/v5 v5.5.0
|
||||
github.com/fsnotify/fsnotify v1.6.0
|
||||
github.com/go-ping/ping v1.1.0
|
||||
github.com/google/go-cmp v0.6.0
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -23,17 +23,18 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/digineo/go-ipset/v2 v2.2.1 h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g=
|
||||
github.com/digineo/go-ipset/v2 v2.2.1/go.mod h1:wBsNzJlZlABHUITkesrggFnZQtgW5wkqw1uo8Qxe0VU=
|
||||
-github.com/dimfeld/httptreemux/v5 v5.5.0 h1:p8jkiMrCuZ0CmhwYLcbNbl7DDo21fozhKHQ2PccwOFQ=
|
||||
-github.com/dimfeld/httptreemux/v5 v5.5.0/go.mod h1:QeEylH57C0v3VO0tkKraVz9oD3Uu93CKPnTLbsidvSw=
|
||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
|
||||
+github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
+github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-ping/ping v1.1.0 h1:3MCGhVX4fyEUuhsfwPrsEdQw6xspHkv5zHsiSoDFZYw=
|
||||
github.com/go-ping/ping v1.1.0/go.mod h1:xIFjORFzTxqIV/tDVGO4eDy/bLuSyawEeojSm3GfRGk=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
@@ -49,6 +50,7 @@ github.com/google/uuid v1.2.0/go.mod h1:
|
||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714 h1:/jC7qQFrv8CrSJVmaolDVOxTfS9kc36uB6H40kdbQq8=
|
||||
+github.com/hugelgupf/socketpair v0.0.0-20190730060125-05d35a94e714/go.mod h1:2Goc3h8EklBH5mspfHFxBnEoURQCGzQQH1ga9Myjvis=
|
||||
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a h1:S33o3djA1nPRd+d/bf7jbbXytXuK/EoXow7+aa76grQ=
|
||||
github.com/insomniacslk/dhcp v0.0.0-20230908212754-65c27093e38a/go.mod h1:zmdm3sTSDP3vOOX3CEWRkkRHtKr1DxBx+J1OQFoDQQs=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
@@ -59,7 +61,9 @@ github.com/josharian/native v1.1.1-0.202
|
||||
github.com/kardianos/service v1.2.2 h1:ZvePhAHfvo0A7Mftk/tEzqEZ7Q4lgnR8sGz4xu1YX60=
|
||||
github.com/kardianos/service v1.2.2/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
|
||||
+github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
||||
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 h1:2oDp6OOhLxQ9JBoUuysVz9UZ9uI6oLUbvAZu0x8o+vE=
|
||||
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118/go.mod h1:ZFUnHIVchZ9lJoWoEGUg8Q3M4U8aNNWA3CVSUTkW4og=
|
||||
github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA=
|
||||
@@ -76,9 +80,11 @@ github.com/mdlayher/socket v0.5.0/go.mod
|
||||
github.com/miekg/dns v1.1.56 h1:5imZaSeoRNvpM9SzWNhEcP9QliKiz20/dA2QabIGVnE=
|
||||
github.com/miekg/dns v1.1.56/go.mod h1:cRm6Oo2C8TY9ZS/TqsSrseAcncm74lfK5G+ikN2SWWY=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
|
||||
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
|
||||
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
|
||||
+github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
|
||||
github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||
@@ -90,6 +96,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:b
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
|
||||
+github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
||||
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
|
||||
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
||||
github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=
|
||||
@@ -97,9 +104,12 @@ github.com/quic-go/qtls-go1-20 v0.3.4/go
|
||||
github.com/quic-go/quic-go v0.39.1 h1:d/m3oaN/SD2c+f7/yEjZxe2zEVotXprnrCCJ2y/ZZFE=
|
||||
github.com/quic-go/quic-go v0.39.1/go.mod h1:T09QsDQWjLiQ74ZmacDfqZmhY/NLnw5BC40MANNNZ1Q=
|
||||
github.com/shirou/gopsutil/v3 v3.23.7 h1:C+fHO8hfIppoJ1WdsVm1RoI0RwXoNdfTK7yWXV0wVj4=
|
||||
+github.com/shirou/gopsutil/v3 v3.23.7/go.mod h1:c4gnmoRC0hQuaLqvxnx1//VXQ0Ms/X9UnJF8pddY5z4=
|
||||
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
|
||||
+github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
||||
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
@@ -108,10 +118,13 @@ github.com/ti-mo/netfilter v0.2.0/go.mod
|
||||
github.com/ti-mo/netfilter v0.5.0 h1:MZmsUw5bFRecOb0AeyjOPxTHg4UxYzyEs0Ek/6Lxoy8=
|
||||
github.com/ti-mo/netfilter v0.5.0/go.mod h1:nt+8B9hx/QpqHr7Hazq+2qMCCA8u2OTkyc/7+U9ARz8=
|
||||
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
|
||||
+github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
|
||||
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=
|
||||
+github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4=
|
||||
github.com/u-root/uio v0.0.0-20230305220412-3e8cd9d6bf63 h1:YcojQL98T/OO+rybuzn2+5KrD5dBwXIvYBvQ2cD3Avg=
|
||||
github.com/u-root/uio v0.0.0-20230305220412-3e8cd9d6bf63/go.mod h1:eLL9Nub3yfAho7qB0MzZizFhTU2QkLeoVsWdHtDW264=
|
||||
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
|
||||
+github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
|
||||
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
|
||||
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
|
||||
@@ -164,8 +177,10 @@ golang.org/x/tools v0.14.0/go.mod h1:uYB
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
+google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
|
||||
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
|
@ -1,11 +0,0 @@
|
||||
--- a/client/src/login/Login/Form.js
|
||||
+++ b/client/src/login/Login/Form.js
|
||||
@@ -25,7 +25,7 @@ const Form = (props) => {
|
||||
type="text"
|
||||
className="form-control"
|
||||
component={renderInputField}
|
||||
- placeholder={t('username_placeholder')}
|
||||
+ placeholder="默认用户名密码都是root"
|
||||
autoComplete="username"
|
||||
autocapitalize="none"
|
||||
disabled={processing}
|
@ -1,9 +0,0 @@
|
||||
--- a/client/src/helpers/version.js
|
||||
+++ b/client/src/helpers/version.js
|
||||
@@ -13,5 +13,5 @@ export const areEqualVersions = (left, right) => {
|
||||
|
||||
const leftVersion = left.replace(/^v/, '');
|
||||
const rightVersion = right.replace(/^v/, '');
|
||||
- return leftVersion === rightVersion;
|
||||
+ return leftVersion >= rightVersion;
|
||||
};
|
@ -5,8 +5,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hysteria
|
||||
PKG_VERSION:=2.2.1
|
||||
PKG_RELEASE:=54
|
||||
PKG_VERSION:=2.2.2
|
||||
PKG_RELEASE:=55
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/apernet/hysteria/tar.gz/app/v$(PKG_VERSION)?
|
||||
|
@ -1,19 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI for Frp Client
|
||||
LUCI_DEPENDS:=+wget +frpc
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_NAME:=luci-app-frpclient
|
||||
PKG_VERSION:=1.4
|
||||
PKG_RELEASE:=2
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
@ -1,18 +0,0 @@
|
||||
module("luci.controller.frp", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/frp") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "frp"}, cbi("frp/basic"), _("Frp Client"), 100).dependent = true
|
||||
entry({"admin", "services", "frp", "config"}, cbi("frp/config")).leaf = true
|
||||
entry({"admin", "services", "frp", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pidof frpc > /dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
@ -1,261 +0,0 @@
|
||||
local o = require "luci.dispatcher"
|
||||
local e = require ("luci.model.ipkg")
|
||||
local s = require "nixio.fs"
|
||||
local e = luci.model.uci.cursor()
|
||||
local i = "frp"
|
||||
local a, t, e
|
||||
local n = {}
|
||||
|
||||
a = Map("frp")
|
||||
a.title = translate("Frp Client")
|
||||
a.description = translate("Frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.")
|
||||
|
||||
a:section(SimpleSection).template = "frp/frp_status"
|
||||
|
||||
t = a:section(NamedSection, "common", "frp")
|
||||
t.anonymous = true
|
||||
t.addremove = false
|
||||
|
||||
t:tab("base", translate("Basic Settings"))
|
||||
t:tab("other", translate("Other Settings"))
|
||||
t:tab("log", translate("Client Log"))
|
||||
|
||||
e = t:taboption("base", Flag, "enabled", translate("Enabled"))
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "server_addr", translate("Server"))
|
||||
e.optional = false
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "server_port", translate("Port"))
|
||||
e.datatype = "port"
|
||||
e.optional = false
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "token", translate("Token"))
|
||||
e.description = translate("Time duration between server of frpc and frps mustn't exceed 15 minutes.")
|
||||
e.optional = false
|
||||
e.password = true
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "user", translate("User"))
|
||||
e.description = translate("Commonly used to distinguish you with other clients.")
|
||||
e.optional = true
|
||||
e.default = ""
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "vhost_http_port", translate("Vhost HTTP Port"))
|
||||
e.datatype = "port"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "vhost_https_port", translate("Vhost HTTPS Port"))
|
||||
e.datatype = "port"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "time", translate("Service registration interval"))
|
||||
e.description = translate("0 means disable this feature, unit: min")
|
||||
e.datatype = "range(0,59)"
|
||||
e.default = 30
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("other", Flag, "login_fail_exit", translate("Exit program when first login failed"))
|
||||
e.description = translate("decide if exit program when first login failed, otherwise continuous relogin to frps.")
|
||||
e.default = "1"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("other", Flag, "tcp_mux", translate("TCP Stream Multiplexing"))
|
||||
e.description = translate("Default is Ture. This feature in frps.ini and frpc.ini must be same.")
|
||||
e.default = "1"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("other", Flag, "tls_enable", translate("Use TLS Connection"))
|
||||
e.description = translate("if tls_enable is true, frpc will connect frps by tls.")
|
||||
e.default = "0"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("other", Flag, "enable_custom_certificate", translate("Custom TLS Protocol Encryption"))
|
||||
e.description = translate("Frp supports traffic encryption between frpc and frps through the TLS protocol, and supports client or server unidirectional and bidirectional authentication.")
|
||||
e.default = "0"
|
||||
e.rmempty = false
|
||||
e:depends("tls_enable", 1)
|
||||
|
||||
e = t:taboption("other", Value, "tls_cert_file", translate("Client Certificate File"))
|
||||
e.description = translate("Frps one-way verifies the identity of frpc.")
|
||||
e.placeholder = "/var/etc/frp/client.crt"
|
||||
e.optional = false
|
||||
e:depends("enable_custom_certificate", 1)
|
||||
|
||||
e = t:taboption("other", Value, "tls_key_file", translate("Client Key File"))
|
||||
e.description = translate("Frps one-way verifies the identity of frpc.")
|
||||
e.placeholder = "/var/etc/frp/client.key"
|
||||
e.optional = false
|
||||
e:depends("enable_custom_certificate", 1)
|
||||
|
||||
e = t:taboption("other", Value, "tls_trusted_ca_file", translate("CA Certificate File"))
|
||||
e.description = translate("Frpc one-way verifies the identity of frps.")
|
||||
e.placeholder = "/var/etc/frp/ca.crt"
|
||||
e.optional = false
|
||||
e:depends("enable_custom_certificate", 1)
|
||||
|
||||
e = t:taboption("other", ListValue, "protocol", translate("Protocol Type"))
|
||||
e.description = translate("Frp support kcp protocol since v0.12.0")
|
||||
e.default = "tcp"
|
||||
e:value("tcp", translate("TCP Protocol"))
|
||||
e:value("kcp", translate("KCP Protocol"))
|
||||
|
||||
e = t:taboption("other", Flag, "enable_http_proxy", translate("Connect frps by HTTP PROXY"))
|
||||
e.description = translate("frpc can connect frps using HTTP PROXY")
|
||||
e.default = "0"
|
||||
e.rmempty = false
|
||||
e:depends("protocol", "tcp")
|
||||
|
||||
e = t:taboption("other", Value, "http_proxy", translate("HTTP PROXY"))
|
||||
e.placeholder = "http://user:pwd@192.168.1.128:8080"
|
||||
e:depends("enable_http_proxy", 1)
|
||||
e.optional = false
|
||||
|
||||
e = t:taboption("other", Flag, "enable_cpool", translate("Enable Connection Pool"))
|
||||
e.description = translate("This feature is fit for a large number of short connections.")
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("other", Value, "pool_count", translate("Connection Pool"))
|
||||
e.description = translate("Connections will be established in advance.")
|
||||
e.datatype = "uinteger"
|
||||
e.default = "1"
|
||||
e:depends("enable_cpool", 1)
|
||||
e.optional = false
|
||||
|
||||
e = t:taboption("other", ListValue, "log_level", translate("Log Level"))
|
||||
e.default = "warn"
|
||||
e:value("trace", translate("Trace"))
|
||||
e:value("debug", translate("Debug"))
|
||||
e:value("info", translate("Info"))
|
||||
e:value("warn", translate("Warning"))
|
||||
e:value("error", translate("Error"))
|
||||
|
||||
e = t:taboption("other", Value, "log_max_days", translate("Log Keepd Max Days"))
|
||||
e.datatype = "uinteger"
|
||||
e.default = "3"
|
||||
e.rmempty = false
|
||||
e.optional = false
|
||||
|
||||
e = t:taboption("other", Flag, "admin_enable", translate("Enable Web API"))
|
||||
e.description = translate("set admin address for control frpc's action by http api such as reload.")
|
||||
e.default = "0"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("other", Value, "admin_port", translate("Admin Web Port"))
|
||||
e.datatype = "port"
|
||||
e.default = 7400
|
||||
e:depends("admin_enable", 1)
|
||||
|
||||
e = t:taboption("other", Value, "admin_user", translate("Admin Web UserName"))
|
||||
e.optional = false
|
||||
e.default = "admin"
|
||||
e:depends("admin_enable", 1)
|
||||
|
||||
e = t:taboption("other", Value, "admin_pwd", translate("Admin Web PassWord"))
|
||||
e.optional = false
|
||||
e.default = "admin"
|
||||
e.password = true
|
||||
e:depends("admin_enable", 1)
|
||||
|
||||
e = t:taboption("log", TextValue, "log")
|
||||
e.rows = 26
|
||||
e.wrap = "off"
|
||||
e.readonly = true
|
||||
e.cfgvalue = function(t,t)
|
||||
return s.readfile("/var/etc/frp/frpc.log")or""
|
||||
end
|
||||
e.write = function(e,e,e)
|
||||
end
|
||||
|
||||
t = a:section(TypedSection, "proxy", translate("Services List"))
|
||||
t.anonymous = true
|
||||
t.addremove = true
|
||||
t.template = "cbi/tblsection"
|
||||
t.extedit = o.build_url("admin", "services", "frp", "config", "%s")
|
||||
|
||||
function t.create(e,t)
|
||||
new = TypedSection.create(e,t)
|
||||
luci.http.redirect(e.extedit:format(new))
|
||||
end
|
||||
|
||||
function t.remove(e,t)
|
||||
e.map.proceed = true
|
||||
e.map:del(t)
|
||||
luci.http.redirect(o.build_url("admin","services","frp"))
|
||||
end
|
||||
|
||||
local o = ""
|
||||
e = t:option(DummyValue, "remark", translate("Service Remark Name"))
|
||||
e.width = "10%"
|
||||
|
||||
e = t:option(DummyValue, "type", translate("Frp Protocol Type"))
|
||||
e.width = "10%"
|
||||
|
||||
e = t:option(DummyValue, "custom_domains", translate("Domain/Subdomain"))
|
||||
e.width = "20%"
|
||||
|
||||
e.cfgvalue = function(t,n)
|
||||
local t = a.uci:get(i,n,"domain_type")or""
|
||||
local m = a.uci:get(i,n,"type")or""
|
||||
if t=="custom_domains" then
|
||||
local b = a.uci:get(i,n,"custom_domains")or"" return b end
|
||||
if t=="subdomain" then
|
||||
local b = a.uci:get(i,n,"subdomain")or"" return b end
|
||||
if t=="both_dtype" then
|
||||
local b = a.uci:get(i,n,"custom_domains")or""
|
||||
local c = a.uci:get(i,n,"subdomain")or""
|
||||
b="%s/%s"%{b,c} return b end
|
||||
if m=="tcp" or m=="udp" then
|
||||
local b = a.uci:get(i,"common","server_addr")or"" return b end
|
||||
end
|
||||
|
||||
e = t:option(DummyValue, "remote_port", translate("Remote Port"))
|
||||
e.width = "10%"
|
||||
e.cfgvalue = function(t,b)
|
||||
local t = a.uci:get(i,b,"type")or""
|
||||
if t==""or b==""then return""end
|
||||
if t=="http" then
|
||||
local b = a.uci:get(i,"common","vhost_http_port")or"" return b end
|
||||
if t=="https" then
|
||||
local b = a.uci:get(i,"common","vhost_https_port")or"" return b end
|
||||
if t=="tcp" or t=="udp" then
|
||||
local b = a.uci:get(i,b,"remote_port")or"" return b end
|
||||
end
|
||||
|
||||
e = t:option(DummyValue, "local_ip", translate("Local Host Address"))
|
||||
e.width = "15%"
|
||||
|
||||
e = t:option(DummyValue, "local_port", translate("Local Host Port"))
|
||||
e.width = "10%"
|
||||
|
||||
e = t:option(DummyValue, "use_encryption", translate("Use Encryption"))
|
||||
e.width = "15%"
|
||||
|
||||
e.cfgvalue = function(t,n)
|
||||
local t = a.uci:get(i,n,"use_encryption")or""
|
||||
local b
|
||||
if t==""or b==""then return""end
|
||||
if t=="1" then b="ON"
|
||||
else b="OFF" end
|
||||
return b
|
||||
end
|
||||
|
||||
e = t:option(DummyValue, "use_compression", translate("Use Compression"))
|
||||
e.width = "15%"
|
||||
e.cfgvalue = function(t,n)
|
||||
local t = a.uci:get(i,n,"use_compression")or""
|
||||
local b
|
||||
if t==""or b==""then return""end
|
||||
if t=="1" then b="ON"
|
||||
else b="OFF" end
|
||||
return b
|
||||
end
|
||||
|
||||
e = t:option(Flag, "enable", translate("Enable State"))
|
||||
e.width = "10%"
|
||||
e.rmempty = false
|
||||
|
||||
return a
|
@ -1,239 +0,0 @@
|
||||
local n = "frp"
|
||||
local i = require "luci.dispatcher"
|
||||
local o = require "luci.model.network".init()
|
||||
local m = require "nixio.fs"
|
||||
local a, t, e
|
||||
|
||||
arg[1] = arg[1]or""
|
||||
|
||||
a = Map("frp")
|
||||
a.title = translate("Frp Domain Config")
|
||||
a.redirect = i.build_url("admin", "services", "frp")
|
||||
|
||||
t = a:section(NamedSection, arg[1], "frp")
|
||||
t.title = translate("Config Frp Protocol")
|
||||
t.addremove = false
|
||||
t.dynamic = false
|
||||
|
||||
t:tab("base", translate("Basic Settings"))
|
||||
t:tab("other", translate("Other Settings"))
|
||||
|
||||
e = t:taboption("base", ListValue, "enable", translate("Enable State"))
|
||||
e.default = "1"
|
||||
e.rmempty = false
|
||||
e:value("1", translate("Enable"))
|
||||
e:value("0", translate("Disable"))
|
||||
|
||||
e = t:taboption("base", ListValue, "type", translate("Frp Protocol Type"))
|
||||
e:value("http", translate("HTTP"))
|
||||
e:value("https", translate("HTTPS"))
|
||||
e:value("tcp", translate("TCP"))
|
||||
e:value("udp", translate("UDP"))
|
||||
e:value("stcp", translate("STCP"))
|
||||
e:value("sudp", translate("SUDP"))
|
||||
e:value("xtcp", translate("XTCP"))
|
||||
|
||||
e = t:taboption("base", ListValue, "domain_type", translate("Domain Type"))
|
||||
e.default = "custom_domains"
|
||||
e:value("custom_domains", translate("Custom Domains"))
|
||||
e:value("subdomain", translate("SubDomain"))
|
||||
e:value("both_dtype", translate("Both the above two Domain types"))
|
||||
e:depends("type", "http")
|
||||
e:depends("type", "https")
|
||||
|
||||
e = t:taboption("base", Value, "custom_domains", translate("Custom Domains"))
|
||||
e.description = translate("If SubDomain is used, Custom Domains couldn't be subdomain or wildcard domain of the maindomain(subdomain_host).")
|
||||
e:depends("domain_type", "custom_domains")
|
||||
e:depends("domain_type", "both_dtype")
|
||||
|
||||
e = t:taboption("base", Value, "subdomain", translate("SubDomain"))
|
||||
e.description = translate("subdomain_host must be configured in server: frps in advance.")
|
||||
e:depends("domain_type", "subdomain")
|
||||
e:depends("domain_type", "both_dtype")
|
||||
|
||||
e = t:taboption("base", ListValue, "stcp_role", translate("STCP Role"))
|
||||
e.default = "server"
|
||||
e:value("server", translate("STCP Server"))
|
||||
e:value("visitor", translate("STCP Vistor"))
|
||||
e:depends("type", "stcp")
|
||||
|
||||
e = t:taboption("base", ListValue, "sudp_role", translate("SUDP Role"))
|
||||
e.default = "server"
|
||||
e:value("server", translate("SUDP Server"))
|
||||
e:value("visitor", translate("SUDP Vistor"))
|
||||
e:depends("type", "sudp")
|
||||
|
||||
e = t:taboption("base", ListValue, "xtcp_role", translate("XTCP Role"))
|
||||
e.default = "server"
|
||||
e:value("server", translate("XTCP Server"))
|
||||
e:value("visitor", translate("XTCP Vistor"))
|
||||
e:depends("type", "xtcp")
|
||||
|
||||
e = t:taboption("base", Value, "remote_port", translate("Remote Port"))
|
||||
e.datatype = "port"
|
||||
e:depends("type", "tcp")
|
||||
e:depends("type", "udp")
|
||||
|
||||
e = t:taboption("other", Flag, "enable_plugin", translate("Use Plugin"))
|
||||
e.description = translate("If plugin is defined, local_ip and local_port is useless, plugin will handle connections got from frps.")
|
||||
e.default = "0"
|
||||
e:depends("type", "tcp")
|
||||
|
||||
e = t:taboption("base", Value, "local_ip", translate("Local Host Address"))
|
||||
luci.sys.net.ipv4_hints(function(x,d)
|
||||
e:value(x,"%s (%s)"%{x,d})
|
||||
end)
|
||||
luci.sys.net.ipv6_hints(function(x,d)
|
||||
e:value(x,"%s (%s)"%{x,d})
|
||||
end)
|
||||
e:depends("type", "udp")
|
||||
e:depends("type", "http")
|
||||
e:depends("type", "https")
|
||||
e:depends("enable_plugin", 0)
|
||||
|
||||
e = t:taboption("base", Value, "local_port", translate("Local Host Port"))
|
||||
e.datatype = "port"
|
||||
e:depends("type", "udp")
|
||||
e:depends("type", "http")
|
||||
e:depends("type", "https")
|
||||
e:depends("enable_plugin", 0)
|
||||
|
||||
e = t:taboption("base", Value, "stcp_secretkey", translate("STCP Screct Key"))
|
||||
e.default = "abcdefg"
|
||||
e:depends("type", "stcp")
|
||||
|
||||
e = t:taboption("base", Value, "stcp_servername", translate("STCP Server Name"))
|
||||
e.description = translate("STCP Server Name is Service Remark Name of STCP Server")
|
||||
e.default = "secret_tcp"
|
||||
e:depends("stcp_role", "visitor")
|
||||
|
||||
e = t:taboption("base", Value, "sudp_secretkey", translate("SUDP Screct Key"))
|
||||
e.default = "abcdefg"
|
||||
e:depends("type", "sudp")
|
||||
|
||||
e = t:taboption("base", Value, "sudp_servername", translate("SUDP Server Name"))
|
||||
e.description = translate("SUDP Server Name is Service Remark Name of SUDP Server")
|
||||
e.default = "secret_tcp"
|
||||
e:depends("sudp_role", "visitor")
|
||||
|
||||
e = t:taboption("base", Value, "xtcp_secretkey", translate("XTCP Screct Key"))
|
||||
e.default = "abcdefg"
|
||||
e:depends("type", "xtcp")
|
||||
|
||||
e = t:taboption("base", Value, "xtcp_servername", translate("XTCP Server Name"))
|
||||
e.description = translate("XTCP Server Name is Service Remark Name of XTCP Server")
|
||||
e.default = "p2p_tcp"
|
||||
e:depends("xtcp_role", "visitor")
|
||||
|
||||
e = t:taboption("other", Flag, "enable_locations", translate("Enable URL routing"))
|
||||
e.description = translate("Frp support forward http requests to different backward web services by url routing.")
|
||||
e:depends("type", "http")
|
||||
|
||||
e = t:taboption("other", Value, "locations", translate("URL routing"))
|
||||
e.description = translate("Http requests with url prefix /news will be forwarded to this service.")
|
||||
e.default = "locations=/"
|
||||
e:depends("enable_locations", 1)
|
||||
|
||||
e = t:taboption("other", ListValue, "plugin", translate("Choose Plugin"))
|
||||
e:value("http_proxy", translate("http_proxy"))
|
||||
e:value("socks5", translate("socks5"))
|
||||
e:value("unix_domain_socket", translate("unix_domain_socket"))
|
||||
e:depends("enable_plugin", 1)
|
||||
|
||||
e = t:taboption("other", Flag, "enable_plugin_httpuserpw", translate("Proxy Authentication"))
|
||||
e.description = translate("Other PCs could access the Internet through frpc's network by using http_proxy plugin.")
|
||||
e.default = "0"
|
||||
e:depends("plugin", "http_proxy")
|
||||
|
||||
e = t:taboption("other", Value, "plugin_http_user", translate("HTTP Proxy UserName"))
|
||||
e.default = "abc"
|
||||
e:depends("enable_plugin_httpuserpw", 1)
|
||||
|
||||
e = t:taboption("other", Value, "plugin_http_passwd", translate("HTTP Proxy Password"))
|
||||
e.default = "abc"
|
||||
e:depends("enable_plugin_httpuserpw", 1)
|
||||
|
||||
e = t:taboption("other", Value, "plugin_unix_path", translate("Plugin Unix Sock Path"))
|
||||
e.default = "/var/run/docker.sock"
|
||||
e:depends("plugin", "unix_domain_socket")
|
||||
|
||||
e = t:taboption("other", Flag, "enable_http_auth", translate("Password protecting your web service"))
|
||||
e.description = translate("Http username and password are safety certification for http protocol.")
|
||||
e.default = "0"
|
||||
e:depends("type", "http")
|
||||
|
||||
e = t:taboption("other", Value, "http_user", translate("HTTP UserName"))
|
||||
e.default = "frp"
|
||||
e:depends("enable_http_auth", 1)
|
||||
|
||||
e = t:taboption("other", Value, "http_pwd", translate("HTTP PassWord"))
|
||||
e.default = "frp"
|
||||
e:depends("enable_http_auth", 1)
|
||||
|
||||
e = t:taboption("other", Flag, "enable_host_header_rewrite", translate("Rewriting the Host Header"))
|
||||
e.description = translate("Frp can rewrite http requests with a modified Host header.")
|
||||
e.default = "0"
|
||||
e:depends("type", "http")
|
||||
|
||||
e = t:taboption("other", Value, "host_header_rewrite", translate("Host Header"))
|
||||
e.description = translate("The Host header will be rewritten to match the hostname portion of the forwarding address.")
|
||||
e.default = "dev.yourdomain.com"
|
||||
e:depends("enable_host_header_rewrite", 1)
|
||||
|
||||
e = t:taboption("other", Flag, "enable_https_plugin", translate("Use Plugin"))
|
||||
e.default = "0"
|
||||
e:depends("type", "https")
|
||||
|
||||
e = t:taboption("other", ListValue, "https_plugin", translate("Choose Plugin"))
|
||||
e.description = translate("If plugin is defined, local_ip and local_port is useless, plugin will handle connections got from frps.")
|
||||
e:value("https2http", translate("https2http"))
|
||||
e:depends("enable_https_plugin", 1)
|
||||
|
||||
e = t:taboption("other", Value, "plugin_local_addr", translate("Plugin_Local_Addr"))
|
||||
e.default = "127.0.0.1:80"
|
||||
e:depends("https_plugin", "https2http")
|
||||
|
||||
e = t:taboption("other", Value, "plugin_crt_path", translate("plugin_crt_path"))
|
||||
e.default = "./server.crt"
|
||||
e:depends("https_plugin", "https2http")
|
||||
|
||||
e = t:taboption("other", Value, "plugin_key_path", translate("plugin_key_path"))
|
||||
e.default = "./server.key"
|
||||
e:depends("https_plugin", "https2http")
|
||||
|
||||
e = t:taboption("other", Value, "plugin_host_header_rewrite", translate("plugin_host_header_rewrite"))
|
||||
e.default = "127.0.0.1"
|
||||
e:depends("https_plugin", "https2http")
|
||||
|
||||
e = t:taboption("other", Value, "plugin_header_X_From_Where", translate("plugin_header_X-From-Where"))
|
||||
e.default = "frp"
|
||||
e:depends("https_plugin", "https2http")
|
||||
|
||||
e = t:taboption("base", ListValue, "proxy_protocol_version", translate("Proxy-Protocol Version"))
|
||||
e.description = translate("Proxy Protocol to send user's real IP to local services.")
|
||||
e.default = "disable"
|
||||
e:value("disable", translate("Disable"))
|
||||
e:value("v1", translate("V1"))
|
||||
e:value("v2", translate("V2"))
|
||||
e:depends("type", "tcp")
|
||||
e:depends("type", "stcp")
|
||||
e:depends("type", "sudp")
|
||||
e:depends("type", "xtcp")
|
||||
e:depends("type", "http")
|
||||
e:depends("type", "https")
|
||||
|
||||
e = t:taboption("base", Flag, "use_encryption", translate("Use Encryption"))
|
||||
e.description = translate("Encrypted the communication between frpc and frps, will effectively prevent the traffic intercepted (If Custom TLS Protocol Encryption is enabled, except that the protocol of xtcp is configured as kcp, you can no longer set Use Encryption to repeat encryption).")
|
||||
e.default = "1"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Flag, "use_compression", translate("Use Compression"))
|
||||
e.description = translate("The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources.")
|
||||
e.default = "1"
|
||||
e.rmempty = false
|
||||
|
||||
e = t:taboption("base", Value, "remark", translate("Service Remark Name"))
|
||||
e.description = translate("<font color=\"red\">Please ensure the remark name is unique.</font>")
|
||||
e.rmempty = false
|
||||
|
||||
return a
|
@ -1,22 +0,0 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[frp]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('frp_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>Frp <%:RUNNING%></font></b></em>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>Frp <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="frp_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
@ -1,335 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
msgid "Frp Client"
|
||||
msgstr "Frp 客户端"
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "Frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
|
||||
msgstr "Frp 是一个可用于内网穿透的高性能的反向代理应用。"
|
||||
|
||||
msgid "Basic Settings"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Other Settings"
|
||||
msgstr "其他设置"
|
||||
|
||||
msgid "Client Log"
|
||||
msgstr "日志"
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
msgid "Port"
|
||||
msgstr "端口"
|
||||
|
||||
msgid "Token"
|
||||
msgstr "令牌"
|
||||
|
||||
msgid "User"
|
||||
msgstr "用户名"
|
||||
|
||||
msgid "Commonly used to distinguish you with other clients."
|
||||
msgstr "通常用于区分你与其他客户端"
|
||||
|
||||
msgid "Time duration between server of frpc and frps mustn't exceed 15 minutes."
|
||||
msgstr "frpc服务器与frps之间的时间间隔不得超过15分钟"
|
||||
|
||||
msgid "Vhost HTTP Port"
|
||||
msgstr "HTTP 穿透服务端口"
|
||||
|
||||
msgid "Vhost HTTPS Port"
|
||||
msgstr "HTTPS 穿透服务端口"
|
||||
|
||||
msgid "Exit program when first login failed"
|
||||
msgstr "初始登录失败即退出程序"
|
||||
|
||||
msgid "TCP Stream Multiplexing"
|
||||
msgstr "TCP 端口复用"
|
||||
|
||||
msgid "decide if exit program when first login failed, otherwise continuous relogin to frps."
|
||||
msgstr "第一次登录失败就退出程序,否则将持续尝试登陆 Frp 服务器。"
|
||||
|
||||
msgid "Default is Ture. This feature in frps.ini and frpc.ini must be same."
|
||||
msgstr "该功能默认启用,该配置项在服务端和客户端必须保持一致。"
|
||||
|
||||
msgid "Use TLS Connection"
|
||||
msgstr "TLS 连接"
|
||||
|
||||
msgid "if tls_enable is true, frpc will connect frps by tls."
|
||||
msgstr "使用 TLS 协议与服务器连接(若连接服务器异常可以尝试开启)"
|
||||
|
||||
msgid "Custom TLS Protocol Encryption"
|
||||
msgstr "自定义TLS协议加密"
|
||||
|
||||
msgid "Frp supports traffic encryption between frpc and frps through the TLS protocol, and supports client or server unidirectional and bidirectional authentication."
|
||||
msgstr "frp 支持 frpc 和 frps 之间的流量通过 TLS 协议加密,并且支持客户端或服务端单向验证,双向验证等功能。"
|
||||
|
||||
msgid "Frps one-way verifies the identity of frpc."
|
||||
msgstr "frps 单向验证 frpc 身份。"
|
||||
|
||||
msgid "Client Certificate File"
|
||||
msgstr "TLS 客户端证书文件路径"
|
||||
|
||||
msgid "Client Key File"
|
||||
msgstr "TLS 客户端密钥文件路径"
|
||||
|
||||
msgid "Frpc one-way verifies the identity of frps."
|
||||
msgstr "frpc 单向验证 frps 身份。"
|
||||
|
||||
msgid "CA Certificate File"
|
||||
msgstr "TLS CA 证书路径"
|
||||
|
||||
msgid "Protocol Type"
|
||||
msgstr "协议类型"
|
||||
|
||||
msgid "Frp support kcp protocol since v0.12.0"
|
||||
msgstr "从 v0.12.0 版本开始,底层通信协议支持选择 kcp 协议加速。"
|
||||
|
||||
msgid "TCP Protocol"
|
||||
msgstr "TCP 协议"
|
||||
|
||||
msgid "KCP Protocol"
|
||||
msgstr "KCP 协议"
|
||||
|
||||
msgid "Connect frps by HTTP PROXY"
|
||||
msgstr "通过代理连接 frps"
|
||||
|
||||
msgid "frpc can connect frps using HTTP PROXY"
|
||||
msgstr "frpc 支持通过 HTTP PROXY 和 frps 进行通信"
|
||||
|
||||
msgid "HTTP PROXY"
|
||||
msgstr "HTTP 代理"
|
||||
|
||||
msgid "Enable Connection Pool"
|
||||
msgstr "启用连接池功能"
|
||||
|
||||
msgid "This feature is fit for a large number of short connections."
|
||||
msgstr "适合有大量短连接请求时开启"
|
||||
|
||||
msgid "Connection Pool"
|
||||
msgstr "指定预创建连接的数量"
|
||||
|
||||
msgid "Connections will be established in advance."
|
||||
msgstr "frpc 会预先和服务端建立起指定数量的连接。"
|
||||
|
||||
msgid "Service registration interval"
|
||||
msgstr "服务注册间隔"
|
||||
|
||||
msgid "0 means disable this feature, unit: min"
|
||||
msgstr "0表示禁用定时注册功能,单位:分钟"
|
||||
|
||||
msgid "Log Level"
|
||||
msgstr "日志记录等级"
|
||||
|
||||
msgid "Trace"
|
||||
msgstr "追踪"
|
||||
|
||||
msgid "Debug"
|
||||
msgstr "调试"
|
||||
|
||||
msgid "Info"
|
||||
msgstr "信息"
|
||||
|
||||
msgid "Warning"
|
||||
msgstr "警告"
|
||||
|
||||
msgid "Error"
|
||||
msgstr "错误"
|
||||
|
||||
msgid "Log Keepd Max Days"
|
||||
msgstr "日志记录天数"
|
||||
|
||||
msgid "Enable Web API"
|
||||
msgstr "开启网页管理"
|
||||
|
||||
msgid "set admin address for control frpc's action by http api such as reload."
|
||||
msgstr "可通过http查看客户端状态以及通过API控制"
|
||||
|
||||
msgid "Admin Web Port"
|
||||
msgstr "管理员端口号"
|
||||
|
||||
msgid "Admin Web UserName"
|
||||
msgstr "管理员用户名"
|
||||
|
||||
msgid "Admin Web PassWord"
|
||||
msgstr "管理员密码"
|
||||
|
||||
msgid "Services List"
|
||||
msgstr "服务列表"
|
||||
|
||||
msgid "Service Remark Name"
|
||||
msgstr "服务备注名"
|
||||
|
||||
msgid "Domain/Subdomain"
|
||||
msgstr "域名/子域名"
|
||||
|
||||
msgid "Remote Port"
|
||||
msgstr "远程主机端口"
|
||||
|
||||
msgid "Local Host Address"
|
||||
msgstr "内网主机地址"
|
||||
|
||||
msgid "Local Host Port"
|
||||
msgstr "内网主机端口"
|
||||
|
||||
msgid "Use Encryption"
|
||||
msgstr "开启数据加密"
|
||||
|
||||
msgid "Use Compression"
|
||||
msgstr "使用压缩"
|
||||
|
||||
msgid "Enable State"
|
||||
msgstr "开启状态"
|
||||
|
||||
msgid "Frp Domain Config"
|
||||
msgstr "Frp 域名配置"
|
||||
|
||||
msgid "Config Frp Protocol"
|
||||
msgstr "配置 Frp 协议参数"
|
||||
|
||||
msgid "Disable"
|
||||
msgstr "关闭"
|
||||
|
||||
msgid "Frp Protocol Type"
|
||||
msgstr "Frp 协议类型"
|
||||
|
||||
msgid "Domain Type"
|
||||
msgstr "域名类型"
|
||||
|
||||
msgid "Custom Domains"
|
||||
msgstr "自定义域名"
|
||||
|
||||
msgid "SubDomain"
|
||||
msgstr "子域名"
|
||||
|
||||
msgid "Both the above two Domain types"
|
||||
msgstr "同时使用2种域名"
|
||||
|
||||
msgid "If SubDomain is used, Custom Domains couldn't be subdomain or wildcard domain of the maindomain(subdomain_host)."
|
||||
msgstr "如果服务端配置了主域名(subdomain_host),则自定义域名不能是属于主域名(subdomain_host) 的子域名或者泛域名。"
|
||||
|
||||
msgid "subdomain_host must be configured in server: frps in advance."
|
||||
msgstr "使用子域名时,必须预先在服务端配置主域名(subdomain_host)参数。"
|
||||
|
||||
msgid "STCP Role"
|
||||
msgstr "STCP 服务类型"
|
||||
|
||||
msgid "SUDP Role"
|
||||
msgstr "SUDP 服务类型"
|
||||
|
||||
msgid "XTCP Role"
|
||||
msgstr "XTCP 服务类型"
|
||||
|
||||
msgid "Use Plugin"
|
||||
msgstr "使用插件"
|
||||
|
||||
msgid "If plugin is defined, local_ip and local_port is useless, plugin will handle connections got from frps."
|
||||
msgstr "使用插件使用插件模式时,本地 IP 地址和端口无需配置,插件将会处理来自服务端的链接请求。"
|
||||
|
||||
msgid "STCP Screct Key"
|
||||
msgstr "STCP 密钥"
|
||||
|
||||
msgid "STCP Server Name"
|
||||
msgstr "STCP 服务名称"
|
||||
|
||||
msgid "SUDP Screct Key"
|
||||
msgstr "SUDP 密钥"
|
||||
|
||||
msgid "SUDP Server Name"
|
||||
msgstr "SUDP 服务名称"
|
||||
|
||||
msgid "XTCP Screct Key"
|
||||
msgstr "XTCP 密钥"
|
||||
|
||||
msgid "XTCP Server Name"
|
||||
msgstr "XTCP 服务名称"
|
||||
|
||||
msgid "Enable URL routing"
|
||||
msgstr "启用 URL 路由"
|
||||
|
||||
msgid "Frp support forward http requests to different backward web services by url routing."
|
||||
msgstr "Frp 支持通过url路由将http请求转发到不同的反向web服务。"
|
||||
|
||||
msgid "Choose Plugin"
|
||||
msgstr "选择插件"
|
||||
|
||||
msgid "Proxy Authentication"
|
||||
msgstr "代理认证"
|
||||
|
||||
msgid "Other PCs could access the Internet through frpc's network by using http_proxy plugin."
|
||||
msgstr "http proxy 插件,可以使其他机器通过 frpc 的网络访问互联网;开启身份验证之后需要用户名、密码才能连接到 HTTP 代理。"
|
||||
|
||||
msgid "HTTP Proxy UserName"
|
||||
msgstr "HTTP 代理用户名"
|
||||
|
||||
msgid "HTTP Proxy Password"
|
||||
msgstr "HTTP 代理密码"
|
||||
|
||||
msgid "Plugin Unix Sock Path"
|
||||
msgstr "Unix Sock 插件路径"
|
||||
|
||||
msgid "Password protecting your web service"
|
||||
msgstr "密码保护您的web服务"
|
||||
|
||||
msgid "HTTP UserName"
|
||||
msgstr "HTTP 用户名"
|
||||
|
||||
msgid "HTTP PassWord"
|
||||
msgstr "HTTP 密码"
|
||||
|
||||
msgid "Rewriting the Host Header"
|
||||
msgstr "修改 Host Header"
|
||||
|
||||
msgid "Frp can rewrite http requests with a modified Host header."
|
||||
msgstr "Frp可以用修改后的主机头重写http请求。"
|
||||
|
||||
msgid "Proxy-Protocol Version"
|
||||
msgstr "Proxy-Protocol 版本"
|
||||
|
||||
msgid "Encrypted the communication between frpc and frps, will effectively prevent the traffic intercepted (If Custom TLS Protocol Encryption is enabled, except that the protocol of xtcp is configured as kcp, you can no longer set Use Encryption to repeat encryption)."
|
||||
msgstr "将 frpc 与 frps 之间的通信内容加密传输,将会有效防止流量被拦截(启用自定义TLS协议加密后除 xtcp 的 protocol 配置为 kcp 外,可不再设置此项重复加密)。"
|
||||
|
||||
msgid "The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources."
|
||||
msgstr "对传输内容进行压缩,加快流量转发速度,但是会额外消耗一些 cpu 资源。"
|
||||
|
||||
msgid "Http username and password are safety certification for http protocol."
|
||||
msgstr "Http用户名和密码是Http协议的安全认证。"
|
||||
|
||||
msgid "Proxy Protocol to send user's real IP to local services."
|
||||
msgstr "将用户的真实IP发送到本地服务的代理协议。"
|
||||
|
||||
msgid "STCP Server Name is Service Remark Name of STCP Server"
|
||||
msgstr "STCP服务器别名"
|
||||
|
||||
msgid "SUDP Server Name is Service Remark Name of SUDP Server"
|
||||
msgstr "SUDP服务器别名"
|
||||
|
||||
msgid "XTCP Server Name is Service Remark Name of XTCP Server"
|
||||
msgstr "XTCP服务器别名"
|
||||
|
||||
msgid "<font color=\"red\">Please ensure the remark name is unique.</font>"
|
||||
msgstr "<font color=\"red\">确保备注名唯一</font>"
|
||||
|
||||
msgid "Plugin_Local_Addr"
|
||||
msgstr "插件本地地址(格式 IP:Port)"
|
||||
|
||||
msgid "plugin_crt_path"
|
||||
msgstr "插件证书路径"
|
||||
|
||||
msgid "plugin_key_path"
|
||||
msgstr "插件私钥路径"
|
||||
|
||||
msgid "plugin_host_header_rewrite"
|
||||
msgstr "插件 Host Header 重写"
|
||||
|
||||
msgid "plugin_header_X-From-Where"
|
||||
msgstr "插件X-From-Where请求头"
|
@ -1,17 +0,0 @@
|
||||
|
||||
config frp 'common'
|
||||
option log_max_days '3'
|
||||
option login_fail_exit '0'
|
||||
option enable_cpool '0'
|
||||
option time '40'
|
||||
option tcp_mux '1'
|
||||
option enabled '0'
|
||||
option vhost_http_port '80'
|
||||
option vhost_https_port '443'
|
||||
option server_addr 'yourdomain.com'
|
||||
option server_port '7000'
|
||||
option token '1234567'
|
||||
option log_level 'info'
|
||||
option enable_http_proxy '0'
|
||||
option protocol 'tcp'
|
||||
option user ''
|
@ -1,268 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#Author: monokoo <realstones2012@gmail.com>
|
||||
#Thanks to FW867's help
|
||||
|
||||
START=99
|
||||
SERVICE_WRITE_PID=1
|
||||
SERVICE_DAEMONIZE=1
|
||||
|
||||
LOGFILE="/var/etc/frp/frpc.log"
|
||||
|
||||
echo_date(){
|
||||
local log=$1
|
||||
echo $(date +%Y/%m/%d\ %X): "$log" >> $LOGFILE
|
||||
}
|
||||
|
||||
Reduce_Log(){
|
||||
local log=$1
|
||||
[ ! -f "$log" ] && return
|
||||
local sc=200
|
||||
[ -n "$2" ] && sc=$2
|
||||
local count=$(grep -c "" $log)
|
||||
if [ $count -gt $sc ];then
|
||||
let count=count-$sc
|
||||
sed -i "1,$count d" $log
|
||||
fi
|
||||
}
|
||||
|
||||
conf_proxy_add() {
|
||||
|
||||
local cfg="$1"
|
||||
local tmpconf="$2"
|
||||
local enable type domain_type custom_domains remote_port local_ip local_port enable_http_auth enable_host_header_rewrite host_header_rewrite
|
||||
local subdomain proxy_protocol_version use_encryption use_compression http_user http_pwd remark locations
|
||||
local enable_plugin plugin plugin_http_user plugin_http_passwd plugin_unix_path stcp_role stcp_secretkey stcp_servername xtcp_role xtcp_secretkey xtcp_servername
|
||||
local enable_https_plugin https_plugin plugin_local_addr plugin_crt_path plugin_key_path plugin_host_header_rewrite plugin_header_X_From_Where
|
||||
|
||||
config_get_bool enable "$cfg" enable 1
|
||||
[ "$enable" -gt 0 ] || return 1
|
||||
|
||||
config_get type "$cfg" type
|
||||
config_get custom_domains "$cfg" custom_domains
|
||||
config_get subdomain "$cfg" subdomain
|
||||
config_get remote_port "$cfg" remote_port
|
||||
config_get local_ip "$cfg" local_ip
|
||||
config_get local_port "$cfg" local_port
|
||||
config_get locations "$cfg" locations
|
||||
config_get host_header_rewrite "$cfg" host_header_rewrite
|
||||
config_get http_user "$cfg" http_user
|
||||
config_get http_pwd "$cfg" http_pwd
|
||||
config_get remark "$cfg" remark
|
||||
config_get plugin "$cfg" plugin
|
||||
config_get plugin_http_user "$cfg" plugin_http_user
|
||||
config_get plugin_http_passwd "$cfg" plugin_http_passwd
|
||||
config_get plugin_unix_path "$cfg" plugin_unix_path
|
||||
config_get stcp_role "$cfg" stcp_role
|
||||
config_get stcp_secretkey "$cfg" stcp_secretkey
|
||||
config_get stcp_servername "$cfg" stcp_servername
|
||||
config_get xtcp_role "$cfg" xtcp_role
|
||||
config_get xtcp_secretkey "$cfg" xtcp_secretkey
|
||||
config_get xtcp_servername "$cfg" xtcp_servername
|
||||
config_get proxy_protocol_version "$cfg" proxy_protocol_version
|
||||
config_get https_plugin "$cfg" https_plugin
|
||||
config_get plugin_local_addr "$cfg" plugin_local_addr
|
||||
config_get plugin_crt_path "$cfg" plugin_crt_path
|
||||
config_get plugin_key_path "$cfg" plugin_key_path
|
||||
config_get plugin_host_header_rewrite "$cfg" plugin_host_header_rewrite
|
||||
config_get plugin_header_X_From_Where "$cfg" plugin_header_X_From_Where
|
||||
|
||||
|
||||
[ -n "$remark" ] && [ -n "$type" ] || return 1
|
||||
|
||||
echo "" >>$tmpconf
|
||||
echo "[$remark]" >>$tmpconf
|
||||
echo "type=$type" >>$tmpconf
|
||||
[ -n "$custom_domains" ] && echo "custom_domains=$custom_domains" >>$tmpconf
|
||||
[ -n "$subdomain" ] && echo "subdomain=$subdomain" >>$tmpconf
|
||||
[ -n "$remote_port" ] && echo "remote_port=$remote_port" >>$tmpconf
|
||||
[ -z "$stcp_role" ] && [ -z "$xtcp_role" ] && [ -n "$local_ip" ] && echo "local_ip=$local_ip" >>$tmpconf
|
||||
[ -z "$stcp_role" ] && [ -z "$xtcp_role" ] && [ -n "$local_port" ] && echo "local_port=$local_port" >>$tmpconf
|
||||
[ -n "$locations" ] && echo "locations=$locations" >>$tmpconf
|
||||
[ -n "$http_user" -a -n "$http_pwd" ] && {
|
||||
echo "http_user=$http_user" >>$tmpconf
|
||||
echo "http_pwd=$http_pwd" >>$tmpconf
|
||||
}
|
||||
[ -n "$host_header_rewrite" ] && echo "host_header_rewrite=$host_header_rewrite" >>$tmpconf
|
||||
[ -n "$plugin" ] && echo "plugin=$plugin" >>$tmpconf
|
||||
[ -n "$plugin_http_user" -a -n "$plugin_http_passwd" ] && {
|
||||
echo "plugin_http_user=$plugin_http_user" >>$tmpconf
|
||||
echo "plugin_http_passwd=$plugin_http_passwd" >>$tmpconf
|
||||
}
|
||||
[ -n "$plugin_unix_path" ] && echo "plugin_unix_path=$plugin_unix_path" >>$tmpconf
|
||||
|
||||
[ -n "$stcp_role" ] && {
|
||||
if [ "$stcp_role" == "visitor" ]; then
|
||||
echo "role=$stcp_role" >>$tmpconf
|
||||
[ -n "$local_ip" ] && echo "bind_addr=$local_ip" >>$tmpconf
|
||||
[ -n "$local_port" ] && echo "bind_port=$local_port" >>$tmpconf
|
||||
[ -n "$stcp_servername" ] && echo "server_name=$stcp_servername" >>$tmpconf || return 1
|
||||
else
|
||||
[ -n "$local_ip" ] && echo "local_ip=$local_ip" >>$tmpconf
|
||||
[ -n "$local_port" ] && echo "local_port=$local_port" >>$tmpconf
|
||||
fi
|
||||
[ -n "$stcp_secretkey" ] && echo "sk=$stcp_secretkey" >>$tmpconf || return 1
|
||||
}
|
||||
|
||||
[ -n "$xtcp_role" ] && {
|
||||
if [ "$xtcp_role" == "visitor" ]; then
|
||||
echo "role=$xtcp_role" >>$tmpconf
|
||||
[ -n "$local_ip" ] && echo "bind_addr=$local_ip" >>$tmpconf
|
||||
[ -n "$local_port" ] && echo "bind_port=$local_port" >>$tmpconf
|
||||
[ -n "$xtcp_servername" ] && echo "server_name=$xtcp_servername" >>$tmpconf || return 1
|
||||
else
|
||||
[ -n "$local_ip" ] && echo "local_ip=$local_ip" >>$tmpconf
|
||||
[ -n "$local_port" ] && echo "local_port=$local_port" >>$tmpconf
|
||||
fi
|
||||
[ -n "$xtcp_secretkey" ] && echo "sk=$xtcp_secretkey" >>$tmpconf || return 1
|
||||
}
|
||||
|
||||
[ -n "$proxy_protocol_version" ] && {
|
||||
if [ "$proxy_protocol_version" != "disable" ]; then
|
||||
echo "proxy_protocol_version=$proxy_protocol_version" >>$tmpconf
|
||||
fi
|
||||
}
|
||||
|
||||
[ -n "$https_plugin" ] && echo "plugin=$https_plugin" >>$tmpconf
|
||||
[ -n "$plugin_local_addr" ] && echo "plugin_local_addr=$plugin_local_addr" >>$tmpconf
|
||||
[ -n "$plugin_crt_path" -a -n "$plugin_key_path" ] && {
|
||||
echo "plugin_crt_path=$plugin_crt_path" >>$tmpconf
|
||||
echo "plugin_key_path=$plugin_key_path" >>$tmpconf
|
||||
}
|
||||
[ -n "$plugin_host_header_rewrite" ] && echo "plugin_host_header_rewrite=$plugin_host_header_rewrite" >>$tmpconf
|
||||
[ -n "$plugin_header_X_From_Where" ] && echo "plugin_header_X_From_Where=$plugin_header_X_From_Where" >>$tmpconf
|
||||
|
||||
frp_write_bool use_encryption $cfg 1
|
||||
frp_write_bool use_compression $cfg 1
|
||||
|
||||
}
|
||||
|
||||
frp_write_bool() {
|
||||
local opt="$1"
|
||||
local config="$2"
|
||||
local def="$3"
|
||||
local val
|
||||
|
||||
config_get_bool val $config "$opt" "$def"
|
||||
if [ "$val" -eq 0 ]; then
|
||||
echo "${opt}=false" >> $tmpconf
|
||||
else
|
||||
echo "${opt}=true" >> $tmpconf
|
||||
fi
|
||||
}
|
||||
|
||||
frp_add_cru(){
|
||||
time=$1
|
||||
if [ ! -f "/etc/crontabs/root" ] || [ -z "$(cat /etc/crontabs/root | grep frp)" ]; then
|
||||
sed -i '/frp/d' /etc/crontabs/root >/dev/null 2>&1
|
||||
echo "*/$time * * * * /etc/init.d/frp restart" >> /etc/crontabs/root
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
frp_del_cru(){
|
||||
if [ ! -f "/etc/crontabs/root" ] || [ -n "$(cat /etc/crontabs/root | grep frp)" ]; then
|
||||
sed -i '/frp/d' /etc/crontabs/root >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
download_binary(){
|
||||
echo_date "开始下载frpc二进制文件..."
|
||||
/usr/bin/wget --no-check-certificate --timeout=10 --tries=1 -o $LOGFILE https://github.com/fatedier/frp/releases/download/v0.13.0/frp_0.13.0_linux_arm.tar.gz -O /tmp/frp_0.13.0_linux_arm.tar.gz
|
||||
[ ! -s "/tmp/frp_0.13.0_linux_arm.tar.gz" ] && /usr/bin/wget -q --no-check-certificate --timeout=10 --tries=1 https://any.mokoo.xyz/app/frp_0.13.0_linux_arm.tar.gz -O /tmp/frp_0.13.0_linux_arm.tar.gz
|
||||
[ -f "/tmp/frp_0.13.0_linux_arm.tar.gz" ] && tar -xf /tmp/frp_0.13.0_linux_arm.tar.gz -C /tmp && \
|
||||
mv /tmp/frp_0.13.0_linux_arm/frpc /usr/bin/frpc
|
||||
rm -rf /tmp/frp_0.13.0_linux_arm*
|
||||
if [ -f "/usr/bin/frpc" ]; then
|
||||
chmod +x /usr/bin/frpc && echo_date "成功下载frpc二进制文件"
|
||||
else
|
||||
echo_date "下载frpc二进制文件失败,请重试!"
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
sleep 10s
|
||||
start
|
||||
}
|
||||
|
||||
start() {
|
||||
|
||||
config_load "frp"
|
||||
local enabled server_addr server_port time privilege_token user tcp_mux enable_cpool tls_enable
|
||||
local pool_count log_level log_max_days login_fail_exit http_proxy protocol admin_port admin_user admin_pwd
|
||||
local tls_cert_file tls_key_file tls_trusted_ca_file
|
||||
|
||||
config_get_bool enabled common enabled 1
|
||||
|
||||
[ "$enabled" -gt 0 ] || return 1
|
||||
|
||||
config_get server_addr common server_addr
|
||||
config_get server_port common server_port
|
||||
config_get token common token
|
||||
config_get user common user
|
||||
config_get enable_cpool common enable_cpool
|
||||
config_get pool_count common pool_count
|
||||
config_get log_level common log_level
|
||||
config_get log_max_days common log_max_days
|
||||
config_get http_proxy common http_proxy
|
||||
config_get protocol common protocol
|
||||
config_get time common time
|
||||
config_get admin_port common admin_port
|
||||
config_get admin_user common admin_user
|
||||
config_get admin_pwd common admin_pwd
|
||||
config_get tls_cert_file common tls_cert_file
|
||||
config_get tls_key_file common tls_key_file
|
||||
config_get tls_trusted_ca_file common tls_trusted_ca_file
|
||||
|
||||
|
||||
mkdir -p /var/etc/frp
|
||||
[ ! -f "$LOGFILE" ] && touch $LOGFILE
|
||||
|
||||
[ ! -f "/usr/bin/frpc" ] && download_binary
|
||||
[ ! -f "/usr/bin/frpc" ] && logger -t Frp 'Download frpc failed, please retry.' && exit 0
|
||||
|
||||
local tmpconf="/var/etc/frp/frpc.conf"
|
||||
|
||||
echo "[common]" >$tmpconf
|
||||
echo "server_addr=${server_addr}" >>$tmpconf
|
||||
echo "server_port=${server_port}" >>$tmpconf
|
||||
echo "token=${token}" >>$tmpconf
|
||||
[ -n "$user" ] && echo "user=$user" >>$tmpconf
|
||||
echo "log_level=${log_level}" >>$tmpconf
|
||||
echo "log_max_days=${log_max_days}" >>$tmpconf
|
||||
echo "protocol=${protocol}" >>$tmpconf
|
||||
echo "log_file=$LOGFILE" >>$tmpconf
|
||||
[ -n "$http_proxy" ] && echo "http_proxy=$http_proxy" >>$tmpconf
|
||||
[ -n "$pool_count" ] && echo "pool_count=$pool_count" >>$tmpconf
|
||||
[ -n "$admin_port" ] && echo "admin_addr=0.0.0.0" >>$tmpconf && echo "admin_port=$admin_port" >>$tmpconf
|
||||
[ -n "$admin_user" ] && echo "admin_user=$admin_user" >>$tmpconf
|
||||
[ -n "$admin_pwd" ] && echo "admin_pwd=$admin_pwd" >>$tmpconf
|
||||
[[ -n "$tls_cert_file" && -n "$tls_key_file" ]] && echo "tls_cert_file=$tls_cert_file" >>$tmpconf && echo "tls_key_file=$tls_key_file" >>$tmpconf
|
||||
[ -n "$tls_trusted_ca_file" ] && echo "tls_trusted_ca_file=$tls_trusted_ca_file" >>$tmpconf
|
||||
|
||||
|
||||
config_load "frp"
|
||||
frp_write_bool tcp_mux common 1
|
||||
frp_write_bool tls_enable common 0
|
||||
frp_write_bool login_fail_exit common 1
|
||||
config_foreach conf_proxy_add proxy "$tmpconf"
|
||||
|
||||
[ "$(cat "$tmpconf" | grep -c "type=")" -gt 0 ] || (echo_date "frp服务启动失败,请首先添加服务列表!" && exit 0)
|
||||
logger -t FRPC 'Starting frp service'
|
||||
SERVICE_DAEMONIZE=1 \
|
||||
service_start /usr/bin/frpc -c $tmpconf
|
||||
|
||||
[ "$time" -gt 0 ] && frp_add_cru $time
|
||||
[ -z "$(pgrep /usr/bin/frpc)" ] && echo_date "frp服务启动失败,请检查服务端 “TCP多路复用(tcp_mux)”设置,确保与客户端完全一致!"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
stop() {
|
||||
frp_del_cru
|
||||
if [ -n "`pidof frpc`" ]; then
|
||||
logger -t FRPC 'Shutting down frp service'
|
||||
service_stop /usr/bin/frpc
|
||||
Reduce_Log $LOGFILE
|
||||
fi
|
||||
return 0
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@frp[-1]
|
||||
add ucitrack frp
|
||||
set ucitrack.@frp[-1].init=frp
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-frpc": {
|
||||
"description": "Grant UCI access for luci-app-frpc",
|
||||
"read": {
|
||||
"uci": [ "frp" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "frp" ]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
#
|
||||
# Copyright 2020 lwz322 <lwz322@qq.com>
|
||||
# Licensed to the public under the MIT License.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-frpserver
|
||||
PKG_VERSION:=0.0.2
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_MAINTAINER:=lwz322 <lwz322@qq.com>
|
||||
|
||||
LUCI_TITLE:=LuCI support for Frp Server
|
||||
LUCI_DEPENDS:=+wget +frps
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/frps
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
@ -1,24 +0,0 @@
|
||||
-- Copyright 2020 lwz322 <lwz322@qq.com>
|
||||
-- Licensed to the public under the MIT License.
|
||||
|
||||
module("luci.controller.frps", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/frps") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "frps"}, alias("admin", "services", "frps", "common"), _("Frp Server"), 99).dependent = true
|
||||
entry({"admin", "services", "frps", "common"}, cbi("frps/common"), _("Settings"), 1).leaf = true
|
||||
entry({"admin", "services", "frps", "server"}, cbi("frps/server"), _("Server"), 2).leaf = true
|
||||
entry({"admin", "services", "frps", "status"}, call("action_status")).leaf = true
|
||||
end
|
||||
|
||||
|
||||
function action_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pidof frps >/dev/null") == 0
|
||||
e.bin_version = luci.sys.exec("frps -v")
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
@ -1,93 +0,0 @@
|
||||
-- Copyright 2020 lwz322 <lwz322@qq.com>
|
||||
-- Licensed to the public under the MIT License.
|
||||
|
||||
local m, s, o
|
||||
|
||||
m = Map("frps")
|
||||
m.title = translate("Frps - Common Settings")
|
||||
m.description = translate("Frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.<br/><a href=\"https://github.com/fatedier/frp\" target=\"_blank\">Project GitHub URL</a>")
|
||||
|
||||
m:section(SimpleSection).template = "frps/frps_status"
|
||||
|
||||
s = m:section(NamedSection, "main", "frps")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
s:tab("general", translate("General Options"))
|
||||
s:tab("advanced", translate("Advanced Options"))
|
||||
s:tab("dashboard", translate("Dashboard Options"))
|
||||
|
||||
o = s:taboption("general", Flag, "enabled", translate("Enabled"))
|
||||
|
||||
o = s:taboption("general", Value, "client_file", translate("Client file"))
|
||||
o.default = "/usr/bin/frps"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:taboption("general", ListValue, "run_user", translate("Run daemon as user"))
|
||||
o:value("", translate("root"))
|
||||
local user
|
||||
for user in luci.util.execi("cat /etc/passwd | cut -d':' -f1") do
|
||||
o:value(user)
|
||||
end
|
||||
|
||||
o = s:taboption("general", Flag, "enable_logging", translate("Enable logging"))
|
||||
|
||||
o = s:taboption("general", Value, "log_file", translate("Log file"))
|
||||
o:depends("enable_logging", "1")
|
||||
o.default = "/var/log/frps.log"
|
||||
|
||||
o = s:taboption("general", ListValue, "log_level", translate("Log level"))
|
||||
o:depends("enable_logging", "1")
|
||||
o:value("trace", translate("Trace"))
|
||||
o:value("debug", translate("Debug"))
|
||||
o:value("info", translate("Info"))
|
||||
o:value("warn", translate("Warning"))
|
||||
o:value("error", translate("Error"))
|
||||
o.default = "Warn"
|
||||
|
||||
o = s:taboption("general", ListValue, "log_max_days", translate("Log max days"))
|
||||
o.description = translate("Maximum number of days to keep log files is 3 day.")
|
||||
o:depends("enable_logging", "1")
|
||||
o.datatype = "uinteger"
|
||||
o:value("1", translate("1"))
|
||||
o:value("2", translate("2"))
|
||||
o:value("3", translate("3"))
|
||||
o.default = "3"
|
||||
o.optional = false
|
||||
|
||||
o = s:taboption("general", Flag, "disable_log_color", translate("Disable log color"))
|
||||
o:depends("enable_logging", "1")
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
|
||||
o = s:taboption("advanced", Value, "max_pool_count", translate("Max pool count"))
|
||||
o.description = translate("pool_count in each proxy will change to max_pool_count if they exceed the maximum value")
|
||||
o.datatype = "uinteger"
|
||||
|
||||
o = s:taboption("advanced", Value, "max_ports_per_client", translate("Max ports per-client"))
|
||||
o.description = translate("max ports can be used for each client, default value is 0 means no limit")
|
||||
o.datatype = "uinteger"
|
||||
o.defalut = '0'
|
||||
o.placeholder = '0'
|
||||
|
||||
o = s:taboption("advanced", Value, "subdomain_host", translate("Subdomain host"))
|
||||
o.description = translatef("if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file; when subdomain is test, the host used by routing is test.frps.com")
|
||||
o.datatype = "host"
|
||||
|
||||
o = s:taboption("dashboard", Value, "dashboard_addr", translate("Dashboard addr"))
|
||||
o.description = translatef("dashboard addr's default value is same with bind_addr")
|
||||
o.default = "0.0.0.0"
|
||||
o.datatype = "host"
|
||||
|
||||
o = s:taboption("dashboard", Value, "dashboard_port", translate("Dashboard port"))
|
||||
o.description = translatef("dashboard is available only if dashboard_port is set")
|
||||
o.default = "7500"
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:taboption("dashboard", Value, "dashboard_user", translate("Dashboard user"))
|
||||
o.description = translatef("dashboard user and passwd for basic auth protect, if not set, both default value is admin")
|
||||
|
||||
o = s:taboption("dashboard", Value, "dashboard_pwd", translate("Dashboard password"))
|
||||
o.password = true
|
||||
|
||||
return m
|
@ -1,58 +0,0 @@
|
||||
-- Copyright 2020 lwz322 <lwz322@qq.com>
|
||||
-- Licensed to the public under the MIT License.
|
||||
|
||||
local m, s, o
|
||||
|
||||
m = Map("frps")
|
||||
m.title = translate("Frps - Server Settings")
|
||||
m.description = translate("FRPS Server Settings")
|
||||
|
||||
s = m:section(NamedSection, "main", "frps")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(Value, "bind_port", translate("Bind port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "token", translate("Token"))
|
||||
o.password = true
|
||||
|
||||
o = s:option(Flag, "tcp_mux", translate("TCP mux"))
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.defalut = o.enabled
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "tls_only", translate("Enforce frps only accept TLS connection"))
|
||||
o.description = translatef("Requirements: frpc v0.25.0+, frps v0.32.0+")
|
||||
o.enabled = "true"
|
||||
o.disabled = "false"
|
||||
o.default = o.disabled
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "bind_udp_port", translate("UDP bind port"))
|
||||
o.description = translatef("Optional: udp port to help make udp hole to penetrate nat")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "kcp_bind_port", translate("KCP bind port"))
|
||||
o.description = translatef("Optional: udp port used for kcp protocol, it can be same with 'bind port'; if not set, kcp is disabled in frps")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "quic_bind_port", translate("Quic bind port"))
|
||||
o.description = translatef("Optional: udp port used for quic protocol, it can be same with 'bind port'; if not set, quic is disabled in frps")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "vhost_http_port", translate("vhost http port"))
|
||||
o.description = translatef("Optional: if you want to support virtual host, you must set the http port for listening")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(Value, "vhost_https_port", translate("vhost https port"))
|
||||
o.description = translatef("Optional: Note: http port and https port can be same with bind_port")
|
||||
o.datatype = "port"
|
||||
|
||||
o = s:option(DynamicList, "extra_setting", translate("Extra Settings"))
|
||||
o.description = translatef("List of extra settings will be added to config file. Format: option=value, eg. <code>detailed_errors_to_client=false</code>.(NO SPACE!)")
|
||||
o.placeholder = "option=value"
|
||||
|
||||
return m
|
@ -1,26 +0,0 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[frps]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('frps_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
tb.innerHTML = '<em><b><font color=green> <%:Frps%>' + data.bin_version + '<%:RUNNING%></font></b></em><input class="btn cbi-button mar-10" type="button" value="<%:Open Frps page%>" onclick="openwebui();" />';
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red> <%:Frps%>' + data.bin_version + '<%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function openwebui(){
|
||||
var url = window.location.host+":<%=luci.sys.exec("uci -q get frps.main.dashboard_port"):gsub("^%s*(.-)%s*$", "%1")%>";
|
||||
window.open('http://'+url,'target','');
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="frps_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
@ -1,264 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:54
|
||||
# msgid "-- default --"
|
||||
# msgstr "-- 默认 --"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:44
|
||||
msgid "Advanced Options"
|
||||
msgstr "高级选项"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:14
|
||||
msgid "Bind port"
|
||||
msgstr "绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:22
|
||||
msgid "Client file"
|
||||
msgstr "客户端文件"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:7
|
||||
msgid "Frps - Common Settings"
|
||||
msgstr "Frps - 通用设置"
|
||||
|
||||
msgid "Frp Server"
|
||||
msgstr "Frp 服务器"
|
||||
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:18
|
||||
msgid "Dashboard Options"
|
||||
msgstr "面板选项"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:78
|
||||
msgid "Dashboard addr"
|
||||
msgstr "面板绑定地址"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:91
|
||||
msgid "Dashboard password"
|
||||
msgstr "面板登录密码"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:83
|
||||
msgid "Dashboard port"
|
||||
msgstr "面板绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:88
|
||||
msgid "Dashboard user"
|
||||
msgstr "面板登录用户名"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:69
|
||||
# msgid "Debug"
|
||||
# msgstr "调试"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:80
|
||||
msgid "Disable log color"
|
||||
msgstr "禁用日志颜色"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:60
|
||||
msgid "Enable logging"
|
||||
msgstr "启用日志"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:47
|
||||
msgid "Enabled"
|
||||
msgstr "已启用"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:72
|
||||
msgid "Error"
|
||||
msgstr "错误"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:8
|
||||
msgid "Frps - Server Settings"
|
||||
msgstr "Frps - 服务器设定"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:8
|
||||
msgid "FRPS Server Settings"
|
||||
msgstr "Frps 服务器设定"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:32
|
||||
msgid "Frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.<br/><a href=\"https://github.com/fatedier/frp\" target=\"_blank\">Project GitHub URL</a>"
|
||||
msgstr "Frp 是一个可用于内网穿透的高性能的反向代理应用。<br/><a href=\"https://github.com/fatedier/frp\" target=\"_blank\">Github 项目地址</a>"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:43
|
||||
msgid "General Options"
|
||||
msgstr "常规选项"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:70
|
||||
msgid "Info"
|
||||
msgstr "信息"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:31
|
||||
msgid "KCP bind port"
|
||||
msgstr "KCP绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:31
|
||||
msgid "Quic bind port"
|
||||
msgstr "QUIC绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:62
|
||||
msgid "Log file"
|
||||
msgstr "日志文件"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:66
|
||||
msgid "Log level"
|
||||
msgstr "日志等级"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:48
|
||||
msgid "Log max days"
|
||||
msgstr "日志保存天数"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:49
|
||||
msgid "Maximum number of days to keep log files is 3 day."
|
||||
msgstr "保留日志文件的最大天数为 3 天。"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:85
|
||||
msgid "Max pool count"
|
||||
msgstr "最大连接数"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:89
|
||||
msgid "Max ports per-client"
|
||||
msgstr "单客户端最大端口映射数"
|
||||
|
||||
#: luasrc/view/frps/status_header.htm:26
|
||||
msgid "Not Running"
|
||||
msgstr "服务未运行"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:40
|
||||
msgid "Optional: Note: http port and https port can be same with bind_port"
|
||||
msgstr "(可选)提示:http/https端口可以和绑定端口设定为一致"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:36
|
||||
msgid ""
|
||||
"Optional: if you want to support virtual host, you must set the http port "
|
||||
"for listening"
|
||||
msgstr "(可选)如果您希望支持虚拟主机,则必须设定http端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:28
|
||||
msgid "Optional: udp port to help make udp hole to penetrate nat"
|
||||
msgstr "(可选)设定UDP端口以帮助UDP协议穿透NAT"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:32
|
||||
msgid ""
|
||||
"Optional: udp port used for kcp protocol, it can be same with 'bind port'; "
|
||||
"if not set, kcp is disabled in frps"
|
||||
msgstr "(可选)UDP端口用于KCP协议,可与绑定端口设定为一致;留空以禁用KCP"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:32
|
||||
msgid ""
|
||||
"Optional: udp port used for quic protocol, it can be same with 'bind port'; "
|
||||
"if not set, quic is disabled in frps"
|
||||
msgstr "(可选)UDP端口用于quic协议,可与绑定端口设定为一致;留空以禁用quic"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:53
|
||||
msgid "Run daemon as user"
|
||||
msgstr "以用户身份运行"
|
||||
|
||||
#: luasrc/controller/frps.lua:22
|
||||
msgid "Server"
|
||||
msgstr "服务端"
|
||||
|
||||
#: luasrc/controller/frps.lua:19
|
||||
msgid "Settings"
|
||||
msgstr "设置"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:95
|
||||
msgid "Subdomain host"
|
||||
msgstr "子域名"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:21
|
||||
msgid "TCP mux"
|
||||
msgstr "TCP 复用"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:27
|
||||
msgid "Enforce frps only accept TLS connection"
|
||||
msgstr "强制frps只接受TLS连接"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:28
|
||||
msgid "Requirements: frpc v0.25.0+, frps v0.32.0+"
|
||||
msgstr "要求:frpc版本0.25.0+, frps版本0.32.0+"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:18
|
||||
msgid "Token"
|
||||
msgstr "令牌"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:68
|
||||
msgid "Trace"
|
||||
msgstr "追踪"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:27
|
||||
msgid "UDP bind port"
|
||||
msgstr "UDP绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:71
|
||||
msgid "Log level"
|
||||
msgstr "日志等级"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:41
|
||||
msgid "Trace"
|
||||
msgstr "追踪"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:42
|
||||
msgid "Debug"
|
||||
msgstr "调试"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:43
|
||||
msgid "Info"
|
||||
msgstr "信息"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:44
|
||||
msgid "Warning"
|
||||
msgstr "警告"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:45
|
||||
msgid "Error"
|
||||
msgstr "错误"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:99
|
||||
msgid "dashboard addr's default value is same with bind_addr"
|
||||
msgstr "面板地址默认和绑定地址一致"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:102
|
||||
msgid "dashboard is available only if dashboard_port is set"
|
||||
msgstr "仅在设定面板绑定端口后才可使用面板功能"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:105
|
||||
msgid ""
|
||||
"dashboard user and passwd for basic auth protect, if not set, both default "
|
||||
"value is admin"
|
||||
msgstr "面板用户名/密码用于基本安全认证;若留空,则用户名/密码均为admin"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:96
|
||||
msgid ""
|
||||
"if subdomain_host is not empty, you can set subdomain when type is http or "
|
||||
"https in frpc's configure file; when subdomain is test, the host used by "
|
||||
"routing is test.frps.com"
|
||||
msgstr "如果subdomain_host不为空,可以在frpc配置文件中设置类型为http(s)的subdomain;subdomain为test,路由将使用test.frps.com"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:90
|
||||
msgid ""
|
||||
"max ports can be used for each client, default value is 0 means no limit"
|
||||
msgstr "每个客户端最多可映射端口数,留空则默认为0(不限制)"
|
||||
|
||||
#: luasrc/model/cbi/frps/common.lua:86
|
||||
msgid ""
|
||||
"pool_count in each proxy will change to max_pool_count if they exceed the "
|
||||
"maximum value"
|
||||
msgstr "代理连接数(pool_count)超过最大值时将变更为最大连接数(max_pool_count)"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:35
|
||||
msgid "vhost http port"
|
||||
msgstr "虚拟主机http绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:39
|
||||
msgid "vhost https port"
|
||||
msgstr "虚拟主机https绑定端口"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:50
|
||||
msgid "Extra Settings"
|
||||
msgstr "额外设置"
|
||||
|
||||
#: luasrc/model/cbi/frps/server.lua:51
|
||||
msgid "List of extra settings will be added to config file. Format: option=value, eg. <code>detailed_errors_to_client=false</code>.(NO SPACE!)"
|
||||
msgstr "额外设置列表将会被添加到config文件中。 格式:option=value,如:<code>detailed_errors_to_client=false</code>.(不含空格!)"
|
||||
|
||||
#: luasrc/view/frps/frps_status.htm:7
|
||||
msgid "Open Frps page"
|
||||
msgstr "打开 Frps 管理面板"
|
@ -1,8 +0,0 @@
|
||||
config frps 'main'
|
||||
option enabled '0'
|
||||
option server 'frps'
|
||||
option dashboard_addr '0.0.0.0'
|
||||
option client_file '/usr/bin/frps'
|
||||
option bind_port '7000'
|
||||
option dashboard_port '7500'
|
||||
option tcp_mux 'true'
|
@ -1,198 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright 2020 lwz322 <lwz322@qq.com>
|
||||
# Licensed to the public under the MIT License.
|
||||
#
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
NAME="frps"
|
||||
CONFIG_FOLDER="/var/etc/$NAME"
|
||||
|
||||
_log() {
|
||||
local level="$1" ; shift
|
||||
local msg="$@"
|
||||
logger -p "daemon.$level" -t "$NAME" "$msg"
|
||||
|
||||
echo "[$level] $msg" >&2
|
||||
}
|
||||
|
||||
_info() {
|
||||
_log "info" $@
|
||||
}
|
||||
|
||||
_err() {
|
||||
_log "err" $@
|
||||
}
|
||||
|
||||
append_options() {
|
||||
local file="$1" ; shift
|
||||
local o v
|
||||
for o in "$@" ; do
|
||||
v="$(eval echo "\$$o")"
|
||||
if [ -n "$v" ] ; then
|
||||
# add brackets when ipv6 address
|
||||
if ( echo "$o" | grep -qE 'addr|ip' ) &&
|
||||
( echo "$v" | grep -q ':' ) ; then
|
||||
v="[$v]"
|
||||
fi
|
||||
|
||||
echo "${o} = $v" >>"$file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
append_setting() {
|
||||
local file="$1" ; shift
|
||||
local s="$1"
|
||||
if [ -n "$s" ] ; then
|
||||
echo "$s" >>"$file"
|
||||
fi
|
||||
}
|
||||
|
||||
frps_scetion_validate() {
|
||||
uci_validate_section "$NAME" "frps" "$1" \
|
||||
'enabled:bool:0' \
|
||||
'client_file:file:/usr/bin/frps' \
|
||||
'run_user:string' \
|
||||
'enable_logging:bool:0' \
|
||||
'log_file:string:/var/log/frps.log' \
|
||||
'log_level:or("trace", "debug", "info", "warn", "error"):warn' \
|
||||
'log_max_days:uinteger:3' \
|
||||
'disable_log_color:or("true", "false")' \
|
||||
'max_pool_count:uinteger' \
|
||||
'max_ports_per_client:uinteger:0' \
|
||||
'subdomain_host:host' \
|
||||
'dashboard_addr:host' \
|
||||
'dashboard_port:port' \
|
||||
'dashboard_user:string' \
|
||||
'dashboard_pwd:string' \
|
||||
'bind_port:port' \
|
||||
'token:string' \
|
||||
'tcp_mux:or("true", "false"):true' \
|
||||
'tls_only:or("true", "false"):false' \
|
||||
'bind_udp_port:port' \
|
||||
'kcp_bind_port:port' \
|
||||
'quic_bind_port:port' \
|
||||
'vhost_http_port:port' \
|
||||
'vhost_https_port:port'
|
||||
}
|
||||
|
||||
client_file_validate() {
|
||||
local file="$1"
|
||||
|
||||
test -f "$file" || return 1
|
||||
test -x "$file" || chmod 755 "$file"
|
||||
|
||||
eval "$file" -h | grep -q "$NAME"
|
||||
return $?
|
||||
}
|
||||
|
||||
add_rule_extra_option() {
|
||||
append_setting "$2" "$1"
|
||||
}
|
||||
|
||||
create_config_file() {
|
||||
local config_file="$1"
|
||||
local tmp_file="$(mktemp /tmp/frps-XXXXXX)"
|
||||
|
||||
echo "[common]" > "$tmp_file"
|
||||
|
||||
append_options "$tmp_file" \
|
||||
"bind_port" "token" "tcp_mux" "tls_only" "bind_udp_port" "kcp_bind_port" "quic_bind_port" "vhost_http_port" "vhost_https_port"
|
||||
|
||||
|
||||
if [ "x$enable_logging" = "x1" ] ; then
|
||||
if [ -z "$log_file" ]; then
|
||||
log_file="/var/log/frps.log"
|
||||
fi
|
||||
|
||||
append_options "$tmp_file" \
|
||||
"log_file" "log_level" "log_max_days" "disable_log_color"
|
||||
|
||||
if [ -f "$log_file" ] ; then
|
||||
echo > "$log_file"
|
||||
else
|
||||
local log_folder="$(dirname "$log_file")"
|
||||
|
||||
if [ ! -d "$log_folder" ] ; then
|
||||
mkdir -p "$log_folder"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$run_user" ] && ( user_exists "$run_user" ) ; then
|
||||
chmod 644 "$log_file"
|
||||
chown "$run_user" "$log_file"
|
||||
else
|
||||
run_user=""
|
||||
fi
|
||||
fi
|
||||
|
||||
append_options "$tmp_file" \
|
||||
"max_pool_count" "max_ports_per_client" "subdomain_host" "dashboard_addr" "dashboard_port" "dashboard_user" "dashboard_pwd"
|
||||
|
||||
extra_setting=$(uci get frps.main.extra_setting 2>/dev/null)
|
||||
if [ -n "$extra_setting" ] ; then
|
||||
for o in $extra_setting ;do
|
||||
echo "$o" >> "$tmp_file"
|
||||
done
|
||||
fi
|
||||
|
||||
sed '/^$/d' "$tmp_file" >"$config_file"
|
||||
|
||||
if [ "$?" = "0" ] ; then
|
||||
rm -f "$tmp_file"
|
||||
fi
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
local section="$1"
|
||||
|
||||
if ! frps_scetion_validate "$section" ; then
|
||||
_err "Config validate failed."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ "x$enabled" != "x1" ] ; then
|
||||
_info "Instance \"$section\" disabled."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$client_file" ] || ( ! client_file_validate "$client_file" ) ; then
|
||||
_err "Client file not valid."
|
||||
return 1
|
||||
fi
|
||||
|
||||
test -d "$CONFIG_FOLDER" || mkdir -p "$CONFIG_FOLDER"
|
||||
|
||||
local config_file="$CONFIG_FOLDER/frps.$section.ini"
|
||||
|
||||
create_config_file "$config_file"
|
||||
|
||||
if [ ! -f "$config_file" ] ; then
|
||||
_err "Could not create config file: \"$config_file\""
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_open_instance "$NAME.$section"
|
||||
procd_set_param command "$client_file"
|
||||
procd_append_param command -c "$config_file"
|
||||
procd_set_param respawn
|
||||
procd_set_param file "$config_file"
|
||||
|
||||
if [ -n "$run_user" ] ; then
|
||||
procd_set_param user "$run_user"
|
||||
fi
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$NAME"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "$NAME"
|
||||
config_foreach start_instance "frps"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@frps[-1]
|
||||
add ucitrack frps
|
||||
set ucitrack.@frps[-1].init=frps
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
|
||||
exit 0
|
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.45.141
|
||||
PKG_RELEASE:=244
|
||||
PKG_VERSION:=0.45.152
|
||||
PKG_RELEASE:=245
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
@ -13,6 +13,9 @@ define Package/$(PKG_NAME)/config
|
||||
config PACKAGE_kmod-inet-diag
|
||||
default y if PACKAGE_$(PKG_NAME)
|
||||
|
||||
config PACKAGE_luci-compat
|
||||
default y if PACKAGE_$(PKG_NAME)
|
||||
|
||||
config PACKAGE_kmod-nft-tproxy
|
||||
default y if PACKAGE_firewall4
|
||||
|
||||
@ -97,6 +100,7 @@ endef
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
sed -i "s/v0.00.00-beta/v$(PKG_VERSION)-beta/g" /www/luci-static/resources/openclash/img/version.svg >/dev/null 2>&1
|
||||
/etc/init.d/network restart >/dev/null 2>&1 &
|
||||
exit 0
|
||||
endef
|
||||
|
||||
@ -135,10 +139,15 @@ define Package/$(PKG_NAME)/postrm
|
||||
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_*_region>/dev/null 2>&1
|
||||
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
|
||||
sed -i '/.*kB maximum content size*/c\HTTP_MAX_CONTENT = 1024*100 -- 100 kB maximum content size' /usr/lib/lua/luci/http.lua >/dev/null 2>&1
|
||||
sed -i '/.*kB maximum content size*/c\export let HTTP_MAX_CONTENT = 1024*100; // 100 kB maximum content size' /usr/share/ucode/luci/http.uc >/dev/null 2>&1
|
||||
uci -q delete firewall.openclash
|
||||
uci -q commit firewall
|
||||
uci -q delete ucitrack.@openclash[-1]
|
||||
uci -q commit ucitrack
|
||||
uci -q delete network.utun
|
||||
uci -q commit network
|
||||
/etc/init.d/network restart >/dev/null 2>&1 &
|
||||
rm -rf /tmp/luci-*
|
||||
exit 0
|
||||
endef
|
||||
|
@ -994,7 +994,7 @@ function action_switch_dashboard()
|
||||
uci:set("openclash", "config", "dashboard_type", "Meta")
|
||||
uci:commit("openclash")
|
||||
end
|
||||
elseif tonumber(state) == 1 then
|
||||
elseif switch_name == "Yacd" and tonumber(state) == 1 then
|
||||
if switch_type == "Official" then
|
||||
uci:set("openclash", "config", "yacd_type", "Official")
|
||||
uci:commit("openclash")
|
||||
|
@ -266,7 +266,15 @@ o.description = font_red..bold_on..translate("TCP Concurrent Request IPs, Choose
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_unified_delay", font_red..bold_on..translate("Enable Unified Delay")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Change the delay calculation method to remove extra delays such as handshaking")..bold_off..font_off
|
||||
o.description = font_red..bold_on..translate("Change The Delay Calculation Method To Remove Extra Delays Such as Handshaking")..bold_off..font_off
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "keep_alive_interval", font_red..bold_on..translate("TCP Keep-alive Interval(s)")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Change The TCP Keep-alive Interval, Selecting a Larger Value Avoids Abnormal Resource Consumption")..bold_off..font_off
|
||||
o:value("0", translate("Disable"))
|
||||
o:value("15")
|
||||
o:value("1800")
|
||||
o:value("3600")
|
||||
o.default = "0"
|
||||
|
||||
o = s:taboption("meta", ListValue, "find_process_mode", translate("Enable Process Rule"))
|
||||
|
@ -82,7 +82,15 @@ if token then
|
||||
fs.unlink(sub_path)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
---- UA
|
||||
o = s:option(Value, "sub_ua", "User-Agent")
|
||||
o.description = font_red..bold_on..translate("Used for Downloading Subscriptions, Defaults to Clash")..bold_off..font_off
|
||||
o:value("Clash")
|
||||
o:value("clash.meta")
|
||||
o.default = "Clash"
|
||||
o.rmempty = true
|
||||
|
||||
---- subconverter
|
||||
o = s:option(Flag, "sub_convert", translate("Subscribe Convert Online"))
|
||||
o.description = translate("Convert Subscribe Online With Template")
|
||||
|
@ -159,8 +159,7 @@ HTTP.setfilehandler(
|
||||
)
|
||||
|
||||
if HTTP.formvalue("upload") then
|
||||
local f = HTTP.formvalue("ulfile")
|
||||
if #f <= 0 then
|
||||
if not um.value then
|
||||
um.value = translate("No Specify Upload File")
|
||||
end
|
||||
end
|
||||
|
@ -80,7 +80,7 @@ o.rmempty = false
|
||||
o.default = o.disbled
|
||||
|
||||
---- Proxy group
|
||||
o = s:option(Value, "specific_group", translate("Specific Group"))
|
||||
o = s:option(Value, "specific_group", translate("Specific Group (Support Regex)"))
|
||||
o.description = translate("Group Use For Proxy The DNS")..translate("(Only Meta Core)")
|
||||
o:depends("group", "nameserver")
|
||||
o:depends("group", "fallback")
|
||||
|
@ -135,6 +135,7 @@ o:value("vmess", translate("Vmess"))
|
||||
o:value("trojan", translate("trojan"))
|
||||
o:value("vless", translate("Vless ")..translate("(Only Meta Core)"))
|
||||
o:value("hysteria", translate("Hysteria ")..translate("(Only Meta Core)"))
|
||||
o:value("hysteria2", translate("Hysteria2 ")..translate("(Only Meta Core)"))
|
||||
o:value("wireguard", translate("WireGuard")..translate("(TUN&Meta Core)"))
|
||||
o:value("tuic", translate("Tuic")..translate("(Only Meta Core)"))
|
||||
o:value("snell", translate("Snell"))
|
||||
@ -169,6 +170,7 @@ o.rmempty = false
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ Tuic ]]--
|
||||
o = s:option(Value, "tc_ip", translate("Server IP"))
|
||||
@ -285,11 +287,13 @@ o = s:option(Value, "hysteria_up", translate("up"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Required")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
o = s:option(Value, "hysteria_down", translate("down"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Required")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
o = s:option(Value, "psk", translate("Psk"))
|
||||
o.rmempty = true
|
||||
@ -544,6 +548,7 @@ o:depends("type", "http")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
o:depends("type", "tuic")
|
||||
|
||||
-- [[ TLS ]]--
|
||||
@ -590,6 +595,7 @@ o.rmempty = true
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ headers ]]--
|
||||
o = s:option(DynamicList, "http_headers", translate("headers"))
|
||||
@ -622,6 +628,7 @@ o.rmempty = false
|
||||
o:value("h3")
|
||||
o:value("h2")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ trojan-ws-path ]]--
|
||||
o = s:option(Value, "trojan_ws_path", translate("Path"))
|
||||
@ -638,8 +645,15 @@ o:depends("obfs_trojan", "ws")
|
||||
-- [[ hysteria_obfs ]]--
|
||||
o = s:option(Value, "hysteria_obfs", translate("obfs"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("yourpassword")
|
||||
o.placeholder = translate("obfs-str")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ hysteria_obfs_password ]]--
|
||||
o = s:option(Value, "hysteria_obfs_password", translate("obfs-password"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("yourpassword")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ hysteria_auth ]]--
|
||||
--o = s:option(Value, "hysteria_auth", translate("auth"))
|
||||
@ -658,12 +672,14 @@ o = s:option(Value, "hysteria_ca", translate("ca"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("./my.ca")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ hysteria_ca_str ]]--
|
||||
o = s:option(Value, "hysteria_ca_str", translate("ca_str"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("xyz")
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
|
||||
-- [[ recv_window_conn ]]--
|
||||
o = s:option(Value, "recv_window_conn", translate("recv_window_conn"))
|
||||
@ -719,7 +735,7 @@ o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
|
||||
-- [[ TFO ]]--
|
||||
-- [[ Fast Open ]]--
|
||||
o = s:option(ListValue, "fast_open", translate("Fast Open"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
@ -747,6 +763,7 @@ o:depends("type", "snell")
|
||||
o = s:option(Value, "fingerprint", translate("Fingerprint")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "hysteria")
|
||||
o:depends("type", "hysteria2")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "trojan")
|
||||
@ -924,4 +941,5 @@ o.write = function()
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
m:append(Template("openclash/config_editor"))
|
||||
return m
|
||||
|
@ -25,6 +25,7 @@ m.description = translate("Note: To restore the default configuration, try acces
|
||||
"<br/>"..font_green..translate("Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off")..font_off..
|
||||
"<br/>"..font_green..translate("Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check")..font_off..
|
||||
"<br/>"..font_green..translate("Note: Game proxy please use nodes except Vmess")..font_off..
|
||||
"<br/>"..font_green..translate("Note: If you need to perform client access control in Fake-ip mode, please change the DNS hijacking mode to firewall forwarding")..font_off..
|
||||
"<br/>"..translate("Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance")..
|
||||
"<br/>"..translate("Note: If the connection is abnormal, please follow the steps on this page to check first")..": ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://github.com/vernesong/OpenClash/wiki/%E7%BD%91%E7%BB%9C%E8%BF%9E%E6%8E%A5%E5%BC%82%E5%B8%B8%E6%97%B6%E6%8E%92%E6%9F%A5%E5%8E%9F%E5%9B%A0\")'>"..translate("Click to the page").."</a>"
|
||||
|
||||
@ -48,7 +49,7 @@ s:tab("debug", translate("Debug Logs"))
|
||||
s:tab("dlercloud", translate("Dler Cloud"))
|
||||
|
||||
o = s:taboption("op_mode", Flag, "enable_meta_core", font_red..bold_on..translate("Enable Meta Core")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Some Premium Core Features are Unavailable, For Other More Useful Functions Go Wiki:")..bold_off..font_off.." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://clash-meta.wiki/\")'>https://clash-meta.wiki/</a>"
|
||||
o.description = font_red..bold_on..translate("Some Premium Core Features are Unavailable, For Other More Useful Functions Go Wiki:")..bold_off..font_off.." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/\")'>https://wiki.metacubex.one/</a>"
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("op_mode", ListValue, "en_mode", font_red..bold_on..translate("Select Mode")..bold_off..font_off)
|
||||
@ -1111,6 +1112,10 @@ o = s:taboption("dashboard", DummyValue, "Yacd", translate("Switch(Update) Yacd
|
||||
o.template="openclash/switch_dashboard"
|
||||
o.rawhtml = true
|
||||
|
||||
o = s:taboption("dashboard", DummyValue, "Metacubexd", translate("Update Metacubexd Version"))
|
||||
o.template="openclash/switch_dashboard"
|
||||
o.rawhtml = true
|
||||
|
||||
---- ipv6
|
||||
o = s:taboption("ipv6", Flag, "ipv6_enable", translate("Proxy IPv6 Traffic"))
|
||||
o.description = font_red..bold_on..translate("The Gateway and DNS of The Connected Device Must be The Router IP, Disable IPv6 DHCP To Avoid Abnormal Connection If You Do Not Use")..bold_off..font_off
|
||||
|
@ -316,6 +316,11 @@ function other_log_area(id, readOnly, wid, height)
|
||||
other_log_area.markText({line:0,ch:0},{line:9999,ch:9999}, {css: 'font-size:13px'});
|
||||
};
|
||||
|
||||
var custom_cfg_value = document.getElementById("cbid.openclash." + window.location.pathname.split("/")[window.location.pathname.split("/").length - 1] + ".other_parameters");
|
||||
if (custom_cfg_value) {
|
||||
editor(custom_cfg_value, 'false', '100%', '300px');
|
||||
};
|
||||
|
||||
var custom_firewall = document.getElementById("cbid.openclash.config.firewall_custom");
|
||||
var custom_ymchange = document.getElementById("cbid.openclash.config.ymchange_custom");
|
||||
if (custom_firewall) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div style="text-align: center; margin:0 auto; display: block; width: 100%; height: 50px; text-overflow: ellipsis;">
|
||||
<div>
|
||||
<%:Note: Please Upload File According To File Type, File Will Be Saved To The Prompt Path%>
|
||||
</div>
|
||||
<div style="color: green; transform:translateY(100%);">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</div>
|
||||
<div style="text-align: center; margin:2% auto; display: block; width: 100%; text-overflow: ellipsis;">
|
||||
<div>
|
||||
<%:Note: Please Upload File According To File Type, File Will Be Saved To The Prompt Path%>
|
||||
</div>
|
||||
<div style="color: green; margin-top: 1%;">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
||||
|
@ -87,8 +87,9 @@
|
||||
<input type="radio" id="direct" name="radios" value="direct" onclick="return switch_rule_mode(this.value)"/>
|
||||
<label for="direct">Direct</label>
|
||||
</span></td><td width="25%"><%:Control Panel Login Secret%></td><td width="25%" align="left" id="_dase"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Yacd Control Panel%></td><td width="25%" align="left" id="_web"><%:Collecting data...%></td><td width="25%"><%:Dashboard Control Panel%></td><td width="25%" align="left" id="_webo"><%:Collecting data...%></td></tr>
|
||||
<tr id="tool_label2"><td colspan="4"><div style="margin: 10px 0; text-align: center">
|
||||
<tr><td colspan="4"><div style="margin: 10px 0; text-align: center"><span id="_web" style="width: 33%; display: inline-block;"></span><span id="_webm" style="width: 33%; display: inline-block;"><%:Collecting data...%></span><span id="_webo" style="width: 33%; display: inline-block;"></span></div></td></tr>
|
||||
<tr id="tool_label2"><td colspan="4">
|
||||
<div style="margin: 10px 0; text-align: center">
|
||||
<span>
|
||||
<%:Up:%>
|
||||
<span id="upload_">
|
||||
@ -152,27 +153,28 @@
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</div></td></tr>
|
||||
<tr height="50px">
|
||||
<td width="100%" colspan="4">
|
||||
<div id="hid_btn" style="height: 25px;width: 100px;margin: 0 auto;" onclick="hid_btn_action()">
|
||||
<div style="margin: 0 auto; top: 50%;" class="dot-typing"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="hid_1"><td width="100%" colspan="4"><p style="margin: 10px 0; text-align: center"><b><%:Quick Operation%></b></p></td></tr>
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr height="50px">
|
||||
<td width="100%" colspan="4">
|
||||
<div id="hid_btn" style="height: 25px;width: 100px;margin: 0 auto;" onclick="hid_btn_action()">
|
||||
<div style="margin: 0 auto; top: 50%;" class="dot-typing"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="hid_1"><td width="100%" colspan="4"><p style="margin: 10px 0; text-align: center"><b><%:Quick Operation%></b></p></td></tr>
|
||||
<tr id="hid_2">
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_close_all_connection"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_reload_firewall"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_flush_fakeip_cache"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_subscribe"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
<tr id="hid_3">
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_other_rules"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geoip"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geosite"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_one_key_update"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_close_all_connection"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_reload_firewall"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_flush_fakeip_cache"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_subscribe"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
<tr id="hid_3">
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_other_rules"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geoip"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geosite"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_one_key_update"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset id="state" class="cbi-section">
|
||||
@ -193,6 +195,7 @@
|
||||
var mode = document.getElementById('_mode');
|
||||
var web = document.getElementById('_web');
|
||||
var webo = document.getElementById('_webo');
|
||||
var webm = document.getElementById('_webm');
|
||||
var watchdog = document.getElementById('_watchdog');
|
||||
var daip = document.getElementById('_daip');
|
||||
var dase = document.getElementById('_dase');
|
||||
@ -257,8 +260,9 @@
|
||||
}
|
||||
watchdog.innerHTML = status.watchdog ? ' | <%:Daemons%>: <b style=color:green><%:Running%></b>' : ' | <%:Daemons%>: <b style=color:red><%:Not Running%></b>';
|
||||
dase.innerHTML = status.dase ? "<b style=color:green>"+status.dase+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
web.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return ycad_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
webo.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return net_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
web.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Yacd Control Panel%>" onclick="return ycad_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
webo.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Dashboard Control Panel%>" onclick="return net_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
webm.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Metacubexd Control Panel%>" onclick="return meta_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
close_all_connection.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Close All Connections%>" onclick="return b_close_all_connection(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
reload_firewall.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Reload Firewall Rules%>" onclick="return b_reload_firewall(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
flush_fakeip_cache.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Flush Fake-IP Cache%>" onclick="return b_flush_fakeip_cache(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
@ -820,11 +824,31 @@
|
||||
});
|
||||
};
|
||||
|
||||
function meta_dashboard(btn)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Metacubexd Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) {
|
||||
var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://';
|
||||
url9='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/metacubexd/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/"%>';
|
||||
}
|
||||
winOpen(url9);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function ycad_dashboard(btn)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Open Panel%>';
|
||||
btn.value = '<%:Yacd Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
@ -844,7 +868,7 @@
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Open Panel%>';
|
||||
btn.value = '<%:Dashboard Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url2='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/dashboard/#/?host='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
|
@ -24,6 +24,9 @@
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Meta Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Meta\')"/>';
|
||||
}
|
||||
}
|
||||
if ( btn_type_<%=self.option%> == "Metacubexd" ) {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Update Metacubexd Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Official\')"/>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -47,17 +50,25 @@
|
||||
if ( name == "Dashboard" ) {
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Meta Version%>" onclick="return switch_dashboard(this, \'Dashboard\', \'Meta\')"/>';
|
||||
}
|
||||
else
|
||||
else if ( name == "Yacd" )
|
||||
{
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Meta Version%>" onclick="return switch_dashboard(this, \'Yacd\', \'Meta\')"/>';
|
||||
}
|
||||
else{
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Update Successful%> - <%:Update Metacubexd Version%>" onclick="return switch_dashboard(this, \'Metacubexd\', \'Official\')"/>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( status.download_state == "2" ) {
|
||||
btn.value = '<%:Unzip Error%>';
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Switch Failed%>';
|
||||
if ( name == "Metacubexd" ) {
|
||||
btn.value = '<%:Update Failed%>';
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Switch Failed%>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div style="text-align: center; margin:0 auto; display:block; white-space: nowrap;">
|
||||
<label class="cbi-value" style="display:inline-block; width: 100%;" for="ulfile"><%:Upload File Type%> <%:(Click to select)%>
|
||||
<label class="cbi-value" style="display:inline-block; width: 100%;" for="ulfiles"><%:Upload File Type%> <%:(Click to select)%>
|
||||
<select name="file_type" style="width:auto">
|
||||
<option value="config" selected="selected"><%:Config File%> (.yaml)</option>
|
||||
<option value="proxy-provider"><%:Proxy Provider File%></option>
|
||||
|
@ -1167,6 +1167,9 @@ msgstr "Yacd 控制面板"
|
||||
msgid "Dashboard Control Panel"
|
||||
msgstr "Dashboard 控制面板"
|
||||
|
||||
msgid "Metacubexd Control Panel"
|
||||
msgstr "Metacubexd 控制面板"
|
||||
|
||||
msgid "Control Panel Login IP"
|
||||
msgstr "控制面板登录 IP"
|
||||
|
||||
@ -1227,9 +1230,6 @@ msgstr "兼容"
|
||||
msgid "Mix"
|
||||
msgstr "混合"
|
||||
|
||||
msgid "Open Panel"
|
||||
msgstr "打开控制面板"
|
||||
|
||||
msgid "Close All Connections"
|
||||
msgstr "重置所有链接"
|
||||
|
||||
@ -2976,6 +2976,9 @@ msgstr "注意: 游戏代理请使用 Vmess 以外的节点"
|
||||
msgid "Note: If the connection is abnormal, please follow the steps on this page to check first"
|
||||
msgstr "注意: 连接异常时请按照此页步骤先进行检查"
|
||||
|
||||
msgid "Note: If you need to perform client access control in Fake-ip mode, please change the DNS hijacking mode to firewall forwarding"
|
||||
msgstr "注意: Fake-ip 模式下如需要进行客户端访问控制,请将DNS劫持模式改为防火墙转发"
|
||||
|
||||
msgid "Click to the page"
|
||||
msgstr "点击前往"
|
||||
|
||||
@ -3036,8 +3039,8 @@ msgstr "指定接口"
|
||||
msgid "DNS Lookup Only Through The Specific Interface"
|
||||
msgstr "DNS 仅通过特定接口进行查询"
|
||||
|
||||
msgid "Specific Group"
|
||||
msgstr "指定策略组"
|
||||
msgid "Specific Group (Support Regex)"
|
||||
msgstr "指定策略组(支持正则匹配)"
|
||||
|
||||
msgid "Group Use For Proxy The DNS"
|
||||
msgstr "用于代理此 DNS 的策略组"
|
||||
@ -3105,9 +3108,18 @@ msgstr "切换(更新) Dashboard 版本"
|
||||
msgid "Switch(Update) Yacd Version"
|
||||
msgstr "切换(更新) Yacd 版本"
|
||||
|
||||
msgid "Update Metacubexd Version"
|
||||
msgstr "更新 Metacubexd 版本"
|
||||
|
||||
msgid "Downloading File..."
|
||||
msgstr "文件下载中..."
|
||||
|
||||
msgid "Update Failed"
|
||||
msgstr "更新失败"
|
||||
|
||||
msgid "Update Successful"
|
||||
msgstr "更新成功"
|
||||
|
||||
msgid "Switch Failed"
|
||||
msgstr "切换失败"
|
||||
|
||||
@ -3432,8 +3444,17 @@ msgstr "警告:跳过核心不支持的 nameserver-policy 规则"
|
||||
msgid "Enable Unified Delay"
|
||||
msgstr "*启用统一延迟"
|
||||
|
||||
msgid "Change the delay calculation method to remove extra delays such as handshaking"
|
||||
msgid "Change The Delay Calculation Method To Remove Extra Delays Such as Handshaking"
|
||||
msgstr "更换延迟计算方式,通过去除握手等额外开销来降低延迟数值"
|
||||
|
||||
msgid "Tip: If the download fails, try setting the CDN in Overwrite Settings - General Settings - Github Address Modify Options"
|
||||
msgstr "提示:如果下载失败,您可以尝试在覆写设置 - 常规设置 - Github地址修改选项中设置CDN"
|
||||
|
||||
msgid "Change The TCP Keep-alive Interval, Selecting a Larger Value Avoids Abnormal Resource Consumption"
|
||||
msgstr "更改 TCP Keep-alive 间隔,选择较大数值可以避免异常的资源消耗"
|
||||
|
||||
msgid "TCP Keep-alive Interval(s)"
|
||||
msgstr "TCP Keep-alive 间隔(s)"
|
||||
|
||||
msgid "Used for Downloading Subscriptions, Defaults to Clash"
|
||||
msgstr "用于下载订阅时指定 UA,默认为 Clash"
|
||||
|
@ -25,7 +25,7 @@ CACHE_PATH_OLD="/etc/openclash/.cache"
|
||||
CACHE_PATH="/etc/openclash/cache.db"
|
||||
LOG_FILE="/tmp/openclash.log"
|
||||
START_LOG="/tmp/openclash_start.log"
|
||||
LOCK_FILE=/tmp/lock/openclash.lock
|
||||
LOCK_FILE="/tmp/lock/openclash.lock"
|
||||
PROXY_FWMARK="0x162"
|
||||
PROXY_ROUTE_TABLE="0x162"
|
||||
|
||||
@ -942,14 +942,23 @@ upnp_exclude()
|
||||
if [ -n "$line" ]; then
|
||||
upnp_ip=$(echo "$line" |awk -F ':' '{print $3}')
|
||||
upnp_dp=$(echo "$line" |awk -F ':' '{print $4}')
|
||||
upnp_type=$(echo "$line" |awk -F ':' '{print $1}')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ]; then
|
||||
if [ -n "$FW4" ]; then
|
||||
if [ -z "$(nft list chain inet fw4 openclash_upnp |grep "$upnp_ip" |grep "$upnp_dp")" ]; then
|
||||
nft add rule inet fw4 openclash_upnp ip saddr { "$upnp_ip" } udp sport "$upnp_dp" counter return 2>/dev/null
|
||||
if [ "$upnp_type" == "UDP" ]; then
|
||||
nft add rule inet fw4 openclash_upnp ip saddr { "$upnp_ip" } udp sport "$upnp_dp" counter return 2>/dev/null
|
||||
else
|
||||
nft add rule inet fw4 openclash_upnp ip saddr { "$upnp_ip" } tcp sport "$upnp_dp" counter return 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ -z "$(iptables -t mangle -nL openclash_upnp |grep "$upnp_ip" |grep "$upnp_dp")" ]; then
|
||||
iptables -t mangle -A openclash_upnp -p udp -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
if [ "$upnp_type" == "UDP" ]; then
|
||||
iptables -t mangle -A openclash_upnp -p udp -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
else
|
||||
iptables -t mangle -A openclash_upnp -p tcp -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -2502,7 +2511,6 @@ if [ -z "$FW4" ]; then
|
||||
#TUN模式
|
||||
#启动TUN
|
||||
set_tun_tap
|
||||
|
||||
#设置防火墙
|
||||
if [ "$router_self_proxy" = "1" ] || ([ "$enable_redirect_dns" != "2" ] && [ "$en_mode" = "fake-ip" ]); then
|
||||
if [ "$en_mode" = "fake-ip" ]; then
|
||||
@ -2960,17 +2968,9 @@ revert_firewall()
|
||||
#TUN
|
||||
ip route del default dev utun table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
|
||||
ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
|
||||
route delete -net "$fakeip_range" dev utun >/dev/null 2>&1
|
||||
ip link set dev utun down >/dev/null 2>&1
|
||||
ip tuntap del utun mode tun >/dev/null 2>&1
|
||||
|
||||
ip -6 route del default dev utun table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
|
||||
ip -6 rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
|
||||
ip -6 rule del oif utun table 2022 >/dev/null 2>&1
|
||||
ip -6 route del default dev utun table 2022 >/dev/null 2>&1
|
||||
ip -6 route del fdfe:dcba:9876::/126 dev utun proto kernel metric 256 >/dev/null 2>&1
|
||||
ip -6 link set dev utun down >/dev/null 2>&1
|
||||
ip -6 tuntap del utun mode tun >/dev/null 2>&1
|
||||
|
||||
if [ -n "$FW4" ]; then
|
||||
for nft in "input" "forward" "dstnat" "srcnat" "nat_output" "mangle_prerouting" "mangle_output"; do
|
||||
@ -3099,6 +3099,7 @@ get_config()
|
||||
upnp_lease_file=$(uci -q get upnpd.config.upnp_lease_file)
|
||||
global_client_fingerprint=$(uci -q get openclash.config.global_client_fingerprint || echo "0")
|
||||
enable_unified_delay=$(uci -q get openclash.config.enable_unified_delay || echo "0")
|
||||
keep_alive_interval=$(uci -q get openclash.config.keep_alive_interval || echo "0")
|
||||
[ -z "$dns_port" ] && dns_port=7874 && uci -q set openclash.config.dns_port=7874
|
||||
uci -q set openclash.config.restricted_mode=0 && uci -q commit openclash
|
||||
}
|
||||
@ -3126,7 +3127,7 @@ start()
|
||||
if ! $quick_start; then
|
||||
LOG_OUT "Step 3: Modify The Config File..."
|
||||
config_check
|
||||
/usr/share/openclash/yml_change.sh 2>/dev/null "$en_mode" "$da_password" "$cn_port" "$proxy_port" "$TMP_CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$log_level" "$proxy_mode" "$en_mode_tun" "$stack_type" "$dns_port" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$stream_domains_prefetch" "$enable_meta_core" "$enable_meta_sniffer" "$enable_geoip_dat" "$geodata_loader" "$enable_meta_sniffer_custom" "$interface_name" "$enable_tcp_concurrent" "$core_type" "$append_default_dns" "$enable_meta_sniffer_pure_ip" "$find_process_mode" "$fakeip_range" "$global_client_fingerprint" "$ipv6_mode" "$stack_type_v6" "$enable_unified_delay"
|
||||
/usr/share/openclash/yml_change.sh 2>/dev/null "$en_mode" "$da_password" "$cn_port" "$proxy_port" "$TMP_CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$log_level" "$proxy_mode" "$en_mode_tun" "$stack_type" "$dns_port" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$stream_domains_prefetch" "$enable_meta_core" "$enable_meta_sniffer" "$enable_geoip_dat" "$geodata_loader" "$enable_meta_sniffer_custom" "$interface_name" "$enable_tcp_concurrent" "$core_type" "$append_default_dns" "$enable_meta_sniffer_pure_ip" "$find_process_mode" "$fakeip_range" "$global_client_fingerprint" "$ipv6_mode" "$stack_type_v6" "$enable_unified_delay" "$keep_alive_interval"
|
||||
/usr/share/openclash/yml_rules_change.sh 2>/dev/null "$rule_source" "$enable_custom_clash_rules" "$TMP_CONFIG_FILE" "$enable_rule_proxy" "$CONFIG_NAME" "$router_self_proxy" "$lan_ip" "$proxy_port" "$tproxy_port" "$enable_meta_core" "$enable_redirect_dns" "$fakeip_range" "$en_mode"
|
||||
/usr/share/openclash/openclash_custom_domain_dns.sh >/dev/null 2>&1
|
||||
#Custom overwrite
|
||||
@ -3265,10 +3266,11 @@ restart()
|
||||
|
||||
reload()
|
||||
{
|
||||
[ -f "$LOCK_FILE" ] && exit 0
|
||||
enable=$(uci -q get openclash.config.enable)
|
||||
if pidof clash >/dev/null && [ "$enable" == "1" ] && [ "$1" == "firewall" ]; then
|
||||
LOG_OUT "Reload OpenClash Firewall Rules..."
|
||||
set_lock
|
||||
LOG_OUT "Reload OpenClash Firewall Rules..."
|
||||
revert_firewall 2>/dev/null
|
||||
do_run_mode 2>/dev/null
|
||||
get_config 2>/dev/null
|
||||
|
@ -190,9 +190,32 @@ uci -q set uhttpd.main.max_requests=50
|
||||
uci -q set uhttpd.main.max_connections=100
|
||||
uci -q set uhttpd.main.script_timeout=3600
|
||||
uci -q commit uhttpd
|
||||
sed -i '/.*kB maximum content size*/c\HTTP_MAX_CONTENT = 1024*1024' /usr/lib/lua/luci/http.lua >/dev/null 2>&1
|
||||
sed -i '/.*kB maximum content size*/c\HTTP_MAX_CONTENT = 1024*10240 -- 100 kB maximum content size' /usr/lib/lua/luci/http.lua >/dev/null 2>&1
|
||||
sed -i '/.*kB maximum content size*/c\export let HTTP_MAX_CONTENT = 1024*10240; // 100 kB maximum content size' /usr/share/ucode/luci/http.uc >/dev/null 2>&1
|
||||
|
||||
/etc/init.d/uhttpd restart >/dev/null 2>&1
|
||||
|
||||
#set tun interface firewall rule
|
||||
add_utun_firewall_zone()
|
||||
{
|
||||
local section="$1"
|
||||
local name network
|
||||
config_get "name" "$section" "name" ""
|
||||
config_get "network" "$section" "network" ""
|
||||
if [ "$name" = "lan" ] && [ -z "$(echo $network |grep utun)" ]; then
|
||||
uci -q set firewall."$section".network="$network utun"
|
||||
uci -q commit firewall
|
||||
fi
|
||||
}
|
||||
|
||||
uci -q set network.utun=interface
|
||||
uci -q set network.utun.proto=none
|
||||
uci -q set network.utun.device=utun
|
||||
uci -q set network.utun.device=utun
|
||||
uci -q commit network
|
||||
|
||||
config_load "firewall"
|
||||
config_foreach add_utun_firewall_zone "zone"
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
|
@ -31,14 +31,7 @@ if [ "$TIME" != "$CHTIME" ]; then
|
||||
curl -SsL -m 60 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ] || [ -n "$(cat $LAST_OPVER |grep '<html>')" ]; then
|
||||
curl -SsL -m 60 --retry 2 https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl_status=${PIPESTATUS[0]}
|
||||
else
|
||||
curl_status=0
|
||||
fi
|
||||
|
||||
if [ "$curl_status" -ne 0 ] ; then
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
rm -rf $LAST_OPVER
|
||||
fi
|
||||
fi
|
||||
|
@ -89,15 +89,15 @@ config_download()
|
||||
{
|
||||
if [ -n "$subscribe_url_param" ]; then
|
||||
if [ -n "$c_address" ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: Clash' "$c_address""$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' "$c_address""$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: Clash' https://api.dler.io/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' https://api.dler.io/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: Clash' https://subconverter.herokuapp.com/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' https://subconverter.herokuapp.com/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: Clash' "$subscribe_url" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' "$subscribe_url" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ EOF
|
||||
|
||||
server_key_match()
|
||||
{
|
||||
local key_match key_word
|
||||
local key_match key_word
|
||||
|
||||
if [ -n "$(echo "$1" |grep "^ \{0,\}$")" ] || [ -n "$(echo "$1" |grep "^\t\{0,\}$")" ]; then
|
||||
return
|
||||
@ -546,7 +546,7 @@ server_key_match()
|
||||
|
||||
sub_info_get()
|
||||
{
|
||||
local section="$1" subscribe_url template_path subscribe_url_param template_path_encode key_match_param key_ex_match_param c_address de_ex_keyword
|
||||
local section="$1" subscribe_url template_path subscribe_url_param template_path_encode key_match_param key_ex_match_param c_address de_ex_keyword sub_ua
|
||||
config_get_bool "enabled" "$section" "enabled" "1"
|
||||
config_get "name" "$section" "name" ""
|
||||
config_get "sub_convert" "$section" "sub_convert" ""
|
||||
@ -563,6 +563,7 @@ sub_info_get()
|
||||
config_get "rule_provider" "$section" "rule_provider" ""
|
||||
config_get "custom_template_url" "$section" "custom_template_url" ""
|
||||
config_get "de_ex_keyword" "$section" "de_ex_keyword" ""
|
||||
config_get "sub_ua" "$section" "sub_ua" "Clash"
|
||||
|
||||
if [ "$enabled" -eq 0 ]; then
|
||||
return
|
||||
@ -641,7 +642,6 @@ sub_info_get()
|
||||
LOG_OUT "Start Updating Config File【$name】..."
|
||||
|
||||
config_download
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -s "$CFG_FILE" ]; then
|
||||
#prevent ruby unexpected error
|
||||
sed -i -E 's/protocol-param: ([^,'"'"'"''}( *#)\n\r]+)/protocol-param: "\1"/g' "$CFG_FILE" 2>/dev/null
|
||||
|
@ -71,13 +71,8 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/"$RELEASE_BRANCH"/core-lateset/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_tun.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl_status=${PIPESTATUS[0]}
|
||||
else
|
||||
curl_status=0
|
||||
fi
|
||||
if [ "$curl_status" -eq 0 ]; then
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -eq 0 ]; then
|
||||
gzip -t /tmp/clash_tun.gz >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
@ -94,13 +89,8 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/"$RELEASE_BRANCH"/core-lateset/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl_status=${PIPESTATUS[0]}
|
||||
else
|
||||
curl_status=0
|
||||
fi
|
||||
if [ "$curl_status" -eq 0 ]; then
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -eq 0 ]; then
|
||||
gzip -t /tmp/clash_meta.tar.gz >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
@ -117,13 +107,8 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/"$RELEASE_BRANCH"/core-lateset/dev/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl_status=${PIPESTATUS[0]}
|
||||
else
|
||||
curl_status=0
|
||||
fi
|
||||
if [ "$curl_status" -eq 0 ]; then
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -eq 0 ]; then
|
||||
gzip -t /tmp/clash.tar.gz >/dev/null 2>&1
|
||||
fi
|
||||
esac
|
||||
|
@ -18,7 +18,7 @@
|
||||
DOWNLOAD_PATH="https://codeload.github.com/MetaCubeX/Razord-meta/zip/refs/heads/gh-pages"
|
||||
FILE_PATH_INCLUDE="Razord-meta-gh-pages"
|
||||
fi
|
||||
else
|
||||
elif [ "$DASH_NAME" == "Yacd" ]; then
|
||||
UNPACK_FILE_DIR="/usr/share/openclash/ui/yacd/"
|
||||
BACKUP_FILE_DIR="/usr/share/openclash/ui/yacd_backup/"
|
||||
if [ "$DASH_TYPE" == "Official" ]; then
|
||||
@ -28,6 +28,11 @@
|
||||
DOWNLOAD_PATH="https://codeload.github.com/MetaCubeX/Yacd-meta/zip/refs/heads/gh-pages"
|
||||
FILE_PATH_INCLUDE="Yacd-meta-gh-pages"
|
||||
fi
|
||||
else
|
||||
UNPACK_FILE_DIR="/usr/share/openclash/ui/metacubexd/"
|
||||
BACKUP_FILE_DIR="/usr/share/openclash/ui/metacubexd_backup/"
|
||||
DOWNLOAD_PATH="https://codeload.github.com/MetaCubeX/metacubexd/zip/refs/heads/gh-pages"
|
||||
FILE_PATH_INCLUDE="metacubexd-gh-pages"
|
||||
fi
|
||||
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$DOWNLOAD_PATH" -o "$DASH_FILE_DIR" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$DASH_FILE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
|
@ -39,9 +39,6 @@
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/dists/v2ray-rules-dat/geoip.dat" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOIP_CUSTOM_URL" -o /tmp/GeoIP.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
|
@ -39,9 +39,6 @@
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/dists/v2ray-rules-dat/geosite.dat" -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$GEOSITE_CUSTOM_URL" -o /tmp/GeoSite.dat 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
|
@ -822,7 +822,7 @@ function auto_get_policy_group(passwd, ip, port)
|
||||
if con then
|
||||
con = JSON.parse(con)
|
||||
end
|
||||
if con then
|
||||
if con and con.connections then
|
||||
for i = 1, #(con.connections) do
|
||||
if type == "Netflix" then
|
||||
if string.match(con.connections[i].metadata.host, "www%.netflix%.com") then
|
||||
@ -1382,7 +1382,7 @@ function paramount_plus_unlock_test()
|
||||
if not string.find(data.url_effective, "intl") then
|
||||
status = 2
|
||||
data = SYS.exec(string.format("curl -sL --connect-timeout 5 -m 5 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
region = string.upper(string.sub(string.match(data, "\"siteEdition\":\"%a+|%a+\""), 19, -1)) or string.upper(string.sub(string.match(data, "property: '%a+'"), 12, -2))
|
||||
region = string.upper(string.sub(string.match(data, "\"siteEdition\":\"%a+|%a+\""), 19, -2)) or string.upper(string.sub(string.match(data, "property: '%a+'"), 12, -2))
|
||||
if region then
|
||||
if FS.isfile(string.format("/tmp/openclash_%s_region", type)) then
|
||||
old_region = FS.readfile(string.format("/tmp/openclash_%s_region", type))
|
||||
|
@ -58,13 +58,8 @@ if [ -n "$OP_CV" ] && [ -n "$OP_LV" ] && [ "$(expr "$OP_LV" \> "$OP_CV")" -eq 1
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/"$RELEASE_BRANCH"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/openclash.ipk" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl_status=${PIPESTATUS[0]}
|
||||
else
|
||||
curl_status=0
|
||||
fi
|
||||
if [ "$curl_status" -eq 0 ] && [ -s "/tmp/openclash.ipk" ]; then
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -s "/tmp/openclash.ipk" ]; then
|
||||
LOG_OUT "【OpenClash - v$LAST_VER】Download Successful, Start Pre Update Test..."
|
||||
|
||||
if [ -z "$(opkg install /tmp/openclash.ipk --noaction 2>/dev/null |grep 'Upgrading luci-app-openclash on root' 2>/dev/null)" ]; then
|
||||
|
@ -22,14 +22,7 @@ if [ "$TIME" != "$CHTIME" ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/package/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ] || [ -n "$(cat $LAST_OPVER |grep '<html>')" ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/"$RELEASE_BRANCH"/version -o $LAST_OPVER 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl_status=${PIPESTATUS[0]}
|
||||
else
|
||||
curl_status=0
|
||||
fi
|
||||
|
||||
if [ "$curl_status" -eq 0 ] && [ -z "$(cat $LAST_OPVER |grep '<html>')" ]; then
|
||||
if [ "${PIPESTATUS[0]}" -eq 0 ] && [ -z "$(cat $LAST_OPVER |grep '<html>')" ]; then
|
||||
OP_LV=$(sed -n 1p $LAST_OPVER 2>/dev/null |awk -F '-' '{print $1}' |awk -F 'v' '{print $2}' |awk -F '.' '{print $2$3}' 2>/dev/null)
|
||||
if [ "$(expr "$OP_CV" \>= "$OP_LV")" = "1" ]; then
|
||||
sed -i '/^https:/,$d' $LAST_OPVER
|
||||
|
@ -224,14 +224,13 @@ fi
|
||||
if [ -n "$FW4" ]; then
|
||||
for i in `$(nft list chain inet fw4 openclash_upnp |grep "return")`
|
||||
do
|
||||
upnp_ip=$(echo "$i" |awk -F 'ip saddr \\{ ' '{print $2}' |awk '{print $1}')
|
||||
upnp_dp=$(echo "$i" |awk -F 'udp sport ' '{print $2}' |awk '{print $1}')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ]; then
|
||||
if [ -z "$(cat "$upnp_lease_file" |grep "$upnp_ip" |grep "$upnp_dp")" ]; then
|
||||
handles=$(nft list chain inet fw4 openclash_upnp |grep "$i" |awk -F '# handle ' '{print$2}')
|
||||
for handle in $handles; do
|
||||
nft delete rule inet fw4 openclash_upnp handle ${handle}
|
||||
done
|
||||
upnp_ip=$(echo "$i" |awk -F 'ip saddr ' '{print $2}' |awk '{print $1}')
|
||||
upnp_dp=$(echo "$i" |awk -F 'sport ' '{print $2}' |awk '{print $1}')
|
||||
upnp_type=$(echo "$i" |awk -F 'sport ' '{print $1}' |awk '{print $4}' |tr '[a-z]' '[A-Z]')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ] && [ -n "$upnp_type" ]; then
|
||||
if [ -z "$(cat "$upnp_lease_file" |grep "$upnp_ip" |grep "$upnp_dp" |grep "$upnp_type")" ]; then
|
||||
handle=$(nft -a list chain inet fw4 openclash_upnp |grep "$i" |awk -F '# handle ' '{print$2}')
|
||||
nft delete rule inet fw4 openclash_upnp handle ${handle}
|
||||
fi
|
||||
fi
|
||||
done >/dev/null 2>&1
|
||||
@ -239,10 +238,11 @@ fi
|
||||
for i in `$(iptables -t mangle -nL openclash_upnp |grep "RETURN")`
|
||||
do
|
||||
upnp_ip=$(echo "$i" |awk '{print $4}')
|
||||
upnp_dp=$(echo "$i" |awk -F 'udp spt:' '{print $2}')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ]; then
|
||||
if [ -z "$(cat "$upnp_lease_file" |grep "$upnp_ip" |grep "$upnp_dp")" ]; then
|
||||
iptables -t mangle -D openclash_upnp -p udp -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
upnp_dp=$(echo "$i" |awk -F 'spt:' '{print $2}')
|
||||
upnp_type=$(echo "$i" |awk '{print $2}' |tr '[a-z]' '[A-Z]')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ] && [ -n "$upnp_type" ]; then
|
||||
if [ -z "$(cat "$upnp_lease_file" |grep "$upnp_ip" |grep "$upnp_dp" |grep "$upnp_type")" ]; then
|
||||
iptables -t mangle -D openclash_upnp -p "$upnp_type" -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
done >/dev/null 2>&1
|
||||
@ -254,14 +254,15 @@ fi
|
||||
if [ -n "$line" ]; then
|
||||
upnp_ip=$(echo "$line" |awk -F ':' '{print $3}')
|
||||
upnp_dp=$(echo "$line" |awk -F ':' '{print $4}')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ]; then
|
||||
upnp_type=$(echo "$line" |awk -F ':' '{print $1}' |tr '[A-Z]' '[a-z]')
|
||||
if [ -n "$upnp_ip" ] && [ -n "$upnp_dp" ] && [ -n "$upnp_type" ]; then
|
||||
if [ -n "$FW4" ]; then
|
||||
if [ -z "$(nft list chain inet fw4 openclash_upnp |grep "$upnp_ip" |grep "$upnp_dp")" ]; then
|
||||
nft add rule inet fw4 openclash_upnp ip saddr { "$upnp_ip" } udp sport "$upnp_dp" counter return 2>/dev/null
|
||||
if [ -z "$(nft list chain inet fw4 openclash_upnp |grep "$upnp_ip" |grep "$upnp_dp" |grep "$upnp_type")" ]; then
|
||||
nft add rule inet fw4 openclash_upnp ip saddr { "$upnp_ip" } "$upnp_type" sport "$upnp_dp" counter return 2>/dev/null
|
||||
fi
|
||||
else
|
||||
if [ -z "$(iptables -t mangle -nL openclash_upnp |grep "$upnp_ip" |grep "$upnp_dp")" ]; then
|
||||
iptables -t mangle -A openclash_upnp -p udp -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
if [ -z "$(iptables -t mangle -nL openclash_upnp |grep "$upnp_ip" |grep "$upnp_dp" |grep "$upnp_type")" ]; then
|
||||
iptables -t mangle -A openclash_upnp -p "$upnp_type" -s "$upnp_ip" --sport "$upnp_dp" -j RETURN 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1 @@
|
||||
import{i,f as s,b as r,d as l}from"./vendor-5507c805.js";const n=l('<div class="py-2 text-center text-lg font-semibold">'),a=t=>(()=>{const e=n();return i(e,s(()=>t.children)),r(()=>e.classList.toggle("divider",!!t.withDivider)),e})();export{a as C};
|
@ -0,0 +1 @@
|
||||
import{c as t,L as V,i as e,F as C,b as w,d as f,k as y,p as P,j as X,g as M,M as Z,ae as G,P as J,ap as K,aq as Q,t as A,D as U,e as Y}from"./vendor-5507c805.js";import{c as ee,g as te,a as le,e as re,f as j,r as se}from"./index-83f95c10.js";import{u as W,y as ne,T as ae,z as oe,L as g,A as ie,E as ce,F as N,G as O,H as B,M as de,c as ge,B as ue,x as he}from"./index-bd53d7c8.js";import{C as I}from"./ConfigTitle-dd5fc83b.js";const fe=f('<div class="flex flex-col gap-4"><div><select class="select select-bordered w-full"></select></div><div><select class="select select-bordered w-full"></select></div><div><select class="select select-bordered w-full">'),k=f("<option>"),me=o=>{const[s]=W();return t(de,{ref:c=>{var i;return(i=o.ref)==null?void 0:i.call(o,c)},get icon(){return t(V,{size:24})},get title(){return s("logsSettings")},get children(){const c=fe(),i=c.firstChild,d=i.firstChild,b=i.nextSibling,_=b.firstChild,p=b.nextSibling,$=p.firstChild;return e(i,t(I,{withDivider:!0,get children(){return s("tableSize")}}),d),d.addEventListener("change",l=>ne(l.target.value)),e(d,t(C,{get each(){return Object.values(ae)},children:l=>(()=>{const n=k();return n.value=l,e(n,()=>s(l)),n})()})),e(b,t(I,{withDivider:!0,get children(){return s("logLevel")}}),_),_.addEventListener("change",l=>oe(l.target.value)),e(_,t(C,{get each(){return[g.Info,g.Error,g.Warning,g.Debug,g.Silent]},children:l=>(()=>{const n=k();return n.value=l,e(n,()=>s(l)),n})()})),e(p,t(I,{withDivider:!0,get children(){return s("logMaxRows")}}),$),$.addEventListener("change",l=>ie(parseInt(l.target.value))),e($,t(C,{each:ce,children:l=>(()=>{const n=k();return n.value=l,e(n,l),n})()})),w(()=>d.value=N()),w(()=>_.value=O()),w(()=>$.value=B()),c}})},ve=f("<span>"),_e=f('<div class="flex h-full flex-col gap-2"><div class="join w-full"><input type=search class="input join-item input-primary input-sm flex-1 flex-shrink-0 sm:input-md"></div><div class="overflow-x-auto whitespace-nowrap rounded-md bg-base-300"><table><thead class="sticky top-0 z-10"></thead><tbody>'),$e=f("<tr>"),be=f('<th class=bg-base-200><div class="flex items-center"><div>'),pe=f('<tr class="hover:!bg-primary hover:text-primary-content">'),Se=f("<td class=py-2>"),q=(o,s,c,i)=>{const d=se(o.getValue(s),c);return i({itemRank:d}),d.passed},Fe=()=>{let o;const[s]=W();let c=1;const[i,d]=y([]),b=ge("logs",{level:O()});P(()=>{const r=b();r&&(d(m=>[{...r,seq:c},...m].slice(0,B())),c++)});const[_,p]=y(""),[$,l]=X(y([]),{name:"logsTableSorting",storage:localStorage}),n=[{header:s("sequence"),accessorFn:r=>r.seq},{header:s("type"),accessorFn:r=>r.type,cell:({row:r})=>{const m=r.original.type;let u="";switch(m){case g.Error:u="text-error";break;case g.Warning:u="text-warning";break;case g.Info:u="text-info";break;case g.Debug:u="text-success";break}return(()=>{const S=ve();return M(S,u),e(S,()=>`[${r.original.type}]`),S})()}},{header:s("payload"),accessorFn:r=>r.payload}],E=ee({filterFns:{fuzzy:q},state:{get globalFilter(){return _()},get sorting(){return $()}},get data(){return i()},sortDescFirst:!0,columns:n,onGlobalFilterChange:p,onSortingChange:l,globalFilterFn:q,getFilteredRowModel:te(),getSortedRowModel:le(),getCoreRowModel:re()});return(()=>{const r=_e(),m=r.firstChild,u=m.firstChild,S=m.nextSibling,R=S.firstChild,D=R.firstChild,H=D.nextSibling;return u.$$input=a=>p(a.target.value),e(m,t(ue,{class:"join-item btn-sm sm:btn-md",onClick:()=>o==null?void 0:o.showModal(),get icon(){return t(Z,{})}}),null),e(D,t(G,{get each(){return E.getHeaderGroups()},children:a=>{const v=a();return(()=>{const h=$e();return e(h,t(G,{get each(){return v.headers},children:L=>{const x=L();return(()=>{const z=be(),T=z.firstChild,F=T.firstChild;return J(F,"click",x.column.getToggleSortingHandler(),!0),e(F,()=>j(x.column.columnDef.header,x.getContext())),e(T,()=>({asc:t(K,{}),desc:t(Q,{})})[x.column.getIsSorted()]??null,null),w(()=>M(F,A(x.column.getCanSort()&&"cursor-pointer select-none","flex-1"))),z})()}})),h})()}})),e(H,t(C,{get each(){return E.getRowModel().rows},children:a=>(()=>{const v=pe();return e(v,t(C,{get each(){return a.getVisibleCells()},children:h=>(()=>{const L=Se();return e(L,()=>j(h.column.columnDef.cell,h.getContext())),L})()})),v})()})),e(r,t(me,{ref:a=>o=a}),null),w(a=>{const v=s("search"),h=A(he(N()),"table relative rounded-none");return v!==a._v$&&U(u,"placeholder",a._v$=v),h!==a._v$2&&M(R,a._v$2=h),a},{_v$:void 0,_v$2:void 0}),r})()};Y(["input","click"]);export{Fe as default};
|
@ -0,0 +1 @@
|
||||
import{B as z,a1 as A,a2 as N,a3 as P,a4 as q,N as H,i as c,c as h,O as M,F as O,d as C,a5 as x,v as U,e as T,w as X}from"./vendor-5507c805.js";import{u as G,e as m,B as _,s as f,a as J,b as S,t as K}from"./index-bd53d7c8.js";let y;const Q=new Uint8Array(16);function W(){if(!y&&(y=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!y))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return y(Q)}const l=[];for(let t=0;t<256;++t)l.push((t+256).toString(16).slice(1));function Y(t,e=0){return l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]}const Z=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),E={randomUUID:Z};function tt(t,e,d){if(E.randomUUID&&!e&&!t)return E.randomUUID();t=t||{};const i=t.random||(t.rng||W)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){d=d||0;for(let r=0;r<16;++r)e[d+r]=i[r];return e}return Y(i)}const et=C('<div class="mx-auto flex max-w-screen-sm flex-col items-center gap-4 py-10"><form class=contents><div class="flex w-full flex-col gap-4"><div class=flex-1><label class=label><span class=label-text></span></label><input name=url type=url class="input input-bordered w-full"placeholder=http://127.0.0.1:9090 list=defaultEndpoints><datalist id=defaultEndpoints><option value=http://127.0.0.1:9090></option></datalist></div><div class=flex-1><label class=label><span class=label-text></span></label><input name=secret type=password class="input input-bordered w-full"placeholder=secret></div></div></form><div class="grid w-full grid-cols-2 gap-4">'),nt=C('<div class="badge badge-info flex w-full cursor-pointer items-center justify-between gap-4 py-4"><span class=truncate>'),st=x.object({url:x.string().min(1),secret:x.string()}),it=()=>{const[t]=G(),e=z(),d=A(),i=n=>{S(n),d("/overview")},r=(n,s)=>X.get(n,{headers:s?{Authorization:`Bearer ${s}`}:{}}).then(({ok:a})=>a).catch(a=>{const{message:o}=a;U.error(o)}),R=async n=>{const s=m().find(a=>a.id===n);s&&await r(s.url,s.secret)&&i(n)},b=async({url:n,secret:s})=>{const a=K(n);if(!await r(a,s))return;const o=tt(),u=m().slice(),p=u.find(v=>v.url===a);if(!p){f([{id:o,url:a,secret:s},...u]),i(o);return}p.secret=s,p.id=o,f(u),i(o)},I=n=>{const{message:s}=n;U.error(s)},{form:$}=N({extend:P({schema:st}),onSubmit:b,onError:I}),L=n=>{J()===n&&S(""),f(m().filter(s=>s.id!==n))};return q(()=>{const n=new URLSearchParams(e.search);n.has("hostname")?b({url:`${window.location.protocol}//${n.get("hostname")}${n.get("port")?`:${n.get("port")}`:""}`,secret:n.get("secret")??""}):m().length===0&&b({url:"http://127.0.0.1:9090",secret:""})}),(()=>{const n=et(),s=n.firstChild,a=s.firstChild,o=a.firstChild,u=o.firstChild,p=u.firstChild,v=o.nextSibling,k=v.firstChild,D=k.firstChild,B=s.nextSibling;return H($,s,()=>$),c(p,()=>t("endpointURL")),c(D,()=>t("secret")),c(a,h(_,{type:"submit",class:"btn-primary uppercase",get children(){return t("add")}}),null),c(B,h(O,{get each(){return m()},children:({id:w,url:V})=>(()=>{const g=nt(),j=g.firstChild;return g.$$click=()=>R(w),c(j,V),c(g,h(_,{class:"btn-circle btn-ghost btn-xs text-white",onClick:F=>{F.stopPropagation(),L(w)},get children(){return h(M,{})}}),null),g})()})),n})()};T(["click"]);export{it as default};
|
@ -0,0 +1 @@
|
||||
import{Y as a}from"./vendor-5507c805.js";import{ac as m}from"./index-bd53d7c8.js";const s=o=>a(o).locale(m()).fromNow();export{s as f};
|
After Width: | Height: | Size: 900 B |
@ -0,0 +1,270 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 200.00 200.00">
|
||||
<g stroke-width="2.00" fill="none" stroke-linecap="butt">
|
||||
<path stroke="#babcbd" vector-effect="non-scaling-stroke" d="
|
||||
M 40.95 140.48
|
||||
Q 68.55 157.30 96.63 173.25
|
||||
C 102.24 176.44 107.25 175.99 112.94 172.72
|
||||
Q 137.94 158.32 162.95 143.97
|
||||
Q 165.51 142.50 167.13 140.70
|
||||
A 1.36 1.36 0.0 0 0 167.49 139.78
|
||||
C 167.62 114.80 168.11 94.50 166.94 76.07
|
||||
C 166.62 71.04 164.79 67.55 160.95 64.72"
|
||||
/>
|
||||
<path stroke="#edefef" vector-effect="non-scaling-stroke" d="
|
||||
M 160.95 64.72
|
||||
C 158.30 59.86 148.11 55.99 143.18 53.08
|
||||
C 131.17 46.00 119.07 39.12 106.93 32.27
|
||||
C 102.78 29.92 100.95 27.45 95.80 30.54
|
||||
Q 86.26 36.27 72.74 43.77
|
||||
C 65.00 48.06 55.94 53.83 47.28 58.44
|
||||
C 36.47 64.19 37.03 68.23 37.02 79.49
|
||||
Q 36.99 107.48 37.00 135.54
|
||||
A 1.33 1.30 24.1 0 0 37.35 136.43
|
||||
L 40.95 140.48"
|
||||
/>
|
||||
<path stroke="#cdcdcd" vector-effect="non-scaling-stroke" d="
|
||||
M 160.95 64.72
|
||||
C 162.26 67.10 163.25 68.73 163.25 71.58
|
||||
Q 163.26 102.51 163.09 133.43
|
||||
Q 163.07 137.05 160.83 138.33
|
||||
Q 133.44 154.04 106.07 169.70
|
||||
C 102.53 171.72 96.73 171.58 93.59 169.67
|
||||
C 81.84 162.53 70.33 156.39 57.98 148.94
|
||||
Q 49.77 143.99 40.95 140.48"
|
||||
/>
|
||||
<path stroke="#848484" vector-effect="non-scaling-stroke" d="
|
||||
M 155.05 66.47
|
||||
A 0.30 0.30 0.0 0 0 155.05 65.95
|
||||
L 100.11 34.53
|
||||
A 0.30 0.30 0.0 0 0 99.81 34.53
|
||||
L 44.98 65.96
|
||||
A 0.30 0.30 0.0 0 0 44.98 66.48
|
||||
L 99.82 97.91
|
||||
A 0.30 0.30 0.0 0 0 100.12 97.91
|
||||
L 155.05 66.47"
|
||||
/>
|
||||
<path stroke="#848484" vector-effect="non-scaling-stroke" d="
|
||||
M 97.83 102.22
|
||||
A 0.32 0.32 0.0 0 0 97.67 101.94
|
||||
L 42.48 70.37
|
||||
A 0.32 0.32 0.0 0 0 42.00 70.65
|
||||
L 42.00 133.51
|
||||
A 0.32 0.32 0.0 0 0 42.16 133.79
|
||||
L 97.04 165.13
|
||||
A 0.32 0.32 0.0 0 0 97.52 164.85
|
||||
L 97.83 102.22"
|
||||
/>
|
||||
<path stroke="#848484" vector-effect="non-scaling-stroke" d="
|
||||
M 102.35 101.92
|
||||
A 0.32 0.32 0.0 0 0 102.19 102.20
|
||||
L 102.47 164.86
|
||||
A 0.32 0.32 0.0 0 0 102.95 165.14
|
||||
L 157.78 133.85
|
||||
A 0.32 0.32 0.0 0 0 157.94 133.57
|
||||
L 157.72 70.85
|
||||
A 0.32 0.32 0.0 0 0 157.24 70.57
|
||||
L 102.35 101.92"
|
||||
/>
|
||||
<path stroke="#848484" vector-effect="non-scaling-stroke" d="
|
||||
M 101.2539 41.9921
|
||||
A 1.17 1.17 0.0 0 0 100.0859 40.8201
|
||||
L 100.0459 40.8200
|
||||
A 1.17 1.17 0.0 0 0 98.8739 41.9880
|
||||
L 98.7861 92.2679
|
||||
A 1.17 1.17 0.0 0 0 99.9541 93.4399
|
||||
L 99.9941 93.4400
|
||||
A 1.17 1.17 0.0 0 0 101.1661 92.2720
|
||||
L 101.2539 41.9921"
|
||||
/>
|
||||
<path stroke="#848484" vector-effect="non-scaling-stroke" d="
|
||||
M 93.8121 104.2576
|
||||
A 1.09 1.09 0.0 0 0 92.3238 103.8561
|
||||
L 48.3895 129.1194
|
||||
A 1.09 1.09 0.0 0 0 47.9879 130.6077
|
||||
L 48.0079 130.6424
|
||||
A 1.09 1.09 0.0 0 0 49.4962 131.0439
|
||||
L 93.4305 105.7806
|
||||
A 1.09 1.09 0.0 0 0 93.8321 104.2923
|
||||
L 93.8121 104.2576"
|
||||
/>
|
||||
<path stroke="#848484" vector-effect="non-scaling-stroke" d="
|
||||
M 152.0194 130.6077
|
||||
A 1.09 1.09 0.0 0 0 151.6178 129.1194
|
||||
L 107.6488 103.8361
|
||||
A 1.09 1.09 0.0 0 0 106.1606 104.2377
|
||||
L 106.1406 104.2723
|
||||
A 1.09 1.09 0.0 0 0 106.5422 105.7606
|
||||
L 150.5112 131.0439
|
||||
A 1.09 1.09 0.0 0 0 151.9994 130.6423
|
||||
L 152.0194 130.6077"
|
||||
/>
|
||||
</g>
|
||||
<path fill="#dadedf" d="
|
||||
M 0.00 0.00
|
||||
L 200.00 0.00
|
||||
L 200.00 200.00
|
||||
L 0.00 200.00
|
||||
L 0.00 0.00
|
||||
Z
|
||||
M 40.95 140.48
|
||||
Q 68.55 157.30 96.63 173.25
|
||||
C 102.24 176.44 107.25 175.99 112.94 172.72
|
||||
Q 137.94 158.32 162.95 143.97
|
||||
Q 165.51 142.50 167.13 140.70
|
||||
A 1.36 1.36 0.0 0 0 167.49 139.78
|
||||
C 167.62 114.80 168.11 94.50 166.94 76.07
|
||||
C 166.62 71.04 164.79 67.55 160.95 64.72
|
||||
C 158.30 59.86 148.11 55.99 143.18 53.08
|
||||
C 131.17 46.00 119.07 39.12 106.93 32.27
|
||||
C 102.78 29.92 100.95 27.45 95.80 30.54
|
||||
Q 86.26 36.27 72.74 43.77
|
||||
C 65.00 48.06 55.94 53.83 47.28 58.44
|
||||
C 36.47 64.19 37.03 68.23 37.02 79.49
|
||||
Q 36.99 107.48 37.00 135.54
|
||||
A 1.33 1.30 24.1 0 0 37.35 136.43
|
||||
L 40.95 140.48
|
||||
Z"
|
||||
/>
|
||||
<path fill="#ffffff" d="
|
||||
M 160.95 64.72
|
||||
C 162.26 67.10 163.25 68.73 163.25 71.58
|
||||
Q 163.26 102.51 163.09 133.43
|
||||
Q 163.07 137.05 160.83 138.33
|
||||
Q 133.44 154.04 106.07 169.70
|
||||
C 102.53 171.72 96.73 171.58 93.59 169.67
|
||||
C 81.84 162.53 70.33 156.39 57.98 148.94
|
||||
Q 49.77 143.99 40.95 140.48
|
||||
L 37.35 136.43
|
||||
A 1.33 1.30 24.1 0 1 37.00 135.54
|
||||
Q 36.99 107.48 37.02 79.49
|
||||
C 37.03 68.23 36.47 64.19 47.28 58.44
|
||||
C 55.94 53.83 65.00 48.06 72.74 43.77
|
||||
Q 86.26 36.27 95.80 30.54
|
||||
C 100.95 27.45 102.78 29.92 106.93 32.27
|
||||
C 119.07 39.12 131.17 46.00 143.18 53.08
|
||||
C 148.11 55.99 158.30 59.86 160.95 64.72
|
||||
Z
|
||||
M 155.05 66.47
|
||||
A 0.30 0.30 0.0 0 0 155.05 65.95
|
||||
L 100.11 34.53
|
||||
A 0.30 0.30 0.0 0 0 99.81 34.53
|
||||
L 44.98 65.96
|
||||
A 0.30 0.30 0.0 0 0 44.98 66.48
|
||||
L 99.82 97.91
|
||||
A 0.30 0.30 0.0 0 0 100.12 97.91
|
||||
L 155.05 66.47
|
||||
Z
|
||||
M 97.83 102.22
|
||||
A 0.32 0.32 0.0 0 0 97.67 101.94
|
||||
L 42.48 70.37
|
||||
A 0.32 0.32 0.0 0 0 42.00 70.65
|
||||
L 42.00 133.51
|
||||
A 0.32 0.32 0.0 0 0 42.16 133.79
|
||||
L 97.04 165.13
|
||||
A 0.32 0.32 0.0 0 0 97.52 164.85
|
||||
L 97.83 102.22
|
||||
Z
|
||||
M 102.35 101.92
|
||||
A 0.32 0.32 0.0 0 0 102.19 102.20
|
||||
L 102.47 164.86
|
||||
A 0.32 0.32 0.0 0 0 102.95 165.14
|
||||
L 157.78 133.85
|
||||
A 0.32 0.32 0.0 0 0 157.94 133.57
|
||||
L 157.72 70.85
|
||||
A 0.32 0.32 0.0 0 0 157.24 70.57
|
||||
L 102.35 101.92
|
||||
Z"
|
||||
/>
|
||||
<path fill="#080808" d="
|
||||
M 155.05 66.47
|
||||
L 100.12 97.91
|
||||
A 0.30 0.30 0.0 0 1 99.82 97.91
|
||||
L 44.98 66.48
|
||||
A 0.30 0.30 0.0 0 1 44.98 65.96
|
||||
L 99.81 34.53
|
||||
A 0.30 0.30 0.0 0 1 100.11 34.53
|
||||
L 155.05 65.95
|
||||
A 0.30 0.30 0.0 0 1 155.05 66.47
|
||||
Z
|
||||
M 101.2539 41.9921
|
||||
A 1.17 1.17 0.0 0 0 100.0859 40.8201
|
||||
L 100.0459 40.8200
|
||||
A 1.17 1.17 0.0 0 0 98.8739 41.9880
|
||||
L 98.7861 92.2679
|
||||
A 1.17 1.17 0.0 0 0 99.9541 93.4399
|
||||
L 99.9941 93.4400
|
||||
A 1.17 1.17 0.0 0 0 101.1661 92.2720
|
||||
L 101.2539 41.9921
|
||||
Z"
|
||||
/>
|
||||
<rect fill="#ffffff" x="-1.19" y="-26.31" transform="translate(100.02,67.13) rotate(0.1)" width="2.38"
|
||||
height="52.62" rx="1.17"/>
|
||||
<path fill="#9a9a9b" d="
|
||||
M 160.95 64.72
|
||||
C 164.79 67.55 166.62 71.04 166.94 76.07
|
||||
C 168.11 94.50 167.62 114.80 167.49 139.78
|
||||
A 1.36 1.36 0.0 0 1 167.13 140.70
|
||||
Q 165.51 142.50 162.95 143.97
|
||||
Q 137.94 158.32 112.94 172.72
|
||||
C 107.25 175.99 102.24 176.44 96.63 173.25
|
||||
Q 68.55 157.30 40.95 140.48
|
||||
Q 49.77 143.99 57.98 148.94
|
||||
C 70.33 156.39 81.84 162.53 93.59 169.67
|
||||
C 96.73 171.58 102.53 171.72 106.07 169.70
|
||||
Q 133.44 154.04 160.83 138.33
|
||||
Q 163.07 137.05 163.09 133.43
|
||||
Q 163.26 102.51 163.25 71.58
|
||||
C 163.25 68.73 162.26 67.10 160.95 64.72
|
||||
Z"
|
||||
/>
|
||||
<path fill="#080808" d="
|
||||
M 97.83 102.22
|
||||
L 97.52 164.85
|
||||
A 0.32 0.32 0.0 0 1 97.04 165.13
|
||||
L 42.16 133.79
|
||||
A 0.32 0.32 0.0 0 1 42.00 133.51
|
||||
L 42.00 70.65
|
||||
A 0.32 0.32 0.0 0 1 42.48 70.37
|
||||
L 97.67 101.94
|
||||
A 0.32 0.32 0.0 0 1 97.83 102.22
|
||||
Z
|
||||
M 93.8121 104.2576
|
||||
A 1.09 1.09 0.0 0 0 92.3238 103.8561
|
||||
L 48.3895 129.1194
|
||||
A 1.09 1.09 0.0 0 0 47.9879 130.6077
|
||||
L 48.0079 130.6424
|
||||
A 1.09 1.09 0.0 0 0 49.4962 131.0439
|
||||
L 93.4305 105.7806
|
||||
A 1.09 1.09 0.0 0 0 93.8321 104.2923
|
||||
L 93.8121 104.2576
|
||||
Z"
|
||||
/>
|
||||
<path fill="#080808" d="
|
||||
M 102.35 101.92
|
||||
L 157.24 70.57
|
||||
A 0.32 0.32 0.0 0 1 157.72 70.85
|
||||
L 157.94 133.57
|
||||
A 0.32 0.32 0.0 0 1 157.78 133.85
|
||||
L 102.95 165.14
|
||||
A 0.32 0.32 0.0 0 1 102.47 164.86
|
||||
L 102.19 102.20
|
||||
A 0.32 0.32 0.0 0 1 102.35 101.92
|
||||
Z
|
||||
M 152.0194 130.6077
|
||||
A 1.09 1.09 0.0 0 0 151.6178 129.1194
|
||||
L 107.6488 103.8361
|
||||
A 1.09 1.09 0.0 0 0 106.1606 104.2377
|
||||
L 106.1406 104.2723
|
||||
A 1.09 1.09 0.0 0 0 106.5422 105.7606
|
||||
L 150.5112 131.0439
|
||||
A 1.09 1.09 0.0 0 0 151.9994 130.6423
|
||||
L 152.0194 130.6077
|
||||
Z"
|
||||
/>
|
||||
<rect fill="#ffffff" x="-26.43" y="-1.11" transform="translate(70.91,117.45) rotate(-29.9)" width="52.86"
|
||||
height="2.22" rx="1.09"/>
|
||||
<rect fill="#ffffff" x="-26.45" y="-1.11" transform="translate(129.08,117.44) rotate(29.9)" width="52.90"
|
||||
height="2.22" rx="1.09"/>
|
||||
</svg>
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
||||
/>
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
||||
<link rel="apple-touch-icon" href="./pwa-192x192.png" />
|
||||
|
||||
<title>metacubexd</title>
|
||||
<script type="module" crossorigin src="./assets/index-bd53d7c8.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/vendor-5507c805.js">
|
||||
<link rel="stylesheet" href="./assets/index-788b021a.css">
|
||||
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
<div id="root" style="display: contents"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1 @@
|
||||
{"name":"metacubexd","short_name":"metacubexd","start_url":"./","display":"standalone","background_color":"#ffffff","lang":"en","scope":"./","icons":[{"src":"pwa-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/pwa-512x512.png","sizes":"512x512","type":"image/png"},{"src":"pwa-512x512.png","sizes":"512x512","type":"image/png","purpose":"any maskable"}]}
|
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 622 B |
@ -0,0 +1 @@
|
||||
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})}
|
@ -0,0 +1 @@
|
||||
if(!self.define){let s,e={};const i=(i,n)=>(i=new URL(i+".js",n).href,e[i]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()})).then((()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s})));self.define=(n,l)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let o={};const u=s=>i(s,r),t={module:{uri:r},exports:o,require:u};e[r]=Promise.all(n.map((s=>t[s]||u(s)))).then((s=>(l(...s),o)))}}define(["./workbox-56a10583"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/Config-8226e777.js",revision:null},{url:"assets/ConfigTitle-dd5fc83b.js",revision:null},{url:"assets/Connections-02d8e92b.js",revision:null},{url:"assets/global-9f47a568.js",revision:null},{url:"assets/index-788b021a.css",revision:null},{url:"assets/index-83f95c10.js",revision:null},{url:"assets/index-bd53d7c8.js",revision:null},{url:"assets/Logs-2575e4f0.js",revision:null},{url:"assets/Overview-51176cc0.js",revision:null},{url:"assets/Proxies-99da7d66.js",revision:null},{url:"assets/Rules-3b098996.js",revision:null},{url:"assets/Setup-a0db2f96.js",revision:null},{url:"assets/vendor-5507c805.js",revision:null},{url:"index.html",revision:"a5e1d64ce0c9b3d960836f3a18769fa1"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"f5b3372f312fbbe60a6ed8c03741ff80"},{url:"pwa-192x192.png",revision:"c45f48fc59b5bf47e6cbf1626aff51fc"},{url:"pwa-512x512.png",revision:"a311504ae6a46bd29b5678a410aaafc6"},{url:"manifest.webmanifest",revision:"4d78c8bc6207146065400ff644fe5a13"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));
|
@ -227,21 +227,22 @@ yml_dns_get()
|
||||
Value = YAML.load_file('$2');
|
||||
Value['proxy-groups'].each{
|
||||
|x|
|
||||
if x['name'] == '$specific_group' then
|
||||
if (x.key?('use') and not x['use'].to_a.empty?) or (x.key?('proxies') and not x['proxies'].to_a.empty?) then
|
||||
puts 'return'
|
||||
end;
|
||||
if x['name'] =~ /${specific_group}/ then
|
||||
puts x['name'];
|
||||
break;
|
||||
end;
|
||||
};
|
||||
}.join;
|
||||
rescue Exception => e
|
||||
puts 'return'
|
||||
puts 'return';
|
||||
end;" 2>/dev/null)
|
||||
|
||||
if [ "$group_check" != "return" ]; then
|
||||
/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 "$specific_group"
|
||||
if [ "$group_check" != "return" ] && [ -n "$group_check" ]; then
|
||||
specific_group="#$group_check"
|
||||
else
|
||||
specific_group=""
|
||||
fi
|
||||
specific_group="#$specific_group"
|
||||
|
||||
elif [ "$specific_group" != "Disable" ] && [ -n "$specific_group" ]; then
|
||||
LOG_OUT "Warning: Only Meta Core Support Specific Group, Skip Setting【$dns_type$dns_address】"
|
||||
specific_group=""
|
||||
@ -380,6 +381,9 @@ Thread.new{
|
||||
if '${34}' == '1' then
|
||||
Value['unified-delay']=true;
|
||||
end;
|
||||
if '${35}' != '0' then
|
||||
Value['keep-alive-interval']=${35};
|
||||
end;
|
||||
if '${29}' != '0' then
|
||||
Value['find-process-mode']='${29}';
|
||||
end;
|
||||
|
@ -1024,7 +1024,7 @@ do
|
||||
}.join
|
||||
end;
|
||||
|
||||
if '$server_type' == 'hysteria' then
|
||||
if '$server_type' == 'hysteria' or '$server_type' == 'hysteria2' then
|
||||
Thread.new{
|
||||
#hysteria_protocol
|
||||
if Value['proxies'][$count].key?('protocol') then
|
||||
@ -1106,6 +1106,13 @@ do
|
||||
end
|
||||
}.join
|
||||
|
||||
#hysteria_obfs_password
|
||||
if Value['proxies'][$count].key?('obfs-password') then
|
||||
hysteria_obfs_password = '${uci_set}hysteria_obfs_password=' + Value['proxies'][$count]['obfs-password'].to_s
|
||||
system(hysteria_obfs_password)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#hysteria_auth
|
||||
if Value['proxies'][$count].key?('auth') then
|
||||
|
@ -302,6 +302,7 @@ yml_servers_set()
|
||||
config_get "multiplex_statistic" "$section" "multiplex_statistic" ""
|
||||
config_get "multiplex_only_tcp" "$section" "multiplex_only_tcp" ""
|
||||
config_get "other_parameters" "$section" "other_parameters" ""
|
||||
config_get "hysteria_obfs_password" "$section" "hysteria_obfs_password" ""
|
||||
|
||||
if [ "$enabled" = "0" ]; then
|
||||
return
|
||||
@ -908,6 +909,75 @@ EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
#hysteria2
|
||||
if [ "$type" = "hysteria2" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
- name: "$name"
|
||||
type: $type
|
||||
server: "$server"
|
||||
port: $port
|
||||
password: "$password"
|
||||
EOF
|
||||
if [ -n "$hysteria_up" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
up: "$hysteria_up"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$hysteria_down" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
down: "$hysteria_down"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$skip_cert_verify" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
skip-cert-verify: $skip_cert_verify
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$sni" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
sni: "$sni"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$hysteria_alpn" ]; then
|
||||
if [ -z "$(echo $hysteria_alpn |grep ' ')" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
alpn:
|
||||
- "$hysteria_alpn"
|
||||
EOF
|
||||
else
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
alpn:
|
||||
EOF
|
||||
config_list_foreach "$section" "hysteria_alpn" set_alpn
|
||||
fi
|
||||
fi
|
||||
if [ -n "$hysteria_obfs" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
obfs: "$hysteria_obfs"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$hysteria_obfs_password" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
obfs-password: "$hysteria_obfs_password"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$hysteria_ca" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
ca: "$hysteria_ca"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$hysteria_ca_str" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
ca-str: "$hysteria_ca_str"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$fingerprint" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
fingerprint: "$fingerprint"
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
#vless
|
||||
if [ "$type" = "vless" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
|
@ -6,8 +6,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=v2ray-plugin
|
||||
PKG_VERSION:=5.11.0
|
||||
PKG_RELEASE:=77
|
||||
PKG_VERSION:=5.12.0
|
||||
PKG_RELEASE:=78
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)?
|
||||
|