mirror of
https://github.com/roacn/openwrt-packages.git
synced 2025-01-08 11:57:31 +08:00
🎁 Sync 2022-12-08 23:36
This commit is contained in:
parent
20bd608773
commit
03a11ff7d5
@ -1,83 +0,0 @@
|
||||
# SPDX-Identifier-License: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic-Go
|
||||
PKG_VERSION:=0.2.13
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/cnsilvan/UnblockNeteaseMusic/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=92201b7f04ab1015c806c672b98a29b97d0f137d9b60e6d35d279c2064ed86a4
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY \
|
||||
CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(firstword $(subst -, ,$(PKG_NAME)))-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/cnsilvan/UnblockNeteaseMusic
|
||||
GO_PKG_BUILD_PKG:=$$(GO_PKG)
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
COMPILE_TIME:= $(shell TZ=UTC-8 date '+%Y-%m-%d %H:%M:%S')
|
||||
GO_PKG_LDFLAGS+= \
|
||||
-X '$(GO_PKG)/version.Version=$(PKG_VERSION)' \
|
||||
-X '$(GO_PKG)/version.BuildTime=$(COMPILE_TIME)' \
|
||||
-X '$(GO_PKG)/version.ExGoVersionInfo=$(GO_ARM) $(GO_MIPS)$(GO_MIPS64)'
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../../lang/golang/golang-package.mk
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go/config
|
||||
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY
|
||||
bool "Compiling with GOPROXY proxy"
|
||||
default n
|
||||
|
||||
config UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX
|
||||
bool "Compress executable files with UPX"
|
||||
depends on !mips64
|
||||
default n
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_GOPROXY),y)
|
||||
export GO111MODULE=on
|
||||
export GOPROXY=https://goproxy.io
|
||||
endif
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=Revive Netease Cloud Music (Golang)
|
||||
URL:=https://github.com/cnsilvan/UnblockNeteaseMusic
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call GoPackage/Build/Compile)
|
||||
ifeq ($(CONFIG_UNBLOCKNETEASEMUSIC_GO_COMPRESS_UPX),y)
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/UnblockNeteaseMusic
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/UnblockNeteaseMusic-Go/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/UnblockNeteaseMusic $(1)/usr/bin/UnblockNeteaseMusic
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusicGo
|
||||
$(CP) ./files/* $(1)/usr/share/UnblockNeteaseMusicGo/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,UnblockNeteaseMusic-Go))
|
||||
$(eval $(call BuildPackage,UnblockNeteaseMusic-Go))
|
@ -1,14 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICIjCCAaigAwIBAgIUTc9HQDej5hLCQ74u436a5yE4MDcwCgYIKoZIzj0EAwMw
|
||||
SDELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRlYXNlTXVzaWMgUm9v
|
||||
dCBDQTETMBEGA1UECgwKMTcxNTE3MzMyOTAeFw0yMTA0MzAwNzIzMDJaFw0yNjA0
|
||||
MjkwNzIzMDJaMEgxCzAJBgNVBAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFz
|
||||
ZU11c2ljIFJvb3QgQ0ExEzARBgNVBAoMCjE3MTUxNzMzMjkwdjAQBgcqhkjOPQIB
|
||||
BgUrgQQAIgNiAASIyI7lYgGlq49qWtY1O2/XNDeowYf7W/Z+l7C14bphxAJ9jSDo
|
||||
tLwbFPWy5VPENc0rB0/yeHA2z7LU67POL2gGgp+17y7scLkkBk3Q7wRMETrtP44Z
|
||||
ITBstZ0wzVyyQEKjUzBRMB0GA1UdDgQWBBQ2F7+t8cPHJaWuCD8RHTSdLugKYzAf
|
||||
BgNVHSMEGDAWgBQ2F7+t8cPHJaWuCD8RHTSdLugKYzAPBgNVHRMBAf8EBTADAQH/
|
||||
MAoGCCqGSM49BAMDA2gAMGUCMQDqaRX2e01e0U+f0As/KUKDhmG5ElkK5CjYK9jk
|
||||
kXLNGFXJLGta6CDvjtMLBPc20qkCMBvDs+JnJKVBEJNZVsRBBs+v2YxNU/u2aYJa
|
||||
dMwXuFveSDWOS7mBeRztX/geEggiSw==
|
||||
-----END CERTIFICATE-----
|
@ -1,15 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICRDCCAcqgAwIBAgIUeVqRrT2mHG5Mc8JD+ErphiAmlgkwCgYIKoZIzj0EAwMw
|
||||
SDELMAkGA1UEBhMCQ04xJDAiBgNVBAMMG1VuYmxvY2tOZXRlYXNlTXVzaWMgUm9v
|
||||
dCBDQTETMBEGA1UECgwKMTcxNTE3MzMyOTAeFw0yMTA0MzAwNzIzMDJaFw0yMjA0
|
||||
MzAwNzIzMDJaMHsxCzAJBgNVBAYTAkNOMREwDwYDVQQHDAhIYW5nemhvdTEsMCoG
|
||||
A1UECgwjTmV0RWFzZSAoSGFuZ3pob3UpIE5ldHdvcmsgQ28uLCBMdGQxETAPBgNV
|
||||
BAsMCElUIERlcHQuMRgwFgYDVQQDDA8qLm11c2ljLjE2My5jb20wdjAQBgcqhkjO
|
||||
PQIBBgUrgQQAIgNiAAQTPyU9RQ1pAFMLmozi+c4pEC1rrxAlPGwO9Em+qV+a5qLW
|
||||
gQjjsJeabMqJ/UQ7hDtdKVxWuXiAjMiDcXwL63I71MZKPTAEKXdCmNQwb4kXvRUn
|
||||
oOR4r7BMxEpGlf0CULWjQjBAMBMGA1UdJQQMMAoGCCsGAQUFBwMBMCkGA1UdEQQi
|
||||
MCCCDW11c2ljLjE2My5jb22CDyoubXVzaWMuMTYzLmNvbTAKBggqhkjOPQQDAwNo
|
||||
ADBlAjEAs5bdgnNP/DiK919RiWscC0kyuY0ugG1C8m8F2Yod4MI3oTyrkVcag21o
|
||||
NSzm802uAjBoPuKEbjjFP4ics0BQdICiVd6WCVAsE69FnlmqRteAJqxvdKGpVLi+
|
||||
Qi3arfomrrc=
|
||||
-----END CERTIFICATE-----
|
@ -1,9 +0,0 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
BgUrgQQAIg==
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIGkAgEBBDBfW3twxGaQmMzP9p0/UU5EvHFVCbBw4piVFJ+pm/uFY6CKZkC5LGMa
|
||||
Uc9vn/KiewGgBwYFK4EEACKhZANiAAQTPyU9RQ1pAFMLmozi+c4pEC1rrxAlPGwO
|
||||
9Em+qV+a5qLWgQjjsJeabMqJ/UQ7hDtdKVxWuXiAjMiDcXwL63I71MZKPTAEKXdC
|
||||
mNQwb4kXvRUnoOR4r7BMxEpGlf0CULU=
|
||||
-----END EC PRIVATE KEY-----
|
@ -1,144 +0,0 @@
|
||||
From f4f5d11b578a1ab2c3d089bbe5453052b43892bb Mon Sep 17 00:00:00 2001
|
||||
From: tofuliang <tofuliang@gmail.com>
|
||||
Date: Mon, 24 Jan 2022 18:53:11 +0800
|
||||
Subject: [PATCH] fix block ad,add web traffic logs
|
||||
|
||||
---
|
||||
app.go | 1 +
|
||||
config/config.go | 1 +
|
||||
processor/processor.go | 55 +++++++++++++++++++++++++++++++++---------
|
||||
3 files changed, 45 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/app.go b/app.go
|
||||
index 73a6070..1018d75 100644
|
||||
--- a/app.go
|
||||
+++ b/app.go
|
||||
@@ -45,6 +45,7 @@ func main() {
|
||||
log.Println("EnableLocalVip=", *config.EnableLocalVip)
|
||||
log.Println("UnlockSoundEffects=", *config.UnlockSoundEffects)
|
||||
log.Println("QQCookieFile=", *config.QQCookieFile)
|
||||
+ log.Println("LogWebTraffic=", *config.LogWebTraffic)
|
||||
if host.InitHosts() == nil {
|
||||
//go func() {
|
||||
// // // terminal: $ go tool pprof -http=:8081 http://localhost:6060/debug/pprof/heap
|
||||
diff --git a/config/config.go b/config/config.go
|
||||
index 6c07873..a653cdf 100644
|
||||
--- a/config/config.go
|
||||
+++ b/config/config.go
|
||||
@@ -31,6 +31,7 @@ var (
|
||||
EnableLocalVip = flag.Bool("lv", false, "enable local vip")
|
||||
UnlockSoundEffects = flag.Bool("sef", false, "unlock SoundEffects")
|
||||
QQCookieFile = flag.String("qc", "./qq.cookie", "specify cookies file ,such as : \"qq.cookie\"")
|
||||
+ LogWebTraffic = flag.Bool("wl", false, "log request url and response")
|
||||
)
|
||||
|
||||
func ValidParams() bool {
|
||||
diff --git a/processor/processor.go b/processor/processor.go
|
||||
index 8d09dbf..d07b9d3 100644
|
||||
--- a/processor/processor.go
|
||||
+++ b/processor/processor.go
|
||||
@@ -6,14 +6,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/cache"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/common"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/config"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/network"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/processor/crypto"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/provider"
|
||||
- "github.com/cnsilvan/UnblockNeteaseMusic/utils"
|
||||
- "golang.org/x/text/width"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@@ -22,6 +14,15 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
+
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/cache"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/common"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/config"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/network"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/processor/crypto"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/provider"
|
||||
+ "github.com/cnsilvan/UnblockNeteaseMusic/utils"
|
||||
+ "golang.org/x/text/width"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -188,6 +189,9 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
if ok {
|
||||
code = codeN.String()
|
||||
}
|
||||
+
|
||||
+ logResponse(netease)
|
||||
+
|
||||
if strings.EqualFold(netease.Path, "/api/osx/version") {
|
||||
modified = disableUpdate(netease)
|
||||
} else if strings.Contains(netease.Path, "/usertool/sound/") {
|
||||
@@ -197,9 +201,24 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
for key, resp := range netease.JsonBody {
|
||||
if strings.Contains(key, "/usertool/sound/") {
|
||||
modified = unblockSoundEffects(resp.(map[string]interface{}))
|
||||
- } else if *config.BlockAds && strings.Contains(netease.Path, "api/ad/") {
|
||||
+ } else if *config.BlockAds && strings.Contains(key, "api/ad/") {
|
||||
+ log.Println("block Ad has been triggered(" + key + ").")
|
||||
resp = &common.MapType{}
|
||||
modified = true
|
||||
+ } else if *config.BlockAds && strings.EqualFold(key, "/api/v2/banner/get") {
|
||||
+ newInfo := make(common.SliceType, 0)
|
||||
+ info := netease.JsonBody[key]
|
||||
+ for _, data := range info.(common.MapType)["banners"].(common.SliceType) {
|
||||
+ if banner, ok := data.(common.MapType); ok {
|
||||
+ if banner["adid"] == nil {
|
||||
+ newInfo = append(newInfo, banner)
|
||||
+ } else {
|
||||
+ log.Println("block banner Ad has been triggered.")
|
||||
+ modified = true
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ info.(common.MapType)["banners"] = newInfo
|
||||
}
|
||||
}
|
||||
} else if !netease.Web && (code == "401" || code == "512") && strings.Contains(netease.Path, "manipulate") {
|
||||
@@ -220,7 +239,9 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
// log.Println("NeedRepackage")
|
||||
modifiedJson, _ := json.Marshal(netease.JsonBody)
|
||||
// log.Println(netease)
|
||||
- // log.Println(string(modifiedJson))
|
||||
+ if *config.LogWebTraffic {
|
||||
+ log.Println("modified =>\n" + string(modifiedJson))
|
||||
+ }
|
||||
if netease.Encrypted {
|
||||
modifiedJson = crypto.AesEncryptECB(modifiedJson, []byte(aeskey))
|
||||
}
|
||||
@@ -258,14 +279,24 @@ func disableUpdate(netease *Netease) bool {
|
||||
if len(value.(common.SliceType)) > 0 {
|
||||
modified = true
|
||||
jsonBody["updateFiles"] = make(common.SliceType, 0)
|
||||
+ log.Println("disable update has been triggered.")
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
- // modifiedJson, _ := json.Marshal(jsonBody)
|
||||
- // log.Println(string(modifiedJson))
|
||||
return modified
|
||||
}
|
||||
+
|
||||
+func logResponse(netease *Netease) {
|
||||
+ if *config.LogWebTraffic {
|
||||
+ reqUrl := netease.Path
|
||||
+ jsonBody := netease.JsonBody
|
||||
+ modifiedJson, _ := json.Marshal(jsonBody)
|
||||
+ sep := "===================================\n"
|
||||
+ log.Println(sep + reqUrl + " => \n" + string(modifiedJson) + "\n")
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
func localVIP(netease *Netease) bool {
|
||||
if !*config.EnableLocalVip {
|
||||
return false
|
@ -1,29 +0,0 @@
|
||||
From 6c009953d357d1cc03478cf65fc05701fb1966d6 Mon Sep 17 00:00:00 2001
|
||||
From: ameansone <ameansone@outlook.com>
|
||||
Date: Sun, 5 Dec 2021 19:18:20 +0800
|
||||
Subject: [PATCH] fix(processor): avoid unnecessary decryption
|
||||
|
||||
---
|
||||
processor/processor.go | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/processor/processor.go b/processor/processor.go
|
||||
index 8d09dbf..011571b 100644
|
||||
--- a/processor/processor.go
|
||||
+++ b/processor/processor.go
|
||||
@@ -177,9 +177,13 @@ func RequestAfter(request *http.Request, response *http.Response, netease *Netea
|
||||
if netease.Forward {
|
||||
aeskey = linuxApiKey
|
||||
}
|
||||
- decryptECBBytes, encrypted := crypto.AesDecryptECB(decryptECBBytes, []byte(aeskey))
|
||||
- netease.Encrypted = encrypted
|
||||
result := utils.ParseJson(decryptECBBytes)
|
||||
+ netease.Encrypted = false;
|
||||
+ if result == nil {
|
||||
+ decryptECBBytes, encrypted := crypto.AesDecryptECB(decryptECBBytes, []byte(aeskey))
|
||||
+ netease.Encrypted = encrypted
|
||||
+ result = utils.ParseJson(decryptECBBytes)
|
||||
+ }
|
||||
netease.JsonBody = result
|
||||
|
||||
modified := false
|
@ -1,52 +0,0 @@
|
||||
# SPDX-Identifier-License: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=UnblockNeteaseMusic
|
||||
PKG_BASE_VERSION:=0.27.0
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git
|
||||
PKG_SOURCE_DATE:=2022-10-09
|
||||
PKG_SOURCE_VERSION:=253dc89329ebd16ff22175d9d0ab9382ed8aaccc
|
||||
PKG_MIRROR_HASH:=c2ed5f269c1935575c57ed5489504ef37f453b2a512209bf0762a55fc3eb4b29
|
||||
|
||||
PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
||||
|
||||
PKG_LICENSE:=LGPL-3.0-only
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/UnblockNeteaseMusic
|
||||
SECTION:=multimedia
|
||||
CATEGORY:=Multimedia
|
||||
TITLE:=Revive Netease Cloud Music (NodeJS)
|
||||
URL:=https://github.com/nondanee/UnblockNeteaseMusic
|
||||
DEPENDS:=+node
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
xzcat $(DL_DIR)/$(PKG_SOURCE) | $(TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
echo -e $(PKG_BASE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/core_ver
|
||||
echo -e $(PKG_SOURCE_VERSION) > $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/local_ver
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/UnblockNeteaseMusic/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/UnblockNeteaseMusic
|
||||
$(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/* $(1)/usr/share/UnblockNeteaseMusic
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,UnblockNeteaseMusic))
|
@ -1,147 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.45.70
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
config PACKAGE_kmod-inet-diag
|
||||
default y if PACKAGE_$(PKG_NAME)
|
||||
|
||||
config PACKAGE_kmod-nft-tproxy
|
||||
default y if PACKAGE_firewall4
|
||||
|
||||
config PACKAGE_kmod-ipt-nat
|
||||
default y if ! PACKAGE_firewall4
|
||||
|
||||
config PACKAGE_iptables-mod-tproxy
|
||||
default y if ! PACKAGE_firewall4
|
||||
|
||||
config PACKAGE_iptables-mod-extra
|
||||
default y if ! PACKAGE_firewall4
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=LuCI support for clash
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-certificates +ipset +ip-full \
|
||||
+libcap +libcap-bin +ruby +ruby-yaml +kmod-tun +unzip
|
||||
MAINTAINER:=vernesong
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
A LuCI support for clash
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(CP) $(CURDIR)/root $(PKG_BUILD_DIR)
|
||||
$(CP) $(CURDIR)/luasrc $(PKG_BUILD_DIR)
|
||||
$(foreach po,$(wildcard ${CURDIR}/po/zh-cn/*.po), \
|
||||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
|
||||
chmod 0755 $(PKG_BUILD_DIR)/root/etc/init.d/openclash
|
||||
chmod -R 0755 $(PKG_BUILD_DIR)/root/usr/share/openclash/
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/config
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/rule_provider
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/backup
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/etc/openclash/core
|
||||
mkdir -p $(PKG_BUILD_DIR)/root/usr/share/openclash/backup
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/config/openclash" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_rules.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_rules_2.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_hosts.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_hosts.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fake_filter.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fake_filter.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns_policy.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns_policy.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fallback_filter.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_netflix_domains.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_netflix_domains.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_force_sniffing_domain.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_force_sniffing_domain.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_domain_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_domain_filter.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_port_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_port_filter.yaml" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv4.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv6.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_chnroute_pass.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_chnroute_pass.list" >/dev/null 2>&1
|
||||
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_chnroute6_pass.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_chnroute6_pass.list" >/dev/null 2>&1
|
||||
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/preinst
|
||||
#!/bin/sh
|
||||
if [ -f "/etc/config/openclash" ]; then
|
||||
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
cp -rf "/etc/openclash" "/tmp/openclash" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/yacd" "/tmp/openclash_yacd" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/dashboard" "/tmp/openclash_dashboard" >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
uci -q set openclash.config.enable=0
|
||||
uci -q commit openclash
|
||||
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
cp -rf "/etc/openclash" "/tmp/openclash" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/yacd" "/tmp/openclash_yacd" >/dev/null 2>&1
|
||||
cp -rf "/usr/share/openclash/ui/dashboard" "/tmp/openclash_dashboard" >/dev/null 2>&1
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postrm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/openclash >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash.log >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_start.log >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_last_version >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_config.tmp >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash.change >/dev/null 2>&1
|
||||
rm -rf /tmp/Proxy_Group >/dev/null 2>&1
|
||||
rm -rf /tmp/rules_name >/dev/null 2>&1
|
||||
rm -rf /tmp/rule_providers_name >/dev/null 2>&1
|
||||
rm -rf /tmp/clash_last_version >/dev/null 2>&1
|
||||
rm -rf /usr/share/openclash/backup >/dev/null 2>&1
|
||||
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash_custom_domain.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash_chnroute_pass.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash_chnroute6_pass.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/dnsmasq.d/dnsmasq_accelerated-domains.china.conf >/dev/null 2>&1
|
||||
rm -rf /tmp/dler* >/dev/null 2>&1
|
||||
rm -rf /tmp/etc/openclash >/dev/null 2>&1
|
||||
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
|
||||
uci -q delete firewall.openclash
|
||||
uci -q commit firewall
|
||||
uci -q delete ucitrack.@openclash[-1]
|
||||
uci -q commit ucitrack
|
||||
rm -rf /tmp/luci-*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.*.lmo $(1)/usr/lib/lua/luci/i18n/
|
||||
$(CP) $(PKG_BUILD_DIR)/root/* $(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/luasrc/* $(1)/usr/lib/lua/luci/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
File diff suppressed because it is too large
Load Diff
@ -1,146 +0,0 @@
|
||||
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
|
||||
m = SimpleForm("openclash",translate("OpenClash"))
|
||||
m.description = translate("A Clash Client For OpenWrt")
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
m:section(SimpleSection).template = "openclash/status"
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
function config_check(CONFIG_FILE)
|
||||
local yaml = fs.isfile(CONFIG_FILE)
|
||||
if yaml then
|
||||
yaml = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "puts YAML.load_file(\'%s\')" 2>/dev/null',CONFIG_FILE))
|
||||
if yaml ~= "false\n" and yaml ~= "" then
|
||||
return "Config Normal"
|
||||
else
|
||||
return "Config Abnormal"
|
||||
end
|
||||
elseif (yaml ~= 0) then
|
||||
return "File Not Exist"
|
||||
end
|
||||
end
|
||||
|
||||
local e,a={}
|
||||
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=fs.basename(o)
|
||||
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
|
||||
if fs.mtime(BACKUP_FILE) then
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
|
||||
else
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
|
||||
end
|
||||
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
|
||||
e[t].state=translate("Enable")
|
||||
else
|
||||
e[t].state=translate("Disable")
|
||||
end
|
||||
e[t].check=translate(config_check(o))
|
||||
end
|
||||
end
|
||||
|
||||
form = SimpleForm("openclash")
|
||||
form.reset = false
|
||||
form.submit = false
|
||||
tb=form:section(Table,e)
|
||||
st=tb:option(DummyValue,"state",translate("State"))
|
||||
nm=tb:option(DummyValue,"name",translate("Config Alias"))
|
||||
sb=tb:option(DummyValue,"name",translate("Subscription Info"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
ck=tb:option(DummyValue,"check",translate("Grammar Check"))
|
||||
st.template="openclash/cfg_check"
|
||||
ck.template="openclash/cfg_check"
|
||||
sb.template="openclash/sub_info_show"
|
||||
|
||||
btnis=tb:option(Button,"switch",translate("Switch Config"))
|
||||
btnis.template="openclash/other_button"
|
||||
btnis.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btnis.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "client"))
|
||||
end
|
||||
|
||||
s = SimpleForm("openclash")
|
||||
s.reset = false
|
||||
s.submit = false
|
||||
s:section(SimpleSection).template = "openclash/myip"
|
||||
|
||||
local t = {
|
||||
{enable, disable}
|
||||
}
|
||||
|
||||
ap = SimpleForm("openclash")
|
||||
ap.reset = false
|
||||
ap.submit = false
|
||||
|
||||
ss = ap:section(Table, t)
|
||||
|
||||
o = ss:option(Button, "enable", " ")
|
||||
o.inputtitle = translate("Enable OpenClash")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
o = ss:option(Button, "disable", " ")
|
||||
o.inputtitle = translate("Disable OpenClash")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
uci:set("openclash", "config", "enable", 0)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash stop >/dev/null 2>&1 &")
|
||||
end
|
||||
|
||||
d = SimpleForm("openclash")
|
||||
d.title = translate("Credits")
|
||||
d.reset = false
|
||||
d.submit = false
|
||||
d:section(SimpleSection).template = "openclash/developer"
|
||||
|
||||
dler = SimpleForm("openclash")
|
||||
dler.reset = false
|
||||
dler.submit = false
|
||||
dler:section(SimpleSection).template = "openclash/dlercloud"
|
||||
|
||||
if uci:get("openclash", "config", "dler_token") then
|
||||
return m, dler, form, s, ap, d
|
||||
else
|
||||
return m, form, s, ap, d
|
||||
end
|
@ -1,213 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local json = require "luci.jsonc"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
||||
m = Map(openclash, translate("Config Subscribe Edit"))
|
||||
m.pageaction = false
|
||||
m.description=translate("Convert Subscribe function of Online is Supported By subconverter Written By tindy X") ..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("API By tindy X & lhie1")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("Subconverter external configuration (subscription conversion template) Description: https://github.com/tindy2013/subconverter#external-configuration-file")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("If you need to customize the external configuration file (subscription conversion template), please write it according to the instructions, upload it to the accessible location of the external network, and fill in the address correctly when using it")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("If you have a recommended external configuration file (subscription conversion template), you can modify by following The file format of /usr/share/openclash/res/sub_ini.list and pr")
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/config-subscribe")
|
||||
if m.uci:get(openclash, sid) ~= "config_subscribe" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Config Subscribe Setting ]]--
|
||||
s = m:section(NamedSection, sid, "config_subscribe")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
---- name
|
||||
o = s:option(Value, "name", translate("Config Alias"))
|
||||
o.description = font_red..bold_on..translate("Name For Distinguishing")..bold_off..font_off
|
||||
o.placeholder = translate("config")
|
||||
o.rmempty = true
|
||||
|
||||
---- address
|
||||
o = s:option(Value, "address", translate("Subscribe Address"))
|
||||
o.template = "cbi/tvalue"
|
||||
o.rows = 10
|
||||
o.wrap = "off"
|
||||
o.description = font_red..bold_on..translate("SS/SSR/Vmess or Other Link And Subscription Address is Supported When Online Subscription Conversion is Enabled, Multiple Links Should be One Per Line or Separated By |")..bold_off..font_off
|
||||
o.placeholder = translate("Not Null")
|
||||
o.rmempty = false
|
||||
function o.validate(self, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
value = value:gsub("%c*$", "")
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
local sub_path = "/tmp/dler_sub"
|
||||
local info, token, get_sub, sub_info
|
||||
local token = uci:get("openclash", "config", "dler_token")
|
||||
if token then
|
||||
get_sub = string.format("curl -sL -H 'Content-Type: application/json' --connect-timeout 2 -d '{\"access_token\":\"%s\"}' -X POST https://dler.cloud/api/v1/managed/clash -o %s", token, sub_path)
|
||||
if not nixio.fs.access(sub_path) then
|
||||
luci.sys.exec(get_sub)
|
||||
else
|
||||
if fs.readfile(sub_path) == "" or not fs.readfile(sub_path) then
|
||||
luci.sys.exec(get_sub)
|
||||
end
|
||||
end
|
||||
sub_info = fs.readfile(sub_path)
|
||||
if sub_info then
|
||||
sub_info = json.parse(sub_info)
|
||||
end
|
||||
if sub_info and sub_info.ret == 200 then
|
||||
o:value(sub_info.smart)
|
||||
o:value(sub_info.ss)
|
||||
o:value(sub_info.vmess)
|
||||
o:value(sub_info.trojan)
|
||||
else
|
||||
fs.unlink(sub_path)
|
||||
end
|
||||
end
|
||||
|
||||
---- subconverter
|
||||
o = s:option(Flag, "sub_convert", translate("Subscribe Convert Online"))
|
||||
o.description = translate("Convert Subscribe Online With Template, Mix Proxies and Keep Settings options Will Not Effect")
|
||||
o.default = 0
|
||||
|
||||
---- Convert Address
|
||||
o = s:option(Value, "convert_address", translate("Convert Address"))
|
||||
o.rmempty = true
|
||||
o.description = font_red..bold_on..translate("Note: There is A Risk of Privacy Leakage in Online Convert")..bold_off..font_off
|
||||
o:depends("sub_convert", "1")
|
||||
o:value("https://api.dler.io/sub", translate("api.dler.io")..translate("(Default)"))
|
||||
o:value("https://subconverter.herokuapp.com/sub", translate("subconverter.herokuapp.com")..translate("(Default)"))
|
||||
o:value("https://v.id9.cc/sub", translate("v.id9.cc")..translate("(Support Vless By Pinyun)"))
|
||||
o:value("https://sub.id9.cc/sub", translate("sub.id9.cc"))
|
||||
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
|
||||
o.default = "https://api.dler.io/sub"
|
||||
|
||||
---- Template
|
||||
o = s:option(ListValue, "template", translate("Template Name"))
|
||||
o.rmempty = true
|
||||
o:depends("sub_convert", "1")
|
||||
file = io.open("/usr/share/openclash/res/sub_ini.list", "r");
|
||||
for l in file:lines() do
|
||||
if l ~= "" and l ~= nil then
|
||||
o:value(string.sub(luci.sys.exec(string.format("echo '%s' |awk -F ',' '{print $1}' 2>/dev/null",l)),1,-2))
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
o:value("0", translate("Custom Template"))
|
||||
|
||||
---- Custom Template
|
||||
o = s:option(Value, "custom_template_url", translate("Custom Template URL"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Not Null")
|
||||
o.datatype = "or(host, string)"
|
||||
o:depends("template", "0")
|
||||
|
||||
---- emoji
|
||||
o = s:option(ListValue, "emoji", translate("Emoji"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- udp
|
||||
o = s:option(ListValue, "udp", translate("UDP Enable"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- skip-cert-verify
|
||||
o = s:option(ListValue, "skip_cert_verify", translate("skip-cert-verify"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- sort
|
||||
o = s:option(ListValue, "sort", translate("Sort"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- node type
|
||||
o = s:option(ListValue, "node_type", translate("Append Node Type"))
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- rule provider
|
||||
o = s:option(ListValue, "rule_provider", translate("Use Rule Provider"))
|
||||
o.description = font_red..bold_on..translate("Note: Please Make Sure Backend Service Supports This Feature")..bold_off..font_off
|
||||
o.rmempty = false
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o:depends("sub_convert", "1")
|
||||
|
||||
---- key
|
||||
o = s:option(DynamicList, "keyword", font_red..bold_on..translate("Keyword Match")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("eg: hk or tw&bgp")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
|
||||
---- exkey
|
||||
o = s:option(DynamicList, "ex_keyword", font_red..bold_on..translate("Exclude Keyword Match")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("eg: hk or tw&bgp")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
|
||||
---- de_exkey
|
||||
o = s:option(MultiValue, "de_ex_keyword", font_red..bold_on..translate("Exclude Keyword Match Default")..bold_off..font_off)
|
||||
o.rmempty = true
|
||||
o:depends("sub_convert", 0)
|
||||
o:value("过期时间")
|
||||
o:value("剩余流量")
|
||||
o:value("TG群")
|
||||
o:value("官网")
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,150 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
m = Map("openclash", translate("Config Update"))
|
||||
m.pageaction = false
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
||||
---- update Settings
|
||||
o = s:option(Flag, "auto_update", translate("Auto Update"))
|
||||
o.description = translate("Auto Update Server subscription")
|
||||
o.default = 0
|
||||
|
||||
o = s:option(ListValue, "config_auto_update_mode", translate("Update Mode"))
|
||||
o:depends("auto_update", "1")
|
||||
o:value("0", translate("Appointment Mode"))
|
||||
o:value("1", translate("Loop Mode"))
|
||||
o.default = "0"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(ListValue, "config_update_week_time", translate("Update Time (Every Week)"))
|
||||
o:depends("config_auto_update_mode", "0")
|
||||
o:value("*", translate("Every Day"))
|
||||
o:value("1", translate("Every Monday"))
|
||||
o:value("2", translate("Every Tuesday"))
|
||||
o:value("3", translate("Every Wednesday"))
|
||||
o:value("4", translate("Every Thursday"))
|
||||
o:value("5", translate("Every Friday"))
|
||||
o:value("6", translate("Every Saturday"))
|
||||
o:value("0", translate("Every Sunday"))
|
||||
o.default = "1"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(ListValue, "auto_update_time", translate("Update time (every day)"))
|
||||
o:depends("config_auto_update_mode", "0")
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default = "0"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "config_update_interval", translate("Update Interval(min)"))
|
||||
o.default = "60"
|
||||
o.datatype = "integer"
|
||||
o:depends("config_auto_update_mode", "1")
|
||||
o.rmempty = true
|
||||
|
||||
-- [[ Edit Server ]] --
|
||||
s = m:section(TypedSection, "config_subscribe", translate("Config Subscribe Edit"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/config-subscribe-edit/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- name
|
||||
o = s:option(DummyValue, "name", translate("Config Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("config")
|
||||
end
|
||||
|
||||
---- address
|
||||
o = s:option(DummyValue, "address", translate("Subscribe Address"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) then
|
||||
if string.len(Value.cfgvalue(...)) <= 50 then
|
||||
return Value.cfgvalue(...)
|
||||
else
|
||||
return string.sub(Value.cfgvalue(...), 1, 50) .. " ..."
|
||||
end
|
||||
end
|
||||
return translate("None")
|
||||
end
|
||||
|
||||
---- template
|
||||
o = s:option(DummyValue, "template", translate("Template Name"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) ~= "0" then
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
else
|
||||
return translate("Custom Template")
|
||||
end
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Update Config")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
uci:foreach("openclash", "config_subscribe",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil and s.enabled == "1" then
|
||||
local back_cfg_path_yaml="/etc/openclash/backup/" .. s.name .. ".yaml"
|
||||
local back_cfg_path_yml="/etc/openclash/backup/" .. s.name .. ".yml"
|
||||
fs.unlink(back_cfg_path_yaml)
|
||||
fs.unlink(back_cfg_path_yml)
|
||||
end
|
||||
end)
|
||||
SYS.call("/usr/share/openclash/openclash.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
@ -1,469 +0,0 @@
|
||||
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local CHIF = "0"
|
||||
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
align_mid = [[<p align="center">]]
|
||||
align_mid_off = [[</p>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
function default_config_set(f)
|
||||
local cf = uci:get("openclash", "config", "config_path")
|
||||
if cf == "/etc/openclash/config/"..f or not cf or cf == "" or not fs.isfile(cf) then
|
||||
if CHIF == "1" and cf == "/etc/openclash/config/"..f then
|
||||
return
|
||||
end
|
||||
local fis = fs.glob("/etc/openclash/config/*")[1]
|
||||
if fis ~= nil then
|
||||
fcf = fs.basename(fis)
|
||||
if fcf then
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..fcf)
|
||||
uci:commit("openclash")
|
||||
end
|
||||
else
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/config.yaml")
|
||||
uci:commit("openclash")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function config_check(CONFIG_FILE)
|
||||
local yaml = fs.isfile(CONFIG_FILE)
|
||||
if yaml then
|
||||
yaml = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "puts YAML.load_file(\'%s\')" 2>/dev/null',CONFIG_FILE))
|
||||
if yaml ~= "false\n" and yaml ~= "" then
|
||||
return "Config Normal"
|
||||
else
|
||||
return "Config Abnormal"
|
||||
end
|
||||
elseif (yaml ~= 0) then
|
||||
return "File Not Exist"
|
||||
end
|
||||
end
|
||||
|
||||
ful = SimpleForm("upload", translate("Config Manage"), nil)
|
||||
ful.reset = false
|
||||
ful.submit = false
|
||||
|
||||
sul =ful:section(SimpleSection, "")
|
||||
o = sul:option(FileUpload, "")
|
||||
o.template = "openclash/upload"
|
||||
um = sul:option(DummyValue, "", nil)
|
||||
um.template = "openclash/dvalue"
|
||||
|
||||
local dir, fd, clash
|
||||
clash = "/etc/openclash/clash"
|
||||
dir = "/etc/openclash/config/"
|
||||
bakck_dir="/etc/openclash/backup"
|
||||
proxy_pro_dir="/etc/openclash/proxy_provider/"
|
||||
rule_pro_dir="/etc/openclash/rule_provider/"
|
||||
core_dir="/etc/openclash/core/core/"
|
||||
backup_dir="/tmp/"
|
||||
create_bakck_dir=fs.mkdir(bakck_dir)
|
||||
create_proxy_pro_dir=fs.mkdir(proxy_pro_dir)
|
||||
create_rule_pro_dir=fs.mkdir(rule_pro_dir)
|
||||
|
||||
HTTP.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
local fp = HTTP.formvalue("file_type")
|
||||
if not fd then
|
||||
if not meta then return end
|
||||
|
||||
if fp == "config" then
|
||||
if meta and chunk then fd = nixio.open(dir .. meta.file, "w") end
|
||||
elseif fp == "proxy-provider" then
|
||||
if meta and chunk then fd = nixio.open(proxy_pro_dir .. meta.file, "w") end
|
||||
elseif fp == "rule-provider" then
|
||||
if meta and chunk then fd = nixio.open(rule_pro_dir .. meta.file, "w") end
|
||||
elseif fp == "clash" or fp == "clash_tun" or fp == "clash_meta" then
|
||||
create_core_dir=fs.mkdir(core_dir)
|
||||
if meta and chunk then fd = nixio.open(core_dir .. meta.file, "w") end
|
||||
elseif fp == "backup-file" then
|
||||
if meta and chunk then fd = nixio.open(backup_dir .. meta.file, "w") end
|
||||
end
|
||||
|
||||
if not fd then
|
||||
um.value = translate("upload file error.")
|
||||
return
|
||||
end
|
||||
end
|
||||
if chunk and fd then
|
||||
fd:write(chunk)
|
||||
end
|
||||
if eof and fd then
|
||||
fd:close()
|
||||
fd = nil
|
||||
if fp == "config" then
|
||||
CHIF = "1"
|
||||
if IsYamlFile(meta.file) then
|
||||
local yamlbackup="/etc/openclash/backup/" .. meta.file
|
||||
local c=fs.copy(dir .. meta.file,yamlbackup)
|
||||
default_config_set(meta.file)
|
||||
end
|
||||
if IsYmlFile(meta.file) then
|
||||
local ymlname=string.lower(string.sub(meta.file,0,-5))
|
||||
local ymlbackup="/etc/openclash/backup/".. ymlname .. ".yaml"
|
||||
local c=fs.rename(dir .. meta.file,"/etc/openclash/config/".. ymlname .. ".yaml")
|
||||
local c=fs.copy("/etc/openclash/config/".. ymlname .. ".yaml",ymlbackup)
|
||||
local yamlname=ymlname .. ".yaml"
|
||||
default_config_set(yamlname)
|
||||
end
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/config/"'
|
||||
elseif fp == "proxy-provider" then
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/proxy_provider/"'
|
||||
elseif fp == "rule-provider" then
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/rule_provider/"'
|
||||
elseif fp == "clash" or fp == "clash_tun" or fp == "clash_meta" then
|
||||
if string.lower(string.sub(meta.file, -7, -1)) == ".tar.gz" then
|
||||
os.execute(string.format("tar -C '/etc/openclash/core/core' -xzf %s >/dev/null 2>&1", (core_dir .. meta.file)))
|
||||
fs.unlink(core_dir .. meta.file)
|
||||
os.execute(string.format("mv $(echo \"/etc/openclash/core/core/$(ls /etc/openclash/core/core/)\") '/etc/openclash/core/%s' >/dev/null 2>&1", fp))
|
||||
elseif string.lower(string.sub(meta.file, -3, -1)) == ".gz" then
|
||||
os.execute(string.format("mv %s '/etc/openclash/core/%s.gz' >/dev/null 2>&1", (core_dir .. meta.file), fp))
|
||||
os.execute("gzip -fd '/etc/openclash/core/%s.gz' >/dev/null 2>&1" %fp)
|
||||
fs.unlink("/etc/openclash/core/%s.gz" %fp)
|
||||
else
|
||||
os.execute(string.format("mv $(echo \"/etc/openclash/core/core/$(ls /etc/openclash/core/core/)\") '/etc/openclash/core/%s' >/dev/null 2>&1", fp))
|
||||
end
|
||||
os.execute("chmod 4755 /etc/openclash/core/%s >/dev/null 2>&1" %fp)
|
||||
os.execute("rm -rf %s >/dev/null 2>&1" %core_dir)
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/core/"'
|
||||
elseif fp == "backup-file" then
|
||||
os.execute("tar -C '/etc/openclash/' -xzf %s >/dev/null 2>&1" % (backup_dir .. meta.file))
|
||||
os.execute("mv /etc/openclash/openclash /etc/config/openclash >/dev/null 2>&1")
|
||||
fs.unlink(backup_dir .. meta.file)
|
||||
um.value = translate("Backup File Restore Successful!")
|
||||
end
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
if HTTP.formvalue("upload") then
|
||||
local f = HTTP.formvalue("ulfile")
|
||||
if #f <= 0 then
|
||||
um.value = translate("No Specify Upload File")
|
||||
end
|
||||
end
|
||||
|
||||
local e,a={}
|
||||
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(o)
|
||||
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
|
||||
if fs.mtime(BACKUP_FILE) then
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
|
||||
else
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
|
||||
end
|
||||
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
|
||||
e[t].state=translate("Enable")
|
||||
else
|
||||
e[t].state=translate("Disable")
|
||||
end
|
||||
e[t].size=fs.filesize(a.size)
|
||||
e[t].check=translate(config_check(o))
|
||||
e[t].remove=0
|
||||
end
|
||||
end
|
||||
|
||||
form=SimpleForm("config_file_list",translate("Config File List"))
|
||||
form.reset=false
|
||||
form.submit=false
|
||||
tb=form:section(Table,e)
|
||||
st=tb:option(DummyValue,"state",translate("State"))
|
||||
nm=tb:option(DummyValue,"name",translate("Config Alias"))
|
||||
sb=tb:option(DummyValue,"name",translate("Subscription Info"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
ck=tb:option(DummyValue,"check",translate("Grammar Check"))
|
||||
st.template="openclash/cfg_check"
|
||||
ck.template="openclash/cfg_check"
|
||||
sb.template="openclash/sub_info_show"
|
||||
|
||||
btnis=tb:option(Button,"switch",translate("Switch Config"))
|
||||
btnis.template="openclash/other_button"
|
||||
btnis.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btnis.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
|
||||
uci:commit("openclash")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
btned=tb:option(Button,"edit",translate("Edit"))
|
||||
btned.render=function(o,t,a)
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btned.write=function(a,t)
|
||||
local file_path = "etc/openclash/config/" .. fs.basename(e[t].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "config", "%s") %file_path)
|
||||
end
|
||||
|
||||
btncp=tb:option(Button,"copy",translate("Copy Config"))
|
||||
btncp.template="openclash/other_button"
|
||||
btncp.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btncp.write=function(a,t)
|
||||
local num = 1
|
||||
while true do
|
||||
num = num + 1
|
||||
if not fs.isfile("/etc/openclash/config/"..fs.filename(e[t].name).."("..num..")"..".yaml") then
|
||||
fs.copy("/etc/openclash/config/"..e[t].name, "/etc/openclash/config/"..fs.filename(e[t].name).."("..num..")"..".yaml")
|
||||
break
|
||||
end
|
||||
end
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
btnrn=tb:option(DummyValue,"/etc/openclash/config/",translate("Rename"))
|
||||
btnrn.template="openclash/input_rename"
|
||||
btnrn.rawhtml = true
|
||||
btnrn.render=function(c,t,a)
|
||||
c.value = e[t].name
|
||||
Button.render(c,t,a)
|
||||
end
|
||||
|
||||
btndl = tb:option(Button,"download",translate("Download Config"))
|
||||
btndl.template="openclash/other_button"
|
||||
btndl.render=function(e,t,a)
|
||||
e.inputstyle="remove"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btndl.write = function (a,t)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/config/"..e[t].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btndlr = tb:option(Button,"download_run",translate("Download Running Config"))
|
||||
btndlr.template="openclash/other_button"
|
||||
btndlr.render=function(c,t,a)
|
||||
if nixio.fs.access("/etc/openclash/"..e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
c.inputstyle="remove"
|
||||
Button.render(c,t,a)
|
||||
end
|
||||
btndlr.write = function (a,t)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/"..e[t].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm=tb:option(Button,"remove",translate("Remove"))
|
||||
btnrm.render=function(e,t,a)
|
||||
e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
fs.unlink("/etc/openclash/backup/"..fs.basename(e[t].name))
|
||||
fs.unlink("/etc/openclash/history/"..fs.filename(e[t].name))
|
||||
fs.unlink("/etc/openclash/history/"..fs.filename(e[t].name)..".db")
|
||||
fs.unlink("/etc/openclash/"..fs.basename(e[t].name))
|
||||
local a=fs.unlink("/etc/openclash/config/"..fs.basename(e[t].name))
|
||||
default_config_set(fs.basename(e[t].name))
|
||||
if a then table.remove(e,t)end
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash","config"))
|
||||
end
|
||||
|
||||
p = SimpleForm("provider_file_manage",translate("Provider File Manage"))
|
||||
p.reset = false
|
||||
p.submit = false
|
||||
|
||||
local provider_manage = {
|
||||
{proxy_mg, rule_mg, game_mg}
|
||||
}
|
||||
|
||||
promg = p:section(Table, provider_manage)
|
||||
|
||||
o = promg:option(Button, "proxy_mg", " ")
|
||||
o.inputtitle = translate("Proxy Provider File List")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = promg:option(Button, "rule_mg", " ")
|
||||
o.inputtitle = translate("Rule Providers File List")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = promg:option(Button, "game_mg", " ")
|
||||
o.inputtitle = translate("Game Rules File List")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
|
||||
end
|
||||
|
||||
m = SimpleForm("openclash",translate("Config File Edit"))
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local tab = {
|
||||
{user, default}
|
||||
}
|
||||
|
||||
s = m:section(Table, tab)
|
||||
s.description = align_mid..translate("Support syntax check, press").." "..font_green..bold_on.."F11"..bold_off..font_off.." "..translate("to enter full screen editing mode")..align_mid_off
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
local conf = uci:get("openclash", "config", "config_path")
|
||||
local dconf = "/usr/share/openclash/res/default.yaml"
|
||||
if not conf then conf = "/etc/openclash/config/config.yaml" end
|
||||
local conf_name = fs.basename(conf)
|
||||
if not conf_name then conf_name = "config.yaml" end
|
||||
local sconf = "/etc/openclash/"..conf_name
|
||||
|
||||
sev = s:option(TextValue, "user")
|
||||
sev.description = align_mid..translate("Modify Your Config file:").." "..font_green..bold_on..conf_name..bold_off..font_off.." "..translate("Here, Except The Settings That Were Taken Over")..align_mid_off
|
||||
sev.rows = 40
|
||||
sev.wrap = "off"
|
||||
sev.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(conf) or NXFS.readfile(dconf) or ""
|
||||
end
|
||||
sev.write = function(self, section, value)
|
||||
if (CHIF == "0") then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile(conf)
|
||||
if value ~= old_value then
|
||||
NXFS.writefile(conf, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def = s:option(TextValue, "default")
|
||||
if fs.isfile(sconf) then
|
||||
def.description = align_mid..translate("Config File Edited By OpenClash For Running")..align_mid_off
|
||||
else
|
||||
def.description = align_mid..translate("Default Config File With Correct Template")..align_mid_off
|
||||
end
|
||||
def.rows = 40
|
||||
def.wrap = "off"
|
||||
def.readonly = true
|
||||
def.cfgvalue = function(self, section)
|
||||
return NXFS.readfile(sconf) or NXFS.readfile(dconf) or ""
|
||||
end
|
||||
def.write = function(self, section, value)
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Create, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/config/"
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/config_editor"))
|
||||
|
||||
return ful , form , p , m
|
@ -1,135 +0,0 @@
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local SYS = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
m = Map(openclash, translate("Add Custom DNS Servers"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/settings")
|
||||
if m.uci:get(openclash, sid) ~= "dns_servers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Edit Custom DNS ]] --
|
||||
s = m:section(NamedSection, sid, "dns_servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
---- group
|
||||
o = s:option(ListValue, "group", translate("DNS Server Group"))
|
||||
o.description = font_red..bold_on..translate("NameServer Group Must Be Set")..bold_off..font_off
|
||||
o:value("nameserver", translate("NameServer "))
|
||||
o:value("fallback", translate("FallBack "))
|
||||
o:value("default", translate("Default-NameServer"))
|
||||
o.default = "nameserver"
|
||||
o.rempty = false
|
||||
|
||||
---- IP address
|
||||
o = s:option(Value, "ip", translate("DNS Server Address"))
|
||||
o.description = translate("Do Not Add Type Ahead")
|
||||
o.placeholder = translate("Not Null")
|
||||
o.datatype = "or(host, string)"
|
||||
o.rmempty = true
|
||||
|
||||
---- port
|
||||
o = s:option(Value, "port", translate("DNS Server Port"))
|
||||
o.description = translate("Require When Use Non-Standard Port")
|
||||
o.datatype = "port"
|
||||
o.rempty = true
|
||||
|
||||
---- type
|
||||
o = s:option(ListValue, "type", translate("DNS Server Type"))
|
||||
o.description = translate("Communication protocol")
|
||||
o:value("udp", translate("UDP"))
|
||||
o:value("tcp", translate("TCP"))
|
||||
o:value("tls", translate("TLS"))
|
||||
o:value("https", translate("HTTPS"))
|
||||
o:value("quic", translate("QUIC ")..translate("(Only Meta Core)"))
|
||||
o.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
---- interface
|
||||
o = s:option(Value, "interface", translate("Specific Interface"))
|
||||
o.description = translate("DNS Lookup Only Through The Specific Interface")..translate("(Only TUN Core)")
|
||||
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
|
||||
for interface in string.gmatch(interfaces, "%S+") do
|
||||
o:value(interface)
|
||||
end
|
||||
o:value("Disable", translate("Disable"))
|
||||
o.default = "Disable"
|
||||
o.rempty = false
|
||||
|
||||
---- Node Domain Resolve
|
||||
o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("Use For Node Domain Resolve")..translate("(Only Meta Core)"))
|
||||
o.rmempty = false
|
||||
o.default = o.disbled
|
||||
|
||||
---- Force HTTP/3
|
||||
o = s:option(Flag, "http3", translate("Force HTTP/3"), translate("Force HTTP/3 to connect")..translate("(Only Meta Core)"))
|
||||
o:depends("type", "https")
|
||||
o.rmempty = false
|
||||
o.default = o.disbled
|
||||
|
||||
---- Proxy group
|
||||
o = s:option(Value, "specific_group", translate("Specific Group"))
|
||||
o.description = translate("Group Use For Proxy The DNS")..translate("(Only Meta Core)")
|
||||
o:depends("group", "nameserver")
|
||||
o:depends("group", "fallback")
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o:value("Disable", translate("Disable"))
|
||||
o.default = "Disable"
|
||||
o.rempty = false
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,121 +0,0 @@
|
||||
|
||||
local rule_form
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
local g,h={}
|
||||
for n,m in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
|
||||
h=fs.stat(m)
|
||||
if h then
|
||||
g[n]={}
|
||||
g[n].name=fs.basename(m)
|
||||
g[n].mtime=os.date("%Y-%m-%d %H:%M:%S",h.mtime)
|
||||
g[n].size=fs.filesize(h.size)
|
||||
g[n].remove=0
|
||||
g[n].enable=false
|
||||
end
|
||||
end
|
||||
|
||||
rule_form=SimpleForm("game_rules_file_list",translate("Game Rules File List"))
|
||||
rule_form.reset=false
|
||||
rule_form.submit=false
|
||||
tb2=rule_form:section(Table,g)
|
||||
nm2=tb2:option(DummyValue,"name",translate("File Name"))
|
||||
mt2=tb2:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz2=tb2:option(DummyValue,"size",translate("Size"))
|
||||
|
||||
btned1=tb2:option(Button,"edit",translate("Edit"))
|
||||
btned1.render=function(g,n,h)
|
||||
g.inputstyle="apply"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btned1.write=function(h,n)
|
||||
local file_path = "etc/openclash/game_rules/" .. fs.basename(g[n].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "game-rules-file-manage", "%s") %file_path)
|
||||
end
|
||||
|
||||
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
|
||||
btndl2.template="openclash/other_button"
|
||||
btndl2.render=function(m,n,h)
|
||||
m.inputstyle="remove"
|
||||
Button.render(m,n,h)
|
||||
end
|
||||
btndl2.write = function (h,n)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/game_rules/"..g[n].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm2=tb2:option(Button,"remove2",translate("Remove"))
|
||||
btnrm2.render=function(g,n,h)
|
||||
g.inputstyle="reset"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btnrm2.write=function(h,n)
|
||||
local h=fs.unlink("/etc/openclash/game_rules/"..luci.openclash.basename(g[n].name))
|
||||
if h then table.remove(g,n)end
|
||||
return h
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Refresh, Create, Delete_all, Apply}
|
||||
}
|
||||
|
||||
a = rule_form:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/game_rules/"
|
||||
|
||||
o = a:option(Button, "Delete_all", " ")
|
||||
o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/game_rules/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
rule_form:append(Template("openclash/toolbar_show"))
|
||||
return rule_form
|
@ -1,99 +0,0 @@
|
||||
|
||||
local form, m
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = SimpleForm("openclash", translate("Game Rules List"))
|
||||
m.description=translate("Rule Project:").." SSTap-Rule ( https://github.com/FQrabbit/SSTap-Rule )"
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local t = {
|
||||
{Refresh, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
|
||||
end
|
||||
|
||||
if not NXFS.access("/tmp/rules_name") then
|
||||
SYS.call("awk -F ',' '{print $1}' /usr/share/openclash/res/game_rules.list > /tmp/rules_name 2>/dev/null")
|
||||
end
|
||||
file = io.open("/tmp/rules_name", "r");
|
||||
|
||||
---- Rules List
|
||||
local e={},o,t
|
||||
if NXFS.access("/tmp/rules_name") then
|
||||
for o in file:lines() do
|
||||
table.insert(e,o)
|
||||
end
|
||||
for t,o in ipairs(e) do
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=o
|
||||
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $3}' 2>/dev/null",e[t].name)),1,-2)
|
||||
if e[t].filename == "" then
|
||||
e[t].filename=string.sub(luci.sys.exec(string.format("grep -F '%s,' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $2}' 2>/dev/null",e[t].name)),1,-2)
|
||||
end
|
||||
RULE_FILE="/etc/openclash/game_rules/".. e[t].filename
|
||||
if fs.mtime(RULE_FILE) then
|
||||
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
|
||||
else
|
||||
e[t].size="/"
|
||||
e[t].mtime="/"
|
||||
end
|
||||
if fs.isfile(RULE_FILE) then
|
||||
e[t].exist=translate("Exist")
|
||||
else
|
||||
e[t].exist=translate("Not Exist")
|
||||
end
|
||||
e[t].remove=0
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
|
||||
form=SimpleForm("filelist")
|
||||
form.reset=false
|
||||
form.submit=false
|
||||
tb=form:section(Table,e)
|
||||
nu=tb:option(DummyValue,"num",translate("Order Number"))
|
||||
st=tb:option(DummyValue,"exist",translate("State"))
|
||||
st.template="openclash/cfg_check"
|
||||
nm=tb:option(DummyValue,"name",translate("Rule Name"))
|
||||
fm=tb:option(DummyValue,"filename",translate("File Name"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
|
||||
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
|
||||
btnis.template="openclash/download_rule"
|
||||
|
||||
btnrm=tb:option(Button,"remove",translate("Remove"))
|
||||
btnrm.render=function(e,t,a)
|
||||
e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/etc/openclash/game_rules/"..e[t].filename)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
|
||||
end
|
||||
|
||||
return m, form
|
@ -1,148 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Edit Group"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
|
||||
if m.uci:get(openclash, sid) ~= "groups" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Groups Setting ]]--
|
||||
s = m:section(NamedSection, sid, "groups")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "type", translate("Group Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Operation Mode")
|
||||
o:value("select", translate("Manual-Select"))
|
||||
o:value("url-test", translate("URL-Test"))
|
||||
o:value("fallback", translate("Fallback"))
|
||||
o:value("load-balance", translate("Load-Balance"))
|
||||
o:value("relay", translate("Relay-Traffic"))
|
||||
|
||||
o = s:option(ListValue, "strategy", translate("Strategy Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Load-Balance's Strategy Type")
|
||||
o:value("consistent-hashing", translate("Consistent-hashing"))
|
||||
o:value("round-robin", translate("Round-robin"))
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "name", translate("Group Name"))
|
||||
o.rmempty = false
|
||||
o.default = "Group - "..sid
|
||||
|
||||
o = s:option(ListValue, "disable_udp", translate("Disable UDP"))
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = "false"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "test_url", translate("Test URL"))
|
||||
o:value("http://cp.cloudflare.com/generate_204")
|
||||
o:value("http://www.gstatic.com/generate_204")
|
||||
o:value("https://cp.cloudflare.com/generate_204")
|
||||
o.rmempty = false
|
||||
o:depends("type", "url-test")
|
||||
o:depends("type", "fallback")
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "test_interval", translate("Test Interval(s)"))
|
||||
o.default = "300"
|
||||
o.rmempty = false
|
||||
o:depends("type", "url-test")
|
||||
o:depends("type", "fallback")
|
||||
o:depends("type", "load-balance")
|
||||
|
||||
o = s:option(Value, "tolerance", translate("Tolerance(ms)"))
|
||||
o.default = "150"
|
||||
o.rmempty = true
|
||||
o:depends("type", "url-test")
|
||||
|
||||
o = s:option(Value, "policy_filter", translate("Policy Filter").." "..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "bgp|sg"
|
||||
|
||||
-- [[ interface-name ]]--
|
||||
o = s:option(Value, "interface_name", translate("interface-name"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("eth0")
|
||||
|
||||
-- [[ routing-mark ]]--
|
||||
o = s:option(Value, "routing_mark", translate("routing-mark"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2333")
|
||||
|
||||
o = s:option(DynamicList, "other_group", translate("Other Group"))
|
||||
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
|
||||
uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil and s.name ~= m.uci:get(openclash, sid, "name") then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o.rmempty = true
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,22 +0,0 @@
|
||||
--
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
|
||||
m = Map("openclash", translate("Server Logs"))
|
||||
s = m:section(TypedSection, "openclash")
|
||||
m.pageaction = false
|
||||
s.anonymous = true
|
||||
s.addremove=false
|
||||
|
||||
log = s:option(TextValue, "clog")
|
||||
log.readonly=true
|
||||
log.pollcheck=true
|
||||
log.template="openclash/log"
|
||||
log.description = translate("")
|
||||
log.rows = 29
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
m:append(Template("openclash/config_editor"))
|
||||
|
||||
return m
|
@ -1,73 +0,0 @@
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local fs = require "luci.openclash"
|
||||
local file_path = ""
|
||||
local edit_file_name = "/tmp/openclash_edit_file_name"
|
||||
|
||||
for i = 2, #(arg) do
|
||||
file_path = file_path .. "/" .. luci.http.urlencode(arg[i])
|
||||
end
|
||||
|
||||
if not fs.isfile(file_path) and file_path ~= "" then
|
||||
file_path = luci.http.urldecode(file_path)
|
||||
end
|
||||
|
||||
--re-get file path to save
|
||||
if NXFS.readfile(edit_file_name) ~= file_path and fs.isfile(file_path) then
|
||||
NXFS.writefile(edit_file_name, file_path)
|
||||
else
|
||||
if not fs.isfile(file_path) and fs.isfile(edit_file_name) then
|
||||
file_path = NXFS.readfile(edit_file_name)
|
||||
fs.unlink(edit_file_name)
|
||||
end
|
||||
end
|
||||
|
||||
m = Map("openclash", translate("File Edit"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/"..arg[1])
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
s.addremove=false
|
||||
|
||||
o = s:option(TextValue, "edit_file")
|
||||
o.rows = 50
|
||||
o.wrap = "off"
|
||||
|
||||
function o.write(self, section, value)
|
||||
if value then
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
local old_value = NXFS.readfile(file_path)
|
||||
if value ~= old_value then
|
||||
NXFS.writefile(file_path, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function o.cfgvalue(self, section)
|
||||
return NXFS.readfile(file_path) or ""
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/config_editor"))
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,407 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Other Rules Edit"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/settings")
|
||||
if m.uci:get(openclash, sid) ~= "other_rules" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Other Rules Setting ]]--
|
||||
s = m:section(NamedSection, sid, "other_rules")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(Value, "Note", translate("Note"))
|
||||
o.default = "default"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
local e,a={}
|
||||
local groupnames,filename
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
if e[t].name == m.uci:get(openclash, sid, "config") then
|
||||
filename = e[t].name
|
||||
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',f))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Button, translate("Get Group Names"))
|
||||
o.title = translate("Get Group Names")
|
||||
o.inputtitle = translate("Get Group Names")
|
||||
o.description = translate("Get Group Names After Select Config File")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin/services/openclash/other-rules-edit/%s") % sid)
|
||||
end
|
||||
|
||||
if groupnames ~= nil and filename ~= nil then
|
||||
o = s:option(ListValue, "rule_name", translate("Other Rules Name"))
|
||||
o.rmempty = true
|
||||
o:value("lhie1", translate("lhie1 Rules"))
|
||||
o:value("ConnersHua", translate("ConnersHua(Provider-type) Rules"))
|
||||
o:value("ConnersHua_return", translate("ConnersHua Return Rules"))
|
||||
|
||||
o = s:option(ListValue, "GlobalTV", translate("GlobalTV"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o:depends("rule_name", "ConnersHua")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "AsianTV", translate("AsianTV"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o:depends("rule_name", "ConnersHua")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Proxy", translate("Proxy"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o:depends("rule_name", "ConnersHua")
|
||||
o:depends("rule_name", "ConnersHua_return")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Youtube", translate("Youtube"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Bilibili", translate("Bilibili"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Bahamut", translate("Bahamut"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "HBOMax", translate("HBO Max"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "HBOGo", translate("HBO Go"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Pornhub", translate("Pornhub"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Apple", translate("Apple"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "GoogleFCM", translate("Google FCM"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Scholar", translate("Scholar"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Microsoft", translate("Microsoft"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Netflix", translate("Netflix"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Disney", translate("Disney Plus"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Discovery", translate("Discovery Plus"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "DAZN", translate("DAZN"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Spotify", translate("Spotify"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Steam", translate("Steam"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Speedtest", translate("Speedtest"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Telegram", translate("Telegram"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Crypto", translate("Crypto"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Discord", translate("Discord"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "PayPal", translate("PayPal"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "AdBlock", translate("AdBlock"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Domestic", translate("Domestic"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o:depends("rule_name", "ConnersHua")
|
||||
o.rmempty = true
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
o = s:option(ListValue, "Others", translate("Others"))
|
||||
o:depends("rule_name", "lhie1")
|
||||
o:depends("rule_name", "ConnersHua")
|
||||
o:depends("rule_name", "ConnersHua_return")
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose Proxy Groups, Base On Your Config File").." ( "..font_green..bold_on..filename..bold_off..font_off.." )"
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
--luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,142 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Edit Proxy-Provider"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
|
||||
if m.uci:get(openclash, sid) ~= "proxy-provider" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Provider Setting ]]--
|
||||
s = m:section(NamedSection, sid, "proxy-provider")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "type", translate("Provider Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Provider Type")
|
||||
o:value("http")
|
||||
o:value("file")
|
||||
|
||||
o = s:option(Value, "name", translate("Provider Name"))
|
||||
o.rmempty = false
|
||||
o.default = "Proxy-provider - "..sid
|
||||
if not m.uci:get("openclash", sid, "name") then
|
||||
m.uci:set("openclash", sid, "manual", 1)
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "path", translate("Provider Path"))
|
||||
o.description = translate("Update Your Proxy Provider File From Config Luci Page")
|
||||
local p,h={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/proxy_provider/*"))do
|
||||
h=fs.stat(f)
|
||||
if h then
|
||||
p[t]={}
|
||||
p[t].name=fs.basename(f)
|
||||
if IsYamlFile(p[t].name) or IsYmlFile(p[t].name) then
|
||||
o:value("./proxy_provider/"..p[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
o.rmempty = false
|
||||
o:depends("type", "file")
|
||||
|
||||
o = s:option(Value, "provider_url", translate("Provider URL"))
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(Value, "provider_filter", translate("Provider Filter"))
|
||||
o.rmempty = true
|
||||
o.placeholder = "bgp|sg"
|
||||
|
||||
o = s:option(Value, "provider_interval", translate("Provider Interval(s)"))
|
||||
o.default = "3600"
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(ListValue, "health_check", translate("Provider Health Check"))
|
||||
o:value("false", translate("Disable"))
|
||||
o:value("true", translate("Enable"))
|
||||
o.default = true
|
||||
|
||||
o = s:option(Value, "health_check_url", translate("Health Check URL"))
|
||||
o:value("http://cp.cloudflare.com/generate_204")
|
||||
o:value("http://www.gstatic.com/generate_204")
|
||||
o:value("https://cp.cloudflare.com/generate_204")
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "health_check_interval", translate("Health Check Interval(s)"))
|
||||
o.default = "300"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(DynamicList, "groups", translate("Proxy Group"))
|
||||
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
o:value("all", translate("All Groups"))
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,121 +0,0 @@
|
||||
|
||||
local proxy_form
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
local p,r={}
|
||||
for x,y in ipairs(fs.glob("/etc/openclash/proxy_provider/*"))do
|
||||
r=fs.stat(y)
|
||||
if r then
|
||||
p[x]={}
|
||||
p[x].name=fs.basename(y)
|
||||
p[x].mtime=os.date("%Y-%m-%d %H:%M:%S",r.mtime)
|
||||
p[x].size=fs.filesize(r.size)
|
||||
p[x].remove=0
|
||||
p[x].enable=false
|
||||
end
|
||||
end
|
||||
|
||||
proxy_form=SimpleForm("proxy_provider_file_list",translate("Proxy Provider File List"))
|
||||
proxy_form.reset=false
|
||||
proxy_form.submit=false
|
||||
tb1=proxy_form:section(Table,p)
|
||||
nm1=tb1:option(DummyValue,"name",translate("File Name"))
|
||||
mt1=tb1:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz1=tb1:option(DummyValue,"size",translate("Size"))
|
||||
|
||||
btned1=tb1:option(Button,"edit",translate("Edit"))
|
||||
btned1.render=function(p,x,r)
|
||||
p.inputstyle="apply"
|
||||
Button.render(p,x,r)
|
||||
end
|
||||
btned1.write=function(r,x)
|
||||
local file_path = "etc/openclash/proxy_provider/" .. fs.basename(p[x].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "proxy-provider-file-manage", "%s") %file_path)
|
||||
end
|
||||
|
||||
btndl1 = tb1:option(Button,"download1",translate("Download Config"))
|
||||
btndl1.template="openclash/other_button"
|
||||
btndl1.render=function(y,x,r)
|
||||
y.inputstyle="remove"
|
||||
Button.render(y,x,r)
|
||||
end
|
||||
btndl1.write = function (r,x)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/proxy_provider/"..p[x].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm1=tb1:option(Button,"remove1",translate("Remove"))
|
||||
btnrm1.render=function(p,x,r)
|
||||
p.inputstyle="reset"
|
||||
Button.render(p,x,r)
|
||||
end
|
||||
btnrm1.write=function(r,x)
|
||||
local r=fs.unlink("/etc/openclash/proxy_provider/"..luci.openclash.basename(p[x].name))
|
||||
if r then table.remove(p,x)end
|
||||
return r
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Refresh, Create, Delete_all, Apply}
|
||||
}
|
||||
|
||||
a = proxy_form:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/proxy_provider/"
|
||||
|
||||
o = a:option(Button, "Delete_all", " ")
|
||||
o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/proxy_provider/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
proxy_form:append(Template("openclash/toolbar_show"))
|
||||
return proxy_form
|
@ -1,155 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
m = Map(openclash, translate("Edit Rule Providers"))
|
||||
m.pageaction = false
|
||||
m.description=translate("规则集使用介绍:https://lancellc.gitbook.io/clash/clash-config-file/rule-provider")
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/rule-providers-settings")
|
||||
if m.uci:get(openclash, sid) ~= "rule_providers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Rule Providers Setting ]]--
|
||||
s = m:section(NamedSection, sid, "rule_providers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Value, "name", translate("Rule Providers Name"))
|
||||
o.rmempty = false
|
||||
o.default = "Rule-provider - "..sid
|
||||
|
||||
o = s:option(ListValue, "type", translate("Rule Providers Type"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Rule Providers Type")
|
||||
o:value("http", translate("http"))
|
||||
o:value("file", translate("file"))
|
||||
|
||||
o = s:option(ListValue, "behavior", translate("Rule Behavior"))
|
||||
o.rmempty = true
|
||||
o.description = translate("Choose The Rule Behavior")
|
||||
o:value("domain")
|
||||
o:value("ipcidr")
|
||||
o:value("classical")
|
||||
|
||||
o = s:option(ListValue, "path", translate("Rule Providers Path"))
|
||||
o.description = translate("Update Your Rule Providers File From Config Luci Page")
|
||||
local p,h={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
|
||||
h=fs.stat(f)
|
||||
if h then
|
||||
p[t]={}
|
||||
p[t].name=fs.basename(f)
|
||||
o:value("./rule_provider/"..p[t].name)
|
||||
end
|
||||
end
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
|
||||
h=fs.stat(f)
|
||||
if h then
|
||||
p[t]={}
|
||||
p[t].name=fs.basename(f)
|
||||
o:value("./game_rules/"..p[t].name)
|
||||
end
|
||||
end
|
||||
o.rmempty = false
|
||||
o:depends("type", "file")
|
||||
|
||||
o = s:option(Value, "url", translate("Rule Providers URL"))
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
|
||||
o.default = "86400"
|
||||
o.rmempty = false
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(ListValue, "position", translate("Append Position"))
|
||||
o.rmempty = false
|
||||
o:value("0", translate("Priority Match"))
|
||||
o:value("1", translate("Extended Match"))
|
||||
|
||||
o = s:option(ListValue, "group", translate("Set Proxy Group"))
|
||||
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = sys.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
sys.call("/usr/share/openclash/yml_groups_name_ch.sh")
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,121 +0,0 @@
|
||||
|
||||
local rule_form
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
local g,h={}
|
||||
for n,m in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
|
||||
h=fs.stat(m)
|
||||
if h then
|
||||
g[n]={}
|
||||
g[n].name=fs.basename(m)
|
||||
g[n].mtime=os.date("%Y-%m-%d %H:%M:%S",h.mtime)
|
||||
g[n].size=fs.filesize(h.size)
|
||||
g[n].remove=0
|
||||
g[n].enable=false
|
||||
end
|
||||
end
|
||||
|
||||
rule_form=SimpleForm("rule_provider_file_list",translate("Rule Providers File List"))
|
||||
rule_form.reset=false
|
||||
rule_form.submit=false
|
||||
tb2=rule_form:section(Table,g)
|
||||
nm2=tb2:option(DummyValue,"name",translate("File Name"))
|
||||
mt2=tb2:option(DummyValue,"mtime",translate("Update Time"))
|
||||
sz2=tb2:option(DummyValue,"size",translate("Size"))
|
||||
|
||||
btned1=tb2:option(Button,"edit",translate("Edit"))
|
||||
btned1.render=function(g,n,h)
|
||||
g.inputstyle="apply"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btned1.write=function(h,n)
|
||||
local file_path = "etc/openclash/rule_provider/" .. fs.basename(g[n].name)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "other-file-edit", "rule-providers-file-manage", "%s") %file_path)
|
||||
end
|
||||
|
||||
btndl2 = tb2:option(Button,"download2",translate("Download Config"))
|
||||
btndl2.template="openclash/other_button"
|
||||
btndl2.render=function(m,n,h)
|
||||
m.inputstyle="remove"
|
||||
Button.render(m,n,h)
|
||||
end
|
||||
btndl2.write = function (h,n)
|
||||
local sPath, sFile, fd, block
|
||||
sPath = "/etc/openclash/rule_provider/"..g[n].name
|
||||
sFile = NXFS.basename(sPath)
|
||||
if fs.isdirectory(sPath) then
|
||||
fd = io.popen('tar -C "%s" -cz .' % {sPath}, "r")
|
||||
sFile = sFile .. ".tar.gz"
|
||||
else
|
||||
fd = nixio.open(sPath, "r")
|
||||
end
|
||||
if not fd then
|
||||
return
|
||||
end
|
||||
HTTP.header('Content-Disposition', 'attachment; filename="%s"' % {sFile})
|
||||
HTTP.prepare_content("application/octet-stream")
|
||||
while true do
|
||||
block = fd:read(nixio.const.buffersize)
|
||||
if (not block) or (#block ==0) then
|
||||
break
|
||||
else
|
||||
HTTP.write(block)
|
||||
end
|
||||
end
|
||||
fd:close()
|
||||
HTTP.close()
|
||||
end
|
||||
|
||||
btnrm2=tb2:option(Button,"remove2",translate("Remove"))
|
||||
btnrm2.render=function(g,n,h)
|
||||
g.inputstyle="reset"
|
||||
Button.render(g,n,h)
|
||||
end
|
||||
btnrm2.write=function(h,n)
|
||||
local h=fs.unlink("/etc/openclash/rule_provider/"..luci.openclash.basename(g[n].name))
|
||||
if h then table.remove(g,n)end
|
||||
return h
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Refresh, Create, Delete_all, Apply}
|
||||
}
|
||||
|
||||
a = rule_form:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(DummyValue, "Create", " ")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/input_file_name"
|
||||
o.value = "/etc/openclash/rule_provider/"
|
||||
|
||||
o = a:option(Button, "Delete_all", " ")
|
||||
o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/rule_provider/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
|
||||
rule_form:append(Template("openclash/toolbar_show"))
|
||||
return rule_form
|
@ -1,106 +0,0 @@
|
||||
|
||||
local form, m
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = SimpleForm("openclash", translate("Other Rule Providers List"))
|
||||
m.description=translate("Rule Project:").." ConnersHua ( https://github.com/DivineEngine/Profiles )<br/>"..
|
||||
translate("Rule Project:").." lhie1 ( https://github.com/dler-io/Rules )<br/>"..
|
||||
translate("Rule Project:").." ACL4SSR ( https://github.com/ACL4SSR/ACL4SSR/tree/master )"
|
||||
m.reset = false
|
||||
m.submit = false
|
||||
|
||||
local t = {
|
||||
{Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button, "Refresh", " ")
|
||||
o.inputtitle = translate("Refresh Page")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-settings"))
|
||||
end
|
||||
|
||||
if not NXFS.access("/tmp/rule_providers_name") then
|
||||
SYS.call("awk -v d=',' -F ',' '{print $4d$5}' /usr/share/openclash/res/rule_providers.list > /tmp/rule_providers_name 2>/dev/null")
|
||||
end
|
||||
file = io.open("/tmp/rule_providers_name", "r");
|
||||
|
||||
---- Rules List
|
||||
local e={},o,t
|
||||
if NXFS.access("/tmp/rule_providers_name") then
|
||||
for o in file:lines() do
|
||||
table.insert(e,o)
|
||||
end
|
||||
for t,o in ipairs(e) do
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",o)),1,-2)
|
||||
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $6}' 2>/dev/null",o)),1,-2)
|
||||
if e[t].lfilename == "" then
|
||||
e[t].lfilename=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $5}' 2>/dev/null",o)),1,-2)
|
||||
end
|
||||
e[t].filename=o
|
||||
e[t].author=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $2}' 2>/dev/null",o)),1,-2)
|
||||
e[t].rule_type=string.sub(luci.sys.exec(string.format("grep -F '%s' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $3}' 2>/dev/null",o)),1,-2)
|
||||
RULE_FILE="/etc/openclash/rule_provider/".. e[t].lfilename
|
||||
if fs.mtime(RULE_FILE) then
|
||||
e[t].size=fs.filesize(fs.stat(RULE_FILE).size)
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(RULE_FILE))
|
||||
else
|
||||
e[t].size="/"
|
||||
e[t].mtime="/"
|
||||
end
|
||||
if fs.isfile(RULE_FILE) then
|
||||
e[t].exist=translate("Exist")
|
||||
else
|
||||
e[t].exist=translate("Not Exist")
|
||||
end
|
||||
e[t].remove=0
|
||||
end
|
||||
end
|
||||
file:close()
|
||||
|
||||
form=SimpleForm("filelist")
|
||||
form.reset=false
|
||||
form.submit=false
|
||||
tb=form:section(Table,e)
|
||||
nu=tb:option(DummyValue,"num",translate("Order Number"))
|
||||
st=tb:option(DummyValue,"exist",translate("State"))
|
||||
st.template="openclash/cfg_check"
|
||||
tp=tb:option(DummyValue,"rule_type",translate("Rule Type"))
|
||||
nm=tb:option(DummyValue,"name",translate("Rule Name"))
|
||||
au=tb:option(DummyValue,"author",translate("Rule Author"))
|
||||
fm=tb:option(DummyValue,"lfilename",translate("File Name"))
|
||||
sz=tb:option(DummyValue,"size",translate("Size"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
|
||||
btnis=tb:option(DummyValue,"filename",translate("Download Rule"))
|
||||
btnis.template="openclash/download_rule"
|
||||
|
||||
btnrm=tb:option(Button,"remove",translate("Remove"))
|
||||
btnrm.render=function(e,t,a)
|
||||
e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/etc/openclash/rule_provider/"..e[t].lfilename)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
return m, form
|
@ -1,289 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local NXFS = require "nixio.fs"
|
||||
local SYS = require "luci.sys"
|
||||
local HTTP = require "luci.http"
|
||||
local DISP = require "luci.dispatcher"
|
||||
local UTIL = require "luci.util"
|
||||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = Map(openclash, translate("Rule Providers and Groups"))
|
||||
m.pageaction = false
|
||||
m.description=translate("Attention:")..
|
||||
"<br/>"..translate("The game proxy is a test function and does not guarantee the availability of rules")..
|
||||
"<br/>"..translate("Preparation steps:")..
|
||||
"<br/>"..translate("1. In the <server and policy group management> page, create the policy group and node you are going to use, and apply the configuration (when adding nodes, you must select the policy group you want to join). Policy group type suggestion: fallback, game nodes must be support UDP and not a Vmess")..
|
||||
"<br/>"..translate("2. Click the <manage third party game rules> or <manage third party rule set> button to enter the rule list and download the rules you want to use")..
|
||||
"<br/>"..translate("3. On this page, set the corresponding configuration file and policy group of the rule you have downloaded, and save the settings")..
|
||||
"<br/>"..translate("4. Install the TUN core")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("When setting this page, if the groups is empty, please go to the <server and group management> page to add")..
|
||||
"<br/>"..
|
||||
"<br/>"..translate("Introduction to rule set usage: https://lancellc.gitbook.io/clash/clash-config-file/rule-provider")
|
||||
|
||||
function IsRuleFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-6,-1))
|
||||
return e==".rules"
|
||||
end
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
-- [[ Edit Game Rule ]] --
|
||||
s = m:section(TypedSection, "game_config", translate("Game Rules and Groups (Only TUN & Meta Core Support)"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.rmempty = false
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- config
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---- rule name
|
||||
o = s:option(DynamicList, "rule_name", translate("Game Rule's Name"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/game_rules/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].filename=fs.basename(f)
|
||||
if IsRuleFile(e[t].filename) then
|
||||
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/game_rules.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
|
||||
if e[t].name ~= "" and e[t].name ~= nil then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o.rmempty = true
|
||||
|
||||
---- Proxy Group
|
||||
o = s:option(ListValue, "group", translate("Select Proxy Group"))
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o.rmempty = true
|
||||
|
||||
-- [[ Edit Other Rule Provider ]] --
|
||||
s = m:section(TypedSection, "rule_provider_config", translate("Other Rule Providers and Groups (Only TUN & Meta Core Support)"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.rmempty = false
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
---- config
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---- rule name
|
||||
o = s:option(DynamicList, "rule_name", translate("Rule Provider's Name"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/rule_provider/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].filename=fs.basename(f)
|
||||
if IsYamlFile(e[t].filename) or IsYmlFile(e[t].filename) then
|
||||
e[t].name=string.gsub(luci.sys.exec(string.format("grep ',%s$' /usr/share/openclash/res/rule_providers.list |awk -F ',' '{print $1}' 2>/dev/null",e[t].filename)), "[\r\n]", "")
|
||||
if e[t].name ~= "" and e[t].name ~= nil then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o.rmempty = true
|
||||
|
||||
---- Proxy Group
|
||||
o = s:option(ListValue, "group", translate("Select Proxy Group"))
|
||||
local groupnames,filename
|
||||
filename = m.uci:get(openclash, "config", "config_path")
|
||||
if filename then
|
||||
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
|
||||
if groupnames then
|
||||
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
|
||||
if groupname ~= nil and groupname ~= "" then
|
||||
o:value(groupname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
o:value("DIRECT")
|
||||
o:value("REJECT")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "interval", translate("Rule Providers Interval(s)"))
|
||||
o.default = "86400"
|
||||
o.rmempty = false
|
||||
|
||||
---- position
|
||||
o = s:option(ListValue, "position", translate("Append Position"))
|
||||
o.rmempty = false
|
||||
o:value("0", translate("Priority Match"))
|
||||
o:value("1", translate("Extended Match"))
|
||||
|
||||
-- [[ Edit Custom Rule Provider ]] --
|
||||
s = m:section(TypedSection, "rule_providers", translate("Custom Rule Providers and Groups (Only TUN & Meta Core Support)"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/rule-providers-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Rule Providers Name"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "position", translate("Append Position"))
|
||||
o.rmempty = false
|
||||
o:value("0", translate("Priority Match"))
|
||||
o:value("1", translate("Extended Match"))
|
||||
|
||||
local rm = {
|
||||
{rule_mg, pro_mg}
|
||||
}
|
||||
|
||||
rmg = m:section(Table, rm)
|
||||
|
||||
o = rmg:option(Button, "rule_mg", " ")
|
||||
o.inputtitle = translate("Game Rules Manage")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "game-rules-manage"))
|
||||
end
|
||||
|
||||
o = rmg:option(Button, "pro_mg", " ")
|
||||
o.inputtitle = translate("Other Rule Provider Manage")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Commit, Apply}
|
||||
}
|
||||
|
||||
ss = m:section(Table, t)
|
||||
|
||||
o = ss:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = ss:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
@ -1,599 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
function IsYamlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-5,-1))
|
||||
return e == ".yaml"
|
||||
end
|
||||
function IsYmlFile(e)
|
||||
e=e or""
|
||||
local e=string.lower(string.sub(e,-4,-1))
|
||||
return e == ".yml"
|
||||
end
|
||||
|
||||
local encrypt_methods_ss = {
|
||||
|
||||
-- stream
|
||||
"rc4-md5",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"aes-128-gcm",
|
||||
"aes-192-gcm",
|
||||
"aes-256-gcm",
|
||||
"chacha20-ietf",
|
||||
"xchacha20",
|
||||
"chacha20-ietf-poly1305",
|
||||
"xchacha20-ietf-poly1305",
|
||||
"2022-blake3-aes-128-gcm",
|
||||
"2022-blake3-aes-256-gcm",
|
||||
"2022-blake3-chacha20-poly1305"
|
||||
}
|
||||
|
||||
local encrypt_methods_ssr = {
|
||||
|
||||
"rc4-md5",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"chacha20-ietf",
|
||||
"xchacha20"
|
||||
}
|
||||
|
||||
local securitys = {
|
||||
"auto",
|
||||
"none",
|
||||
"aes-128-gcm",
|
||||
"chacha20-poly1305"
|
||||
}
|
||||
|
||||
local protocols = {
|
||||
"origin",
|
||||
"auth_sha1_v4",
|
||||
"auth_aes128_md5",
|
||||
"auth_aes128_sha1",
|
||||
"auth_chain_a",
|
||||
"auth_chain_b"
|
||||
}
|
||||
|
||||
local hysteria_protocols = {
|
||||
"udp",
|
||||
"wechat-video",
|
||||
"faketcp"
|
||||
}
|
||||
|
||||
local obfs = {
|
||||
"plain",
|
||||
"http_simple",
|
||||
"http_post",
|
||||
"random_head",
|
||||
"tls1.2_ticket_auth",
|
||||
"tls1.2_ticket_fastauth"
|
||||
}
|
||||
|
||||
m = Map(openclash, translate("Edit Server"))
|
||||
m.pageaction = false
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/openclash/servers")
|
||||
|
||||
if m.uci:get(openclash, sid) ~= "servers" then
|
||||
luci.http.redirect(m.redirect)
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Servers Setting ]] --
|
||||
s = m:section(NamedSection, sid, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(DummyValue, "server_url", "SS/SSR/VMESS/TROJAN URL")
|
||||
o.rawhtml = true
|
||||
o.template = "openclash/server_url"
|
||||
o.value = sid
|
||||
|
||||
o = s:option(ListValue, "config", translate("Config File"))
|
||||
o:value("all", translate("Use For All Config File"))
|
||||
local e,a={}
|
||||
for t,f in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(f)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].name=fs.basename(f)
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
o:value(e[t].name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "type", translate("Server Node Type"))
|
||||
o:value("ss", translate("Shadowsocks"))
|
||||
o:value("ssr", translate("ShadowsocksR"))
|
||||
o:value("vmess", translate("Vmess"))
|
||||
o:value("vless", translate("Vless ")..translate("(Only Meta Core)"))
|
||||
o:value("hysteria", translate("Hysteria ")..translate("(Only Meta Core)"))
|
||||
o:value("trojan", translate("trojan"))
|
||||
o:value("snell", translate("Snell"))
|
||||
o:value("socks5", translate("Socks5"))
|
||||
o:value("http", translate("HTTP(S)"))
|
||||
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
|
||||
|
||||
o = s:option(Value, "name", translate("Server Alias"))
|
||||
o.rmempty = false
|
||||
o.default = "Server - "..sid
|
||||
if not m.uci:get("openclash", sid, "name") then
|
||||
m.uci:set("openclash", sid, "manual", 1)
|
||||
end
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "port", translate("Server Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
o.default = "443"
|
||||
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = false
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "trojan")
|
||||
|
||||
o = s:option(ListValue, "hysteria_protocol", translate("Protocol"))
|
||||
for _, v in ipairs(hysteria_protocols) do o:value(v) end
|
||||
o.rmempty = false
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
o = s:option(Value, "hysteria_up", translate("up"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Required")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
o = s:option(Value, "hysteria_down", translate("down"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Required")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
--o = s:option(Value, "up_mbps", translate("up_mbps"))
|
||||
--o.rmempty = true
|
||||
--o.datatype = "uinteger"
|
||||
--o:depends("type", "hysteria")
|
||||
|
||||
--o = s:option(Value, "down_mbps", translate("down_mbps"))
|
||||
--o.rmempty = true
|
||||
--o.datatype = "uinteger"
|
||||
--o:depends("type", "hysteria")
|
||||
|
||||
o = s:option(Value, "psk", translate("Psk"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "snell_version", translate("Version"))
|
||||
o:value("2")
|
||||
o:value("3")
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "cipher", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_ss) do o:value(v) end
|
||||
o.description = translate("Only Meta Core Support SS2022")
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "cipher_ssr", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_ssr) do o:value(v) end
|
||||
o:value("dummy", "none")
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocols) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "protocol_param", translate("Protocol param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(ListValue, "securitys", translate("Encrypt Method"))
|
||||
for _, v in ipairs(securitys) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "obfs_ssr", translate("Obfs"))
|
||||
for _, v in ipairs(obfs) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
-- AlterId
|
||||
o = s:option(Value, "alterId", translate("AlterId"))
|
||||
o.datatype = "port"
|
||||
o.default = "32"
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
|
||||
-- VmessId
|
||||
o = s:option(Value, "uuid", translate("UUID"))
|
||||
o.rmempty = true
|
||||
o.default = uuid
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "udp", translate("UDP Enable"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "trojan")
|
||||
o:depends({type = "snell", snell_version = "3"})
|
||||
|
||||
o = s:option(ListValue, "xudp", translate("XUDP Enable")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends({type = "vmess", udp = "true"})
|
||||
|
||||
o = s:option(Value, "packet_encoding", translate("Packet-Encoding")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "global_padding", translate("Global-Padding")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "authenticated_length", translate("Authenticated-Length")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "obfs", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("tls")
|
||||
o:value("http")
|
||||
o:value("websocket", translate("websocket (ws)"))
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "obfs_snell", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("tls")
|
||||
o:value("http")
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "obfs_vless", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("ws", translate("websocket (ws)"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "obfs_vmess", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("websocket", translate("websocket (ws)"))
|
||||
o:value("http", translate("http"))
|
||||
o:value("h2", translate("h2"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "vmess")
|
||||
|
||||
o = s:option(ListValue, "obfs_trojan", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("ws", translate("websocket (ws)"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "trojan")
|
||||
|
||||
o = s:option(Value, "host", translate("obfs-hosts"))
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example.com")
|
||||
o.rmempty = true
|
||||
o:depends("obfs", "tls")
|
||||
o:depends("obfs", "http")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs_snell", "tls")
|
||||
o:depends("obfs_snell", "http")
|
||||
|
||||
-- vmess路径
|
||||
o = s:option(Value, "path", translate("path"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("/")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
o = s:option(DynamicList, "h2_host", translate("host"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("http.example.com")
|
||||
o.datatype = "host"
|
||||
o:depends("obfs_vmess", "h2")
|
||||
|
||||
o = s:option(Value, "h2_path", translate("path"))
|
||||
o.rmempty = true
|
||||
o.default = "/"
|
||||
o:depends("obfs_vmess", "h2")
|
||||
|
||||
o = s:option(DynamicList, "http_path", translate("path"))
|
||||
o.rmempty = true
|
||||
o:value("/")
|
||||
o:value("/video")
|
||||
o:depends("obfs_vmess", "http")
|
||||
|
||||
o = s:option(Value, "custom", translate("headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("v2ray.com")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
o = s:option(Value, "ws_opts_path", translate("ws-opts-path"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("/path")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(DynamicList, "ws_opts_headers", translate("ws-opts-headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Host: v2ray.com")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(Value, "max_early_data", translate("max-early-data"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2048")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
|
||||
o = s:option(Value, "early_data_header_name", translate("early-data-header-name"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Sec-WebSocket-Protocol")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
|
||||
-- [[ skip-cert-verify ]]--
|
||||
o = s:option(ListValue, "skip_cert_verify", translate("skip-cert-verify"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("obfs_vmess", "none")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ TLS ]]--
|
||||
o = s:option(ListValue, "tls", translate("tls"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
|
||||
o = s:option(Value, "servername", translate("servername"))
|
||||
o.rmempty = true
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example.com")
|
||||
o:depends({obfs_vmess = "websocket", tls = "true"})
|
||||
o:depends({obfs_vmess = "grpc", tls = "true"})
|
||||
o:depends({obfs_vmess = "none", tls = "true"})
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(Value, "vless_flow", translate("flow"))
|
||||
o.rmempty = true
|
||||
o.default = "xtls-rprx-direct"
|
||||
o:value("xtls-rprx-direct")
|
||||
o:value("xtls-rprx-origin")
|
||||
o:depends("obfs_vless", "none")
|
||||
|
||||
o = s:option(Value, "keep_alive", translate("keep-alive"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs_vmess", "http")
|
||||
|
||||
-- [[ MUX ]]--
|
||||
o = s:option(ListValue, "mux", translate("mux"))
|
||||
o.rmempty = true
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
|
||||
-- [[ sni ]]--
|
||||
o = s:option(Value, "sni", translate("sni"))
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example.com")
|
||||
o.rmempty = true
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ headers ]]--
|
||||
o = s:option(DynamicList, "http_headers", translate("headers"))
|
||||
o.description = translate("Only Meta Core")
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("User-Agent: okhttp/3.11.0 Dalvik/2.1.0 ...... ")
|
||||
o:depends("type", "http")
|
||||
|
||||
-- 验证用户名
|
||||
o = s:option(Value, "auth_name", translate("Auth Username"))
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o.rmempty = true
|
||||
|
||||
-- 验证密码
|
||||
o = s:option(Value, "auth_pass", translate("Auth Password"))
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o.rmempty = true
|
||||
|
||||
-- [[ alpn ]]--
|
||||
o = s:option(DynamicList, "alpn", translate("alpn"))
|
||||
o.rmempty = true
|
||||
o:value("h2")
|
||||
o:value("http/1.1")
|
||||
o:depends("type", "trojan")
|
||||
|
||||
-- [[ alpn ]]--
|
||||
o = s:option(DynamicList, "hysteria_alpn", translate("alpn"))
|
||||
o.rmempty = false
|
||||
o:value("h3")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ grpc ]]--
|
||||
o = s:option(Value, "grpc_service_name", translate("grpc-service-name"))
|
||||
o.rmempty = true
|
||||
o.datatype = "host"
|
||||
o.placeholder = translate("example")
|
||||
o:depends("obfs_trojan", "grpc")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
|
||||
-- [[ trojan-ws-path ]]--
|
||||
o = s:option(Value, "trojan_ws_path", translate("Path"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("/path")
|
||||
o:depends("obfs_trojan", "ws")
|
||||
|
||||
-- [[ trojan-ws-headers ]]--
|
||||
o = s:option(DynamicList, "trojan_ws_headers", translate("Headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Host: v2ray.com")
|
||||
o:depends("obfs_trojan", "ws")
|
||||
|
||||
-- [[ hysteria_obfs ]]--
|
||||
o = s:option(Value, "hysteria_obfs", translate("obfs"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("yourpassword")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ hysteria_auth ]]--
|
||||
--o = s:option(Value, "hysteria_auth", translate("auth"))
|
||||
--o.rmempty = true
|
||||
--o.placeholder = translate("[BASE64]")
|
||||
--o:depends("type", "hysteria")
|
||||
|
||||
-- [[ hysteria_auth_str ]]--
|
||||
o = s:option(Value, "hysteria_auth_str", translate("auth_str"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("yubiyubi")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ hysteria_ca ]]--
|
||||
o = s:option(Value, "hysteria_ca", translate("ca"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("./my.ca")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ hysteria_ca_str ]]--
|
||||
o = s:option(Value, "hysteria_ca_str", translate("ca_str"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("xyz")
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ recv_window_conn ]]--
|
||||
o = s:option(Value, "recv_window_conn", translate("recv_window_conn"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("QUIC stream receive window")
|
||||
o.datatype = "uinteger"
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ recv_window ]]--
|
||||
o = s:option(Value, "recv_window", translate("recv_window"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("QUIC connection receive window")
|
||||
o.datatype = "uinteger"
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ disable_mtu_discovery ]]--
|
||||
o = s:option(ListValue, "disable_mtu_discovery", translate("disable_mtu_discovery"))
|
||||
o.rmempty = true
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o.default = "false"
|
||||
o:depends("type", "hysteria")
|
||||
|
||||
-- [[ interface-name ]]--
|
||||
o = s:option(Value, "interface_name", translate("interface-name"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("eth0")
|
||||
|
||||
-- [[ routing-mark ]]--
|
||||
o = s:option(Value, "routing_mark", translate("routing-mark"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("2333")
|
||||
|
||||
o = s:option(DynamicList, "groups", translate("Proxy Group"))
|
||||
o.description = font_red..bold_on..translate("No Need Set when Config Create, The added Proxy Groups Must Exist")..bold_off..font_off
|
||||
o.rmempty = true
|
||||
o:value("all", translate("All Groups"))
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
if s.name ~= "" and s.name ~= nil then
|
||||
o:value(s.name)
|
||||
end
|
||||
end)
|
||||
|
||||
local t = {
|
||||
{Commit, Back}
|
||||
}
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:commit(openclash)
|
||||
sys.call("/usr/share/openclash/cfg_servers_address_fake_filter.sh &")
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
o = a:option(Button,"Back", " ")
|
||||
o.inputtitle = translate("Back Settings")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:revert(openclash, sid)
|
||||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
return m
|
@ -1,271 +0,0 @@
|
||||
|
||||
local m, s, o
|
||||
local openclash = "openclash"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
m = Map(openclash, translate("Servers manage and Config create"))
|
||||
m.pageaction = false
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "create_config", translate("Create Config"))
|
||||
o.description = font_red .. bold_on .. translate("Create Config By One-Click Only Need Proxies") .. bold_off .. font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:option(ListValue, "rule_sources", translate("Choose Template For Create Config"))
|
||||
o.description = translate("Use Other Rules To Create Config")
|
||||
o:depends("create_config", 1)
|
||||
o:value("lhie1", translate("lhie1 Rules"))
|
||||
o:value("ConnersHua", translate("ConnersHua(Provider-type) Rules"))
|
||||
o:value("ConnersHua_return", translate("ConnersHua Return Rules"))
|
||||
|
||||
o = s:option(Flag, "mix_proxies", translate("Mix Proxies"))
|
||||
o.description = font_red .. bold_on .. translate("Mix This Page's Proxies") .. bold_off .. font_off
|
||||
o:depends("create_config", 1)
|
||||
o.default = 0
|
||||
|
||||
o = s:option(Flag, "servers_update", translate("Keep Settings"))
|
||||
o.description = font_red .. bold_on .. translate("Only Update Servers Below When Subscription") .. bold_off .. font_off
|
||||
o.default = 0
|
||||
|
||||
o = s:option(DynamicList, "new_servers_group", translate("New Servers Group"))
|
||||
o.description = translate("Set The New Subscribe Server's Default Proxy Groups")
|
||||
o.rmempty = true
|
||||
o:depends("servers_update", 1)
|
||||
o:value("all", translate("All Groups"))
|
||||
m.uci:foreach("openclash", "groups",
|
||||
function(s)
|
||||
o:value(s.name)
|
||||
end)
|
||||
|
||||
-- [[ Groups Manage ]]--
|
||||
s = m:section(TypedSection, "groups", translate("Proxy Groups(No Need Set when Config Create)"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/groups-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "type", translate("Group Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Group Name"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
-- [[ Proxy-Provider Manage ]]--
|
||||
s = m:section(TypedSection, "proxy-provider", translate("Proxy-Provider"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/proxy-provider-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "type", translate("Provider Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Provider Name"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
-- [[ Servers Manage ]]--
|
||||
s = m:section(TypedSection, "servers", translate("Proxies"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.extedit = luci.dispatcher.build_url("admin/services/openclash/servers-config/%s")
|
||||
function s.create(...)
|
||||
local sid = TypedSection.create(...)
|
||||
if sid then
|
||||
luci.http.redirect(s.extedit % sid)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
---- enable flag
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.rmempty = false
|
||||
o.default = o.enabled
|
||||
o.cfgvalue = function(...)
|
||||
return Flag.cfgvalue(...) or "1"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "config", translate("Config File"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("all")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "type", translate("Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "name", translate("Server Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "server", translate("Server Address"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "port", translate("Server Port"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "udp", translate("UDP Support"))
|
||||
function o.cfgvalue(...)
|
||||
if Value.cfgvalue(...) == "true" then
|
||||
return translate("Enable")
|
||||
elseif Value.cfgvalue(...) == "false" then
|
||||
return translate("Disable")
|
||||
else
|
||||
return translate("None")
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(DummyValue,"server",translate("Ping Latency"))
|
||||
o.template="openclash/ping"
|
||||
o.width="10%"
|
||||
|
||||
local tt = {
|
||||
{Delete_Unused_Servers, Delete_Servers, Delete_Proxy_Provider, Delete_Groups}
|
||||
}
|
||||
|
||||
b = m:section(Table, tt)
|
||||
|
||||
o = b:option(Button,"Delete_Unused_Servers", " ")
|
||||
o.inputtitle = translate("Delete Unused Servers")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
luci.sys.call("sh /usr/share/openclash/cfg_unused_servers_del.sh 2>/dev/null")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
o = b:option(Button,"Delete_Servers", " ")
|
||||
o.inputtitle = translate("Delete Servers")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:delete_all("openclash", "servers", function(s) return true end)
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
o = b:option(Button,"Delete_Proxy_Provider", " ")
|
||||
o.inputtitle = translate("Delete Proxy Providers")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:delete_all("openclash", "proxy-provider", function(s) return true end)
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
o = b:option(Button,"Delete_Groups", " ")
|
||||
o.inputtitle = translate("Delete Groups")
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:delete_all("openclash", "groups", function(s) return true end)
|
||||
m.uci:commit("openclash")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "servers"))
|
||||
end
|
||||
|
||||
local t = {
|
||||
{Load_Config, Commit, Apply}
|
||||
}
|
||||
|
||||
a = m:section(Table, t)
|
||||
|
||||
o = a:option(Button,"Load_Config", " ")
|
||||
o.inputtitle = translate("Read Config")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Commit", " ")
|
||||
o.inputtitle = translate("Commit Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply", " ")
|
||||
o.inputtitle = translate("Apply Settings")
|
||||
o.inputstyle = "apply"
|
||||
o.write = function()
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
m.uci:set("openclash", "config", "enable", 0)
|
||||
m.uci:commit("openclash")
|
||||
luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
|
||||
m:append(Template("openclash/server_list"))
|
||||
m:append(Template("openclash/toolbar_show"))
|
||||
|
||||
return m
|
File diff suppressed because it is too large
Load Diff
@ -1,264 +0,0 @@
|
||||
--[[
|
||||
LuCI - Filesystem tools
|
||||
|
||||
Description:
|
||||
A module offering often needed filesystem manipulation functions
|
||||
|
||||
FileId:
|
||||
$Id$
|
||||
|
||||
License:
|
||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
]]--
|
||||
|
||||
local io = require "io"
|
||||
local os = require "os"
|
||||
local ltn12 = require "luci.ltn12"
|
||||
local fs = require "nixio.fs"
|
||||
local nutil = require "nixio.util"
|
||||
|
||||
local type = type
|
||||
local string = string
|
||||
|
||||
--- LuCI filesystem library.
|
||||
module "luci.openclash"
|
||||
|
||||
--- Test for file access permission on given path.
|
||||
-- @class function
|
||||
-- @name access
|
||||
-- @param str String value containing the path
|
||||
-- @return Number containing the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description (if any)
|
||||
-- @return Number containing the os specific errno (if any)
|
||||
access = fs.access
|
||||
|
||||
--- Evaluate given shell glob pattern and return a table containing all matching
|
||||
-- file and directory entries.
|
||||
-- @class function
|
||||
-- @name glob
|
||||
-- @param filename String containing the path of the file to read
|
||||
-- @return Table containing file and directory entries or nil if no matches
|
||||
-- @return String containing the error description (if no matches)
|
||||
-- @return Number containing the os specific errno (if no matches)
|
||||
function glob(...)
|
||||
local iter, code, msg = fs.glob(...)
|
||||
if iter then
|
||||
return nutil.consume(iter)
|
||||
else
|
||||
return nil, code, msg
|
||||
end
|
||||
end
|
||||
|
||||
--- Checks wheather the given path exists and points to a regular file.
|
||||
-- @param filename String containing the path of the file to test
|
||||
-- @return Boolean indicating wheather given path points to regular file
|
||||
function isfile(filename)
|
||||
return fs.stat(filename, "type") == "reg"
|
||||
end
|
||||
|
||||
--- Checks wheather the given path exists and points to a directory.
|
||||
-- @param dirname String containing the path of the directory to test
|
||||
-- @return Boolean indicating wheather given path points to directory
|
||||
function isdirectory(dirname)
|
||||
return fs.stat(dirname, "type") == "dir"
|
||||
end
|
||||
|
||||
--- Read the whole content of the given file into memory.
|
||||
-- @param filename String containing the path of the file to read
|
||||
-- @return String containing the file contents or nil on error
|
||||
-- @return String containing the error message on error
|
||||
readfile = fs.readfile
|
||||
|
||||
--- Write the contents of given string to given file.
|
||||
-- @param filename String containing the path of the file to read
|
||||
-- @param data String containing the data to write
|
||||
-- @return Boolean containing true on success or nil on error
|
||||
-- @return String containing the error message on error
|
||||
writefile = fs.writefile
|
||||
|
||||
--- Copies a file.
|
||||
-- @param source Source file
|
||||
-- @param dest Destination
|
||||
-- @return Boolean containing true on success or nil on error
|
||||
copy = fs.datacopy
|
||||
|
||||
--- Renames a file.
|
||||
-- @param source Source file
|
||||
-- @param dest Destination
|
||||
-- @return Boolean containing true on success or nil on error
|
||||
rename = fs.move
|
||||
|
||||
--- Get the last modification time of given file path in Unix epoch format.
|
||||
-- @param path String containing the path of the file or directory to read
|
||||
-- @return Number containing the epoch time or nil on error
|
||||
-- @return String containing the error description (if any)
|
||||
-- @return Number containing the os specific errno (if any)
|
||||
function mtime(path)
|
||||
return fs.stat(path, "mtime")
|
||||
end
|
||||
|
||||
--- Set the last modification time of given file path in Unix epoch format.
|
||||
-- @param path String containing the path of the file or directory to read
|
||||
-- @param mtime Last modification timestamp
|
||||
-- @param atime Last accessed timestamp
|
||||
-- @return 0 in case of success nil on error
|
||||
-- @return String containing the error description (if any)
|
||||
-- @return Number containing the os specific errno (if any)
|
||||
function utime(path, mtime, atime)
|
||||
return fs.utimes(path, atime, mtime)
|
||||
end
|
||||
|
||||
--- Return the last element - usually the filename - from the given path with
|
||||
-- the directory component stripped.
|
||||
-- @class function
|
||||
-- @name basename
|
||||
-- @param path String containing the path to strip
|
||||
-- @return String containing the base name of given path
|
||||
-- @see dirname
|
||||
basename = fs.basename
|
||||
|
||||
--- Return the directory component of the given path with the last element
|
||||
-- stripped of.
|
||||
-- @class function
|
||||
-- @name dirname
|
||||
-- @param path String containing the path to strip
|
||||
-- @return String containing the directory component of given path
|
||||
-- @see basename
|
||||
dirname = fs.dirname
|
||||
|
||||
--- Return a table containing all entries of the specified directory.
|
||||
-- @class function
|
||||
-- @name dir
|
||||
-- @param path String containing the path of the directory to scan
|
||||
-- @return Table containing file and directory entries or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function dir(...)
|
||||
local iter, code, msg = fs.dir(...)
|
||||
if iter then
|
||||
local t = nutil.consume(iter)
|
||||
t[#t+1] = "."
|
||||
t[#t+1] = ".."
|
||||
return t
|
||||
else
|
||||
return nil, code, msg
|
||||
end
|
||||
end
|
||||
|
||||
--- Create a new directory, recursively on demand.
|
||||
-- @param path String with the name or path of the directory to create
|
||||
-- @param recursive Create multiple directory levels (optional, default is true)
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function mkdir(path, recursive)
|
||||
return recursive and fs.mkdirr(path) or fs.mkdir(path)
|
||||
end
|
||||
|
||||
--- Remove the given empty directory.
|
||||
-- @class function
|
||||
-- @name rmdir
|
||||
-- @param path String containing the path of the directory to remove
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
rmdir = fs.rmdir
|
||||
|
||||
local stat_tr = {
|
||||
reg = "regular",
|
||||
dir = "directory",
|
||||
lnk = "link",
|
||||
chr = "character device",
|
||||
blk = "block device",
|
||||
fifo = "fifo",
|
||||
sock = "socket"
|
||||
}
|
||||
--- Get information about given file or directory.
|
||||
-- @class function
|
||||
-- @name stat
|
||||
-- @param path String containing the path of the directory to query
|
||||
-- @return Table containing file or directory properties or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function stat(path, key)
|
||||
local data, code, msg = fs.stat(path)
|
||||
if data then
|
||||
data.mode = data.modestr
|
||||
data.type = stat_tr[data.type] or "?"
|
||||
end
|
||||
return key and data and data[key] or data, code, msg
|
||||
end
|
||||
|
||||
--- Set permissions on given file or directory.
|
||||
-- @class function
|
||||
-- @name chmod
|
||||
-- @param path String containing the path of the directory
|
||||
-- @param perm String containing the permissions to set ([ugoa][+-][rwx])
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
chmod = fs.chmod
|
||||
|
||||
--- Create a hard- or symlink from given file (or directory) to specified target
|
||||
-- file (or directory) path.
|
||||
-- @class function
|
||||
-- @name link
|
||||
-- @param path1 String containing the source path to link
|
||||
-- @param path2 String containing the destination path for the link
|
||||
-- @param symlink Boolean indicating wheather to create a symlink (optional)
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
function link(src, dest, sym)
|
||||
return sym and fs.symlink(src, dest) or fs.link(src, dest)
|
||||
end
|
||||
|
||||
--- Remove the given file.
|
||||
-- @class function
|
||||
-- @name unlink
|
||||
-- @param path String containing the path of the file to remove
|
||||
-- @return Number with the return code, 0 on sucess or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
unlink = fs.unlink
|
||||
|
||||
--- Retrieve target of given symlink.
|
||||
-- @class function
|
||||
-- @name readlink
|
||||
-- @param path String containing the path of the symlink to read
|
||||
-- @return String containing the link target or nil on error
|
||||
-- @return String containing the error description on error
|
||||
-- @return Number containing the os specific errno on error
|
||||
readlink = fs.readlink
|
||||
|
||||
function filename(str)
|
||||
local idx = str:match(".+()%.%w+$")
|
||||
if(idx) then
|
||||
return str:sub(1, idx-1)
|
||||
else
|
||||
return str
|
||||
end
|
||||
end
|
||||
|
||||
function filesize(e)
|
||||
local t=0
|
||||
local a={' KB',' MB',' GB',' TB'}
|
||||
repeat
|
||||
e=e/1024
|
||||
t=t+1
|
||||
until(e<=1024)
|
||||
return string.format("%.1f",e)..a[t]
|
||||
end
|
@ -1,18 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div>
|
||||
<%
|
||||
local val = self:cfgvalue(section)
|
||||
if val == translate("Enable") or val == translate("Config Normal") or val == translate("Exist") then
|
||||
%>
|
||||
<div style="color: green; font-weight:bold;">
|
||||
<%
|
||||
else
|
||||
%>
|
||||
<div style="color: red; font-weight:bold;">
|
||||
<%
|
||||
end
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
@ -1,263 +0,0 @@
|
||||
<style>
|
||||
.CodeMirror {
|
||||
text-align: left !important;
|
||||
font-size: 15px;
|
||||
line-height: 150%;
|
||||
resize: both !important;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/lib/codemirror.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/material.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/theme/idea.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/fold/foldgutter.css"/>
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/lint/lint.css">
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/display/fullscreen.css">
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/dialog/dialog.css">
|
||||
<link rel="stylesheet" href="/luci-static/resources/openclash/addon/search/matchesonscrollbar.css">
|
||||
<script src="/luci-static/resources/openclash/lib/codemirror.js"></script>
|
||||
<script src="/luci-static/resources/openclash/mode/yaml/yaml.js"></script>
|
||||
<script src="/luci-static/resources/openclash/mode/lua/lua.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/fold/foldcode.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/fold/foldgutter.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/fold/indent-fold.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/edit/matchbrackets.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/selection/active-line.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/lint/lint.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/lint/yaml-lint.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/lint/js-yaml.min.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/display/fullscreen.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/display/autorefresh.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/dialog/dialog.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/searchcursor.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/search.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/scroll/annotatescrollbar.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/matchesonscrollbar.js"></script>
|
||||
<script src="/luci-static/resources/openclash/addon/search/jump-to-line.js"></script>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function editor(id, readOnly, wid, height)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "text/yaml",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "material",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
lint: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (readOnly == "true") {
|
||||
editor.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
if (wid && height) {
|
||||
editor.setSize(wid, height);
|
||||
};
|
||||
};
|
||||
|
||||
function other_editor(id, readOnly)
|
||||
{
|
||||
var editor = CodeMirror.fromTextArea(id, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "material",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
},
|
||||
"Tab": function(cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
cm.indentSelection('add')
|
||||
} else {
|
||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ")
|
||||
cm.replaceSelection(spaces)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function other_log_area(id, readOnly, wid, height)
|
||||
{
|
||||
var other_log_area = CodeMirror.fromTextArea(id, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "idea",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (readOnly == "true") {
|
||||
other_log_area.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
if (wid && height) {
|
||||
other_log_area.setSize(wid, height);
|
||||
};
|
||||
|
||||
other_log_area.markText({line:0,ch:0},{line:9999,ch:9999}, {css: 'font-size:13px'});
|
||||
};
|
||||
|
||||
var myEditor_use = document.getElementById("cbid.table.1.user");
|
||||
var myEditor_def = document.getElementById("cbid.table.1.default");
|
||||
|
||||
if (myEditor_use && myEditor_def) {
|
||||
var myEditor_use_wid = document.getElementById("cbi-table-1-user").offsetWidth;
|
||||
var myEditor_def_wid = document.getElementById("cbi-table-1-default").offsetWidth;
|
||||
|
||||
editor(myEditor_use, 'false', myEditor_use_wid, '700px');
|
||||
editor(myEditor_def, 'true', myEditor_def_wid, '700px');
|
||||
};
|
||||
|
||||
var myEditor_hosts = document.getElementById("cbid.openclash.config.custom_hosts");
|
||||
var myEditor_fall_fil = document.getElementById("cbid.openclash.config.custom_fallback_fil");
|
||||
var myEditor_name_pol = document.getElementById("cbid.openclash.config.custom_domain_dns_core");
|
||||
var myEditor_name_cus_r1 = document.getElementById("cbid.openclash.config.custom_rules_2");
|
||||
var myEditor_name_cus_r2 = document.getElementById("cbid.openclash.config.custom_rules");
|
||||
var myEditor_fake_filter = document.getElementById("cbid.openclash.config.custom_fake_filter");
|
||||
var myEditor_custom_domain_dns = document.getElementById("cbid.openclash.config.custom_domain_dns");
|
||||
var myEditor_edit_file = document.getElementById("cbid.openclash.config.edit_file");
|
||||
var myEditor_sniffing_domain_force = document.getElementById("cbid.openclash.config.sniffing_domain_force");
|
||||
var myEditor_sniffing_domain_filter = document.getElementById("cbid.openclash.config.sniffing_domain_filter");
|
||||
var myEditor_sniffing_port_filter = document.getElementById("cbid.openclash.config.sniffing_port_filter");
|
||||
|
||||
if (myEditor_hosts) {
|
||||
editor(myEditor_hosts, 'false');
|
||||
};
|
||||
|
||||
if (myEditor_edit_file) {
|
||||
editor(myEditor_edit_file, 'false', "auto", '700px');
|
||||
};
|
||||
|
||||
if (myEditor_fall_fil) {
|
||||
editor(myEditor_fall_fil, 'false');
|
||||
editor(myEditor_name_pol, 'false');
|
||||
editor(myEditor_name_cus_r1, 'false');
|
||||
editor(myEditor_name_cus_r2, 'false');
|
||||
};
|
||||
|
||||
if (myEditor_fake_filter) {
|
||||
other_editor(myEditor_fake_filter, 'false');
|
||||
};
|
||||
|
||||
if (myEditor_custom_domain_dns) {
|
||||
other_editor(myEditor_custom_domain_dns, 'false');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_domain_force) {
|
||||
other_editor(myEditor_sniffing_domain_force, 'false');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_domain_filter) {
|
||||
other_editor(myEditor_sniffing_domain_filter, 'false');
|
||||
};
|
||||
|
||||
if (myEditor_sniffing_port_filter) {
|
||||
other_editor(myEditor_sniffing_port_filter, 'false');
|
||||
};
|
||||
|
||||
|
||||
var core_log = document.getElementById("core_log");
|
||||
var oc_log = document.getElementById("cbid.openclash.config.clog");
|
||||
if (core_log && oc_log) {
|
||||
var core_editor = CodeMirror.fromTextArea(core_log, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "idea",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var oc_editor = CodeMirror.fromTextArea(oc_log, {
|
||||
mode: "lua",
|
||||
autoRefresh: true,
|
||||
styleActiveLine: true,
|
||||
lineNumbers: true,
|
||||
theme: "idea",
|
||||
lineWrapping: true,
|
||||
matchBrackets: true,
|
||||
foldGutter: true,
|
||||
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
|
||||
extraKeys: {
|
||||
"F11": function(cm) {
|
||||
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
|
||||
},
|
||||
"Esc": function(cm) {
|
||||
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
core_editor.setSize("auto", "540px");
|
||||
core_editor.setOption("readOnly","true");
|
||||
oc_editor.setSize("auto", "540px");
|
||||
oc_editor.setOption("readOnly","true");
|
||||
};
|
||||
|
||||
var proxy_mg = document.getElementById('cbi-table-1-proxy_mg');
|
||||
var rule_mg = document.getElementById('cbi-table-1-rule_mg');
|
||||
var game_mg = document.getElementById('cbi-table-1-game_mg');
|
||||
var Commit = document.getElementById('cbi-table-1-Commit');
|
||||
var Apply = document.getElementById('cbi-table-1-Apply');
|
||||
|
||||
if (proxy_mg) {
|
||||
proxy_mg.style.textAlign="center";
|
||||
rule_mg.style.textAlign="center";
|
||||
game_mg.style.textAlign="center";
|
||||
Commit.style.textAlign="center";
|
||||
Apply.style.textAlign="center";
|
||||
};
|
||||
//]]>
|
||||
</script>
|
@ -1,139 +0,0 @@
|
||||
<%#
|
||||
Copyright 2010 Jo-Philipp Wich <jow@openwrt.org>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local diag_host = "www.instagram.com"
|
||||
%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function show_diag_info(addr)
|
||||
{
|
||||
var addr = addr;
|
||||
var legend = document.getElementById('diag-rc-legend');
|
||||
var output = document.getElementById('diag-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "diag_connection")%>', {addr: addr}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
|
||||
}
|
||||
else if (x.status == 500)
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Bad address specified!%></span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Could not find any connection logs!%></br></br><%:1. It may be that the plugin is not running%></br></br><%:2. It may be that the cache causes the browser to directly use the IP for access%></br></br><%:3. It may be that DNS hijacking did not take effect, so clash unable to reverse the domain name%></br></br><%:4. It may be that the filled address cannot be resolved and connected%></span>';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function update_status(field)
|
||||
{
|
||||
var addr = field.value;
|
||||
var legend = document.getElementById('diag-rc-legend');
|
||||
var output = document.getElementById('diag-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
legend.parentNode.style.display = 'block';
|
||||
legend.style.display = 'inline';
|
||||
}
|
||||
|
||||
let HTTP = {
|
||||
checker: (domain) => {
|
||||
let img = new Image;
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
show_diag_info(addr);
|
||||
}, 10000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
show_diag_info(addr);
|
||||
}
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
show_diag_info(addr);
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker(addr);
|
||||
}
|
||||
};
|
||||
HTTP.runcheck();
|
||||
}
|
||||
|
||||
|
||||
function gen_debug_logs()
|
||||
{
|
||||
var legend = document.getElementById('debug-rc-legend');
|
||||
var output = document.getElementById('debug-rc-output');
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
legend.parentNode.style.display = 'block';
|
||||
legend.style.display = 'inline';
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "gen_debug_logs")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<textarea class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="30" cols="60" readonly="readonly" >'+x.responseText+'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:Some error occurred!%></span>';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
//]]></script>
|
||||
|
||||
<form>
|
||||
<fieldset>
|
||||
<div style="width:50%; float: left; text-align: center;">
|
||||
<%:Connection Test (Current Browser)%>
|
||||
<input type="text" value="<%=diag_host%>" name="diag" />
|
||||
<input type="button" value="<%:Click to Test%>" class="btn cbi-button cbi-button-apply" onclick="update_status(this.form.diag)" />
|
||||
</div>
|
||||
<div style="width:50%; float: left; text-align: center;">
|
||||
<%:Generate Logs%>
|
||||
<input type="button" value="<%:Click to Generate%>" class="btn cbi-button cbi-button-apply" onclick="gen_debug_logs(this)" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="display:none">
|
||||
<legend id="diag-rc-legend"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="diag-rc-output"></span>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="display:none">
|
||||
<legend id="debug-rc-legend"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="debug-rc-output"></span>
|
||||
</fieldset>
|
||||
</form>
|
File diff suppressed because one or more lines are too long
@ -1,111 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function dler_login(btn,option)
|
||||
{
|
||||
btn.disabled = true;
|
||||
if (option == "dler_login") {
|
||||
var s = document.getElementById(option+'-status');
|
||||
var e = document.getElementsByName('cbid.openclash.config.dler_email');
|
||||
var p = document.getElementsByName('cbid.openclash.config.dler_passwd');
|
||||
var c = document.getElementsByName('cbid.openclash.config.dler_checkin');
|
||||
if (!e[0].value || !p[0].value) {
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Error Login Info%>"+"</strong></font>";
|
||||
return false;
|
||||
};
|
||||
if (c[0] && c[0].checked) {
|
||||
c = "1";
|
||||
var i = document.getElementsByName('cbid.openclash.config.dler_checkin_interval');
|
||||
var m = document.getElementsByName('cbid.openclash.config.dler_checkin_multiple');
|
||||
if (!i[0].value || !(/(^[1-9]\d*$)/.test(i[0].value))) { i = "1"} else {i = i[0].value};
|
||||
if (!m[0].value || !(/(^[1-9]\d*$)/.test(m[0].value)))
|
||||
{
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 50%>"+"</strong></font>";
|
||||
return false;
|
||||
}
|
||||
else if (m[0].value < 1)
|
||||
{
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 50%>"+"</strong></font>";
|
||||
return false;
|
||||
}
|
||||
else if (m[0].value > 50)
|
||||
{
|
||||
btn.disabled = false;
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Multiple Must Be a Positive Integer and No More Than 50%>"+"</strong></font>";
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
m = m[0].value;
|
||||
};
|
||||
}
|
||||
else {
|
||||
c = "0";
|
||||
var i = "1";
|
||||
var m = "1";
|
||||
};
|
||||
btn.value = '<%:Login...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login_info_save")%>', {email: e[0].value, passwd : p[0].value, checkin: c, interval: i, multiple: m}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_login")%>', null, function(x, status) {
|
||||
if (s)
|
||||
{
|
||||
if (x && x.status == 200 && status.dler_login == 200) {
|
||||
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Login Successful%>"+"</strong></font>";
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
else {
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Login Faild%>"+"</strong></font>";
|
||||
if (status.dler_login) {
|
||||
alert("<%:Dler Cloud Login Faild%>: "+status.dler_login)
|
||||
}
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Login Account%>';
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (option == "dler_logout") {
|
||||
var s = document.getElementById('dler_login-status');
|
||||
btn.value = '<%:Logout...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dler_logout")%>', null, function(x, status) {
|
||||
if (s)
|
||||
{
|
||||
if (x && x.status == 200 && status.dler_logout == 200) {
|
||||
s.innerHTML ="<font color='green'><strong>"+"<%:Dler Cloud Logout Successful%>"+"</strong></font>";
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
else {
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Logout Faild%>"+"</strong></font>";
|
||||
if (status.dler_logout) {
|
||||
alert("<%:Dler Cloud Logout Faild%>: "+status.dler_logout)
|
||||
}
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Logout Account%>';
|
||||
}
|
||||
);
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
||||
function web_dler(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
url='https://bit.ly/32mrABp';
|
||||
window.open(url);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
//]]></script>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Login Account%>" onclick="return dler_login(this,'dler_login')" />
|
||||
<input type="button" class="btn cbi-button cbi-button-remove" value="<%:Logout Account%>" onclick="return dler_login(this,'dler_logout')" />
|
||||
<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Official Website%>" onclick="return web_dler(this)" />
|
||||
<span id="<%=self.option%>-status"><%=self.value%></span>
|
||||
<%+cbi/valuefooter%>
|
File diff suppressed because one or more lines are too long
@ -1,41 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function act_download_rule(btn,filename)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Downloading Rule...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_rule")%>',
|
||||
{
|
||||
filename: filename
|
||||
},
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.rule_download_status=="0")
|
||||
{
|
||||
btn.value = '<%:Download Failed%>';
|
||||
}
|
||||
else if (status.rule_download_status=="1")
|
||||
{
|
||||
btn.value = '<%:Download Successful%>';
|
||||
}
|
||||
else if (status.rule_download_status=="2")
|
||||
{
|
||||
btn.value = '<%:Rule No Change%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Download Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Click to Update%>" onclick="return act_download_rule(this,'<%=self:cfgvalue(section)%>')" />
|
||||
|
||||
<%+cbi/valuefooter%>
|
@ -1,152 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var catch_num;
|
||||
var catch_timeout;
|
||||
var catch_out;
|
||||
|
||||
function act_download_disney_rule(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Downloading Rule...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_disney_domains")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.rule_download_status=="0")
|
||||
{
|
||||
btn.value = '<%:Download Failed%>';
|
||||
}
|
||||
else if (status.rule_download_status=="1")
|
||||
{
|
||||
btn.value = '<%:Download Successful%>';
|
||||
}
|
||||
else if (status.rule_download_status=="2")
|
||||
{
|
||||
btn.value = '<%:Rule No Change%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Download Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function act_download_netflix_rule(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Downloading Rule...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","download_netflix_domains")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.rule_download_status=="0")
|
||||
{
|
||||
btn.value = '<%:Downloading Fail%>';
|
||||
}
|
||||
else if (status.rule_download_status=="1")
|
||||
{
|
||||
btn.value = '<%:Downloading Successful%>';
|
||||
}
|
||||
else if (status.rule_download_status=="2")
|
||||
{
|
||||
btn.value = '<%:Rule No Change%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Downloading Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function catch_netflix_domains()
|
||||
{
|
||||
var legend = document.getElementById('catch-netflix-state');
|
||||
var output = document.getElementById('catch-netflix-output');
|
||||
var r = confirm("<%:Attention:%>\n<%:The catch result will be automatically saved%>\n\n1. <%:Please make sure the OpenClash works normally%>\n2. <%:The domains catch time is one minute%>\n3. <%:About to open fast.com%>\n4. <%:You can also try to catch while unlocking device playing%>");
|
||||
if (r == true) {
|
||||
|
||||
winOpen("https://fast.com/");
|
||||
|
||||
if (legend && output)
|
||||
{
|
||||
output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
legend.parentNode.style.display = 'block';
|
||||
legend.style.display = 'inline';
|
||||
catch_num = 0;
|
||||
catch_out = "";
|
||||
get_netflix_domains();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function strUnique(str){
|
||||
var ret = [];
|
||||
str.replace(/[^,]+/g, function($1, $2) {
|
||||
(str.indexOf($1) == $2) && ret.push($1);
|
||||
});
|
||||
return ret.join('\n');
|
||||
}
|
||||
|
||||
function get_netflix_domains()
|
||||
{
|
||||
var legend = document.getElementById('catch-netflix-state');
|
||||
var output = document.getElementById('catch-netflix-output');
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "catch_netflix_domains")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
if (catch_out != "") {
|
||||
catch_out = catch_out + x.responseText;
|
||||
}
|
||||
else
|
||||
{
|
||||
catch_out = x.responseText;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
catch_num = catch_num + 1;
|
||||
|
||||
if ( catch_num < 20 ) {
|
||||
catch_timeout = setTimeout("get_netflix_domains()", 3000);
|
||||
}
|
||||
else {
|
||||
clearTimeout(catch_timeout);
|
||||
if (catch_out != "")
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<textarea class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+strUnique(catch_out)+'</textarea>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "write_netflix_domains")%>', {domains: strUnique(catch_out)}, function(x, status) {});
|
||||
}
|
||||
else
|
||||
{
|
||||
legend.style.display = 'none';
|
||||
output.innerHTML = '<span class="error"><%:No domain names were catched...%></span>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Netflix%>" onclick="return act_download_netflix_rule(this)" />
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Disney Plus%>" onclick="return act_download_disney_rule(this)" />
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Catch Netflix%>" onclick="return catch_netflix_domains(this)" />
|
||||
<fieldset style="display: none;margin: 0 auto;">
|
||||
<legend id="catch-netflix-state"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="catch-netflix-output"></span>
|
||||
</fieldset>
|
||||
<%+cbi/valuefooter%>
|
@ -1,13 +0,0 @@
|
||||
<%+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>
|
||||
<%+cbi/valuefooter%>
|
@ -1,37 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function act_flush_fakeip_cache(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Flushing...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","flush_fakeip_cache")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.flush_status == "0" || status.flush_status != "")
|
||||
{
|
||||
btn.value = '<%:Flush Failed%>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.value = '<%:Flush Successful%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Flush Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Flush%>" onclick="return act_flush_fakeip_cache(this)" />
|
||||
<%+cbi/valuefooter%>
|
@ -1,19 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function import_file_name(btn, option, file_path) {
|
||||
var file_name = prompt("<%:Paste the name of the new file (including the extension) here:%>", "");
|
||||
if (file_name == null || file_name == "") {
|
||||
return false;
|
||||
}
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "create_file")%>', {filename: file_name, filepath: file_path}, function(x, status) {
|
||||
if (x && x.status == 200)
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Create File%>" onclick="return import_file_name(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<%+cbi/valuefooter%>
|
@ -1,23 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function import_new_file_name(btn, file_path, file_name) {
|
||||
var new_file_name = prompt("<%:Paste the new file name (including the extension) here:%>", "");
|
||||
if (new_file_name == null || new_file_name == "") {
|
||||
return false;
|
||||
}
|
||||
if (file_path == "/etc/openclash/config/" && new_file_name.split('.').pop() != "yaml" && new_file_name.split('.').pop() != "yml") {
|
||||
alert('<%:Illegal extension!%>')
|
||||
return false;
|
||||
}
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "rename_file")%>', {new_file_name: new_file_name, file_path: file_path, file_name: file_name}, function(x, status) {
|
||||
if (x && x.status == 200)
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Rename%>" onclick="return import_new_file_name(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<%+cbi/valuefooter%>
|
@ -1,314 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<style type="text/css">
|
||||
*{margin: 0;padding: 0;}
|
||||
|
||||
ul{
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#tab{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #ddd;
|
||||
box-shadow: 0 0 2px #ddd;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tab-header{
|
||||
background-color: #F7F7F7;
|
||||
height: 33px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
#tab-header ul{
|
||||
width: 500px;
|
||||
position: absolute;
|
||||
left: -1px;
|
||||
}
|
||||
#tab-header ul li{
|
||||
float: left;
|
||||
width: 120px;
|
||||
height: 33px;
|
||||
line-height: 33px;
|
||||
padding: 0 1px;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
border-right: 1px solid #dddddd;
|
||||
}
|
||||
#tab-header ul li.selected{
|
||||
background-color: white;
|
||||
font-weight: bolder;
|
||||
border-bottom: 0;
|
||||
border-right: 1px solid #dddddd;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#tab-header ul li:hover{
|
||||
color: orangered;
|
||||
}
|
||||
|
||||
#tab-content .dom{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tab-content .dom ul li{
|
||||
float: left;
|
||||
margin: 15px 10px;
|
||||
width: 225px;
|
||||
}
|
||||
|
||||
.radio-button{
|
||||
width: fit-content;
|
||||
text-align: center;
|
||||
overflow: auto;
|
||||
margin: 10px auto;
|
||||
background-color: #d1d1d1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-button label {
|
||||
display: inline-block;
|
||||
padding: 4px 11px;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"]:checked+label {
|
||||
background-color: #1080c1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div id="tab">
|
||||
<div id="tab-header">
|
||||
<ul>
|
||||
<li name="tab-header" class="selected"><%:OpenClash Log%></li>
|
||||
<li name="tab-header"><%:Core Log%></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="tab-content">
|
||||
<div class="dom" style="display: block;">
|
||||
<textarea id="cbid.openclash.config.clog" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
|
||||
</div>
|
||||
<div class="dom">
|
||||
<textarea id="core_log" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="32" cols="60" readonly="readonly" ></textarea>
|
||||
<div class="radio-button">
|
||||
<input type="radio" id="info" name="radios" value="info" checked onclick="return switch_log_level(this.value)"/>
|
||||
<label for="info">Info</label>
|
||||
<input type="radio" id="warning" name="radios" value="warning" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="warning">Warning</label>
|
||||
<input type="radio" id="error" name="radios" value="error" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="error">Error</label>
|
||||
<input type="radio" id="debug" name="radios" value="debug" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="debug">Debug</label>
|
||||
<input type="radio" id="silent" name="radios" value="silent" onclick="return switch_log_level(this.value)"/>
|
||||
<label for="silent">Silent</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="stop_refresh_button" value="<%:Stop Refresh Log%>" onclick=" return stop_refresh() "/>
|
||||
</td>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="start_refresh_button" value="<%:Start Refresh Log%>" onclick=" return start_refresh() "/>
|
||||
</td>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="del_log_button" value="<%:Clean Log%>" style=" display:inline;" onclick=" return del_log() " />
|
||||
</td>
|
||||
<td style="text-align: center; width: 25%">
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" id="down_log_button" value="<%:Download Log%>" style=" display:inline;" onclick=" return download_log() " />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var r;
|
||||
var s;
|
||||
var log_len = 0;
|
||||
var lv = document.getElementById('cbid.openclash.config.clog');
|
||||
var cl = document.getElementById('core_log');
|
||||
document.getElementById('stop_refresh_button').style.textAlign="center";
|
||||
document.getElementById('start_refresh_button').style.textAlign="center";
|
||||
document.getElementById('del_log_button').style.textAlign="center";
|
||||
document.getElementById('down_log_button').style.textAlign="center";
|
||||
|
||||
function get_log_level() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "log_level")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.log_level != "") {
|
||||
var radio = document.getElementsByName("radios");
|
||||
for (i=0; i<radio.length; i++) {
|
||||
if (radio[i].value == status.log_level && ! radio[i].checked) {
|
||||
radio[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
s=setTimeout("get_log_level()",5000);
|
||||
};
|
||||
|
||||
function switch_log_level(value)
|
||||
{
|
||||
clearTimeout(s);
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_log")%>', {log_level: value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
alert(' <%:Log Level%>: ' + value + ' <%:switching succeeded!%>');
|
||||
get_log_level();
|
||||
}
|
||||
else {
|
||||
alert(' <%:Log Level%>: ' + value + ' <%:switching failed!%>');
|
||||
get_log_level();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function stop_refresh() {
|
||||
clearTimeout(r);
|
||||
return
|
||||
};
|
||||
|
||||
function start_refresh() {
|
||||
clearTimeout(r);
|
||||
r=setTimeout("poll_log()",1000*2);
|
||||
return
|
||||
};
|
||||
|
||||
function createAndDownloadFile(fileName, content) {
|
||||
var aTag = document.createElement('a');
|
||||
var blob = new Blob([content]);
|
||||
aTag.download = fileName;
|
||||
aTag.href = URL.createObjectURL(blob);
|
||||
aTag.click();
|
||||
URL.revokeObjectURL(blob);
|
||||
};
|
||||
|
||||
function download_log(){
|
||||
var dt = new Date();
|
||||
var timestamp = dt.getFullYear()+"-"+(dt.getMonth()+1)+"-"+dt.getDate()+"-"+dt.getHours()+"-"+dt.getMinutes()+"-"+dt.getSeconds();
|
||||
createAndDownloadFile("OpenClash-"+timestamp+".log","<%:OpenClash Log%>:\n"+lv.innerHTML+"\n<%:Core Log%>:\n"+cl.innerHTML)
|
||||
return
|
||||
};
|
||||
|
||||
function del_log() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_log")%>',null,function(x, data){
|
||||
lv.innerHTML="";
|
||||
cl.innerHTML="";
|
||||
log_len = 0;
|
||||
oc_editor.setValue(lv.value);
|
||||
core_editor.setValue(cl.value);
|
||||
core_editor.refresh();
|
||||
oc_editor.refresh();
|
||||
});
|
||||
return
|
||||
};
|
||||
|
||||
function p(s) {
|
||||
return s < 10 ? '0' + s: s;
|
||||
};
|
||||
|
||||
function line_tolocal(str){
|
||||
var strt=new Array();
|
||||
var cstrt=new Array();
|
||||
var cn = 0;
|
||||
var sn = 0;
|
||||
str.trim().split('\n').forEach(function(v, i) {
|
||||
var regex = /"([^"]*)"/g;
|
||||
var res = regex.exec(v);
|
||||
if (res) {
|
||||
var dt = new Date(res[1]);
|
||||
}
|
||||
if (dt && dt != "Invalid Date"){
|
||||
if (v.indexOf("level=") != -1) {
|
||||
var log_info = v.substring(res[1].length + 7);
|
||||
}
|
||||
else {
|
||||
var log_info = v.substring(res[1].length + 2);
|
||||
}
|
||||
cstrt[cn]=dt.getFullYear()+"-"+p(dt.getMonth()+1)+"-"+p(dt.getDate())+" "+p(dt.getHours())+":"+p(dt.getMinutes())+":"+p(dt.getSeconds())+log_info;
|
||||
cn = cn + 1;
|
||||
}
|
||||
else{
|
||||
strt[sn]=v;
|
||||
sn = sn + 1;
|
||||
}
|
||||
})
|
||||
return [strt,cstrt]
|
||||
};
|
||||
|
||||
function poll_log(){
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "refresh_log")%>', {log_len: log_len},
|
||||
function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if (status && status.log != "" && lv && cl) {
|
||||
var log = line_tolocal(status.log);
|
||||
var lines = log[0];
|
||||
var clines = log[1];
|
||||
if (lines != "" || clines != "") {
|
||||
if (lines != "") {
|
||||
lv.innerHTML = lines.join('\n')+ (log_len != 0 ? '\n' : '') + lv.innerHTML;
|
||||
oc_editor.setValue(lv.value);
|
||||
oc_editor.refresh();
|
||||
}
|
||||
if (clines != "") {
|
||||
if (lines[0] != "..." && lines[lines.length-1] != "...") {
|
||||
cl.innerHTML = clines.join('\n') + (log_len != 0 ? '\n' : '') + cl.innerHTML;
|
||||
}
|
||||
else {
|
||||
cl.innerHTML = clines.join('\n') + (log_len != 0 ? '\n' : cl.innerHTML + '\n...');
|
||||
}
|
||||
core_editor.setValue(cl.value);
|
||||
core_editor.refresh();
|
||||
}
|
||||
log_len = status.len;
|
||||
//lv.innerHTML = x.responseText.split('\n').reverse().join('\n')+lv.innerHTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
r=setTimeout("poll_log()",1000*2);
|
||||
};
|
||||
|
||||
window.onload = function(){
|
||||
var titles = document.getElementsByName('tab-header');
|
||||
var divs = document.getElementsByClassName('dom');
|
||||
if(titles.length != divs.length) return;
|
||||
for(var i=0; i<titles.length; i++){
|
||||
var li = titles[i];
|
||||
li.id = i;
|
||||
li.onclick = function(){
|
||||
for(var j=0; j<titles.length; j++){
|
||||
titles[j].className = '';
|
||||
divs[j].style.display = 'none';
|
||||
}
|
||||
this.className = 'selected';
|
||||
divs[this.id].style.display = 'block';
|
||||
}
|
||||
li.onTouchStart = function(){
|
||||
for(var j=0; j<titles.length; j++){
|
||||
titles[j].className = '';
|
||||
divs[j].style.display = 'none';
|
||||
}
|
||||
this.className = 'selected';
|
||||
divs[this.id].style.display = 'block';
|
||||
}
|
||||
}
|
||||
get_log_level();
|
||||
poll_log();
|
||||
};
|
||||
//]]>
|
||||
</script>
|
||||
<%+cbi/valuefooter%>
|
@ -1,366 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on">
|
||||
<link rel="dns-prefetch" href="//cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="//whois.pconline.com.cn/ipJson.jsp">
|
||||
<link rel="dns-prefetch" href="//www.taobao.com/help/getip.php">
|
||||
<link rel="dns-prefetch" href="//api-ipv4.ip.sb">
|
||||
<link rel="dns-prefetch" href="//api.ipify.org">
|
||||
<link rel="dns-prefetch" href="//api.ttt.sh">
|
||||
<link rel="dns-prefetch" href="//qqwry.api.skk.moe">
|
||||
<link rel="dns-prefetch" href="//d.skk.moe">
|
||||
<link rel="preconnect" href="https://www.taobao.com/help/getip.php">
|
||||
<link rel="preconnect" href="https://whois.pconline.com.cn/ipJson.jsp">
|
||||
<link rel="preconnect" href="https://api-ipv4.ip.sb">
|
||||
<link rel="preconnect" href="https://api.ipify.org">
|
||||
<link rel="preconnect" href="https://api.ttt.sh">
|
||||
<link rel="preconnect" href="https://qqwry.api.skk.moe">
|
||||
<link rel="preconnect" href="https://d.skk.moe">
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
|
||||
<title>IP 地址查询</title>
|
||||
<style>
|
||||
.ip-title {
|
||||
font-weight: bold;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-state_title {
|
||||
font-weight: bold;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 42%;
|
||||
vertical-align:bottom;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transform:translateY(5%);
|
||||
}
|
||||
|
||||
.ip-result {
|
||||
font-size:16px;
|
||||
margin:0px 0px 0px 5%;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 25%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(8%);
|
||||
}
|
||||
|
||||
.ip-geo {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 35%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
text-align: right;
|
||||
vertical-align:bottom;
|
||||
transform:translateY(15%);
|
||||
}
|
||||
|
||||
.ip-checking {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 29%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
|
||||
.sk-text-success {
|
||||
color: #32b643;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 30%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
|
||||
.sk-load-success {
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 18%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: right;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
|
||||
.sk-text-error {
|
||||
color: #e85600;
|
||||
font-size:15px;
|
||||
line-height:20px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 30%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(12%);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td>
|
||||
<div style="display: flex">
|
||||
<div style="width: 51%">
|
||||
<h3 style="margin: 10px -2% 10px 2%"><%:IP Address%></h3>
|
||||
<p style="margin: 10px -2% 10px 2%">
|
||||
<span class="ip-title">IP.TB <%:Mainland%>:</span><span class="ip-result" id="ip-taobao"></span> <span class="ip-geo" id="ip-taobao-geo"></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 10px 2%">
|
||||
<span class="ip-title">IP.PC <%:Mainland%>:</span><span class="ip-result" id="ip-pcol"></span> <span class="ip-geo" id="ip-pcol-geo"></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 10px 2%">
|
||||
<span class="ip-title">IP.SB <%:Abroad%>:</span><span class="ip-result" id="ip-ipsb"></span> <span class="ip-geo" id="ip-ipsb-geo"></span>
|
||||
</p>
|
||||
<p style="margin: 10px -2% 10px 2%">
|
||||
<span class="ip-title">IPIFY <%:Abroad%>:</span><span class="ip-result" id="ip-ipify"></span> <span class="ip-geo" id="ip-ipify-geo"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div style="width: 49%">
|
||||
<h3 style="margin: 10px 0 10px 5%"><%:Website Access Check%></h3>
|
||||
<p style="margin: 10px 0 10px 5%">
|
||||
<span class="ip-state_title"><%:Baidu Search%>:</span><span id="http-baidu"></span><span id="ldtime-baidu"></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 10px 5%">
|
||||
<span class="ip-state_title"><%:NetEase Music%>:</span><span id="http-163"></span><span id="ldtime-163"></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 10px 5%">
|
||||
<span class="ip-state_title">GitHub:</span><span id="http-github"></span><span id="ldtime-github"></span>
|
||||
</p>
|
||||
<p style="margin: 10px 0 10px 5%">
|
||||
<span class="ip-state_title">YouTube:</span><span id="http-youtube"></span><span id="ldtime-youtube"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p style="float: right; margin: 5px 10px 10px 0; font-size:15px">Powered by <a style="text-decoration: none; color: #666" onclick="return ip_skk()" href="javascript:void(0);">ip.skk.moe</a></p>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</body>
|
||||
<script>
|
||||
function ip_skk()
|
||||
{
|
||||
url2='https://ip.skk.moe';
|
||||
window.open(url2);
|
||||
}
|
||||
const $$ = document;
|
||||
$$.getElementById('ip-pcol').innerHTML = '<%:Querying...%>';
|
||||
$$.getElementById('ip-ipify').innerHTML = '<%:Querying...%>';
|
||||
$$.getElementById('ip-taobao').innerHTML = '<%:Querying...%>';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '<%:Querying...%>';
|
||||
let random = parseInt(Math.random() * 100000000);
|
||||
let IP = {
|
||||
get: (url, type) =>
|
||||
fetch(url, { method: 'GET' }).then((resp) => {
|
||||
if (type === 'text')
|
||||
return Promise.all([resp.ok, resp.status, resp.text(), resp.headers]);
|
||||
else {
|
||||
return Promise.all([resp.ok, resp.status, resp.json(), resp.headers]);
|
||||
}
|
||||
}).then(([ok, status, data, headers]) => {
|
||||
if (ok) {
|
||||
let json = {
|
||||
ok,
|
||||
status,
|
||||
data,
|
||||
headers
|
||||
}
|
||||
return json;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(json.error));
|
||||
}
|
||||
}).catch(error => {
|
||||
throw error;
|
||||
}),
|
||||
parseIPIpip: (ip, elID) => {
|
||||
const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}';
|
||||
const v4Exact = new RegExp(`^${v4}$`);
|
||||
const anonymizedIp = (() => {
|
||||
if (v4Exact.test(ip)) {
|
||||
const [a, b, c] = ip.split('.');
|
||||
return `${a}.${b}.${c}.0`;
|
||||
}
|
||||
return ip;
|
||||
})();
|
||||
|
||||
fetch(`https://qqwry.api.skk.moe/${anonymizedIp}`, {
|
||||
referrerPolicy: 'no-referrer-when-downgrade',
|
||||
}).then(r => r.json())
|
||||
.then(resp => {
|
||||
$$.getElementById(elID).innerHTML = resp.geo;
|
||||
//$$.getElementById(elID).innerHTML = `${resp.data.country} ${resp.data.regionName} ${resp.data.city} ${resp.data.isp}`;
|
||||
})
|
||||
},
|
||||
getIpipnetIP: () => {
|
||||
IP.get(window.location.protocol+`//myip.ipip.net/?z=${random}`, 'text')
|
||||
.then((resp) => {
|
||||
let data = resp.data.replace('当前 IP:', '').split(' 来自于:');
|
||||
$$.getElementById('ip-ipipnet').innerHTML = `${data[0]}`;
|
||||
$$.getElementById('ip-ipipnet-geo').innerHTML = `${data[1]}`;
|
||||
});
|
||||
},
|
||||
getIPApiIP: () => {
|
||||
IP.get(`https://ipapi.co/json?z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-ipapi').innerHTML = resp.data.ip;
|
||||
IP.parseIPIpip(resp.data.ip, 'ip-ipapi-geo');
|
||||
})
|
||||
},
|
||||
getSpeedIP: () => {
|
||||
IP.get(`https://forge.speedtest.cn/api/location/info?z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-speedtest').innerHTML = resp.data.ip;
|
||||
$$.getElementById('ip-speedtest-geo').innerHTML = resp.data.country + resp.data.province + resp.data.city + (resp.data.distinct == "null" ? resp.data.distinct : '') + ' ' + (resp.data.isp == "null" ? resp.data.isp : '');
|
||||
//IP.parseIPIpip(resp.data.ip, 'ip-speedtest-geo');
|
||||
})
|
||||
},
|
||||
getIpifyIP: () => {
|
||||
IP.get(`https://api.ipify.org/?format=json&z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-ipify').innerHTML = resp.data.ip;
|
||||
return resp.data.ip;
|
||||
})
|
||||
.then(ip => {
|
||||
IP.parseIPIpip(ip, 'ip-ipify-geo');
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
$$.getElementById('http-baidu').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
$$.getElementById('http-163').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
$$.getElementById('http-github').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
$$.getElementById('http-youtube').innerHTML = '<span class="ip-checking"><%:Testing...%></span>';
|
||||
let HTTP = {
|
||||
checker: (domain, cbElID, cbLoID) => {
|
||||
let img = new Image;
|
||||
let img_start_time = (+new Date());
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
$$.getElementById(cbLoID).style.display = 'none';
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error"><%:Access Timed Out%></span>'
|
||||
}, 5000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbLoID).style.display = 'none';
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error"><%:Access Denied%></span>'
|
||||
}
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
let img_load_time = (new Date())- img_start_time;
|
||||
if ($$.getElementById(cbLoID).style.display == 'none') {
|
||||
$$.getElementById(cbLoID).style.display = '';
|
||||
}
|
||||
if (img_load_time <= 500) {
|
||||
$$.getElementById(cbLoID).innerHTML = '<span class="sk-load-success">' + img_load_time + ' ms</span>'
|
||||
$$.getElementById(cbLoID).style.color = '#32b643';
|
||||
}
|
||||
else if (img_load_time > 500 && img_load_time <= 1000) {
|
||||
$$.getElementById(cbLoID).innerHTML = '<span class="sk-load-success">' + img_load_time + ' ms</span>'
|
||||
$$.getElementById(cbLoID).style.color = 'orange';
|
||||
}
|
||||
else {
|
||||
$$.getElementById(cbLoID).innerHTML = '<span class="sk-load-success">' + img_load_time + ' ms</span>'
|
||||
$$.getElementById(cbLoID).style.color = '#e85600';
|
||||
}
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-success"><%:Access Normal%></span>'
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker('www.baidu.com', 'http-baidu', 'ldtime-baidu');
|
||||
HTTP.checker('s1.music.126.net/style', 'http-163', 'ldtime-163');
|
||||
HTTP.checker('github.com', 'http-github', 'ldtime-github');
|
||||
HTTP.checker('www.youtube.com', 'http-youtube', 'ldtime-youtube');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function getPcolIP(data){
|
||||
let pcisp = data.addr.split(' ');
|
||||
$$.getElementById('ip-pcol').innerHTML = data.ip;
|
||||
$$.getElementById('ip-pcol-geo').innerHTML = `${data.pro}${data.city}${data.region} ${pcisp[1]}`;
|
||||
};
|
||||
|
||||
function getIpsbIP(data){
|
||||
$$.getElementById('ip-ipsb').innerHTML = data.ip;
|
||||
IP.parseIPIpip(data.ip, 'ip-ipsb-geo');
|
||||
};
|
||||
|
||||
function ipCallback(data){
|
||||
$$.getElementById('ip-taobao').innerHTML = data.ip;
|
||||
IP.parseIPIpip(data.ip, 'ip-taobao-geo');
|
||||
};
|
||||
|
||||
function myip_Load()
|
||||
{
|
||||
var pcip = document.getElementsByTagName('HEAD').item(0);
|
||||
var pcipScript= document.createElement("script");
|
||||
var random = parseInt(Math.random() * 100000000);
|
||||
pcipScript.defer = "defer";
|
||||
pcipScript.src=`https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP&z=${random}`;
|
||||
pcip.appendChild(pcipScript);
|
||||
|
||||
var sbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var sbipScript= document.createElement("script");
|
||||
sbipScript.defer = "defer";
|
||||
sbipScript.src='https://api-ipv4.ip.sb/jsonip?callback=getIpsbIP';
|
||||
sbip.appendChild(sbipScript);
|
||||
|
||||
var tbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var tbipScript= document.createElement("script");
|
||||
tbipScript.defer = "defer";
|
||||
tbipScript.src='https://www.taobao.com/help/getip.php?callback=ipCallback';
|
||||
tbip.appendChild(sbipScript);
|
||||
|
||||
//HTTP.runcheck();
|
||||
IP.getIpifyIP();
|
||||
//IP.getSpeedIP();
|
||||
}
|
||||
|
||||
HTTP.runcheck();
|
||||
IP.getIpifyIP();
|
||||
//IP.getSpeedIP();
|
||||
setInterval("HTTP.runcheck()", Math.floor(Math.random()*(10-5+1)+5)*1000);
|
||||
setInterval("myip_Load()", Math.floor(Math.random()*(30-10+1)+10)*1000);
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
document.write('<script defer="defer" src="https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP&z='+parseInt(Math.random() * 100000000)+'" type="text/javascript"><\/script>');
|
||||
</script>
|
||||
<script defer="defer" src="https://api-ipv4.ip.sb/jsonip?callback=getIpsbIP"></script>
|
||||
<script defer="defer" src="https://www.taobao.com/help/getip.php?callback=ipCallback"></script>
|
||||
</html>
|
@ -1,7 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<% if self:cfgvalue(section) ~= false then %>
|
||||
<input class="btn cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
|
||||
<% else %>
|
||||
-
|
||||
<% end %>
|
||||
<%+cbi/valuefooter%>
|
@ -1,88 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<%
|
||||
local stream_id_name = string.gsub(self.value, "%W", "")
|
||||
%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function act_manual_unlock_test_<%=stream_id_name%>(btn, type)
|
||||
{
|
||||
var manual_<%=stream_id_name%>_type_legend = document.getElementById('manual-<%=stream_id_name%>-test-state');
|
||||
var manual_<%=stream_id_name%>_type_output = document.getElementById('manual-<%=stream_id_name%>-test-output');
|
||||
var r = confirm("<%:Network instability may occur during testing, Are you sure want to start test?%>")
|
||||
if (r == true) {
|
||||
if (manual_<%=stream_id_name%>_type_legend && manual_<%=stream_id_name%>_type_output)
|
||||
{
|
||||
manual_<%=stream_id_name%>_type_output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
manual_<%=stream_id_name%>_type_legend.parentNode.style.display = 'block';
|
||||
manual_<%=stream_id_name%>_type_legend.style.display = 'inline';
|
||||
};
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "manual_stream_unlock_test")%>', {type: type}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
manual_<%=stream_id_name%>_type_legend.style.display = 'none';
|
||||
manual_<%=stream_id_name%>_type_output.innerHTML = '<textarea id="manual_<%=stream_id_name%>_type_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
|
||||
other_log_area(document.getElementById("manual_<%=stream_id_name%>_type_output"), 'true', manual_<%=stream_id_name%>_type_output.offsetWidth, '250px');
|
||||
}
|
||||
else
|
||||
{
|
||||
manual_<%=stream_id_name%>_type_legend.style.display = 'none';
|
||||
manual_<%=stream_id_name%>_type_output.innerHTML = '<span class="error"><%:Something Wrong While Testing...%></span>';
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
function act_all_proxies_test_<%=stream_id_name%>(btn, type)
|
||||
{
|
||||
var all_<%=stream_id_name%>_legend = document.getElementById('all-<%=stream_id_name%>-test-state');
|
||||
var all_<%=stream_id_name%>_output = document.getElementById('all-<%=stream_id_name%>-test-output');
|
||||
var r = confirm("<%:Network instability may occur during testing, Are you sure want to start test?%>")
|
||||
if (r == true) {
|
||||
if (all_<%=stream_id_name%>_legend && all_<%=stream_id_name%>_output)
|
||||
{
|
||||
all_<%=stream_id_name%>_output.innerHTML =
|
||||
'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
|
||||
'<%:Waiting for command to complete...%>';
|
||||
|
||||
all_<%=stream_id_name%>_legend.parentNode.style.display = 'block';
|
||||
all_<%=stream_id_name%>_legend.style.display = 'inline';
|
||||
};
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "all_proxies_stream_test")%>', {type: type}, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "")
|
||||
{
|
||||
all_<%=stream_id_name%>_legend.style.display = 'none';
|
||||
all_<%=stream_id_name%>_output.innerHTML = '<textarea id="all_<%=stream_id_name%>_output" class="cbi-input-textarea" style="width: 100%;display:inline" data-update="change" rows="10" cols="50" readonly="readonly" >'+x.responseText+'</textarea>';
|
||||
other_log_area(document.getElementById("all_<%=stream_id_name%>_output"), 'true', all_<%=stream_id_name%>_output.offsetWidth, '250px');
|
||||
}
|
||||
else
|
||||
{
|
||||
all_<%=stream_id_name%>_legend.style.display = 'none';
|
||||
all_<%=stream_id_name%>_output.innerHTML = '<span class="error"><%:Something Wrong While Testing...%></span>';
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
|
||||
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:Unlock Test(Select)%>" onclick="return act_manual_unlock_test_<%=stream_id_name%>(this, '<%=self.value%>')" />
|
||||
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:All Proxies Test%>" onclick="return act_all_proxies_test_<%=stream_id_name%>(this, '<%=self.value%>')" />
|
||||
<fieldset style="display: none;margin: 0 auto;">
|
||||
<legend id="manual-<%=stream_id_name%>-test-state"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="manual-<%=stream_id_name%>-test-output"></span>
|
||||
</fieldset>
|
||||
<fieldset style="display: none;margin: 0 auto;">
|
||||
<legend id="all-<%=stream_id_name%>-test-state"><%:Collecting data...%></legend>
|
||||
<br />
|
||||
<span id="all-<%=stream_id_name%>-test-output"></span>
|
||||
</fieldset>
|
||||
<%+cbi/valuefooter%>
|
@ -1,3 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<span class="pingtime" hint="<%=self:cfgvalue(section)%>">-- ms</span>
|
||||
<%+cbi/valuefooter%>
|
@ -1,32 +0,0 @@
|
||||
<%#
|
||||
Copyright 2018-2019 Lienol <lawlienol@gmail.com>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-%>
|
||||
|
||||
<%
|
||||
local dsp = require "luci.dispatcher"
|
||||
-%>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var pings = document.getElementsByClassName('pingtime');
|
||||
for(var i = 0; i < pings.length; i++) {
|
||||
XHR.get('<%=dsp.build_url("admin", "services", "openclash", "ping")%>', {
|
||||
index: i,
|
||||
domain: pings[i].getAttribute("hint")
|
||||
},
|
||||
function(x, result) {
|
||||
pings[result.index].innerHTML = (result.ping ? "<b style=color:green>"+result.ping+"</b> ms" : "<b style=color:red><%:Test failed%></b>");
|
||||
}
|
||||
);
|
||||
XHR.poll(10,'<%=dsp.build_url("admin", "services", "openclash", "ping")%>',{
|
||||
index: i,
|
||||
domain: pings[i].getAttribute("hint")
|
||||
},
|
||||
function(x, result) {
|
||||
pings[result.index].innerHTML = (result.ping ? "<b style=color:green>"+result.ping+"</b> ms" : "<b style=color:red><%:Test failed%></b>");
|
||||
}
|
||||
);
|
||||
}
|
||||
//]]>
|
||||
</script>
|
@ -1,316 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function padright(str, cnt, pad) {
|
||||
return str + Array(cnt + 1).join(pad);
|
||||
}
|
||||
|
||||
function b64EncodeUnicode(str) {
|
||||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
||||
return String.fromCharCode('0x' + p1);
|
||||
}));
|
||||
}
|
||||
|
||||
function b64encutf8safe(str) {
|
||||
return b64EncodeUnicode(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '');
|
||||
}
|
||||
|
||||
function b64DecodeUnicode(str) {
|
||||
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) {
|
||||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
||||
}).join(''));
|
||||
}
|
||||
|
||||
function b64decutf8safe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l) str = padright(str, l, "=");
|
||||
return b64DecodeUnicode(str);
|
||||
}
|
||||
|
||||
function b64encsafe(str) {
|
||||
return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '')
|
||||
}
|
||||
|
||||
function b64decsafe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l) str = padright(str, l, "=");
|
||||
return atob(str);
|
||||
}
|
||||
|
||||
function dictvalue(d, key) {
|
||||
var v = d[key];
|
||||
if (typeof (v) == 'undefined' || v == '') return '';
|
||||
return b64decsafe(v);
|
||||
}
|
||||
|
||||
function export_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s) return false;
|
||||
var v_server = document.getElementsByName('cbid.openclash.' + sid + '.server')[0];
|
||||
var v_port = document.getElementsByName('cbid.openclash.' + sid + '.port')[0];
|
||||
var v_protocol = document.getElementsByName('cbid.openclash.' + sid + '.protocol')[0];
|
||||
var v_method = document.getElementsByName('cbid.openclash.' + sid + '.cipher_ssr')[0];
|
||||
var v_obfs = document.getElementsByName('cbid.openclash.' + sid + '.obfs_ssr')[0];
|
||||
var v_password = document.getElementsByName('cbid.openclash.' + sid + '.password')[0];
|
||||
var v_obfs_param = document.getElementsByName('cbid.openclash.' + sid + '.obfs_param')[0];
|
||||
var v_protocol_param = document.getElementsByName('cbid.openclash.' + sid + '.protocol_param')[0];
|
||||
var v_alias = document.getElementsByName('cbid.openclash.' + sid + '.name')[0];
|
||||
var ssr_str = v_server.value + ":" + v_port.value + ":" + v_protocol.value + ":" + v_method.value + ":" + v_obfs.value + ":" + b64encsafe(v_password.value) + "/?obfsparam=" + b64encsafe(v_obfs_param.value) + "&protoparam=" + b64encsafe(v_protocol_param.value) + "&remarks=" + b64encutf8safe(v_alias.value);
|
||||
var textarea = document.createElement("textarea");
|
||||
textarea.textContent = "ssr://" + b64encsafe(ssr_str);
|
||||
textarea.style.position = "fixed";
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
try {
|
||||
document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Copy SSR to clipboard successfully.%></font>";
|
||||
} catch (ex) {
|
||||
s.innerHTML = "<font style=\"color:red\"><%:Unable to copy SSR to clipboard.%></font>";
|
||||
} finally {
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function import_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s) return false;
|
||||
var ssrurl = prompt("<%:Paste sharing link here%>", "");
|
||||
if (ssrurl == null || ssrurl == "") {
|
||||
s.innerHTML = "<font style=\"color:red\"><%:User cancelled.%></font>";
|
||||
return false;
|
||||
}
|
||||
s.innerHTML = "";
|
||||
//var ssu = ssrurl.match(/ssr:\/\/([A-Za-z0-9_-]+)/i);
|
||||
var ssu = ssrurl.split('://');
|
||||
//console.log(ssu.length);
|
||||
var event = document.createEvent("HTMLEvents");
|
||||
event.initEvent("change", true, true);
|
||||
switch (ssu[0]) {
|
||||
case "ss":
|
||||
var url0, param = "";
|
||||
var sipIndex = ssu[1].indexOf("@");
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = ssu[1].substr(ploc + 1);
|
||||
} else {
|
||||
url0 = ssu[1];
|
||||
}
|
||||
if (sipIndex != -1) {
|
||||
// SIP002
|
||||
var userInfo = b64decsafe(url0.substr(0, sipIndex));
|
||||
var temp = url0.substr(sipIndex + 1).split("/?");
|
||||
var serverInfo = temp[0].split(":");
|
||||
var server = serverInfo[0];
|
||||
var port = serverInfo[1];
|
||||
var method, password, plugin, pluginOpts, pluginObfs, pluginObfsHost, pluginObfsPath, pluginObfsHeaders;
|
||||
if (temp[1]) {
|
||||
var pluginInfo = decodeURIComponent(temp[1]);
|
||||
var pluginIndex = pluginInfo.indexOf(";");
|
||||
var pluginNameInfo = pluginInfo.substr(0, pluginIndex);
|
||||
plugin = pluginNameInfo.substr(pluginNameInfo.indexOf("=") + 1);
|
||||
pluginOpts = pluginInfo.substr(pluginIndex + 1);
|
||||
if (pluginOpts.indexOf("obfs=") != -1) {
|
||||
pluginObfs = pluginOpts.split("obfs=")[1].split(";")[0];
|
||||
if (pluginObfs == "ws") {
|
||||
pluginObfs = "websocket"
|
||||
}
|
||||
if (pluginOpts.indexOf("obfs-host=") != -1) {
|
||||
pluginObfsHost = pluginOpts.split("obfs-host=")[1].split("&group=")[0] || pluginOpts.split("obfs-host=")[1].split(";")[0];
|
||||
}
|
||||
if (pluginOpts.indexOf("path=") != -1) {
|
||||
pluginObfsPath = pluginOpts.split("path=")[1].split(";")[0];
|
||||
}
|
||||
if (pluginOpts.indexOf("headers=") != -1) {
|
||||
pluginObfsHeaders = pluginOpts.split("headers=")[1].split(";")[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
var userInfoSplitIndex = userInfo.indexOf(":");
|
||||
if (userInfoSplitIndex != -1) {
|
||||
method = userInfo.substr(0, userInfoSplitIndex);
|
||||
password = userInfo.substr(userInfoSplitIndex + 1);
|
||||
}
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = server;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = port;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = password || "";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher')[0].value = method || "";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs')[0].value = pluginObfs || "none";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs')[0].dispatchEvent(event);
|
||||
if (plugin != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.host')[0].value = pluginObfsHost || "";
|
||||
if (pluginObfs == "websocket") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.custom')[0].value = pluginObfsHeaders || "";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.path')[0].value = pluginObfsPath || "";
|
||||
}
|
||||
}
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
} else {
|
||||
var sstr = b64decsafe(url0);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = part2[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = part2[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = part1[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher')[0].value = part1[0];
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
}
|
||||
return false;
|
||||
case "ssr":
|
||||
var sstr = b64decsafe(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = url0.match(/^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)/);
|
||||
if (!ssm || ssm.length < 7) return false;
|
||||
var pdict = {};
|
||||
if (param.length > 2) {
|
||||
var a = param.split('&');
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
var b = a[i].split('=');
|
||||
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = ssm[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = ssm[2];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.protocol')[0].value = ssm[3];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher_ssr')[0].value = (ssm[4] == "none" ? "dummy" : ssm[4]);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_ssr')[0].value = ssm[5];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = b64decsafe(ssm[6]);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_param')[0].value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam');
|
||||
var rem = pdict['remarks'];
|
||||
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0) document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = b64decutf8safe(rem);
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
case "trojan":
|
||||
var url0, param = "";
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = ssu[1].substr(ploc + 1);
|
||||
} else {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = url0;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = "trojan";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var password = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
var others = serverPart[1].split('?');
|
||||
var port = parseInt(others[0]);
|
||||
var queryParam = {}
|
||||
if (others.length > 1) {
|
||||
var queryParams = others[1]
|
||||
var queryArray = queryParams.split('&');
|
||||
for (i = 0; i < queryArray.length; i++) {
|
||||
var params = queryArray[i].split('=');
|
||||
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = serverPart[0];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = port || '443';
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = password;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.sni')[0].value = queryParam.sni || '';
|
||||
if (queryParam.type != undefined) {
|
||||
for (i = 0; i < document.getElementById('cbi.combobox.cbid.openclash.' + sid + '.alpn.1').getElementsByTagName("option").length; i++) {
|
||||
if ( document.getElementById('cbi.combobox.cbid.openclash.' + sid + '.alpn.1').getElementsByTagName("option")[i].value == queryParam.type ) {
|
||||
document.getElementById('cbi.combobox.cbid.openclash.' + sid + '.alpn.1').getElementsByTagName("option")[i].selected=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
case "vmess":
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = "vmess";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = JSON.parse(sstr);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = ssm.ps;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = ssm.add;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = ssm.port;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.alterId')[0].value = ssm.aid;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.uuid')[0].value = ssm.id;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = ssm.net;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
if (ssm.method) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.securitys')[0].value = ssm.method;
|
||||
}
|
||||
if (ssm.net == "tcp") {
|
||||
if (ssm.type && ssm.type != "http") {
|
||||
ssm.type = "none"
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = ssm.type;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
} else {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = "http";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.http_path')[0].value = ssm.path;
|
||||
}
|
||||
}
|
||||
if (ssm.net == "ws") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].value = "websocket";
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_vmess')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.ws_opts_path')[0].value = ssm.path;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.ws_opts_headers')[0].value = "Host: " + ssm.host;
|
||||
if (ssm.maxearlydata) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.max_early_data')[0].value = ssm.maxearlydata;
|
||||
}
|
||||
if (ssm.earlydataheadername) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.early_data_header_name')[0].value = ssm.earlydataheadername;
|
||||
}
|
||||
}
|
||||
if (ssm.net == "h2") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.h2_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.h2_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.tls == "tls") {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.tls')[0].value = "true";
|
||||
}
|
||||
if (ssm.sni) {
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.servername')[0].value = ssm.sni;
|
||||
}
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
default:
|
||||
s.innerHTML = "<font style=\"color:red\"><%:Invalid format.%></font>";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Import%>" onclick="return import_ssr_url(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<span id="<%=self.option%>-status"></span>
|
||||
<%+cbi/valuefooter%>
|
@ -1,918 +0,0 @@
|
||||
<head>
|
||||
<style>
|
||||
.dot-typing{position:relative;left:-9999px;width:10px;height:10px;border-radius:5px;background-color:#9880ff;color:#9880ff;box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff;animation:dotTyping 1.5s infinite linear}@keyframes dotTyping{0%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}16.667%{box-shadow:9984px -10px 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}33.333%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}50%{box-shadow:9984px 0 0 0 #9880ff,9999px -10px 0 0 #9880ff,10014px 0 0 0 #9880ff}66.667%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}83.333%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px -10px 0 0 #9880ff}100%{box-shadow:9984px 0 0 0 #9880ff,9999px 0 0 0 #9880ff,10014px 0 0 0 #9880ff}}
|
||||
.radio-button{
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
background-color: #d1d1d1;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-button label {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
padding: 4px 5px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.radio-button input[type="radio"]:checked+label {
|
||||
background-color: #1080c1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<%
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
local RELEASE_BRANCH = uci:get("openclash", "config", "release_branch")
|
||||
local random = tostring(os.time()):reverse():sub(1, 9)
|
||||
%>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td colspan="4" width="100%">
|
||||
<p style="margin: 10px 0; text-align: center">
|
||||
<%
|
||||
if uci:get("openclash", "config", "enable_meta_core") ~= '1' then
|
||||
%>
|
||||
<img id="_logo" src="/luci-static/resources/openclash/img/logo.png?<%=random%>" loading="lazy" onload="return logo_check(this,this.src,'https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/<%=RELEASE_BRANCH%>/img/logo.png')" onerror="return imgerrorfuns(this,'https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/<%=RELEASE_BRANCH%>/img/logo.png')" title="Hello, World!" alt="OpenClash" onclick="return homepage()" />
|
||||
<%
|
||||
else
|
||||
%>
|
||||
<img id="_logo" src="/luci-static/resources/openclash/img/meta.png?<%=random%>" loading="lazy" onload="return logo_check(this,this.src,'https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/<%=RELEASE_BRANCH%>/img/meta.png')" onerror="return imgerrorfuns(this,'https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/<%=RELEASE_BRANCH%>/img/meta.png')" title="Hello, World!" alt="OpenClash" onclick="return homepage()" />
|
||||
<%
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
<p id="_clashversion" style="margin: 10px 0; text-align: center">
|
||||
<img src="/luci-static/resources/openclash/img/version.svg?<%=random%>" onerror="return imgerrorfuns(this,'https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/<%=RELEASE_BRANCH%>/img/version.png')" alt="currentversion" height="21px" onclick="return go_update()">
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td colspan="4" width="100%">
|
||||
<p style="margin: 10px 0; text-align: center">
|
||||
<img id="gitbook" src="/luci-static/resources/openclash/img/Wiki.svg?<%=random%>" loading="lazy" alt="GitBook" width="50px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Wiki--lightgrey?logo=GitBook&style=social')" onclick="return gitbookpage()" />
|
||||
|
||||
<img id="wiki" src="/luci-static/resources/openclash/img/Tutorials.svg?<%=random%>" loading="lazy" alt="Wiki" width="75px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Tutorials--lightgrey?logo=Wikipedia&style=social')" onclick="return wikipage()" />
|
||||
|
||||
<img id="star" src="/luci-static/resources/openclash/img/Star.svg?<%=random%>g" loading="lazy" alt="star" width="50px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Star--lightgrey?logo=github&style=social')" onclick="return homepage()" />
|
||||
|
||||
<img id="telegram" src="/luci-static/resources/openclash/img/Telegram.svg?<%=random%>" loading="lazy" alt="Telegram" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Telegram--lightgrey?logo=Telegram&style=social')" onclick="return telegrampage()" />
|
||||
|
||||
<img id="sponsor" src="/luci-static/resources/openclash/img/Sponsor.svg?<%=random%>" loading="lazy" alt="Sponsor" width="73px" height="20px" onerror="return imgerrorfuns(this,'https://img.shields.io/badge/Sponsor--lightgrey?logo=ko-fi&style=social')" onclick="return sponsorpage()" />
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p style="margin: 10px 0; text-align: center" id="_clashstart">
|
||||
<b><%:Tip: after started, please wait patiently until the connection is normal%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Main Program%></td><td width="25%" align="left"><span id="_clash"><%:Collecting data...%></span><span id="_watchdog"></span></td><td width="25%"><%:Control Panel Login IP%></td><td width="25%" align="left" id="_daip"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="20%"><%:Running Mode%></td><td width="30%" align="left"><span id="_mode"><%:Collecting data...%></span><span id="radio-ru-mode" class="radio-button">
|
||||
<input type="radio" id="normal" name="radios-ru" value="" checked onclick="return switch_run_mode(this.value)"/>
|
||||
<label for="normal" id="run_normal"><%:Compatible%></label>
|
||||
<input type="radio" id="tun" name="radios-ru" value="-tun" onclick="return switch_run_mode(this.value)"/>
|
||||
<label for="tun"><%:TUN%></label>
|
||||
<input type="radio" id="mix" name="radios-ru" value="-mix" onclick="return switch_run_mode(this.value)"/>
|
||||
<label for="mix"><%:Mix%></label>
|
||||
</span></td><td width="25%"><%:Control Panel Login Port%></td><td width="25%" align="left" id="_dapo"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Proxy Mode%></td><td width="25%" align="left"><span id="radio-de"><%:Collecting data...%></span><span id="radio-mode" class="radio-button">
|
||||
<input type="radio" id="rule" name="radios" value="rule" checked onclick="return switch_rule_mode(this.value)"/>
|
||||
<label for="rule">Rule</label>
|
||||
<input type="radio" id="global" name="radios" value="global" onclick="return switch_rule_mode(this.value)"/>
|
||||
<label for="global">Global</label>
|
||||
<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"><p style="margin: 10px 0; text-align: center">
|
||||
<span>
|
||||
<%:Up:%>
|
||||
<span id="upload_">
|
||||
<font style=color:green>
|
||||
0 KB/S
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Down:%>
|
||||
<span id="download_">
|
||||
<font style=color:green>
|
||||
0 KB/S
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Up Total:%>
|
||||
<span id="uploadtotal_">
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Down Total:%>
|
||||
<span id="downloadtotal_">
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Connections:%>
|
||||
<span id="connect_t">
|
||||
<font style=color:green>
|
||||
0
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:Ram:%>
|
||||
<span id="mem_t">
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<%:CPU:%>
|
||||
<span id="cpu_t">
|
||||
<font style=color:green>
|
||||
0 %
|
||||
</font>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</p></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>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset id="state" class="cbi-section">
|
||||
<table>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p style="margin: 10px 0; text-align: center">
|
||||
<b><%:Please ensure that all items are displayed normally before running. If you need to update, please go to the global settings page%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Node Select Backup%></td><td width="25%" align="left" id="_historychecktime"><%:Collecting data...%></td><td width="25%"><%:lhie1 Rule Update%></td><td width="25%" align="left" id="_lhie1"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:ConnersHua Rule Update%></td><td width="25%" align="left" id="_ConnersHua"><%:Collecting data...%></td><td width="25%"><%:ConnersHua Return Rule Update%></td><td width="25%" align="left" id="_ConnersHua_return"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Mainland IP Update%></td><td width="25%" align="left" id="_chnroute"><%:Collecting data...%></td><td width="25%"><%: Mainland IPv6 Update%></td><td width="25%" align="left" id="_chnroutev6"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:GEOIP Data Update%></td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td><td width="25%"><%:GeoSite Data Update%></td><td width="25%" align="left" id="_geosite"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var clash = document.getElementById('_clash');
|
||||
var mode = document.getElementById('_mode');
|
||||
var web = document.getElementById('_web');
|
||||
var webo = document.getElementById('_webo');
|
||||
var watchdog = document.getElementById('_watchdog');
|
||||
var daip = document.getElementById('_daip');
|
||||
var dase = document.getElementById('_dase');
|
||||
var dapo = document.getElementById('_dapo');
|
||||
var startlog = document.getElementById('_clashstart');
|
||||
var clashversion = document.getElementById('_clashversion');
|
||||
var close_all_connection = document.getElementById('_close_all_connection');
|
||||
var reload_firewall = document.getElementById('_reload_firewall');
|
||||
var one_key_update = document.getElementById('_one_key_update');
|
||||
var update_subscribe = document.getElementById('_update_subscribe');
|
||||
var update_other_rules = document.getElementById('_update_other_rules');
|
||||
var update_geoip = document.getElementById('_update_geoip');
|
||||
var update_geosite = document.getElementById('_update_geosite');
|
||||
var flush_fakeip_cache= document.getElementById('_flush_fakeip_cache');
|
||||
var ipdb = document.getElementById('_ipdb');
|
||||
var geosite = document.getElementById('_geosite');
|
||||
var lhie1 = document.getElementById('_lhie1');
|
||||
var ConnersHua = document.getElementById('_ConnersHua');
|
||||
var ConnersHua_return = document.getElementById('_ConnersHua_return');
|
||||
var chnroute = document.getElementById('_chnroute');
|
||||
var chnroutev6 = document.getElementById('_chnroutev6');
|
||||
var historychecktime = document.getElementById('_historychecktime');
|
||||
var hid_1 = document.getElementById("hid_1");
|
||||
var hid_2 = document.getElementById("hid_2");
|
||||
var hid_3 = document.getElementById("hid_3");
|
||||
var state = document.getElementById("state");
|
||||
var hid_btn = document.getElementById("hid_btn");
|
||||
var tool_label2 = document.getElementById('tool_label2');
|
||||
var radio_mode = document.getElementById('radio-mode');
|
||||
var radio = document.getElementsByName("radios");
|
||||
var radio_de = document.getElementById('radio-de');
|
||||
var radio_ru_mode = document.getElementById('radio-ru-mode');
|
||||
var radio_ru = document.getElementsByName("radios-ru");
|
||||
var radio_run_normal = document.getElementById("run_normal");
|
||||
var script_radio;
|
||||
var script_radio_label;
|
||||
var hid_btn_if = true;
|
||||
var ws_connect = false;
|
||||
var ws_error = false;
|
||||
var ws_retry = 0;
|
||||
var luci_protocol;
|
||||
var ws_t;
|
||||
var ws_c;
|
||||
var state_refresh;
|
||||
var s;
|
||||
var gr;
|
||||
|
||||
hid_1.style.display = "none";
|
||||
hid_2.style.display = "none";
|
||||
hid_3.style.display = "none";
|
||||
state.style.display="none";
|
||||
|
||||
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.restricted_mode != "1" )
|
||||
{
|
||||
clash.innerHTML = status.clash ? '<b style=color:green><%:Running%></b>' : '<b style=color:red><%:Not Running%></b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
clash.innerHTML = status.clash ? '<b style=color:green><%:Running%> <%:<Limited State>%></b>' : '<b style=color:red><%:Not Running%></b>';
|
||||
}
|
||||
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>';
|
||||
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>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check All Components Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
update_subscribe.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Config Update%>" onclick="return b_update_subscribe(this)"/>';
|
||||
update_other_rules.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Third Party Rules Update%>" onclick="return b_update_other_rules(this)"/>';
|
||||
update_geoip.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GEOIP Data Update%>" onclick="return b_update_geoip(this)"/>';
|
||||
update_geosite.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GeoSite Data Update%>" onclick="return b_update_geosite(this)"/>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port;
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port)
|
||||
{
|
||||
daip.innerHTML = status.db_foward_domain ? "<b style=color:green>"+status.db_foward_domain+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.db_foward_port ? "<b style=color:green>"+status.db_foward_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.db_foward_domain + ":" + status.db_foward_port;
|
||||
}
|
||||
else {
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port;
|
||||
};
|
||||
|
||||
if (status.clash && status.watchdog) {
|
||||
radio_mode.style.display = "inline-block";
|
||||
radio_de.style.display = "none";
|
||||
}
|
||||
else {
|
||||
radio_mode.style.display = "none";
|
||||
radio_de.style.display = "";
|
||||
radio_de.innerHTML = "<b style=color:red><%:Not Running%></b>";
|
||||
};
|
||||
|
||||
if (status.clash && status.watchdog) {
|
||||
radio_ru_mode.style.display = "inline-block";
|
||||
}
|
||||
else {
|
||||
radio_ru_mode.style.display = "none";
|
||||
};
|
||||
|
||||
function ws_open() {
|
||||
ws_t = new WebSocket(luci_protocol+"/traffic?token="+status.dase);
|
||||
ws_c = new WebSocket(luci_protocol+"/connections?token="+status.dase);
|
||||
ws_t.onmessage = ws_tmessage;
|
||||
ws_c.onmessage = ws_cmessage;
|
||||
ws_t.onerror = ws_terror;
|
||||
ws_t.onopen = function (event) {
|
||||
ws_connect = true;
|
||||
ws_error = false;
|
||||
};
|
||||
};
|
||||
|
||||
if (status.watchdog && status.clash) {
|
||||
if (!ws_connect) {
|
||||
if (!ws_error) {
|
||||
ws_open();
|
||||
}
|
||||
else if (ws_retry < 3)
|
||||
{
|
||||
ws_retry=ws_retry+1;
|
||||
ws_open();
|
||||
}
|
||||
else
|
||||
{
|
||||
ws_terror();
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
ws_connect = false;
|
||||
ws_error = false;
|
||||
if (status.clash) {
|
||||
ws_terror();
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
XHR.poll(1, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog.match("level=fatal") ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
|
||||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
|
||||
}
|
||||
else if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
startlog.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
XHR.poll(6, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog == "\n" || status.startlog == "" ) {
|
||||
var rdmdl=Math.floor(Math.random()*16)+1;
|
||||
if(rdmdl==1)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: You can modify the profile on the profile page (for content that is not taken over)%></font></b>';
|
||||
}
|
||||
if(rdmdl==2)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: click the version icon above to jump to the client publishing page%></font></b>';
|
||||
}
|
||||
if(rdmdl==3)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: do not write configuration files? Try to create one click on the server page%></font></b>';
|
||||
}
|
||||
if(rdmdl==4)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: some website are abnormal? Try switching modes or using third-party rules%></font></b>';
|
||||
}
|
||||
if(rdmdl==5)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: using the fake IP mode can get a faster access experience%></font></b>';
|
||||
}
|
||||
if(rdmdl==6)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: query DNS by TLS & TCP & HTTPS can get better anti pollution effect%></font></b>';
|
||||
}
|
||||
if(rdmdl==7)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: openlash will check the configuration file parameters to ensure that it works properly%></font></b>';
|
||||
}
|
||||
if(rdmdl==8)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: the nameserver group must have at least one server set when using custom DNS%></font></b>';
|
||||
}
|
||||
if(rdmdl==9)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: the website access check shows the connection of the device currently logged in to the Luci page%></font></b>';
|
||||
}
|
||||
if(rdmdl==10)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: after started, please wait patiently until the connection is normal%></font></b>';
|
||||
}
|
||||
if(rdmdl==11)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: if you don not use IPv6, please turn off the DHCP service of IPv6, otherwise the connection will be abnormal%></font></b>';
|
||||
}
|
||||
if(rdmdl==12)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: you can update the version in the global settings page%></font></b>';
|
||||
}
|
||||
if(rdmdl==13)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it%></font></b>';
|
||||
}
|
||||
if(rdmdl==14)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off%></font></b>';
|
||||
}
|
||||
if(rdmdl==15)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check%></font></b>';
|
||||
}
|
||||
if(rdmdl==16)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%: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%></font></b>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
get_rule_mode();
|
||||
get_run_mode();
|
||||
state_get();
|
||||
clashversion_check();
|
||||
|
||||
function get_rule_mode() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "rule_mode")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.mode != "") {
|
||||
if (status.core_type == "TUN" && radio.length != 4) {
|
||||
script_radio = document.createElement("input")
|
||||
script_radio.setAttribute("type", "radio");
|
||||
script_radio.setAttribute("id", "script");
|
||||
script_radio.setAttribute("name", "radios");
|
||||
script_radio.setAttribute("value", "script");
|
||||
script_radio.setAttribute("onclick", "javascript:return switch_rule_mode(this.value);");
|
||||
script_radio_label = document.createElement("label")
|
||||
script_radio_label.setAttribute("for", "script");
|
||||
script_radio_label.innerHTML = "Script";
|
||||
radio_mode.appendChild(script_radio);
|
||||
radio_mode.appendChild(script_radio_label);
|
||||
}
|
||||
else if (status.core_type != "TUN" && radio.length == 4) {
|
||||
radio_mode.removeChild(script_radio)
|
||||
radio_mode.removeChild(script_radio_label)
|
||||
}
|
||||
for (i=0; i<radio.length; i++) {
|
||||
if (radio[i].value == status.mode && ! radio[i].checked) {
|
||||
radio[i].checked = true;
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
s = setTimeout("get_rule_mode()",5000);
|
||||
};
|
||||
|
||||
function switch_rule_mode(value)
|
||||
{
|
||||
clearTimeout(s);
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_rule_mode")%>', {rule_mode: value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
alert(' <%:Proxy Mode%>: ' + value + ' <%:switching succeeded!%>');
|
||||
get_rule_mode();
|
||||
}
|
||||
else {
|
||||
alert(' <%:Proxy Mode%>: ' + value + ' <%:switching failed!%>');
|
||||
get_rule_mode();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function get_run_mode() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "get_run_mode")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.mode) {
|
||||
if (status.mode == "fake-ip" || status.mode == "fake-ip-tun" || status.mode == "fake-ip-mix")
|
||||
{
|
||||
mode.innerHTML = status.clash && status.watchdog ? "<b style=color:green><%:Fake-IP%></b> | " : '<b style=color:red><%:Not Running%></b>';
|
||||
radio_run_normal.innerHTML = "<%:Enhance%>"
|
||||
}
|
||||
else if (status.mode == "redir-host" || status.mode == "redir-host-tun" || status.mode == "redir-host-mix")
|
||||
{
|
||||
mode.innerHTML = status.clash && status.watchdog ? "<b style=color:green><%:Redir-Host%></b> | " : '<b style=color:red><%:Not Running%></b>';
|
||||
radio_run_normal.innerHTML = "<%:Compatible%>"
|
||||
};
|
||||
for (i=0; i<radio_ru.length; i++) {
|
||||
if (radio_ru[i].value == (status["mode"].split("-")[2] == undefined ? "" : ("-" + status["mode"].split("-")[2])) && ! radio_ru[i].checked) {
|
||||
radio_ru[i].checked = true;
|
||||
}
|
||||
};
|
||||
};
|
||||
});
|
||||
gr = setTimeout("get_run_mode()",2000);
|
||||
};
|
||||
|
||||
function switch_run_mode(value)
|
||||
{
|
||||
var r = confirm("<%:Are you sure want to switch the running mode?%>")
|
||||
if (r == true) {
|
||||
clearTimeout(gr);
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_run_mode")%>', {run_mode: value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
get_run_mode();
|
||||
}
|
||||
else {
|
||||
get_run_mode();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function state_get() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
ipdb.innerHTML = status.ipdb ? "<b style=color:green>"+status.ipdb+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
geosite.innerHTML = status.geosite ? "<b style=color:green>"+status.geosite+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b style=color:green>"+status.lhie1+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
ConnersHua.innerHTML = status.ConnersHua ? "<b style=color:green>"+status.ConnersHua+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b style=color:green>"+status.ConnersHua_return+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroute.innerHTML = status.chnroute ? "<b style=color:green>"+status.chnroute+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroutev6.innerHTML = status.chnroutev6 ? "<b style=color:green>"+status.chnroutev6+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
if ( status.historychecktime != "0" ) {
|
||||
historychecktime.innerHTML = "<b style=color:green>"+status.historychecktime+"</b>";
|
||||
}
|
||||
else {
|
||||
historychecktime.innerHTML = "<b style=color:green>"+"<%:No Backup%>"+"</b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function hid_btn_action() {
|
||||
if (hid_btn_if) {
|
||||
hid_1.style.display = "";
|
||||
hid_2.style.display = "";
|
||||
hid_3.style.display = "";
|
||||
state.style.display = "block";
|
||||
hid_btn_if = false;
|
||||
clearInterval(state_refresh);
|
||||
state_refresh=setInterval("state_get()",1000*2);
|
||||
} else {
|
||||
hid_1.style.display = "none";
|
||||
hid_2.style.display = "none";
|
||||
hid_3.style.display = "none";
|
||||
state.style.display = "none";
|
||||
hid_btn_if = true;
|
||||
clearInterval(state_refresh);
|
||||
}
|
||||
};
|
||||
|
||||
function winOpen(url)
|
||||
{
|
||||
var winOpen = window.open(url);
|
||||
if(winOpen == null || typeof(winOpen) == 'undefined'){
|
||||
window.location.href=url;
|
||||
}
|
||||
};
|
||||
|
||||
function ws_terror() {
|
||||
ws_error = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "") {
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">"+status.up+"</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">"+status.down+"</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">"+status.up_total+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">"+status.down_total+"</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">"+status.mem+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">"+status.connections+"</font>";
|
||||
if (status.cpu <= 50) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu >= 50 && status.cpu <= 80) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:orange\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu <= 100) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:red\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">0</font>";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function show_sys() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "") {
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">"+status.mem+"</font>";
|
||||
if (status.cpu <= 50) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu >= 50 && status.cpu <= 80) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:orange\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu <= 100) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:red\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function ws_tmessage(event) {
|
||||
var data = JSON.parse(event.data)
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.up)+"/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.down)+"/S</font>";
|
||||
};
|
||||
|
||||
function ws_cmessage(event) {
|
||||
var data = JSON.parse(event.data)
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.uploadTotal)+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.downloadTotal)+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">"+Object.keys(data.connections).length+"</font>";
|
||||
show_sys();
|
||||
};
|
||||
|
||||
function bytesToSize(bytes) {
|
||||
var sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
if (bytes == 0) return '0 B';
|
||||
var i = Math.floor(Math.log(bytes) / Math.log(1024));
|
||||
return i == 0 ? (bytes / Math.pow(1024, i)) + ' ' + sizes[i] : (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
|
||||
};
|
||||
|
||||
function all_one_key_update(btn)
|
||||
{
|
||||
btn.value = '<%:Check All Components Update%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Check and update all Cores and plug-ins?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', null, function(x, status) {
|
||||
if ( x && x.status != 200 ) {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert('<%:No compiled version is selected. Please configure it in the General Settings tab!%>')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function b_update_other_rules(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_other_rules")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Third Party Rules Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Third Party Rules Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_update_geoip(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_geoip")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GEOIP Data Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GEOIP Data Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_update_geosite(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_geosite")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GeoSite Data Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GeoSite Data Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_flush_fakeip_cache(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Flushing...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","flush_fakeip_cache")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.flush_status == "0" || status.flush_status != "")
|
||||
{
|
||||
btn.value = '<%:Flush Failed%>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.value = '<%:Flush Successful%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Flush Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function b_update_subscribe(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_subscribe")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Config Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check Config Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_reload_firewall(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Reloading...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "reload_firewall")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Reload Firewall Rules%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Firewall Rules Reset Failed%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_close_all_connection(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Reloading...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "close_all_connection")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Close All Connections%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Close All Connections Failed%>';
|
||||
}
|
||||
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%>';
|
||||
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 +'"%>';
|
||||
}
|
||||
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://';
|
||||
url1='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/yacd/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/"%>';
|
||||
}
|
||||
winOpen(url1);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function net_dashboard(btn)
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "status")%>', null, function(x, status) {
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Open 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 +'"%>';
|
||||
}
|
||||
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://';
|
||||
url2='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/dashboard/#/?host='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url2='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/dashboard/"%>';
|
||||
}
|
||||
winOpen(url2);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function homepage()
|
||||
{
|
||||
url3='https://github.com/vernesong/OpenClash';
|
||||
winOpen(url3);
|
||||
};
|
||||
|
||||
|
||||
function gitbookpage()
|
||||
{
|
||||
url8='https://lancellc.gitbook.io/clash';
|
||||
winOpen(url8);
|
||||
};
|
||||
|
||||
function wikipage()
|
||||
{
|
||||
url5='https://github.com/vernesong/OpenClash/wiki';
|
||||
winOpen(url5);
|
||||
};
|
||||
|
||||
function telegrampage()
|
||||
{
|
||||
url6='https://t.me/ctcgfw_openwrt_discuss';
|
||||
winOpen(url6);
|
||||
};
|
||||
|
||||
function sponsorpage()
|
||||
{
|
||||
url7='https://ko-fi.com/vernesong';
|
||||
winOpen(url7);
|
||||
};
|
||||
|
||||
function logo_check(imgobj,imgSrc,imgNewSrc)
|
||||
{
|
||||
var newimg = new Image();
|
||||
newimg.src = imgNewSrc;
|
||||
newimg.onload = function() {
|
||||
imgobj.src = imgNewSrc;
|
||||
imgobj.onload = function() {};
|
||||
};
|
||||
newimg.onerror = function() {
|
||||
imgobj.onload = function() {};
|
||||
imgerrorfuns(imgobj,imgSrc);
|
||||
};
|
||||
};
|
||||
|
||||
function clashversion_check()
|
||||
{
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "lastversion")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.lastversion != "" )
|
||||
{
|
||||
clashversion.innerHTML = '<img id="lastver" src="'+status.lastversion+'" alt="lastversion" onerror="return clashversion_error()" onclick="return go_update()">';
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function clashversion_error()
|
||||
{
|
||||
clashversion.innerHTML = '<img id="clashversion" src="/luci-static/resources/openclash/img/version.svg?<%=random%>" alt="currentversion" height="21px" onerror="return imgerrorfuns(this,\'https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/o/op/openclash/<%=RELEASE_BRANCH%>/img/version.png\')" onclick="return go_update()">';
|
||||
};
|
||||
|
||||
function imgerrorfuns(imgobj,imgSrc){
|
||||
setTimeout(function(){
|
||||
imgobj.src=imgSrc;
|
||||
},1000*10);
|
||||
};
|
||||
|
||||
function go_update()
|
||||
{
|
||||
url4='https://github.com/vernesong/OpenClash/releases';
|
||||
winOpen(url4);
|
||||
};
|
||||
//]]></script>
|
||||
|
@ -1,104 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<style>
|
||||
.sub_tab{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
margin: 0 auto;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sub_tab_show{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
margin: 0 auto;
|
||||
-webkit-transition: all 1.5s;
|
||||
-moz-transition: all 1.5s;
|
||||
-ms-transition: all 1.5s;
|
||||
-o-transition: all 1.5s;
|
||||
transition: all 1s;
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
<%
|
||||
local fs = require "luci.openclash"
|
||||
local val = self:cfgvalue(section)
|
||||
local filename = fs.filename(val)
|
||||
local idname = math.random(1000)..(string.match(filename, "[%w_]+") or "")
|
||||
%>
|
||||
<div id='<%=idname%>' class="sub_tab"></div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
var retry_<%=idname%> = 0;
|
||||
var s_<%=idname%>;
|
||||
sub_info_get_<%=idname%>();
|
||||
|
||||
function progressbar_<%=idname%>(v, m, pc, np, f, t, tr) {
|
||||
return String.format(
|
||||
'<div style="width:250px; max-width:500px; position:relative; border:1px solid #999999; border-radius: 6px">' +
|
||||
(pc >= 50 ? '<div style="background-color:#9edd9e; width:%d%%; height:36px; border-radius: 6px">' : (pc < 50 && pc >= 20 ? '<div style="background-color:#ffc99f; width:%d%%; height:35px">' : '<div style="background-color:#ffb9b9; width:%d%%; height:35px">')) +
|
||||
'<div style="position:absolute; left:0;' + (tr == "null" ? 'top:12px;' : 'top:0;') + 'text-align:center; width:100%%">' +
|
||||
'<small>%s '+ (f ? f : '/') +' %s ' + (np ? "" : '(%s%%)') + (tr == "null" ? '<div style="visibility: hidden;">' : '<div style="visibility: visible;">') + '%s (<%:Remaining%> %s <%:days%>)</small>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>', pc, v, m, pc, t, tr
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
function sub_info_get_<%=idname%>()
|
||||
{
|
||||
|
||||
if (localStorage.getItem("<%=filename%>")) {
|
||||
var save_info = JSON.parse(localStorage.getItem("<%=filename%>"));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
if (save_info.sub_info == "No Sub Info Found") {
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
}
|
||||
else {
|
||||
//document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + save_info.used + "</span> | <span style=color:green>" + save_info.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + save_info.expire + "</span>";
|
||||
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((save_info.used), (save_info.total), (save_info.percent ? save_info.percent : 0), false, false, (save_info.expire), (save_info.day_left ? save_info.day_left : 0));
|
||||
}
|
||||
};
|
||||
|
||||
if (s_<%=idname%>) { clearTimeout(s_<%=idname%>);};
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "sub_info_get")%>', {filename: "<%=filename%>"}, function(x, status) {
|
||||
if (x && x.status == 200 && status.sub_info != "" && status.sub_info != "No Sub Info Found") {
|
||||
retry_<%=idname%> = 0;
|
||||
localStorage.setItem("<%=filename%>",JSON.stringify(status));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((status.used), (status.total), (status.percent), false, false, (status.expire), (status.day_left));
|
||||
//document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + status.used + "</span> | <span style=color:green>" + status.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + status.expire + "</span>";
|
||||
}
|
||||
else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
|
||||
retry_<%=idname%> = 0;
|
||||
localStorage.setItem("<%=filename%>",JSON.stringify(status));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
}
|
||||
else {
|
||||
if (document.getElementById('<%=idname%>').innerHTML == "" || retry_<%=idname%> > 2) {
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>";
|
||||
}
|
||||
if (retry_<%=idname%> > 2) {
|
||||
retry_<%=idname%> = 0;
|
||||
localStorage.removeItem("<%=filename%>");
|
||||
}
|
||||
else {
|
||||
retry_<%=idname%> ++;
|
||||
s_<%=idname%> = setTimeout("sub_info_get_<%=idname%>()",1000*120);
|
||||
return
|
||||
}
|
||||
|
||||
};
|
||||
s_<%=idname%> = setTimeout("sub_info_get_<%=idname%>()",1000*1800);
|
||||
});
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
<%+cbi/valuefooter%>
|
@ -1,70 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<div class="cbi-value-field" id="switch_dashboard_<%=self.option%>">
|
||||
<%:Collecting data...%>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var btn_type_<%=self.option%> = "<%=self.option%>";
|
||||
var switch_dashboard_<%=self.option%> = document.getElementById('switch_dashboard_<%=self.option%>');
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "dashboard_type")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( btn_type_<%=self.option%> == "Dashboard" ) {
|
||||
if ( status.dashboard_type == "Meta" ) {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Official Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Official\')"/>';
|
||||
}
|
||||
else {
|
||||
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%> == "Yacd" ) {
|
||||
if ( status.yacd_type == "Meta" ) {
|
||||
switch_dashboard_<%=self.option%>.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch To Official Version%>" onclick="return switch_dashboard(this, btn_type_<%=self.option%>, \'Official\')"/>';
|
||||
}
|
||||
else {
|
||||
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\')"/>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function switch_dashboard(btn, name, type)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Downloading File...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_dashboard")%>', {name: name, type : type}, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.download_state == "1" ) {
|
||||
if ( type == "Meta" ) {
|
||||
if ( name == "Dashboard" ) {
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Official Version%>" onclick="return switch_dashboard(this, \'Dashboard\', \'Official\')"/>';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("switch_dashboard_"+name).innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch Successful%> - <%:Switch To Official Version%>" onclick="return switch_dashboard(this, \'Yacd\', \'Official\')"/>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
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
|
||||
{
|
||||
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 if ( status.download_state == "2" ) {
|
||||
btn.value = '<%:Unzip Error%>';
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Switch Failed%>';
|
||||
}
|
||||
}
|
||||
});
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
|
||||
<%+cbi/valuefooter%>
|
@ -1,45 +0,0 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center" id="switch_mode">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var switch_mode = document.getElementById('switch_mode');
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "op_mode")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.op_mode == "redir-host" ) {
|
||||
switch_mode.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch page to Fake-IP mode%>" onclick="return switch_modes(this)"/>';
|
||||
}
|
||||
else {
|
||||
switch_mode.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Switch page to Redir-Host mode%>" onclick="return switch_modes(this)"/>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function switch_modes(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_mode")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.switch_mode == "redir-host" ) {
|
||||
alert('<%:Page has been switched to Fake-IP mode!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
else {
|
||||
alert('<%:Page has been switched to Redir-Host mode!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
}
|
||||
});
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
//]]></script>
|
||||
|
@ -1,128 +0,0 @@
|
||||
<head>
|
||||
<style>
|
||||
.tool_label {
|
||||
display: inline-block;
|
||||
padding: 0.6rem 0rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<div id="tool_label" class="tool_label">
|
||||
<span>
|
||||
<%:Current Config File%>:
|
||||
<select id="cfg_name">
|
||||
</select>
|
||||
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Switch Config%>" onclick="return switch_config(this)" />
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
var config_name = document.getElementById('cfg_name');
|
||||
var tool_label = document.getElementById('tool_label');
|
||||
var Commit = document.getElementById('cbi-table-1-Commit');
|
||||
var Apply = document.getElementById('cbi-table-1-Apply');
|
||||
var Back = document.getElementById('cbi-table-1-Back');
|
||||
var Load_Config = document.getElementById('cbi-table-1-Load_Config');
|
||||
var Delete_Unused_Servers = document.getElementById('cbi-table-1-Delete_Unused_Servers');
|
||||
var Delete_Servers = document.getElementById('cbi-table-1-Delete_Servers');
|
||||
var Delete_Proxy_Provider = document.getElementById('cbi-table-1-Delete_Proxy_Provider');
|
||||
var Delete_Groups = document.getElementById('cbi-table-1-Delete_Groups');
|
||||
var rule_mg = document.getElementById('cbi-table-1-rule_mg');
|
||||
var pro_mg = document.getElementById('cbi-table-1-pro_mg');
|
||||
|
||||
setTimeout("get_header()",100);
|
||||
|
||||
if (Commit) {
|
||||
Commit.style.textAlign="center";
|
||||
}
|
||||
if (Apply) {
|
||||
Apply.style.textAlign="center";
|
||||
}
|
||||
if (Back) {
|
||||
Back.style.textAlign="center";
|
||||
}
|
||||
if (Load_Config) {
|
||||
Load_Config.style.textAlign="center";
|
||||
Delete_Unused_Servers.style.textAlign="center";
|
||||
Delete_Servers.style.textAlign="center";
|
||||
Delete_Proxy_Provider.style.textAlign="center";
|
||||
Delete_Groups.style.textAlign="center";
|
||||
}
|
||||
if (rule_mg) {
|
||||
rule_mg.style.textAlign="center";
|
||||
pro_mg.style.textAlign="center";
|
||||
}
|
||||
|
||||
if (tool_label.style.display != "none") {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "config_name")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && status.config_name != "") {
|
||||
for(var i in status.config_name){
|
||||
config_name.options.add(new Option(status.config_name[i].name,status.config_name[i].name));
|
||||
}
|
||||
if (status.config_path != "") {
|
||||
config_name.value = status.config_path;
|
||||
}
|
||||
else
|
||||
{
|
||||
config_name.options.add(new Option("<%:Not Select%>",""));
|
||||
config_name.value = "";
|
||||
}
|
||||
}
|
||||
else if (x && x.status == 200 && status.config_path != "") {
|
||||
config_name.options.add(new Option(status.config_path,status.config_path));
|
||||
config_name.value = status.config_path;
|
||||
}
|
||||
else {
|
||||
tool_label.style.display = "none";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function get_header() {
|
||||
var header = document.getElementsByClassName("tabmenu-item-log ")[0];
|
||||
if (header) {
|
||||
insertAfter(tool_label,header);
|
||||
}
|
||||
else {
|
||||
setTimeout("get_header()",100);
|
||||
}
|
||||
}
|
||||
|
||||
function insertAfter(newElement, targetElement) {
|
||||
var parent = targetElement.parentNode;
|
||||
if (parent.lastChild == targetElement) {
|
||||
parent.appendChild(newElement, targetElement);
|
||||
}
|
||||
else {
|
||||
parent.insertBefore(newElement, targetElement.nextSibling);
|
||||
};
|
||||
};
|
||||
|
||||
function switch_config(btn)
|
||||
{
|
||||
if (config_name.value && config_name.value != "") {
|
||||
btn.disabled = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "switch_config")%>', {config_name: config_name.value}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.disabled = false;
|
||||
alert(' <%:Config File%>: ' + config_name.value + ' <%:switching succeeded!%>')
|
||||
window.location.href=location.pathname;
|
||||
}
|
||||
else {
|
||||
alert(' <%:Config File%>: ' + config_name.value + ' <%:switching failed!%>')
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function winOpen(url)
|
||||
{
|
||||
var winOpen = window.open(url);
|
||||
if(winOpen == null || typeof(winOpen) == 'undefined'){
|
||||
window.location.href=url;
|
||||
}
|
||||
}
|
||||
//]]></script>
|
@ -1,544 +0,0 @@
|
||||
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center" id="update_tip">
|
||||
<b><%:Note: if the update fails, you can manually download and upload%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Compiled Version Selected%></td>
|
||||
<td width="25%" align="left"><select id="CORE_VERSION">
|
||||
<option value="linux-386"><%:linux-386%></option>
|
||||
<option value="linux-amd64"><%:linux-amd64(x86-64)%></option>
|
||||
<option value="linux-amd64-v3"><%:linux-amd64-v3(x86-64)%></option>
|
||||
<option value="linux-armv5"><%:linux-armv5%></option>
|
||||
<option value="linux-armv6"><%:linux-armv6%></option>
|
||||
<option value="linux-armv7"><%:linux-armv7%></option>
|
||||
<option value="linux-arm64"><%:linux-arm64(armv8)%></option>
|
||||
<option value="linux-mips-hardfloat"><%:linux-mips-hardfloat%></option>
|
||||
<option value="linux-mips-softfloat"><%:linux-mips-softfloat%></option>
|
||||
<option value="linux-mips64"><%:linux-mips64%></option>
|
||||
<option value="linux-mips64le"><%:linux-mips64le%></option>
|
||||
<option value="linux-mipsle-softfloat"><%:linux-mipsle-softfloat%></option>
|
||||
<option value="linux-mipsle-hardfloat"><%:linux-mipsle-hardfloat%></option>
|
||||
<option value="0"><%:Not Set%></option>
|
||||
</select></td>
|
||||
<td width="25%"><%:Release Branch Selected%></td>
|
||||
<td width="25%" align="left"><select id="RELEASE_BRANCH">
|
||||
<option value="master">Master</option>
|
||||
<option value="dev">Developer</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%"><%:CPU Architecture%></td><td width="25%" align="left" id="CPU_MODEL"><%:Collecting data...%></td>
|
||||
<td width="25%"><%:Last Check Update%></td><td width="25%" align="left" id="CHECKTIME"><%:Collecting data...%></td>
|
||||
</tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Core path:%>/etc/openclash/core/clash</b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%">[Dev] <%:Current Core%></td><td width="25%" align="left" id="CORE_CV"><%:Collecting data...%></td><td width="25%">[Dev] <%:Latest Core%></td><td width="25%" align="left" id="CORE_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_up"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Core path:%>/etc/openclash/core/clash_tun</b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%">[TUN] <%:Current Core%></td><td width="25%" align="left" id="CORE_TUN_CV"><%:Collecting data...%></td><td width="25%">[TUN] <%:Latest Core%></td><td width="25%" align="left" id="CORE_TUN_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_tun_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_tun_up"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%">[Meta] <%:Current Core%></td><td width="25%" align="left" id="CORE_META_CV"><%:Collecting data...%></td><td width="25%">[Meta] <%:Latest Core%></td><td width="25%" align="left" id="CORE_META_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_meta_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_meta_up"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Client Update%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%"><%:Current Client%></td><td width="25%" align="left" id="OP_CV"><%:Collecting data...%></td><td width="25%"><%:Latest Client%></td><td width="25%" align="left" id="OP_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Client%></td><td width="25%" align="left" id="op_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Client%></td><td width="25%" align="left" id="ma_op_up"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="25%">
|
||||
<p align="center" id="restore">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="remove_core">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="one_key_update">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
<table width="100%">
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Backup Section%></b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_ex_core">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_core_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_config_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_rule_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
<td width="25%">
|
||||
<p align="center" id="backup_proxy_only">
|
||||
<%:Collecting data...%>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var core_version = document.getElementById('CORE_VERSION');
|
||||
var checktime = document.getElementById('CHECKTIME');
|
||||
var cpu_model = document.getElementById('CPU_MODEL');
|
||||
var core_cv = document.getElementById('CORE_CV');
|
||||
var core_lv = document.getElementById('CORE_LV');
|
||||
var core_tun_cv = document.getElementById('CORE_TUN_CV');
|
||||
var core_tun_lv = document.getElementById('CORE_TUN_LV');
|
||||
var core_meta_cv = document.getElementById('CORE_META_CV');
|
||||
var core_meta_lv = document.getElementById('CORE_META_LV');
|
||||
var op_cv = document.getElementById('OP_CV');
|
||||
var op_lv = document.getElementById('OP_LV');
|
||||
var core_up = document.getElementById('core_up');
|
||||
var core_tun_up = document.getElementById('core_tun_up');
|
||||
var core_meta_up = document.getElementById('core_meta_up');
|
||||
var op_up = document.getElementById('op_up');
|
||||
var update_tip = document.getElementById('update_tip');
|
||||
var ma_core_up = document.getElementById('ma_core_up');
|
||||
var ma_core_tun_up = document.getElementById('ma_core_tun_up');
|
||||
var ma_core_meta_up = document.getElementById('ma_core_meta_up');
|
||||
var ma_op_up = document.getElementById('ma_op_up');
|
||||
var restore = document.getElementById('restore');
|
||||
var backup = document.getElementById('backup');
|
||||
var backup_ex_core = document.getElementById('backup_ex_core');
|
||||
var backup_core_only = document.getElementById('backup_core_only');
|
||||
var backup_config_only = document.getElementById('backup_config_only');
|
||||
var backup_rule_only = document.getElementById('backup_rule_only');
|
||||
var backup_proxy_only = document.getElementById('backup_proxy_only');
|
||||
var one_key_update = document.getElementById('one_key_update');
|
||||
var remove_core = document.getElementById('remove_core');
|
||||
var release_branch = document.getElementById('RELEASE_BRANCH');
|
||||
core_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'Dev\')"/>';
|
||||
core_tun_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'TUN\')"/>';
|
||||
core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'Meta\')"/>';
|
||||
op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return op_update(this)"/>';
|
||||
ma_core_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Dev\')"/>';
|
||||
ma_core_tun_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'TUN\')"/>';
|
||||
ma_core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Meta\')"/>';
|
||||
ma_op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_op_update(this)"/>';
|
||||
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default Config%>" onclick="return restore_config(this)"/>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:One Click Check Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
remove_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Remove Core%>" onclick="return remove_all_core(this)"/>';
|
||||
backup.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup OpenClash%>" onclick="return backup_all_file(this)"/>';
|
||||
backup_ex_core.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Exclude Cores%>" onclick="return backup_no_core(this)"/>';
|
||||
backup_core_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Core%>" onclick="return backup_only_core(this)"/>';
|
||||
backup_config_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Config%>" onclick="return backup_only_config(this)"/>';
|
||||
backup_rule_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Rule Provider%>" onclick="return backup_only_rule(this)"/>';
|
||||
backup_proxy_only.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Backup Proxy Provider%>" onclick="return backup_only_proxy(this)"/>';
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_info")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" && status.corever != "" ) {
|
||||
core_version.value = status.corever;
|
||||
}
|
||||
else {
|
||||
core_version.value = "0";
|
||||
}
|
||||
if ( status.release_branch != "" ) {
|
||||
release_branch.value = status.release_branch;
|
||||
}
|
||||
else {
|
||||
release_branch.value = "master";
|
||||
}
|
||||
}
|
||||
else {
|
||||
core_version.value = "0";
|
||||
release_branch.value = "master";
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "update")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
cpu_model.innerHTML = status.coremodel ? "<b style=color:green>"+status.coremodel+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
|
||||
}
|
||||
else {
|
||||
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
|
||||
}
|
||||
if ( status.corecv == "0" ) {
|
||||
core_cv.innerHTML = "<b style=color:red><%:File Not Exist%></b>";
|
||||
}
|
||||
else if (status.corecv != "") {
|
||||
core_cv.innerHTML = "<b style=color:green>"+status.corecv+"</b>";
|
||||
}
|
||||
else {
|
||||
core_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if ( status.coretuncv == "0" ) {
|
||||
core_tun_cv.innerHTML = "<b style=color:red><%:File Not Exist%></b>";
|
||||
}
|
||||
else if (status.coretuncv != "") {
|
||||
core_tun_cv.innerHTML = "<b style=color:green>"+status.coretuncv+"</b>";
|
||||
}
|
||||
else {
|
||||
core_tun_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if ( status.coremetacv == "0" ) {
|
||||
core_meta_cv.innerHTML = "<b style=color:red><%:File Not Exist%></b>";
|
||||
}
|
||||
else if (status.coremetacv != "") {
|
||||
core_meta_cv.innerHTML = "<b style=color:green>"+status.coremetacv+"</b>";
|
||||
}
|
||||
else {
|
||||
core_meta_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
var corelv = status.corelv;
|
||||
var arr_core = corelv.split(",");
|
||||
var corelvis = arr_core[0];
|
||||
var coretunlvis = arr_core[1];
|
||||
var coremetalvis = arr_core[2];
|
||||
if (corelvis != status.corecv && corelvis != "" && corelvis != "\n") {
|
||||
core_lv.innerHTML = "<b style=color:green>"+corelvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (corelvis != "" && corelvis == status.corecv && corelvis != "\n") {
|
||||
core_lv.innerHTML = "<b style=color:green>"+corelvis+"</b>";
|
||||
}
|
||||
else {
|
||||
core_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if (coretunlvis != status.coretuncv && coretunlvis != "" && coretunlvis != "\n") {
|
||||
core_tun_lv.innerHTML = "<b style=color:green>"+coretunlvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (coretunlvis != "" && coretunlvis == status.coretuncv && coretunlvis != "\n") {
|
||||
core_tun_lv.innerHTML = "<b style=color:green>"+coretunlvis+"</b>";
|
||||
}
|
||||
else {
|
||||
core_tun_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if (coremetalvis != status.coremetacv && coremetalvis != "" && coremetalvis != "\n") {
|
||||
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (coremetalvis != "" && coremetalvis == status.coremetacv && coremetalvis != "\n") {
|
||||
core_meta_lv.innerHTML = "<b style=color:green>"+coremetalvis+"</b>";
|
||||
}
|
||||
else {
|
||||
core_meta_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
var oplv = status.oplv;
|
||||
var arr_op = oplv.split(",");
|
||||
var oplvis = arr_op[0];
|
||||
var new_op = arr_op[1];
|
||||
op_cv.innerHTML = status.opcv ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
|
||||
if ( new_op == "2" && oplvis != "" && oplvis != "\n") {
|
||||
op_lv.innerHTML = "<b style=color:green>"+oplvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (oplvis != "" && oplvis != "\n") {
|
||||
op_lv.innerHTML = "<b style=color:green>"+oplvis+"</b>";
|
||||
}
|
||||
else {
|
||||
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(7, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', status.startlog, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog == "\n" || status.startlog == "" ) {
|
||||
var rdmdl=Math.floor(Math.random()*2)+1;
|
||||
if(rdmdl==1)
|
||||
{
|
||||
update_tip.innerHTML = '<b><font><%:Note: if the update fails, you can manually download and upload%></font></b>';
|
||||
}
|
||||
if(rdmdl==2)
|
||||
{
|
||||
update_tip.innerHTML = '<b><font><%:Note: the client may not support update, because the firmware with squashfs format will not release flash space after updating%></font></b>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
XHR.poll(1, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog.match("level=fatal") ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "del_start_log")%>', null, function(x) {});
|
||||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
|
||||
}
|
||||
else if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
update_tip.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
function core_update(btn,type)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', {core_type: type}, function(x, status) {
|
||||
btn.value = '<%:Check And Update%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function op_update(btn)
|
||||
{
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "opupdate")%>', null, function(x, status) {
|
||||
btn.value = '<%:Check And Update%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ma_core_update(btn,type)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.value = '<%:Download%>';
|
||||
btn.disabled = false;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.corever, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" ) {
|
||||
if (type == "Dev") {
|
||||
url1='https://raw.githubusercontent.com/vernesong/OpenClash/'+r+'/core-lateset/dev/clash-'+status.corever+'.tar.gz';
|
||||
window.location.href=url1;
|
||||
}
|
||||
if (type == "TUN") {
|
||||
var corelv = status.corelv;
|
||||
var arr_core = corelv.split(",");
|
||||
var coretunlvis = arr_core[1];
|
||||
if ( coretunlvis != "" ) {
|
||||
url3='https://raw.githubusercontent.com/vernesong/OpenClash/'+r+'/core-lateset/premium/clash-'+status.corever+'-'+coretunlvis+'.gz';
|
||||
window.location.href=url3;
|
||||
}
|
||||
else {
|
||||
alert('<%:Failed to get the latest version. Please try again later!%>')
|
||||
}
|
||||
}
|
||||
if (type == "Meta") {
|
||||
url4='https://raw.githubusercontent.com/vernesong/OpenClash/'+r+'/core-lateset/meta/clash-'+status.corever+'.tar.gz';
|
||||
window.location.href=url4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ma_op_update(btn)
|
||||
{
|
||||
btn.value = '<%:Download%>';
|
||||
btn.disabled = false;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_ma")%>', status.oplv, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
var oplv = status.oplv;
|
||||
var oplvis = oplv.substring(oplv.indexOf("v") + 1,oplv.indexOf(","));
|
||||
if ( oplvis != "" ) {
|
||||
url2='https://raw.githubusercontent.com/vernesong/OpenClash/'+r+'/luci-app-openclash_'+oplvis+'_all.ipk';
|
||||
window.location.href=url2;
|
||||
}
|
||||
else {
|
||||
alert('<%:Failed to get the latest version. Please try again later!%>')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function remove_all_core(btn)
|
||||
{
|
||||
btn.value = '<%:Remove Core%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Are you sure want to remove all core files?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "remove_all_core")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
alert('<%:Remove succeeded!%>')
|
||||
window.location.href='<%="settings?tab.openclash.config=version_update"%>';
|
||||
}
|
||||
else {
|
||||
alert('<%:Remove failed!%>')
|
||||
}
|
||||
});
|
||||
} else {
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function restore_config(btn)
|
||||
{
|
||||
btn.value = '<%:Restore Default Config%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Are you sure want to restore the default config?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "restore")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
alert('<%:Restore succeeded!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
else {
|
||||
alert('<%:Restore failed!%>')
|
||||
window.location.href='<%="settings"%>';
|
||||
}
|
||||
});
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_all_file(btn)
|
||||
{
|
||||
btn.value = '<%:Backup OpenClash%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_no_core(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Exclude Cores%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_ex_core"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_core(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Core%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_core"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_config(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Config%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_config"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_rule(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Rule Provider%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_rule"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function backup_only_proxy(btn)
|
||||
{
|
||||
btn.value = '<%:Backup Proxy Provider%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup_only_proxy"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function all_one_key_update(btn)
|
||||
{
|
||||
var v = core_version.value;
|
||||
var r = release_branch.value;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "save_corever_branch")%>', {core_ver: v, release_branch: r}, function(x, status) {
|
||||
if (x && x.status == 200) {
|
||||
btn.value = '<%:One Click Check Update%>';
|
||||
btn.disabled = true;
|
||||
var r = confirm("<%:Check and update all Cores and plug-ins?%>")
|
||||
if (r == true) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update_check")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.corever != "0" ) {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "one_key_update")%>', null, function(x, status) {
|
||||
if ( x && x.status != 200 ) {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:Check failed, Please try again later!%>')
|
||||
}
|
||||
});
|
||||
}
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//]]></script>
|
@ -1,30 +0,0 @@
|
||||
<%+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%>
|
||||
<select name="file_type" style="width:auto">
|
||||
<option value="config" selected="selected"><%:Config File%></option>
|
||||
<option value="proxy-provider"><%:Proxy Provider File%></option>
|
||||
<option value="rule-provider"><%:Rule Provider File%></option>
|
||||
<option value="clash">[Dev] <%:Core File%></option>
|
||||
<option value="clash_tun">[TUN] <%:Core File%></option>
|
||||
<option value="clash_meta">[Meta] <%:Core File%></option>
|
||||
<option value="backup-file"><%:Backup File%></option>
|
||||
</select>
|
||||
<input class="cbi-input-file" style="width: 30%" type="file" id="ulfile" name="ulfile" />
|
||||
<input type="submit" class="btn cbi-button cbi-input-reload" name="upload" value="<%:Upload%>" />
|
||||
<input type="submit" class="btn cbi-button cbi-button-reset" value="<%:Backup%>" onclick="return backup_all_file(this)"/>
|
||||
</div>
|
||||
<%+cbi/valuefooter%>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
function backup_all_file(btn)
|
||||
{
|
||||
btn.value = '<%:Backup%>';
|
||||
btn.disabled = true;
|
||||
window.location.href='<%="backup"%>';
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
//]]></script>
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
zh-cn
|
@ -1,186 +0,0 @@
|
||||
|
||||
config openclash 'config'
|
||||
option proxy_port '7892'
|
||||
option tproxy_port '7895'
|
||||
option mixed_port '7893'
|
||||
option socks_port '7891'
|
||||
option http_port '7890'
|
||||
option dns_port '7874'
|
||||
option enable '0'
|
||||
option update '0'
|
||||
option en_mode '0'
|
||||
option auto_update '0'
|
||||
option auto_update_time '0'
|
||||
option cn_port '9090'
|
||||
option dashboard_password '123456'
|
||||
option dashboard_forward_ssl '0'
|
||||
option rule_source '0'
|
||||
option enable_custom_dns '0'
|
||||
option ipv6_enable '0'
|
||||
option ipv6_dns '0'
|
||||
option enable_custom_clash_rules '0'
|
||||
option other_rule_auto_update '0'
|
||||
option core_version '0'
|
||||
option en_mode 'redir-host'
|
||||
option enable_redirect_dns '1'
|
||||
option dns_advanced_setting '0'
|
||||
option servers_if_update '0'
|
||||
option disable_masq_cache '0'
|
||||
option servers_update '0'
|
||||
option log_level 'silent'
|
||||
option proxy_mode 'rule'
|
||||
option intranet_allowed '1'
|
||||
option enable_udp_proxy '1'
|
||||
option disable_udp_quic '1'
|
||||
option lan_ac_mode '0'
|
||||
option operation_mode 'redir-host'
|
||||
option enable_rule_proxy '0'
|
||||
option redirect_dns '0'
|
||||
option cachesize_dns '0'
|
||||
option filter_aaaa_dns '0'
|
||||
option small_flash_memory '0'
|
||||
option interface_name '0'
|
||||
option common_ports '0'
|
||||
option log_size '1024'
|
||||
option tolerance '0'
|
||||
option store_fakeip '1'
|
||||
option custom_fallback_filter '0'
|
||||
option append_wan_dns '1'
|
||||
option stream_domains_prefetch '0'
|
||||
option stream_auto_select '0'
|
||||
option dns_remote '1'
|
||||
option bypass_gateway_compatible '0'
|
||||
option github_address_mod '0'
|
||||
option delay_start '0'
|
||||
option router_self_proxy '1'
|
||||
option release_branch 'master'
|
||||
option enable_meta_core '0'
|
||||
option dashboard_type 'Official'
|
||||
option yacd_type 'Official'
|
||||
option append_default_dns '1'
|
||||
option geo_custom_url 'https://testingcf.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb'
|
||||
option geosite_custom_url 'https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat'
|
||||
option geoip_custom_url 'https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat'
|
||||
option chnr_custom_url 'https://ispip.clang.cn/all_cn.txt'
|
||||
option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt'
|
||||
option cndomain_custom_url 'https://testingcf.jsdelivr.net/gh/felixonmars/dnsmasq-china-list@master/accelerated-domains.china.conf'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '114.114.114.114'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '119.29.29.29'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '119.28.28.28'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option group 'nameserver'
|
||||
option type 'udp'
|
||||
option ip '223.5.5.5'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option ip 'doh.pub/dns-query'
|
||||
option group 'nameserver'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option ip 'dns.alidns.com/dns-query'
|
||||
option group 'nameserver'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option group 'fallback'
|
||||
option ip 'dns.cloudflare.com/dns-query'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option ip 'dns.google'
|
||||
option port '853'
|
||||
option type 'tls'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option type 'https'
|
||||
option ip '1.1.1.1/dns-query'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option ip '1.1.1.1'
|
||||
option port '853'
|
||||
option type 'tls'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '8.8.8.8'
|
||||
option port '853'
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option group 'fallback'
|
||||
option ip '2001:4860:4860::8888'
|
||||
option port '53'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option group 'fallback'
|
||||
option ip '2001:4860:4860::8844'
|
||||
option port '53'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option group 'fallback'
|
||||
option ip '2001:da8::666'
|
||||
option port '53'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option type 'https'
|
||||
option ip 'public.dns.iij.jp/dns-query'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option type 'https'
|
||||
option ip 'jp.tiar.app/dns-query'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option type 'https'
|
||||
option ip 'jp.tiarap.org/dns-query'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option ip 'jp.tiar.app'
|
||||
option type 'tls'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option ip 'dot.tiar.app'
|
||||
option type 'tls'
|
||||
option enabled '1'
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
#baidu.com
|
||||
#2400:da00::dbf:0:100
|
@ -1,2 +0,0 @@
|
||||
#baidu.com
|
||||
#114.114.114.114
|
@ -1 +0,0 @@
|
||||
#baidu.com
|
@ -1,2 +0,0 @@
|
||||
#'www.baidu.com': '114.114.114.114'
|
||||
#'+.internal.crop.com': '10.0.0.1'
|
@ -1,133 +0,0 @@
|
||||
#LAN
|
||||
*.lan
|
||||
*.localdomain
|
||||
*.example
|
||||
*.invalid
|
||||
*.localhost
|
||||
*.test
|
||||
*.local
|
||||
*.home.arpa
|
||||
#放行NTP服务
|
||||
time.*.com
|
||||
time.*.gov
|
||||
time.*.edu.cn
|
||||
time.*.apple.com
|
||||
time-ios.apple.com
|
||||
time1.*.com
|
||||
time2.*.com
|
||||
time3.*.com
|
||||
time4.*.com
|
||||
time5.*.com
|
||||
time6.*.com
|
||||
time7.*.com
|
||||
ntp.*.com
|
||||
ntp1.*.com
|
||||
ntp2.*.com
|
||||
ntp3.*.com
|
||||
ntp4.*.com
|
||||
ntp5.*.com
|
||||
ntp6.*.com
|
||||
ntp7.*.com
|
||||
*.time.edu.cn
|
||||
*.ntp.org.cn
|
||||
+.pool.ntp.org
|
||||
time1.cloud.tencent.com
|
||||
#放行网易云音乐
|
||||
music.163.com
|
||||
*.music.163.com
|
||||
*.126.net
|
||||
#百度音乐
|
||||
musicapi.taihe.com
|
||||
music.taihe.com
|
||||
#酷狗音乐
|
||||
songsearch.kugou.com
|
||||
trackercdn.kugou.com
|
||||
#酷我音乐
|
||||
*.kuwo.cn
|
||||
#JOOX音乐
|
||||
api-jooxtt.sanook.com
|
||||
api.joox.com
|
||||
joox.com
|
||||
#QQ音乐
|
||||
y.qq.com
|
||||
*.y.qq.com
|
||||
streamoc.music.tc.qq.com
|
||||
mobileoc.music.tc.qq.com
|
||||
isure.stream.qqmusic.qq.com
|
||||
dl.stream.qqmusic.qq.com
|
||||
aqqmusic.tc.qq.com
|
||||
amobile.music.tc.qq.com
|
||||
#虾米音乐
|
||||
*.xiami.com
|
||||
#咪咕音乐
|
||||
*.music.migu.cn
|
||||
music.migu.cn
|
||||
#win10本地连接检测
|
||||
+.msftconnecttest.com
|
||||
+.msftncsi.com
|
||||
msftconnecttest.com
|
||||
msftncsi.com
|
||||
#QQ快捷登录
|
||||
localhost.ptlogin2.qq.com
|
||||
localhost.sec.qq.com
|
||||
#Game
|
||||
#Nintendo Switch
|
||||
+.srv.nintendo.net
|
||||
*.n.n.srv.nintendo.net
|
||||
#Sony PlayStation
|
||||
+.stun.playstation.net
|
||||
#Microsoft Xbox
|
||||
xbox.*.*.microsoft.com
|
||||
*.*.xboxlive.com
|
||||
xbox.*.microsoft.com
|
||||
xnotify.xboxlive.com
|
||||
#Wotgame
|
||||
+.battlenet.com.cn
|
||||
+.wotgame.cn
|
||||
+.wggames.cn
|
||||
+.wowsgame.cn
|
||||
+.wargaming.net
|
||||
#Golang
|
||||
proxy.golang.org
|
||||
#STUN
|
||||
stun.*.*
|
||||
stun.*.*.*
|
||||
+.stun.*.*
|
||||
+.stun.*.*.*
|
||||
+.stun.*.*.*.*
|
||||
+.stun.*.*.*.*.*
|
||||
#Linksys Router
|
||||
heartbeat.belkin.com
|
||||
*.linksys.com
|
||||
*.linksyssmartwifi.com
|
||||
#ASUS Router
|
||||
*.router.asus.com
|
||||
#Apple Software Update Service
|
||||
mesu.apple.com
|
||||
swscan.apple.com
|
||||
swquery.apple.com
|
||||
swdownload.apple.com
|
||||
swcdn.apple.com
|
||||
swdist.apple.com
|
||||
#Google
|
||||
lens.l.google.com
|
||||
stun.l.google.com
|
||||
#Netflix
|
||||
+.nflxvideo.net
|
||||
#FinalFantasy XIV Worldwide Server & CN Server
|
||||
*.square-enix.com
|
||||
*.finalfantasyxiv.com
|
||||
*.ffxiv.com
|
||||
*.ff14.sdo.com
|
||||
ff.dorado.sdo.com
|
||||
#Bilibili
|
||||
*.mcdn.bilivideo.cn
|
||||
#Disney Plus
|
||||
+.media.dssott.com
|
||||
#shark007 Codecs
|
||||
shark007.net
|
||||
#Mijia
|
||||
Mijia Cloud
|
||||
#招商银行
|
||||
+.cmbchina.com
|
||||
+.cmbimg.com
|
@ -1,42 +0,0 @@
|
||||
# If IP addresses resolved with servers in `nameservers` are in the specified
|
||||
# subnets below, they are considered invalid and results from `fallback`
|
||||
# servers are used instead.
|
||||
#
|
||||
# IP address resolved with servers in `nameserver` is used when
|
||||
# `fallback-filter.geoip` is true and when GEOIP of the IP address is `CN`.
|
||||
#
|
||||
# If `fallback-filter.geoip` is false, results from `nameserver` nameservers
|
||||
# are always used if not match `fallback-filter.ipcidr`.
|
||||
#
|
||||
# This is a countermeasure against DNS pollution attacks.
|
||||
|
||||
fallback-filter:
|
||||
geoip: true
|
||||
geoip-code: CN
|
||||
ipcidr:
|
||||
- 0.0.0.0/8
|
||||
- 10.0.0.0/8
|
||||
- 100.64.0.0/10
|
||||
- 127.0.0.0/8
|
||||
- 169.254.0.0/16
|
||||
- 172.16.0.0/12
|
||||
- 192.0.0.0/24
|
||||
- 192.0.2.0/24
|
||||
- 192.88.99.0/24
|
||||
- 192.168.0.0/16
|
||||
- 198.18.0.0/15
|
||||
- 198.51.100.0/24
|
||||
- 203.0.113.0/24
|
||||
- 224.0.0.0/4
|
||||
- 240.0.0.0/4
|
||||
- 255.255.255.255/32
|
||||
domain:
|
||||
- "+.google.com"
|
||||
- "+.facebook.com"
|
||||
- "+.youtube.com"
|
||||
- "+.githubusercontent.com"
|
||||
- "+.googlevideo.com"
|
||||
- "+.msftconnecttest.com"
|
||||
- "+.msftncsi.com"
|
||||
- msftconnecttest.com
|
||||
- msftncsi.com
|
@ -1,10 +0,0 @@
|
||||
# Static hosts for DNS server and connection establishment (like /etc/hosts)
|
||||
#
|
||||
# Wildcard hostnames are supported (e.g. *.clash.dev, *.foo.*.example.com)
|
||||
# Non-wildcard domain names have a higher priority than wildcard domain names
|
||||
# e.g. foo.example.com > *.example.com > .example.com
|
||||
# P.S. +.foo.com equals to .foo.com and foo.com
|
||||
|
||||
# '*.clash.dev': 127.0.0.1
|
||||
# '.dev': 127.0.0.1
|
||||
# 'alpha.clash.dev': '::1'
|
@ -1,9 +0,0 @@
|
||||
0.0.0.0/8
|
||||
10.0.0.0/8
|
||||
100.64.0.0/10
|
||||
127.0.0.0/8
|
||||
169.254.0.0/16
|
||||
172.16.0.0/12
|
||||
192.168.0.0/16
|
||||
224.0.0.0/4
|
||||
240.0.0.0/4
|
@ -1,13 +0,0 @@
|
||||
::/128
|
||||
::1/128
|
||||
::ffff:0:0/96
|
||||
::ffff:0:0:0/96
|
||||
64:ff9b::/96
|
||||
100::/64
|
||||
2001::/32
|
||||
2001:20::/28
|
||||
2001:db8::/32
|
||||
2002::/16
|
||||
fc00::/7
|
||||
fe80::/10
|
||||
ff00::/8
|
@ -1,11 +0,0 @@
|
||||
ipv4-c041-hkg001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c016-jnb001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c007-sin001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c010-jnb001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c047-sin001-ix.1.oca.nflxvideo.net
|
||||
ipv6-c041-hkg001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c056-sin001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c030-sin001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c025-jnb001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c027-jnb001-ix.1.oca.nflxvideo.net
|
||||
ipv4-c046-hkg001-ix.1.oca.nflxvideo.net
|
@ -1,69 +0,0 @@
|
||||
script:
|
||||
## shortcuts:
|
||||
## Notice: The core timezone is UTC
|
||||
## CST 20:00-24:00 = time.now().hour > 12 and time.now().hour < 16
|
||||
## 内核时区为UTC,故以下time.now()函数的取值需要根据本地时区进行转换
|
||||
## 北京时间(CST) 20:00-24:00 = time.now().hour > 12 and time.now().hour < 16
|
||||
## quic: network == 'udp' and dst_port == 443 and (geoip(resolve_ip(host)) != 'CN' or geoip(dst_ip) != 'CN')
|
||||
## time-limit: in_cidr(src_ip,'192.168.1.2/32') and time.now().hour < 20 or time.now().hour > 21
|
||||
## time-limit: src_ip == '192.168.1.2' and time.now().hour < 20 or time.now().hour > 21
|
||||
|
||||
## code: |
|
||||
## def main(ctx, metadata):
|
||||
## directkeywordlist = ["baidu"]
|
||||
## for directkeyword in directkeywordlist:
|
||||
## if directkeyword in metadata["host"]:
|
||||
## ctx.log('[Script] matched keyword %s use direct' % directkeyword)
|
||||
## return "DIRECT"
|
||||
|
||||
rules:
|
||||
##- SCRIPT,quic,REJECT #shortcuts rule
|
||||
##- SCRIPT,time-limit,REJECT #shortcuts rule
|
||||
|
||||
##- PROCESS-NAME,curl,DIRECT #匹配路由自身进程(curl直连)
|
||||
##- DOMAIN-SUFFIX,google.com,Proxy #匹配域名后缀(交由Proxy代理服务器组)
|
||||
##- DOMAIN-KEYWORD,google,Proxy #匹配域名关键字(交由Proxy代理服务器组)
|
||||
##- DOMAIN,google.com,Proxy #匹配域名(交由Proxy代理服务器组)
|
||||
##- DOMAIN-SUFFIX,ad.com,REJECT #匹配域名后缀(拒绝)
|
||||
##- IP-CIDR,127.0.0.0/8,DIRECT #匹配数据目标IP(直连)
|
||||
##- SRC-IP-CIDR,192.168.1.201/32,DIRECT #匹配数据发起IP(直连)
|
||||
##- DST-PORT,80,DIRECT #匹配数据目标端口(直连)
|
||||
##- SRC-PORT,7777,DIRECT #匹配数据源端口(直连)
|
||||
|
||||
##排序在上的规则优先生效,如添加(去除规则前的#号):
|
||||
##IP段:192.168.1.2-192.168.1.200 直连
|
||||
##- SRC-IP-CIDR,192.168.1.2/31,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.4/30,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.8/29,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.16/28,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.32/27,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.64/26,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.128/26,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.192/29,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.200/32,DIRECT
|
||||
|
||||
##IP段:192.168.1.202-192.168.1.255 直连
|
||||
##- SRC-IP-CIDR,192.168.1.202/31,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.204/30,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.208/28,DIRECT
|
||||
##- SRC-IP-CIDR,192.168.1.224/27,DIRECT
|
||||
|
||||
##此时IP为192.168.1.1和192.168.1.201的客户端流量走代理(策略),其余客户端不走代理
|
||||
##因为Fake-IP模式下,IP地址为192.168.1.1的路由器自身流量可走代理(策略),所以需要排除
|
||||
|
||||
##仅设置路由器自身直连:
|
||||
##- SRC-IP-CIDR,192.168.1.1/32,DIRECT
|
||||
##- SRC-IP-CIDR,198.18.0.1/32,DIRECT
|
||||
|
||||
##DDNS
|
||||
##- DOMAIN-SUFFIX,checkip.dyndns.org,DIRECT
|
||||
##- DOMAIN-SUFFIX,checkipv6.dyndns.org,DIRECT
|
||||
##- DOMAIN-SUFFIX,checkip.synology.com,DIRECT
|
||||
##- DOMAIN-SUFFIX,ifconfig.co,DIRECT
|
||||
##- DOMAIN-SUFFIX,api.myip.com,DIRECT
|
||||
##- DOMAIN-SUFFIX,ip-api.com,DIRECT
|
||||
##- DOMAIN-SUFFIX,ipapi.co,DIRECT
|
||||
##- DOMAIN-SUFFIX,ip6.seeip.org,DIRECT
|
||||
##- DOMAIN-SUFFIX,members.3322.org,DIRECT
|
||||
|
||||
##在线IP段转CIDR地址:http://ip2cidr.com
|
@ -1,23 +0,0 @@
|
||||
script:
|
||||
## shortcuts:
|
||||
## common_port: dst_port not in [21, 22, 23, 53, 80, 123, 143, 194, 443, 465, 587, 853, 993, 995, 998, 2052, 2053, 2082, 2083, 2086, 2095, 2096, 5222, 5228, 5229, 5230, 8080, 8443, 8880, 8888, 8889]
|
||||
|
||||
## code: |
|
||||
## def main(ctx, metadata):
|
||||
## directkeywordlist = ["baidu"]
|
||||
## for directkeyword in directkeywordlist:
|
||||
## if directkeyword in metadata["host"]:
|
||||
## ctx.log('[Script] matched keyword %s use direct' % directkeyword)
|
||||
## return "DIRECT"
|
||||
|
||||
rules:
|
||||
##- SCRIPT,common_port,DIRECT #shortcuts rule
|
||||
|
||||
##- DOMAIN-SUFFIX,google.com,Proxy #匹配域名后缀(交由Proxy代理服务器组)
|
||||
##- DOMAIN-KEYWORD,google,Proxy #匹配域名关键字(交由Proxy代理服务器组)
|
||||
##- DOMAIN,google.com,Proxy #匹配域名(交由Proxy代理服务器组)
|
||||
##- DOMAIN-SUFFIX,ad.com,REJECT #匹配域名后缀(拒绝)
|
||||
##- IP-CIDR,127.0.0.0/8,DIRECT #匹配数据目标IP(直连)
|
||||
##- SRC-IP-CIDR,192.168.1.201/32,DIRECT #匹配数据发起IP(直连)
|
||||
##- DST-PORT,80,DIRECT #匹配数据目标端口(直连)
|
||||
##- SRC-PORT,7777,DIRECT #匹配数据源端口(直连)
|
@ -1,6 +0,0 @@
|
||||
force-domain:
|
||||
# - '+'
|
||||
- '+.netflix.com'
|
||||
- '+.nflxvideo.net'
|
||||
- '+.amazonaws.com'
|
||||
- '+.media.dssott.com'
|
@ -1,4 +0,0 @@
|
||||
skip-domain:
|
||||
- '+.apple.com'
|
||||
- Mijia Cloud
|
||||
- '+.jd.com'
|
@ -1,4 +0,0 @@
|
||||
port-whitelist:
|
||||
- 443
|
||||
- 80
|
||||
# - 8080-9090
|
@ -1,618 +0,0 @@
|
||||
payload:
|
||||
- 1.165.84.0/24
|
||||
- 1.165.85.0/24
|
||||
- 1.165.90.0/24
|
||||
- 5.8.200.0/24
|
||||
- 5.9.123.0/24
|
||||
- 13.73.0.0/16
|
||||
- 13.73.1.0/24
|
||||
- 13.75.114.0/24
|
||||
- 13.126.76.0/24
|
||||
- 14.18.251.72/32
|
||||
- 18.214.26.0/24
|
||||
- 24.105.28.0/24
|
||||
- 27.64.93.0/24
|
||||
- 34.235.169.0/24
|
||||
- 35.185.157.0/24
|
||||
- 35.198.200.0/24
|
||||
- 36.232.23.0/24
|
||||
- 36.232.28.0/24
|
||||
- 36.232.29.0/24
|
||||
- 37.21.10.0/24
|
||||
- 37.230.228.0/24
|
||||
- 42.113.94.0/24
|
||||
- 42.114.229.0/24
|
||||
- 43.225.199.0/24
|
||||
- 43.239.136.0/24
|
||||
- 43.241.50.0/24
|
||||
- 43.249.36.0/24
|
||||
- 45.113.137.0/24
|
||||
- 45.113.191.0/24
|
||||
- 45.119.240.0/24
|
||||
- 45.121.184.0/24
|
||||
- 45.121.185.0/24
|
||||
- 45.121.186.0/24
|
||||
- 45.121.187.0/24
|
||||
- 47.52.16.0/24
|
||||
- 47.52.17.0/24
|
||||
- 47.52.18.0/24
|
||||
- 47.52.19.0/24
|
||||
- 47.52.20.0/24
|
||||
- 47.52.21.0/24
|
||||
- 47.52.22.0/24
|
||||
- 47.52.23.0/24
|
||||
- 47.52.24.0/24
|
||||
- 47.52.25.0/24
|
||||
- 47.52.26.0/24
|
||||
- 47.52.27.0/24
|
||||
- 47.52.28.0/24
|
||||
- 47.52.29.0/24
|
||||
- 47.52.30.0/24
|
||||
- 47.52.31.0/24
|
||||
- 47.52.40.0/24
|
||||
- 47.52.41.0/24
|
||||
- 47.52.42.0/24
|
||||
- 47.52.43.0/24
|
||||
- 47.52.44.0/24
|
||||
- 47.52.45.0/24
|
||||
- 47.52.46.0/24
|
||||
- 47.52.47.0/24
|
||||
- 47.52.56.0/24
|
||||
- 47.52.57.0/24
|
||||
- 47.52.58.0/24
|
||||
- 47.52.59.0/24
|
||||
- 47.52.60.0/24
|
||||
- 47.52.61.0/24
|
||||
- 47.52.62.0/24
|
||||
- 47.52.63.0/24
|
||||
- 47.52.64.0/24
|
||||
- 47.52.65.0/24
|
||||
- 47.52.66.0/24
|
||||
- 47.52.67.0/24
|
||||
- 47.52.68.0/24
|
||||
- 47.52.69.0/24
|
||||
- 47.52.70.0/24
|
||||
- 47.52.71.0/24
|
||||
- 47.52.72.0/24
|
||||
- 47.52.73.0/24
|
||||
- 47.52.74.0/24
|
||||
- 47.52.75.0/24
|
||||
- 47.52.76.0/24
|
||||
- 47.52.77.0/24
|
||||
- 47.52.78.0/24
|
||||
- 47.52.79.0/24
|
||||
- 47.52.88.0/24
|
||||
- 47.52.89.0/24
|
||||
- 47.52.90.0/24
|
||||
- 47.52.91.0/24
|
||||
- 47.52.92.0/24
|
||||
- 47.52.93.0/24
|
||||
- 47.52.94.0/24
|
||||
- 47.52.95.0/24
|
||||
- 47.52.96.0/24
|
||||
- 47.52.97.0/24
|
||||
- 47.52.98.0/24
|
||||
- 47.52.99.0/24
|
||||
- 47.52.100.0/24
|
||||
- 47.52.101.0/24
|
||||
- 47.52.102.0/24
|
||||
- 47.52.103.0/24
|
||||
- 47.52.104.0/24
|
||||
- 47.52.105.0/24
|
||||
- 47.52.106.0/24
|
||||
- 47.52.107.0/24
|
||||
- 47.52.108.0/24
|
||||
- 47.52.109.0/24
|
||||
- 47.52.110.0/24
|
||||
- 47.52.111.0/24
|
||||
- 47.52.112.0/24
|
||||
- 47.52.113.0/24
|
||||
- 47.52.114.0/24
|
||||
- 47.52.115.0/24
|
||||
- 47.52.116.0/24
|
||||
- 47.52.117.0/24
|
||||
- 47.52.118.0/24
|
||||
- 47.52.119.0/24
|
||||
- 47.52.128.0/24
|
||||
- 47.52.129.0/24
|
||||
- 47.52.130.0/24
|
||||
- 47.52.131.0/24
|
||||
- 47.52.132.0/24
|
||||
- 47.52.133.0/24
|
||||
- 47.52.134.0/24
|
||||
- 47.52.135.0/24
|
||||
- 47.52.136.0/24
|
||||
- 47.52.137.0/24
|
||||
- 47.52.138.0/24
|
||||
- 47.52.139.0/24
|
||||
- 47.52.140.0/24
|
||||
- 47.52.141.0/24
|
||||
- 47.52.142.0/24
|
||||
- 47.52.143.0/24
|
||||
- 47.52.144.0/24
|
||||
- 47.52.145.0/24
|
||||
- 47.52.146.0/24
|
||||
- 47.52.147.0/24
|
||||
- 47.52.148.0/24
|
||||
- 47.52.149.0/24
|
||||
- 47.52.150.0/24
|
||||
- 47.52.151.0/24
|
||||
- 47.52.152.0/24
|
||||
- 47.52.153.0/24
|
||||
- 47.52.154.0/24
|
||||
- 47.52.155.0/24
|
||||
- 47.52.156.0/24
|
||||
- 47.52.157.0/24
|
||||
- 47.52.158.0/24
|
||||
- 47.52.159.0/24
|
||||
- 47.52.160.0/24
|
||||
- 47.52.161.0/24
|
||||
- 47.52.162.0/24
|
||||
- 47.52.163.0/24
|
||||
- 47.52.164.0/24
|
||||
- 47.52.165.0/24
|
||||
- 47.52.166.0/24
|
||||
- 47.52.167.0/24
|
||||
- 47.52.168.0/24
|
||||
- 47.52.169.0/24
|
||||
- 47.52.170.0/24
|
||||
- 47.52.171.0/24
|
||||
- 47.52.172.0/24
|
||||
- 47.52.173.0/24
|
||||
- 47.52.174.0/24
|
||||
- 47.52.175.0/24
|
||||
- 47.52.188.0/24
|
||||
- 47.52.190.0/24
|
||||
- 47.52.191.0/24
|
||||
- 47.52.192.0/24
|
||||
- 47.52.193.0/24
|
||||
- 47.52.194.0/24
|
||||
- 47.52.195.0/24
|
||||
- 47.52.196.0/24
|
||||
- 47.52.197.0/24
|
||||
- 47.52.198.0/24
|
||||
- 47.52.199.0/24
|
||||
- 47.52.200.0/24
|
||||
- 47.52.201.0/24
|
||||
- 47.52.202.0/24
|
||||
- 47.52.203.0/24
|
||||
- 47.52.204.0/24
|
||||
- 47.52.205.0/24
|
||||
- 47.52.206.0/24
|
||||
- 47.52.207.0/24
|
||||
- 47.52.208.0/24
|
||||
- 47.52.209.0/24
|
||||
- 47.52.224.0/24
|
||||
- 47.52.225.0/24
|
||||
- 47.52.226.0/24
|
||||
- 47.52.228.0/24
|
||||
- 47.52.230.0/24
|
||||
- 47.52.231.0/24
|
||||
- 47.52.232.0/24
|
||||
- 47.52.234.0/24
|
||||
- 47.52.235.0/24
|
||||
- 47.52.236.0/24
|
||||
- 47.52.241.0/24
|
||||
- 47.52.242.0/24
|
||||
- 47.52.244.0/24
|
||||
- 47.52.246.0/24
|
||||
- 47.52.247.0/24
|
||||
- 47.52.248.0/24
|
||||
- 47.52.249.0/24
|
||||
- 47.52.250.0/24
|
||||
- 47.52.251.0/24
|
||||
- 47.52.252.0/24
|
||||
- 47.52.253.0/24
|
||||
- 47.52.254.0/24
|
||||
- 47.52.255.0/24
|
||||
- 47.74.1.0/24
|
||||
- 47.75.3.0/24
|
||||
- 47.75.5.0/24
|
||||
- 47.75.94.0/24
|
||||
- 47.75.98.0/24
|
||||
- 47.75.143.0/24
|
||||
- 47.75.194.0/24
|
||||
- 47.75.207.0/24
|
||||
- 47.75.219.0/24
|
||||
- 47.89.8.0/24
|
||||
- 47.89.9.0/24
|
||||
- 47.89.10.0/24
|
||||
- 47.89.11.0/24
|
||||
- 47.89.12.0/24
|
||||
- 47.89.13.0/24
|
||||
- 47.89.14.0/24
|
||||
- 47.89.15.0/24
|
||||
- 47.89.16.0/24
|
||||
- 47.89.17.0/24
|
||||
- 47.89.18.0/24
|
||||
- 47.89.19.0/24
|
||||
- 47.89.20.0/24
|
||||
- 47.89.21.0/24
|
||||
- 47.89.22.0/24
|
||||
- 47.89.23.0/24
|
||||
- 47.90.8.0/24
|
||||
- 47.90.90.0/24
|
||||
- 47.90.96.0/24
|
||||
- 47.90.97.0/24
|
||||
- 47.90.98.0/24
|
||||
- 47.90.99.0/24
|
||||
- 47.90.100.0/24
|
||||
- 47.90.101.0/24
|
||||
- 47.90.102.0/24
|
||||
- 47.90.103.0/24
|
||||
- 47.90.120.0/24
|
||||
- 47.90.121.0/24
|
||||
- 47.90.122.0/24
|
||||
- 47.90.123.0/24
|
||||
- 47.90.124.0/24
|
||||
- 47.90.125.0/24
|
||||
- 47.90.126.0/24
|
||||
- 47.90.127.0/24
|
||||
- 47.90.214.0/24
|
||||
- 47.91.152.0/24
|
||||
- 47.91.153.0/24
|
||||
- 47.91.154.0/24
|
||||
- 47.91.155.0/24
|
||||
- 47.91.156.0/24
|
||||
- 47.91.157.0/24
|
||||
- 47.91.158.0/24
|
||||
- 47.91.159.0/24
|
||||
- 47.91.207.0/24
|
||||
- 47.91.208.0/24
|
||||
- 47.91.209.0/24
|
||||
- 47.91.210.0/24
|
||||
- 47.91.211.0/24
|
||||
- 47.91.212.0/24
|
||||
- 47.91.213.0/24
|
||||
- 47.91.214.0/24
|
||||
- 47.91.215.0/24
|
||||
- 47.91.216.0/24
|
||||
- 47.91.217.0/24
|
||||
- 47.91.218.0/24
|
||||
- 47.91.219.0/24
|
||||
- 47.91.220.0/24
|
||||
- 47.91.221.0/24
|
||||
- 47.91.224.0/24
|
||||
- 47.91.225.0/24
|
||||
- 47.91.226.0/24
|
||||
- 47.91.227.0/24
|
||||
- 47.91.228.0/24
|
||||
- 47.91.229.0/24
|
||||
- 47.91.230.0/24
|
||||
- 47.91.231.0/24
|
||||
- 47.91.232.0/24
|
||||
- 47.91.233.0/24
|
||||
- 47.91.234.0/24
|
||||
- 47.91.235.0/24
|
||||
- 47.91.236.0/24
|
||||
- 47.91.237.0/24
|
||||
- 47.91.238.0/24
|
||||
- 47.91.239.0/24
|
||||
- 47.91.240.0/24
|
||||
- 47.91.241.0/24
|
||||
- 47.91.242.0/24
|
||||
- 47.91.243.0/24
|
||||
- 47.91.244.0/24
|
||||
- 47.91.245.0/24
|
||||
- 47.91.246.0/24
|
||||
- 47.91.247.0/24
|
||||
- 47.91.248.0/24
|
||||
- 47.91.249.0/24
|
||||
- 47.91.250.0/24
|
||||
- 47.91.251.0/24
|
||||
- 47.91.252.0/24
|
||||
- 47.91.253.0/24
|
||||
- 47.91.254.0/24
|
||||
- 47.91.255.0/24
|
||||
- 47.96.0.0/16
|
||||
- 47.96.2.0/24
|
||||
- 47.96.3.0/24
|
||||
- 47.96.5.0/24
|
||||
- 47.96.6.0/24
|
||||
- 47.96.7.0/24
|
||||
- 47.96.8.0/24
|
||||
- 47.96.9.0/24
|
||||
- 47.96.10.0/24
|
||||
- 47.96.12.0/24
|
||||
- 47.96.13.0/24
|
||||
- 47.96.14.0/24
|
||||
- 47.99.33.0/24
|
||||
- 47.99.38.0/24
|
||||
- 47.99.44.0/24
|
||||
- 47.99.62.0/24
|
||||
- 47.99.73.0/24
|
||||
- 47.99.75.0/24
|
||||
- 47.99.76.0/24
|
||||
- 47.99.81.0/24
|
||||
- 47.99.84.0/24
|
||||
- 47.99.89.0/24
|
||||
- 47.99.90.0/24
|
||||
- 47.99.93.0/24
|
||||
- 47.99.95.0/24
|
||||
- 47.99.98.0/24
|
||||
- 47.99.99.0/24
|
||||
- 47.99.101.0/24
|
||||
- 47.99.103.0/24
|
||||
- 47.99.104.0/24
|
||||
- 47.99.107.0/24
|
||||
- 47.99.111.0/24
|
||||
- 47.99.120.0/24
|
||||
- 47.99.128.0/24
|
||||
- 47.99.159.0/24
|
||||
- 47.99.161.0/24
|
||||
- 47.99.164.0/24
|
||||
- 47.99.166.0/24
|
||||
- 47.99.169.0/24
|
||||
- 47.110.42.0/24
|
||||
- 47.244.1.0/24
|
||||
- 47.244.2.0/24
|
||||
- 47.244.3.0/24
|
||||
- 47.244.5.0/24
|
||||
- 47.244.7.0/24
|
||||
- 47.244.10.0/24
|
||||
- 47.244.11.0/24
|
||||
- 47.244.12.0/24
|
||||
- 47.244.13.0/24
|
||||
- 47.244.14.0/24
|
||||
- 47.244.15.0/24
|
||||
- 47.244.16.0/24
|
||||
- 47.244.17.0/24
|
||||
- 47.244.18.0/24
|
||||
- 47.244.19.0/24
|
||||
- 47.244.21.0/24
|
||||
- 47.244.22.0/24
|
||||
- 47.244.24.0/24
|
||||
- 47.244.25.0/24
|
||||
- 47.244.26.0/24
|
||||
- 47.244.33.0/24
|
||||
- 47.244.35.0/24
|
||||
- 47.244.36.0/24
|
||||
- 47.244.37.0/24
|
||||
- 47.244.43.0/24
|
||||
- 47.244.44.0/24
|
||||
- 47.244.48.0/24
|
||||
- 47.244.51.0/24
|
||||
- 47.244.56.0/24
|
||||
- 52.53.89.0/24
|
||||
- 52.63.114.0/24
|
||||
- 52.64.199.0/24
|
||||
- 52.90.185.0/24
|
||||
- 52.175.16.0/24
|
||||
- 52.175.31.0/24
|
||||
- 52.207.236.0/24
|
||||
- 52.229.154.0/24
|
||||
- 52.229.160.0/24
|
||||
- 52.229.161.0/24
|
||||
- 54.66.223.0/24
|
||||
- 54.158.198.0/24
|
||||
- 54.164.19.0/24
|
||||
- 54.169.27.0/24
|
||||
- 54.209.147.0/24
|
||||
- 58.153.0.0/16
|
||||
- 58.153.19.0/24
|
||||
- 58.153.171.0/24
|
||||
- 58.153.208.0/24
|
||||
- 58.153.209.0/24
|
||||
- 58.153.221.0/24
|
||||
- 58.176.80.0/24
|
||||
- 58.177.181.0/24
|
||||
- 58.215.54.0/24
|
||||
- 58.221.252.0/24
|
||||
- 59.16.249.0/24
|
||||
- 59.127.115.0/24
|
||||
- 59.149.239.0/24
|
||||
- 60.248.89.0/24
|
||||
- 61.80.89.0/24
|
||||
- 61.84.148.0/24
|
||||
- 61.155.210.0/24
|
||||
- 61.216.2.0/24
|
||||
- 61.216.34.0/24
|
||||
- 61.216.146.0/24
|
||||
- 61.238.35.0/24
|
||||
- 61.239.213.0/24
|
||||
- 61.239.223.0/24
|
||||
- 74.91.112.0/24
|
||||
- 74.201.99.0/24
|
||||
- 87.98.228.0/24
|
||||
- 88.82.185.0/24
|
||||
- 90.188.238.0/24
|
||||
- 94.245.155.0/24
|
||||
- 95.154.88.0/24
|
||||
- 95.154.113.0/24
|
||||
- 95.172.92.0/24
|
||||
- 95.183.13.0/24
|
||||
- 103.9.89.0/24
|
||||
- 103.10.124.0/24
|
||||
- 103.10.125.0/24
|
||||
- 103.16.27.0/24
|
||||
- 103.28.54.0/24
|
||||
- 103.28.55.0/24
|
||||
- 103.36.208.0/24
|
||||
- 103.44.160.0/24
|
||||
- 103.57.72.0/24
|
||||
- 103.58.149.0/24
|
||||
- 103.60.126.0/24
|
||||
- 103.62.48.0/24
|
||||
- 103.89.90.0/24
|
||||
- 103.207.36.0/24
|
||||
- 103.222.20.0/24
|
||||
- 103.231.163.0/24
|
||||
- 103.232.85.0/24
|
||||
- 103.241.165.0/24
|
||||
- 103.244.2.0/24
|
||||
- 103.254.153.0/24
|
||||
- 104.199.166.0/24
|
||||
- 104.236.115.0/24
|
||||
- 107.21.14.0/24
|
||||
- 110.42.10.0/24
|
||||
- 110.173.58.0/24
|
||||
- 111.91.236.0/24
|
||||
- 111.231.11.0/24
|
||||
- 111.253.47.0/24
|
||||
- 111.253.49.0/24
|
||||
- 111.253.50.0/24
|
||||
- 111.253.52.0/24
|
||||
- 111.253.55.0/24
|
||||
- 112.118.44.0/24
|
||||
- 112.118.193.0/24
|
||||
- 113.160.204.0/24
|
||||
- 113.190.242.0/24
|
||||
- 114.46.16.0/24
|
||||
- 114.46.20.0/24
|
||||
- 114.46.21.0/24
|
||||
- 114.46.22.0/24
|
||||
- 114.46.24.0/24
|
||||
- 114.46.30.0/24
|
||||
- 114.167.236.0/24
|
||||
- 115.230.127.0/24
|
||||
- 115.231.221.0/24
|
||||
- 115.231.223.0/24
|
||||
- 116.31.123.0/24
|
||||
- 116.49.214.0/24
|
||||
- 116.122.109.0/24
|
||||
- 116.251.223.0/24
|
||||
- 118.107.76.0/24
|
||||
- 119.28.222.0/24
|
||||
- 119.197.57.0/24
|
||||
- 119.236.132.0/24
|
||||
- 119.237.11.0/24
|
||||
- 120.72.85.0/24
|
||||
- 123.31.20.0/24
|
||||
- 123.194.52.0/24
|
||||
- 124.158.10.0/24
|
||||
- 124.228.91.0/24
|
||||
- 125.212.211.0/24
|
||||
- 125.212.226.0/24
|
||||
- 125.226.128.0/24
|
||||
- 125.253.124.0/24
|
||||
- 128.199.81.0/24
|
||||
- 132.232.7.0/24
|
||||
- 132.232.9.0/24
|
||||
- 132.232.12.0/24
|
||||
- 132.232.29.0/24
|
||||
- 132.232.51.0/24
|
||||
- 132.232.55.0/24
|
||||
- 132.232.57.0/24
|
||||
- 132.232.61.0/24
|
||||
- 132.232.62.0/24
|
||||
- 132.232.75.0/24
|
||||
- 132.232.91.0/24
|
||||
- 132.232.94.0/24
|
||||
- 132.232.99.0/24
|
||||
- 132.232.104.0/24
|
||||
- 133.130.123.0/24
|
||||
- 138.19.63.0/24
|
||||
- 139.99.9.0/24
|
||||
- 139.99.104.0/24
|
||||
- 139.99.119.0/24
|
||||
- 139.162.55.0/24
|
||||
- 146.66.152.0/24
|
||||
- 146.66.153.0/24
|
||||
- 146.66.154.0/24
|
||||
- 146.66.155.0/24
|
||||
- 146.66.156.0/24
|
||||
- 146.66.157.0/24
|
||||
- 146.66.158.0/24
|
||||
- 146.66.159.0/24
|
||||
- 150.109.40.0/24
|
||||
- 151.80.60.0/24
|
||||
- 151.80.145.0/24
|
||||
- 152.111.192.0/24
|
||||
- 153.160.25.0/24
|
||||
- 153.254.86.0/24
|
||||
- 155.133.227.0/24
|
||||
- 155.133.230.0/24
|
||||
- 155.133.232.0/24
|
||||
- 155.133.233.0/24
|
||||
- 155.133.235.0/24
|
||||
- 155.133.238.0/24
|
||||
- 155.133.239.0/24
|
||||
- 155.133.242.0/24
|
||||
- 155.133.244.0/24
|
||||
- 155.133.245.0/24
|
||||
- 155.133.246.0/24
|
||||
- 155.133.247.0/24
|
||||
- 155.133.248.0/24
|
||||
- 155.133.249.0/24
|
||||
- 155.133.252.0/24
|
||||
- 155.133.253.0/24
|
||||
- 155.133.254.0/24
|
||||
- 159.28.159.0/24
|
||||
- 161.202.44.0/24
|
||||
- 162.254.192.0/24
|
||||
- 162.254.193.0/24
|
||||
- 162.254.194.0/24
|
||||
- 162.254.195.0/24
|
||||
- 162.254.196.0/24
|
||||
- 162.254.197.0/24
|
||||
- 162.254.198.0/24
|
||||
- 162.254.199.0/24
|
||||
- 163.53.149.0/24
|
||||
- 169.254.0.0/16
|
||||
- 169.254.125.95/32
|
||||
- 169.254.10.218/32
|
||||
- 175.210.83.0/24
|
||||
- 176.215.255.0/24
|
||||
- 180.149.95.0/24
|
||||
- 180.177.178.0/24
|
||||
- 182.171.230.0/24
|
||||
- 182.176.65.0/24
|
||||
- 183.60.111.0/24
|
||||
- 183.179.66.0/24
|
||||
- 185.25.60.0/24
|
||||
- 185.25.180.0/24
|
||||
- 185.25.181.0/24
|
||||
- 185.25.182.0/24
|
||||
- 185.25.183.0/24
|
||||
- 185.37.216.0/24
|
||||
- 185.62.205.0/24
|
||||
- 185.113.141.0/24
|
||||
- 190.217.33.0/24
|
||||
- 192.69.96.0/24
|
||||
- 192.69.97.0/24
|
||||
- 193.33.176.0/24
|
||||
- 195.14.118.0/24
|
||||
- 195.201.246.0/24
|
||||
- 196.38.180.0/24
|
||||
- 197.80.200.0/24
|
||||
- 198.27.83.0/24
|
||||
- 202.21.115.0/24
|
||||
- 203.175.163.0/24
|
||||
- 203.175.164.0/24
|
||||
- 203.175.165.0/24
|
||||
- 203.175.166.0/24
|
||||
- 203.218.101.0/24
|
||||
- 205.185.194.0/24
|
||||
- 205.196.6.0/24
|
||||
- 208.64.200.0/24
|
||||
- 208.64.203.0/24
|
||||
- 208.78.164.0/24
|
||||
- 208.78.165.0/24
|
||||
- 208.78.166.0/24
|
||||
- 209.58.164.0/24
|
||||
- 209.58.168.0/24
|
||||
- 209.58.178.0/24
|
||||
- 209.58.188.0/24
|
||||
- 210.211.124.0/24
|
||||
- 211.21.37.0/24
|
||||
- 211.48.69.0/24
|
||||
- 211.75.181.0/24
|
||||
- 212.64.32.0/24
|
||||
- 216.52.148.0/24
|
||||
- 217.150.77.0/24
|
||||
- 218.250.12.0/24
|
||||
- 218.250.15.0/24
|
||||
- 218.250.113.0/24
|
||||
- 218.255.3.0/24
|
||||
- 220.80.129.0/24
|
||||
- 220.134.154.0/24
|
||||
- 220.135.180.0/24
|
||||
- 220.169.242.0/24
|
||||
- 220.170.89.0/24
|
||||
- 221.6.100.0/24
|
||||
- 222.102.95.0/24
|
||||
- 222.112.242.0/24
|
||||
- 222.186.50.0/24
|
||||
- 222.187.224.0/24
|
||||
- 224.0.0.0/4
|
||||
- 240.0.0.0/4
|
@ -1,294 +0,0 @@
|
||||
payload:
|
||||
- 2.16.0.0/16
|
||||
- 2.17.0.0/16
|
||||
- 2.18.0.0/16
|
||||
- 2.19.0.0/16
|
||||
- 2.20.0.0/16
|
||||
- 2.21.0.0/16
|
||||
- 2.22.0.0/16
|
||||
- 2.23.0.0/16
|
||||
- 8.7.0.0/16
|
||||
- 14.21.0.0/16
|
||||
- 23.0.0.0/4
|
||||
- 23.1.0.0/16
|
||||
- 23.2.0.0/16
|
||||
- 23.3.0.0/16
|
||||
- 23.4.0.0/16
|
||||
- 23.5.0.0/16
|
||||
- 23.7.0.0/16
|
||||
- 23.8.0.0/16
|
||||
- 23.9.0.0/16
|
||||
- 23.11.0.0/16
|
||||
- 23.12.0.0/16
|
||||
- 23.13.0.0/16
|
||||
- 23.14.0.0/16
|
||||
- 23.15.0.0/16
|
||||
- 23.32.0.0/16
|
||||
- 23.33.0.0/16
|
||||
- 23.34.0.0/16
|
||||
- 23.35.0.0/16
|
||||
- 23.36.0.0/16
|
||||
- 23.37.0.0/16
|
||||
- 23.38.0.0/16
|
||||
- 23.39.0.0/16
|
||||
- 23.40.0.0/16
|
||||
- 23.41.0.0/16
|
||||
- 23.42.0.0/16
|
||||
- 23.44.0.0/16
|
||||
- 23.45.0.0/16
|
||||
- 23.46.0.0/16
|
||||
- 23.48.0.0/16
|
||||
- 23.49.0.0/16
|
||||
- 23.50.0.0/16
|
||||
- 23.51.0.0/16
|
||||
- 23.52.0.0/16
|
||||
- 23.53.0.0/16
|
||||
- 23.54.0.0/16
|
||||
- 23.55.0.0/16
|
||||
- 23.56.0.0/16
|
||||
- 23.57.0.0/16
|
||||
- 23.58.0.0/16
|
||||
- 23.59.0.0/16
|
||||
- 23.60.0.0/16
|
||||
- 23.61.0.0/16
|
||||
- 23.62.0.0/16
|
||||
- 23.63.0.0/16
|
||||
- 23.64.0.0/16
|
||||
- 23.65.0.0/16
|
||||
- 23.67.0.0/16
|
||||
- 23.72.0.0/16
|
||||
- 23.73.0.0/16
|
||||
- 23.74.0.0/16
|
||||
- 23.75.0.0/16
|
||||
- 23.76.0.0/16
|
||||
- 23.77.0.0/16
|
||||
- 23.78.0.0/16
|
||||
- 23.79.0.0/16
|
||||
- 23.192.0.0/16
|
||||
- 23.193.0.0/16
|
||||
- 23.194.0.0/16
|
||||
- 23.196.0.0/16
|
||||
- 23.197.0.0/16
|
||||
- 23.198.0.0/16
|
||||
- 23.199.0.0/16
|
||||
- 23.200.0.0/16
|
||||
- 23.201.0.0/16
|
||||
- 23.202.0.0/16
|
||||
- 23.203.0.0/16
|
||||
- 23.204.0.0/16
|
||||
- 23.205.0.0/16
|
||||
- 23.206.0.0/16
|
||||
- 23.207.0.0/16
|
||||
- 23.208.0.0/16
|
||||
- 23.209.0.0/16
|
||||
- 23.210.0.0/16
|
||||
- 23.211.0.0/16
|
||||
- 23.212.0.0/16
|
||||
- 23.213.0.0/16
|
||||
- 23.214.0.0/16
|
||||
- 23.215.0.0/16
|
||||
- 23.216.0.0/16
|
||||
- 23.217.0.0/16
|
||||
- 23.218.0.0/16
|
||||
- 23.219.0.0/16
|
||||
- 23.220.0.0/16
|
||||
- 23.221.0.0/16
|
||||
- 23.222.0.0/16
|
||||
- 23.223.0.0/16
|
||||
- 31.0.0.0/4
|
||||
- 31.13.0.0/16
|
||||
- 37.10.0.0/16
|
||||
- 45.121.0.0/16
|
||||
- 45.121.184.0/24
|
||||
- 45.121.186.0/24
|
||||
- 46.0.0.0/4
|
||||
- 59.0.0.0/4
|
||||
- 60.254.0.0/16
|
||||
- 61.213.0.0/16
|
||||
- 63.146.0.0/16
|
||||
- 63.219.0.0/16
|
||||
- 63.243.0.0/16
|
||||
- 64.0.0.0/4
|
||||
- 64.124.0.0/16
|
||||
- 65.152.0.0/16
|
||||
- 65.158.0.0/16
|
||||
- 66.0.0.0/4
|
||||
- 67.0.0.0/4
|
||||
- 67.131.0.0/16
|
||||
- 69.0.0.0/4
|
||||
- 69.16.0.0/16
|
||||
- 69.63.0.0/16
|
||||
- 69.171.0.0/16
|
||||
- 69.192.0.0/16
|
||||
- 72.165.0.0/16
|
||||
- 72.246.0.0/16
|
||||
- 72.247.0.0/16
|
||||
- 74.0.0.0/4
|
||||
- 74.86.0.0/16
|
||||
- 74.201.0.0/16
|
||||
- 75.0.0.0/4
|
||||
- 75.126.0.0/16
|
||||
- 78.16.0.0/16
|
||||
- 84.53.0.0/16
|
||||
- 85.190.0.0/16
|
||||
- 88.0.0.0/4
|
||||
- 88.221.0.0/16
|
||||
- 92.122.0.0/16
|
||||
- 92.123.0.0/16
|
||||
- 95.100.0.0/16
|
||||
- 95.101.0.0/16
|
||||
- 96.0.0.0/4
|
||||
- 96.6.0.0/16
|
||||
- 96.16.0.0/16
|
||||
- 96.17.0.0/16
|
||||
- 103.10.124.0/24
|
||||
- 103.28.0.0/16
|
||||
- 103.28.54.0/24
|
||||
- 103.74.0.0/16
|
||||
- 104.0.0.0/4
|
||||
- 104.65.0.0/16
|
||||
- 104.66.0.0/16
|
||||
- 104.67.0.0/16
|
||||
- 104.68.0.0/16
|
||||
- 104.70.0.0/16
|
||||
- 104.71.0.0/16
|
||||
- 104.72.0.0/16
|
||||
- 104.73.0.0/16
|
||||
- 104.75.0.0/16
|
||||
- 104.76.0.0/16
|
||||
- 104.77.0.0/16
|
||||
- 104.79.0.0/16
|
||||
- 104.80.0.0/16
|
||||
- 104.81.0.0/16
|
||||
- 104.82.0.0/16
|
||||
- 104.83.0.0/16
|
||||
- 104.84.0.0/16
|
||||
- 104.85.0.0/16
|
||||
- 104.86.0.0/16
|
||||
- 104.87.0.0/16
|
||||
- 104.89.0.0/16
|
||||
- 104.90.0.0/16
|
||||
- 104.91.0.0/16
|
||||
- 104.92.0.0/16
|
||||
- 104.94.0.0/16
|
||||
- 104.95.0.0/16
|
||||
- 104.97.0.0/16
|
||||
- 104.98.0.0/16
|
||||
- 104.100.0.0/16
|
||||
- 104.101.0.0/16
|
||||
- 104.102.0.0/16
|
||||
- 104.103.0.0/16
|
||||
- 104.104.0.0/16
|
||||
- 104.105.0.0/16
|
||||
- 104.106.0.0/16
|
||||
- 104.107.0.0/16
|
||||
- 104.108.0.0/16
|
||||
- 104.109.0.0/16
|
||||
- 104.110.0.0/16
|
||||
- 104.111.0.0/16
|
||||
- 104.112.0.0/16
|
||||
- 104.113.0.0/16
|
||||
- 104.115.0.0/16
|
||||
- 104.116.0.0/16
|
||||
- 104.117.0.0/16
|
||||
- 104.118.0.0/16
|
||||
- 104.119.0.0/16
|
||||
- 104.120.0.0/16
|
||||
- 104.121.0.0/16
|
||||
- 104.122.0.0/16
|
||||
- 104.123.0.0/16
|
||||
- 104.124.0.0/16
|
||||
- 104.126.0.0/16
|
||||
- 104.127.0.0/16
|
||||
- 106.15.0.0/16
|
||||
- 110.45.0.0/16
|
||||
- 115.223.0.0/16
|
||||
- 117.103.0.0/16
|
||||
- 118.155.0.0/16
|
||||
- 118.214.0.0/16
|
||||
- 118.215.0.0/16
|
||||
- 120.24.184.25/32
|
||||
- 121.156.0.0/16
|
||||
- 122.252.0.0/16
|
||||
- 125.56.0.0/16
|
||||
- 125.252.0.0/16
|
||||
- 128.241.0.0/16
|
||||
- 139.175.0.0/16
|
||||
- 141.0.0.0/4
|
||||
- 146.66.0.0/16
|
||||
- 152.199.0.0/16
|
||||
- 153.254.0.0/16
|
||||
- 153.254.86.0/24
|
||||
- 155.133.0.0/16
|
||||
- 155.133.232.0/24
|
||||
- 155.133.233.0/24
|
||||
- 155.133.234.0/24
|
||||
- 155.133.235.0/24
|
||||
- 155.133.239.0/24
|
||||
- 155.133.244.0/24
|
||||
- 155.133.253.0/24
|
||||
- 155.133.254.0/24
|
||||
- 162.254.0.0/16
|
||||
- 162.254.192.0/24
|
||||
- 162.254.193.0/24
|
||||
- 162.254.194.0/24
|
||||
- 162.254.199.0/24
|
||||
- 165.254.0.0/16
|
||||
- 172.0.0.0/4
|
||||
- 172.224.0.0/16
|
||||
- 172.226.0.0/16
|
||||
- 172.227.0.0/16
|
||||
- 172.228.0.0/16
|
||||
- 172.229.0.0/16
|
||||
- 172.230.0.0/16
|
||||
- 172.231.0.0/16
|
||||
- 173.0.0.0/4
|
||||
- 173.197.0.0/16
|
||||
- 173.205.0.0/16
|
||||
- 173.222.0.0/16
|
||||
- 173.223.0.0/16
|
||||
- 173.252.0.0/16
|
||||
- 174.36.0.0/16
|
||||
- 175.99.0.0/16
|
||||
- 175.139.0.0/16
|
||||
- 180.101.192.0/24
|
||||
- 182.162.0.0/16
|
||||
- 184.0.0.0/4
|
||||
- 184.24.0.0/16
|
||||
- 184.25.0.0/16
|
||||
- 184.26.0.0/16
|
||||
- 184.29.0.0/16
|
||||
- 184.30.0.0/16
|
||||
- 184.31.0.0/16
|
||||
- 184.50.0.0/16
|
||||
- 184.51.0.0/16
|
||||
- 184.84.0.0/16
|
||||
- 184.85.0.0/16
|
||||
- 184.87.0.0/16
|
||||
- 185.25.0.0/16
|
||||
- 185.27.0.0/16
|
||||
- 185.88.0.0/16
|
||||
- 192.69.96.0/24
|
||||
- 192.81.0.0/16
|
||||
- 198.87.0.0/16
|
||||
- 198.172.0.0/16
|
||||
- 199.0.0.0/4
|
||||
- 199.239.0.0/16
|
||||
- 203.69.0.0/16
|
||||
- 203.80.149.0/24
|
||||
- 205.186.0.0/16
|
||||
- 205.196.6.0/24
|
||||
- 205.197.0.0/16
|
||||
- 208.0.0.0/4
|
||||
- 208.64.0.0/16
|
||||
- 208.64.200.0/24
|
||||
- 208.78.0.0/16
|
||||
- 208.78.164.0/24
|
||||
- 208.78.166.0/24
|
||||
- 208.78.167.0/24
|
||||
- 209.170.0.0/16
|
||||
- 210.61.0.0/16
|
||||
- 210.201.0.0/16
|
||||
- 216.3.0.0/16
|
||||
- 216.156.0.0/16
|
||||
- 223.119.0.0/16
|
@ -1,133 +0,0 @@
|
||||
payload:
|
||||
- 96.7.54.0/24
|
||||
- 96.17.68.0/24
|
||||
- 95.101.58.0/24
|
||||
- 92.123.234.0/24
|
||||
- 72.249.197.0/24
|
||||
- 72.247.118.0/24
|
||||
- 75.126.208.0/20
|
||||
- 69.192.4.0/24
|
||||
- 61.213.189.0/24
|
||||
- 61.213.168.0/24
|
||||
- 23.9.186.0/24
|
||||
- 23.9.179.0/24
|
||||
- 23.9.117.0/24
|
||||
- 23.77.27.0/24
|
||||
- 23.77.18.0/24
|
||||
- 23.76.210.0/24
|
||||
- 23.75.104.0/24
|
||||
- 23.67.53.0/24
|
||||
- 23.67.189.0/24
|
||||
- 23.66.135.0/24
|
||||
- 23.62.226.0/24
|
||||
- 23.61.244.0/24
|
||||
- 23.61.195.0/24
|
||||
- 23.57.66.0/24
|
||||
- 23.56.108.0/24
|
||||
- 23.55.56.0/24
|
||||
- 23.55.47.0/24
|
||||
- 23.55.37.0/24
|
||||
- 23.52.74.0/24
|
||||
- 23.52.171.0/24
|
||||
- 23.50.232.0/24
|
||||
- 23.5.229.0/24
|
||||
- 23.48.201.0/24
|
||||
- 23.47.143.0/24
|
||||
- 23.46.16.0/24
|
||||
- 23.46.147.0/24
|
||||
- 23.45.51.0/24
|
||||
- 23.45.127.0/24
|
||||
- 23.44.51.0/24
|
||||
- 23.44.172.0/24
|
||||
- 23.44.17.0/24
|
||||
- 23.43.49.0/24
|
||||
- 23.42.74.0/24
|
||||
- 23.37.126.0/24
|
||||
- 23.36.111.0/24
|
||||
- 23.34.96.0/24
|
||||
- 23.33.178.0/24
|
||||
- 23.33.151.0/24
|
||||
- 23.32.255.0/24
|
||||
- 23.32.248.0/24
|
||||
- 23.32.241.0/24
|
||||
- 23.219.172.0/24
|
||||
- 23.218.94.0/24
|
||||
- 23.218.5.0/24
|
||||
- 23.218.24.0/24
|
||||
- 23.215.188.0/24
|
||||
- 23.211.136.0/24
|
||||
- 23.211.117.0/24
|
||||
- 23.211.108.0/24
|
||||
- 23.210.215.0/24
|
||||
- 23.204.57.0/24
|
||||
- 23.204.147.0/24
|
||||
- 23.200.74.0/24
|
||||
- 23.2.16.0/24
|
||||
- 23.199.34.0/24
|
||||
- 23.198.137.0/24
|
||||
- 23.198.136.0/24
|
||||
- 23.198.103.0/24
|
||||
- 23.192.168.0/24
|
||||
- 23.192.119.0/24
|
||||
- 23.15.4.0/24
|
||||
- 23.12.40.0/24
|
||||
- 23.1.237.0/24
|
||||
- 23.1.236.0/24
|
||||
- 23.1.234.0/24
|
||||
- 23.7.208.0/20
|
||||
- 223.119.50.0/24
|
||||
- 223.119.248.0/24
|
||||
- 220.90.198.0/24
|
||||
- 219.76.10.0/24
|
||||
- 203.74.140.0/24
|
||||
- 203.69.141.0/24
|
||||
- 202.4.185.0/24
|
||||
- 2.21.98.0/24
|
||||
- 2.20.27.0/24
|
||||
- 189.6.45.0/24
|
||||
- 184.87.133.0/24
|
||||
- 184.86.250.0/24
|
||||
- 184.51.198.0/24
|
||||
- 184.51.183.0/24
|
||||
- 184.50.26.0/24
|
||||
- 184.31.165.0/24
|
||||
- 184.28.223.0/24
|
||||
- 184.28.218.0/24
|
||||
- 184.27.20.0/24
|
||||
- 184.26.194.0/24
|
||||
- 184.24.58.0/24
|
||||
- 184.150.58.0/24
|
||||
- 184.150.154.0/24
|
||||
- 175.207.14.0/24
|
||||
- 172.217.0.0/16
|
||||
- 172.232.19.0/24
|
||||
- 139.175.236.0/24
|
||||
- 125.56.201.0/24
|
||||
- 125.252.224.0/24
|
||||
- 119.56.4.0/24
|
||||
- 119.207.66.0/24
|
||||
- 119.207.64.0/24
|
||||
- 104.88.23.0/24
|
||||
- 104.84.150.0/24
|
||||
- 104.84.160.0/19
|
||||
- 104.81.21.0/24
|
||||
- 104.76.86.0/24
|
||||
- 104.76.172.0/24
|
||||
- 104.75.169.0/24
|
||||
- 104.74.47.0/24
|
||||
- 104.74.30.0/24
|
||||
- 104.74.214.0/24
|
||||
- 104.74.209.0/24
|
||||
- 104.71.139.0/24
|
||||
- 104.64.155.0/24
|
||||
- 104.250.32.0/23
|
||||
- 104.254.123.0/24
|
||||
- 104.127.4.0/24
|
||||
- 104.124.248.0/24
|
||||
- 104.124.233.0/24
|
||||
- 104.124.232.0/24
|
||||
- 104.122.6.0/24
|
||||
- 104.120.11.0/24
|
||||
- 104.116.243.0/24
|
||||
- 104.110.72.0/24
|
||||
- 153.254.86.0/24
|
@ -1,4 +0,0 @@
|
||||
payload:
|
||||
# > ABC
|
||||
- DOMAIN-SUFFIX,edgedatg.com
|
||||
- DOMAIN-SUFFIX,go.com
|
@ -1,10 +0,0 @@
|
||||
payload:
|
||||
# > AbemaTV
|
||||
# - USER-AGENT,AbemaTV*
|
||||
- PROCESS-NAME,tv.abema
|
||||
- DOMAIN-SUFFIX,abema.io
|
||||
- DOMAIN-SUFFIX,abema.tv
|
||||
- DOMAIN-SUFFIX,akamaized.net
|
||||
- DOMAIN-SUFFIX,ameba.jp
|
||||
- DOMAIN-SUFFIX,hayabusa.io
|
||||
- DOMAIN-KEYWORD,abematv.akamaized.net
|
@ -1,45 +0,0 @@
|
||||
payload:
|
||||
# > Amazon Prime Video
|
||||
# - USER-AGENT,InstantVideo.US*
|
||||
# - USER-AGENT,Prime%20Video*
|
||||
|
||||
- DOMAIN-KEYWORD,avoddashs
|
||||
|
||||
- DOMAIN-SUFFIX,aiv-cdn.net
|
||||
- DOMAIN-SUFFIX,aiv-delivery.net
|
||||
- DOMAIN-SUFFIX,amazonprimevideos.com
|
||||
- DOMAIN-SUFFIX,amazonvideo.cc
|
||||
- DOMAIN-SUFFIX,amazonvideo.com
|
||||
- DOMAIN-SUFFIX,amazonvideodirect.cc
|
||||
- DOMAIN-SUFFIX,atv-ext.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ext-eu.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ext-fe.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ps.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ps-eu.amazon.co.uk
|
||||
- DOMAIN-SUFFIX,atv-ps-eu.amazon.com
|
||||
- DOMAIN-SUFFIX,atv-ps-fe.amazon.co.jp
|
||||
- DOMAIN-SUFFIX,atv-ps-fe.amazon.com
|
||||
- DOMAIN-SUFFIX,fls-na.amazon.com
|
||||
- DOMAIN-SUFFIX,media-amazon.com
|
||||
- DOMAIN-SUFFIX,primevideo.cc
|
||||
- DOMAIN-SUFFIX,primevideo.com
|
||||
- DOMAIN-SUFFIX,prime-video.com
|
||||
- DOMAIN-SUFFIX,primevideo.info
|
||||
- DOMAIN-SUFFIX,primevideo.org
|
||||
- DOMAIN-SUFFIX,primevideo.tv
|
||||
- DOMAIN-SUFFIX,pv-cdn.net
|
||||
- DOMAIN-SUFFIX,video.a2z.com
|
||||
|
||||
- DOMAIN,avodmp4s3ww-a.akamaihd.net
|
||||
- DOMAIN,d1v5ir2lpwr8os.cloudfront.net
|
||||
- DOMAIN,d1y002tclu9djj.cloudfront.net
|
||||
- DOMAIN,d22qjgkvxw22r6.cloudfront.net
|
||||
- DOMAIN,d25xi40x97liuc.cloudfront.net
|
||||
- DOMAIN,dmqdd6hw24ucf.cloudfront.net
|
||||
- DOMAIN,d27xxe7juh1us6.cloudfront.net
|
||||
|
||||
- DOMAIN,dualstack.pefs-alb-266603904.eu-west-1.elb.amazonaws.com
|
||||
|
||||
# // 美区网页版需二选一走代理,如 URL-REGEX 则需 MITM www.amazon.com
|
||||
# // DOMAIN,www.amazon.com
|
||||
# URL-REGEX,^https?:\/\/www\.amazon\.com\/(Amazon-Video|gp\/video)\/
|
@ -1,33 +0,0 @@
|
||||
payload:
|
||||
# > Apple API
|
||||
- DOMAIN-KEYWORD,apple.com.akadns.net
|
||||
- DOMAIN-KEYWORD,icloud.com.akadns.net
|
||||
- DOMAIN-SUFFIX,aaplimg.com
|
||||
- DOMAIN-SUFFIX,apple.co
|
||||
- DOMAIN-SUFFIX,apple.com
|
||||
- DOMAIN-SUFFIX,apple-cloudkit.com
|
||||
- DOMAIN-SUFFIX,apple-mapkit.com
|
||||
- DOMAIN-SUFFIX,appsto.re
|
||||
- DOMAIN-SUFFIX,cdn-apple.com
|
||||
- DOMAIN-SUFFIX,icloud.com
|
||||
- DOMAIN-SUFFIX,icloud-content.com
|
||||
- DOMAIN-SUFFIX,itunes.com
|
||||
- DOMAIN-SUFFIX,me.com
|
||||
- DOMAIN-SUFFIX,mzstatic.com
|
||||
- IP-CIDR,17.0.0.0/8,no-resolve
|
||||
- IP-CIDR,63.92.224.0/19,no-resolve
|
||||
- IP-CIDR,65.199.22.0/23,no-resolve
|
||||
- IP-CIDR,139.178.128.0/18,no-resolve
|
||||
- IP-CIDR,144.178.0.0/19,no-resolve
|
||||
- IP-CIDR,144.178.36.0/22,no-resolve
|
||||
- IP-CIDR,144.178.48.0/20,no-resolve
|
||||
- IP-CIDR,192.35.50.0/24,no-resolve
|
||||
- IP-CIDR,198.183.17.0/24,no-resolve
|
||||
- IP-CIDR,205.180.175.0/24,no-resolve
|
||||
|
||||
# > Apple News
|
||||
- DOMAIN-SUFFIX,apple.comscoreresearch.com
|
||||
- DOMAIN-SUFFIX,apple.news
|
||||
|
||||
# > Apple Maps
|
||||
- PROCESS-NAME,com.apple.geod
|
@ -1,16 +0,0 @@
|
||||
payload:
|
||||
# > Apple Music
|
||||
# - USER-AGENT,Music*
|
||||
- PROCESS-NAME,music
|
||||
- DOMAIN-SUFFIX,applemusic.com
|
||||
- DOMAIN-SUFFIX,blobstore.apple.com
|
||||
- DOMAIN-SUFFIX,music.apple.com
|
||||
- DOMAIN,aod.itunes.apple.com
|
||||
- DOMAIN,aod-ssl.itunes.apple.com
|
||||
- DOMAIN,audio.itunes.apple.com
|
||||
- DOMAIN,audio-ssl.itunes.apple.com
|
||||
- DOMAIN,mvod.itunes.apple.com
|
||||
- DOMAIN,streamingaudio.itunes.apple.com
|
||||
|
||||
# iCloud Music Library
|
||||
- DOMAIN-SUFFIX,blobstore.apple.com
|
@ -1,12 +0,0 @@
|
||||
payload:
|
||||
# > Apple News and Apple Map TOMTOM Version
|
||||
# - USER-AGENT,AppleNews*
|
||||
# - USER-AGENT,com.apple.news*
|
||||
- DOMAIN,gspe1-ssl.ls.apple.com
|
||||
# - USER-AGENT,News*
|
||||
# - DOMAIN,apple.comscoreresearch.com
|
||||
# - DOMAIN,gateway.icloud.com
|
||||
# - DOMAIN,news-client.apple.com
|
||||
# - DOMAIN,news-edge.apple.com
|
||||
# - DOMAIN,news-events.apple.com
|
||||
# - DOMAIN-SUFFIX,apple.news
|
@ -1,5 +0,0 @@
|
||||
payload:
|
||||
# > Apple TV
|
||||
- DOMAIN,np-edge.itunes.apple.com
|
||||
- DOMAIN,play-edge.itunes.apple.com
|
||||
- DOMAIN-SUFFIX,tv.apple.com
|
@ -1,15 +0,0 @@
|
||||
payload:
|
||||
# > BBC iPlayer
|
||||
- PROCESS-NAME,bbc.iplayer.android
|
||||
- DOMAIN-KEYWORD,bbcfmt
|
||||
- DOMAIN,aod-dash-uk-live.akamaized.net
|
||||
- DOMAIN,aod-hls-uk-live.akamaized.net
|
||||
- DOMAIN,vod-dash-uk-live.akamaized.net
|
||||
- DOMAIN,vod-thumb-uk-live.akamaized.net
|
||||
- DOMAIN-SUFFIX,bbc.co
|
||||
- DOMAIN-SUFFIX,bbc.co.uk
|
||||
- DOMAIN-SUFFIX,bbc.com
|
||||
- DOMAIN-SUFFIX,bbcfmt.hs.llnwd.net
|
||||
- DOMAIN-SUFFIX,bbci.co
|
||||
- DOMAIN-SUFFIX,bbci.co.uk
|
||||
- DOMAIN-SUFFIX,bidi.net.uk
|
@ -1,8 +0,0 @@
|
||||
payload:
|
||||
# > Bahamut
|
||||
# - USER-AGENT,Anime*
|
||||
- PROCESS-NAME,tw.com.gamer.android.animad
|
||||
- DOMAIN-SUFFIX,bahamut.com.tw
|
||||
- DOMAIN-SUFFIX,gamer.com.tw
|
||||
- DOMAIN,gamer-cds.cdn.hinet.net
|
||||
- DOMAIN,gamer2-cds.cdn.hinet.net
|
@ -1,16 +0,0 @@
|
||||
payload:
|
||||
# > Bilibili
|
||||
# - USER-AGENT,bili*
|
||||
- DOMAIN-SUFFIX,acg.tv
|
||||
- DOMAIN-SUFFIX,acgvideo.com
|
||||
- DOMAIN-SUFFIX,b23.tv
|
||||
- DOMAIN-SUFFIX,bilibili.com
|
||||
- DOMAIN-SUFFIX,bilibili.tv
|
||||
- DOMAIN-SUFFIX,biliapi.net
|
||||
- DOMAIN-SUFFIX,biliapi.com
|
||||
- DOMAIN-SUFFIX,bilivideo.com
|
||||
- DOMAIN-SUFFIX,hdslb.com
|
||||
- DOMAIN,upos-hz-mirrorakam.akamaized.net
|
||||
# Hong Kong, Macau, Taiwan
|
||||
# - USER-AGENT,bili-inter*
|
||||
- DOMAIN,apiintl.biliapi.net
|
@ -1,366 +0,0 @@
|
||||
payload:
|
||||
# China Area Network
|
||||
# > 360
|
||||
- DOMAIN-SUFFIX,qhres.com
|
||||
- DOMAIN-SUFFIX,qhimg.com
|
||||
# > Alibaba
|
||||
# USER-AGENT,%E4%BC%98%E9%85%B7*
|
||||
- DOMAIN-SUFFIX,alibaba.com
|
||||
- DOMAIN-SUFFIX,alibabausercontent.com
|
||||
- DOMAIN-SUFFIX,alicdn.com
|
||||
- DOMAIN-SUFFIX,alikunlun.com
|
||||
- DOMAIN-SUFFIX,alipay.com
|
||||
- DOMAIN-SUFFIX,amap.com
|
||||
- DOMAIN-SUFFIX,autonavi.com
|
||||
- DOMAIN-SUFFIX,dingtalk.com
|
||||
- DOMAIN-SUFFIX,mxhichina.com
|
||||
- DOMAIN-SUFFIX,soku.com
|
||||
- DOMAIN-SUFFIX,taobao.com
|
||||
- DOMAIN-SUFFIX,tmall.com
|
||||
- DOMAIN-SUFFIX,tmall.hk
|
||||
- DOMAIN-SUFFIX,ykimg.com
|
||||
- DOMAIN-SUFFIX,youku.com
|
||||
- DOMAIN-SUFFIX,xiami.com
|
||||
- DOMAIN-SUFFIX,xiami.net
|
||||
# > Apple
|
||||
- DOMAIN-SUFFIX,aaplimg.com
|
||||
- DOMAIN-SUFFIX,apple.co
|
||||
- DOMAIN-SUFFIX,apple.com
|
||||
- DOMAIN-SUFFIX,apple-cloudkit.com
|
||||
- DOMAIN-SUFFIX,appstore.com
|
||||
- DOMAIN-SUFFIX,cdn-apple.com
|
||||
- DOMAIN-SUFFIX,icloud.com
|
||||
- DOMAIN-SUFFIX,icloud-content.com
|
||||
- DOMAIN-SUFFIX,me.com
|
||||
- DOMAIN-SUFFIX,mzstatic.com
|
||||
# - DOMAIN-KEYWORD,apple.com.akadns.net
|
||||
# - DOMAIN-KEYWORD,icloud.com.akadns.net
|
||||
# > Baidu
|
||||
- DOMAIN-SUFFIX,baidu.com
|
||||
- DOMAIN-SUFFIX,baidubcr.com
|
||||
- DOMAIN-SUFFIX,baidupan.com
|
||||
- DOMAIN-SUFFIX,baidupcs.com
|
||||
- DOMAIN-SUFFIX,bdimg.com
|
||||
- DOMAIN-SUFFIX,bdstatic.com
|
||||
- DOMAIN-SUFFIX,yunjiasu-cdn.net
|
||||
# > Battle
|
||||
- DOMAIN-SUFFIX,battle.net
|
||||
- DOMAIN-SUFFIX,blizzard.com
|
||||
# > bilibili
|
||||
- DOMAIN-SUFFIX,acgvideo.com
|
||||
- DOMAIN-SUFFIX,biliapi.com
|
||||
- DOMAIN-SUFFIX,biliapi.net
|
||||
- DOMAIN-SUFFIX,bilibili.com
|
||||
- DOMAIN-SUFFIX,bilibili.tv
|
||||
- DOMAIN-SUFFIX,hdslb.com
|
||||
# > ByteDance
|
||||
- DOMAIN-SUFFIX,feiliao.com
|
||||
- DOMAIN-SUFFIX,pstatp.com
|
||||
- DOMAIN-SUFFIX,snssdk.com
|
||||
- DOMAIN-SUFFIX,iesdouyin.com
|
||||
- DOMAIN-SUFFIX,toutiao.com
|
||||
# > CCTV
|
||||
- DOMAIN-SUFFIX,cctv.com
|
||||
- DOMAIN-SUFFIX,cctvpic.com
|
||||
- DOMAIN-SUFFIX,livechina.com
|
||||
# > ChinaTelecom
|
||||
- DOMAIN-SUFFIX,21cn.com
|
||||
# > DiDi
|
||||
- DOMAIN-SUFFIX,didialift.com
|
||||
- DOMAIN-SUFFIX,didiglobal.com
|
||||
- DOMAIN-SUFFIX,udache.com
|
||||
# > HunanTV
|
||||
- DOMAIN-SUFFIX,hitv.com
|
||||
- DOMAIN-SUFFIX,mgtv.com
|
||||
# > iQiyi
|
||||
- DOMAIN-SUFFIX,iqiyi.com
|
||||
- DOMAIN-SUFFIX,iqiyipic.com
|
||||
- DOMAIN-SUFFIX,71.am
|
||||
# > JD
|
||||
- DOMAIN-SUFFIX,jd.com
|
||||
- DOMAIN-SUFFIX,jd.hk
|
||||
- DOMAIN-SUFFIX,jdpay.com
|
||||
- DOMAIN-SUFFIX,360buyimg.com
|
||||
# > Kingsoft
|
||||
- DOMAIN-SUFFIX,iciba.com
|
||||
- DOMAIN-SUFFIX,ksosoft.com
|
||||
# > Meitu
|
||||
- DOMAIN-SUFFIX,meitu.com
|
||||
- DOMAIN-SUFFIX,meitudata.com
|
||||
- DOMAIN-SUFFIX,meitustat.com
|
||||
- DOMAIN-SUFFIX,meipai.com
|
||||
# > Meituan
|
||||
- DOMAIN-SUFFIX,dianping.com
|
||||
- DOMAIN-SUFFIX,dpfile.com
|
||||
- DOMAIN-SUFFIX,meituan.com
|
||||
- DOMAIN-SUFFIX,meituan.net
|
||||
# > MI
|
||||
- DOMAIN-SUFFIX,duokan.com
|
||||
- DOMAIN-SUFFIX,mi.com
|
||||
- DOMAIN-SUFFIX,mi-img.com
|
||||
- DOMAIN-SUFFIX,miui.com
|
||||
- DOMAIN-SUFFIX,miwifi.com
|
||||
- DOMAIN-SUFFIX,xiaomi.com
|
||||
- DOMAIN-SUFFIX,xiaomi.net
|
||||
# > Microsoft
|
||||
# - DOMAIN-SUFFIX,microsoft.com
|
||||
# - DOMAIN-SUFFIX,msecnd.net
|
||||
# - DOMAIN-SUFFIX,office.com
|
||||
# - DOMAIN-SUFFIX,office365.com
|
||||
# - DOMAIN-SUFFIX,s-microsoft.com
|
||||
# - DOMAIN-SUFFIX,windows.com
|
||||
- DOMAIN-SUFFIX,visualstudio.com
|
||||
# >> Microsoft Software Download
|
||||
# - DOMAIN,software-download.microsoft.com
|
||||
# - DOMAIN-KEYWORD,-microsoft-com.akamaized.net
|
||||
# >> OneDrive
|
||||
# - DOMAIN-SUFFIX,1drv.com
|
||||
# - DOMAIN-SUFFIX,storage.live.com
|
||||
# >> Outlook
|
||||
- DOMAIN-SUFFIX,hotmail.com
|
||||
- DOMAIN-SUFFIX,outlook.com
|
||||
- DOMAIN,outlook.office365.com
|
||||
- DOMAIN,smtp.office365.com
|
||||
# >> Windows Server Update Services
|
||||
- DOMAIN-SUFFIX,dl.delivery.mp.microsoft.com
|
||||
- DOMAIN-SUFFIX,update.microsoft.com
|
||||
- DOMAIN-SUFFIX,windowsupdate.com
|
||||
- DOMAIN-SUFFIX,windowsupdate.microsoft.com
|
||||
- DOMAIN,download.microsoft.com
|
||||
- DOMAIN,wustat.windows.com
|
||||
- DOMAIN,ntservicepack.microsoft.com
|
||||
# > NetEase
|
||||
# USER-AGENT,NeteaseMusic*
|
||||
# USER-AGENT,%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90*
|
||||
- DOMAIN-SUFFIX,163.com
|
||||
- DOMAIN-SUFFIX,126.com
|
||||
- DOMAIN-SUFFIX,126.net
|
||||
- DOMAIN-SUFFIX,127.net
|
||||
- DOMAIN-SUFFIX,163yun.com
|
||||
- DOMAIN-SUFFIX,lofter.com
|
||||
- DOMAIN-SUFFIX,netease.com
|
||||
- DOMAIN-SUFFIX,ydstatic.com
|
||||
- DOMAIN-SUFFIX,youdao.com
|
||||
# > PayPal
|
||||
# USER-AGENT,PayPal*
|
||||
- DOMAIN-SUFFIX,paypal.com
|
||||
- DOMAIN-SUFFIX,paypal.me
|
||||
- DOMAIN-SUFFIX,paypalobjects.com
|
||||
# > Sina
|
||||
- DOMAIN-SUFFIX,sina.com
|
||||
- DOMAIN-SUFFIX,weibo.com
|
||||
- DOMAIN-SUFFIX,weibocdn.com
|
||||
# > Sohu
|
||||
- DOMAIN-SUFFIX,sohu.com
|
||||
- DOMAIN-SUFFIX,sohucs.com
|
||||
- DOMAIN-SUFFIX,sohu-inc.com
|
||||
- DOMAIN-SUFFIX,v-56.com
|
||||
# > Sogo
|
||||
- DOMAIN-SUFFIX,sogo.com
|
||||
- DOMAIN-SUFFIX,sogou.com
|
||||
- DOMAIN-SUFFIX,sogoucdn.com
|
||||
# > Steam
|
||||
- DOMAIN-SUFFIX,steamcontent.com
|
||||
- DOMAIN-SUFFIX,steampowered.com
|
||||
- DOMAIN-SUFFIX,steamstatic.com
|
||||
# > Tencent
|
||||
# USER-AGENT,MicroMessenger*
|
||||
# USER-AGENT,WeChat*
|
||||
# USER-AGENT,%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1*
|
||||
- DOMAIN-SUFFIX,gtimg.com
|
||||
- DOMAIN-SUFFIX,idqqimg.com
|
||||
- DOMAIN-SUFFIX,igamecj.com
|
||||
- DOMAIN-SUFFIX,myapp.com
|
||||
- DOMAIN-SUFFIX,myqcloud.com
|
||||
- DOMAIN-SUFFIX,qq.com
|
||||
- DOMAIN-SUFFIX,qqmail.com
|
||||
- DOMAIN-SUFFIX,servicewechat.com
|
||||
- DOMAIN-SUFFIX,tencent.com
|
||||
- DOMAIN-SUFFIX,tencent-cloud.com
|
||||
- DOMAIN-SUFFIX,tencent-cloud.net
|
||||
- DOMAIN-SUFFIX,tenpay.com
|
||||
- DOMAIN-SUFFIX,wechat.com
|
||||
- DOMAIN,file-igamecj.akamaized.net
|
||||
- IP-CIDR,182.254.116.0/24,no-resolve
|
||||
- IP-CIDR,203.205.254.0/23,no-resolve
|
||||
# > Content Delivery Network
|
||||
- DOMAIN-SUFFIX,ccgslb.com
|
||||
- DOMAIN-SUFFIX,ccgslb.net
|
||||
- DOMAIN-SUFFIX,chinanetcenter.com
|
||||
- DOMAIN-SUFFIX,meixincdn.com
|
||||
- DOMAIN-SUFFIX,ourdvs.com
|
||||
- DOMAIN-SUFFIX,staticdn.net
|
||||
- DOMAIN-SUFFIX,wangsu.com
|
||||
# > IP Query
|
||||
- DOMAIN-SUFFIX,ipip.net
|
||||
- DOMAIN-SUFFIX,ip.la
|
||||
- DOMAIN-SUFFIX,ip.sb
|
||||
- DOMAIN-SUFFIX,ip-cdn.com
|
||||
- DOMAIN-SUFFIX,ipv6-test.com
|
||||
- DOMAIN-SUFFIX,myip.la
|
||||
- DOMAIN-SUFFIX,test-ipv6.com
|
||||
- DOMAIN-SUFFIX,whatismyip.com
|
||||
- DOMAIN,ip.istatmenus.app
|
||||
- DOMAIN,sms.imagetasks.com
|
||||
# > Speed Test
|
||||
# - DOMAIN-SUFFIX,speedtest.net
|
||||
- DOMAIN-SUFFIX,netspeedtestmaster.com
|
||||
- DOMAIN,speedtest.macpaw.com
|
||||
# > Private Tracker
|
||||
- DOMAIN-SUFFIX,acg.rip
|
||||
- DOMAIN-SUFFIX,animebytes.tv
|
||||
- DOMAIN-SUFFIX,awesome-hd.me
|
||||
- DOMAIN-SUFFIX,broadcasthe.net
|
||||
- DOMAIN-SUFFIX,chdbits.co
|
||||
- DOMAIN-SUFFIX,classix-unlimited.co.uk
|
||||
- DOMAIN-SUFFIX,comicat.org
|
||||
- DOMAIN-SUFFIX,empornium.me
|
||||
- DOMAIN-SUFFIX,gazellegames.net
|
||||
- DOMAIN-SUFFIX,hdbits.org
|
||||
- DOMAIN-SUFFIX,hdchina.org
|
||||
- DOMAIN-SUFFIX,hddolby.com
|
||||
- DOMAIN-SUFFIX,hdhome.org
|
||||
- DOMAIN-SUFFIX,hdsky.me
|
||||
- DOMAIN-SUFFIX,icetorrent.org
|
||||
- DOMAIN-SUFFIX,jpopsuki.eu
|
||||
- DOMAIN-SUFFIX,keepfrds.com
|
||||
- DOMAIN-SUFFIX,madsrevolution.net
|
||||
- DOMAIN-SUFFIX,morethan.tv
|
||||
- DOMAIN-SUFFIX,m-team.cc
|
||||
- DOMAIN-SUFFIX,myanonamouse.net
|
||||
- DOMAIN-SUFFIX,nanyangpt.com
|
||||
- DOMAIN-SUFFIX,ncore.cc
|
||||
- DOMAIN-SUFFIX,open.cd
|
||||
- DOMAIN-SUFFIX,ourbits.club
|
||||
- DOMAIN-SUFFIX,passthepopcorn.me
|
||||
- DOMAIN-SUFFIX,privatehd.to
|
||||
- DOMAIN-SUFFIX,pterclub.com
|
||||
- DOMAIN-SUFFIX,redacted.ch
|
||||
- DOMAIN-SUFFIX,springsunday.net
|
||||
- DOMAIN-SUFFIX,tjupt.org
|
||||
- DOMAIN-SUFFIX,totheglory.im
|
||||
# > Other
|
||||
- DOMAIN-SUFFIX,cn
|
||||
- DOMAIN-SUFFIX,115.com
|
||||
- DOMAIN-SUFFIX,360in.com
|
||||
- DOMAIN-SUFFIX,51ym.me
|
||||
- DOMAIN-SUFFIX,8686c.com
|
||||
- DOMAIN-SUFFIX,99.com
|
||||
- DOMAIN-SUFFIX,abchina.com
|
||||
- DOMAIN-SUFFIX,accuweather.com
|
||||
- DOMAIN-SUFFIX,agora.io
|
||||
- DOMAIN-SUFFIX,aicoinstorge.com
|
||||
- DOMAIN-SUFFIX,air-matters.com
|
||||
- DOMAIN-SUFFIX,air-matters.io
|
||||
- DOMAIN-SUFFIX,aixifan.com
|
||||
- DOMAIN-SUFFIX,amd.com
|
||||
- DOMAIN-SUFFIX,b612.net
|
||||
- DOMAIN-SUFFIX,bdatu.com
|
||||
- DOMAIN-SUFFIX,beitaichufang.com
|
||||
- DOMAIN-SUFFIX,booking.com
|
||||
- DOMAIN-SUFFIX,bstatic.com
|
||||
- DOMAIN-SUFFIX,cailianpress.com
|
||||
- DOMAIN-SUFFIX,camera360.com
|
||||
- DOMAIN-SUFFIX,chaoxing.com
|
||||
- DOMAIN-SUFFIX,chaoxing.com
|
||||
- DOMAIN-SUFFIX,chinaso.com
|
||||
- DOMAIN-SUFFIX,chuimg.com
|
||||
- DOMAIN-SUFFIX,chunyu.mobi
|
||||
- DOMAIN-SUFFIX,cibntv.net
|
||||
- DOMAIN-SUFFIX,cmbchina.com
|
||||
- DOMAIN-SUFFIX,cmbimg.com
|
||||
- DOMAIN-SUFFIX,coolapk.com
|
||||
- DOMAIN-SUFFIX,ctrip.com
|
||||
- DOMAIN-SUFFIX,dfcfw.com
|
||||
- DOMAIN-SUFFIX,dji.net
|
||||
- DOMAIN-SUFFIX,docschina.org
|
||||
- DOMAIN-SUFFIX,douban.com
|
||||
- DOMAIN-SUFFIX,doubanio.com
|
||||
- DOMAIN-SUFFIX,douyu.com
|
||||
- DOMAIN-SUFFIX,dxycdn.com
|
||||
- DOMAIN-SUFFIX,dytt8.net
|
||||
- DOMAIN-SUFFIX,eastmoney.com
|
||||
- DOMAIN-SUFFIX,eudic.net
|
||||
- DOMAIN-SUFFIX,feng.com
|
||||
- DOMAIN-SUFFIX,fengkongcloud.com
|
||||
- DOMAIN-SUFFIX,frdic.com
|
||||
- DOMAIN-SUFFIX,futu5.com
|
||||
- DOMAIN-SUFFIX,futunn.com
|
||||
- DOMAIN-SUFFIX,gandi.net
|
||||
- DOMAIN-SUFFIX,gcores.com
|
||||
- DOMAIN-SUFFIX,geilicdn.com
|
||||
- DOMAIN-SUFFIX,getpricetag.com
|
||||
- DOMAIN-SUFFIX,gifshow.com
|
||||
- DOMAIN-SUFFIX,godic.net
|
||||
- DOMAIN-SUFFIX,heweather.net
|
||||
- DOMAIN-SUFFIX,hicloud.com
|
||||
- DOMAIN-SUFFIX,hongxiu.com
|
||||
- DOMAIN-SUFFIX,hostbuf.com
|
||||
- DOMAIN-SUFFIX,huxiucdn.com
|
||||
- DOMAIN-SUFFIX,huya.com
|
||||
- DOMAIN-SUFFIX,ibm.com
|
||||
- DOMAIN-SUFFIX,infinitynewtab.com
|
||||
- DOMAIN-SUFFIX,ithome.com
|
||||
- DOMAIN-SUFFIX,java.com
|
||||
- DOMAIN-SUFFIX,jianguoyun.com
|
||||
- DOMAIN-SUFFIX,jianshu.com
|
||||
- DOMAIN-SUFFIX,jianshu.io
|
||||
- DOMAIN-SUFFIX,jidian.im
|
||||
- DOMAIN-SUFFIX,kaiyanapp.com
|
||||
- DOMAIN-SUFFIX,kaspersky-labs.com
|
||||
- DOMAIN-SUFFIX,keepcdn.com
|
||||
- DOMAIN-SUFFIX,kkmh.com
|
||||
- DOMAIN-SUFFIX,lanzous.com
|
||||
- DOMAIN-SUFFIX,luojilab.com
|
||||
- DOMAIN-SUFFIX,maoyan.com
|
||||
- DOMAIN-SUFFIX,maoyun.tv
|
||||
- DOMAIN-SUFFIX,mls-cdn.com
|
||||
- DOMAIN-SUFFIX,mobike.com
|
||||
- DOMAIN-SUFFIX,moke.com
|
||||
- DOMAIN-SUFFIX,mubu.com
|
||||
- DOMAIN-SUFFIX,myzaker.com
|
||||
- DOMAIN-SUFFIX,nim-lang-cn.org
|
||||
- DOMAIN-SUFFIX,ntp.org
|
||||
- DOMAIN-SUFFIX,nvidia.com
|
||||
- DOMAIN-SUFFIX,oracle.com
|
||||
- DOMAIN-SUFFIX,plex.tv
|
||||
- DOMAIN-SUFFIX,qidian.com
|
||||
- DOMAIN-SUFFIX,qweather.com
|
||||
- DOMAIN-SUFFIX,qyer.com
|
||||
- DOMAIN-SUFFIX,qyerstatic.com
|
||||
- DOMAIN-SUFFIX,raychase.net
|
||||
- DOMAIN-SUFFIX,ronghub.com
|
||||
- DOMAIN-SUFFIX,ruguoapp.com
|
||||
- DOMAIN-SUFFIX,sankuai.com
|
||||
- DOMAIN-SUFFIX,scomper.me
|
||||
- DOMAIN-SUFFIX,shouqianba.com
|
||||
- DOMAIN-SUFFIX,sm.ms
|
||||
- DOMAIN-SUFFIX,smzdm.com
|
||||
- DOMAIN-SUFFIX,snapdrop.net
|
||||
- DOMAIN-SUFFIX,snwx.com
|
||||
- DOMAIN-SUFFIX,s-reader.com
|
||||
- DOMAIN-SUFFIX,sspai.com
|
||||
- DOMAIN-SUFFIX,subhd.tv
|
||||
- DOMAIN-SUFFIX,takungpao.com
|
||||
- DOMAIN-SUFFIX,teamviewer.com
|
||||
- DOMAIN-SUFFIX,tianyancha.com
|
||||
- DOMAIN-SUFFIX,tophub.today
|
||||
- DOMAIN-SUFFIX,uning.com
|
||||
- DOMAIN-SUFFIX,weather.com
|
||||
- DOMAIN-SUFFIX,weico.cc
|
||||
- DOMAIN-SUFFIX,weidian.com
|
||||
- DOMAIN-SUFFIX,xiachufang.com
|
||||
- DOMAIN-SUFFIX,xiaoka.tv
|
||||
- DOMAIN-SUFFIX,ximalaya.com
|
||||
- DOMAIN-SUFFIX,xinhuanet.com
|
||||
- DOMAIN-SUFFIX,xmcdn.com
|
||||
- DOMAIN-SUFFIX,yangkeduo.com
|
||||
- DOMAIN-SUFFIX,yizhibo.com
|
||||
- DOMAIN-SUFFIX,zhangzishi.cc
|
||||
- DOMAIN-SUFFIX,zhihu.com
|
||||
- DOMAIN-SUFFIX,zhihuishu.com
|
||||
- DOMAIN-SUFFIX,zhimg.com
|
||||
- DOMAIN-SUFFIX,zhuihd.com
|
||||
|
||||
- DOMAIN,download.jetbrains.com
|
||||
- DOMAIN,images-cn.ssl-images-amazon.com
|
File diff suppressed because it is too large
Load Diff
@ -1,300 +0,0 @@
|
||||
payload:
|
||||
# > Forum
|
||||
- DOMAIN-SUFFIX,bitcointalk.org
|
||||
|
||||
# > Exchange
|
||||
- DOMAIN-SUFFIX,aex.com
|
||||
- DOMAIN-SUFFIX,bibox.com
|
||||
- DOMAIN-SUFFIX,bitfinex.com
|
||||
- DOMAIN-SUFFIX,bithumb.com
|
||||
- DOMAIN-SUFFIX,bitmex.com
|
||||
- DOMAIN-SUFFIX,bitstamp.net
|
||||
- DOMAIN-SUFFIX,bittrex.com
|
||||
- DOMAIN-SUFFIX,bybit.com
|
||||
- DOMAIN-SUFFIX,coinbase.com
|
||||
- DOMAIN-SUFFIX,coincheck.com
|
||||
- DOMAIN-SUFFIX,coinone.co.kr
|
||||
- DOMAIN-SUFFIX,gemini.com
|
||||
- DOMAIN-SUFFIX,korbit.co.kr
|
||||
- DOMAIN-SUFFIX,kraken.com
|
||||
- DOMAIN-SUFFIX,kucoin.com
|
||||
- DOMAIN-SUFFIX,liquid.com
|
||||
- DOMAIN-SUFFIX,poloniex.com
|
||||
- DOMAIN-SUFFIX,bitbank.cc
|
||||
- DOMAIN-SUFFIX,bitcoin.org
|
||||
- DOMAIN-SUFFIX,bitquick.co
|
||||
- DOMAIN-SUFFIX,btcbox.co.jp
|
||||
- DOMAIN-SUFFIX,cex.io
|
||||
- DOMAIN-SUFFIX,dogecoin.com
|
||||
- DOMAIN-SUFFIX,paxful.com
|
||||
- DOMAIN-SUFFIX,tether.to
|
||||
- DOMAIN-SUFFIX,dydx.exchange
|
||||
- DOMAIN-SUFFIX,solana.com
|
||||
- DOMAIN-SUFFIX,avax.network
|
||||
- DOMAIN-SUFFIX,optimism.io
|
||||
- DOMAIN-SUFFIX,arbitrum.io
|
||||
- DOMAIN-SUFFIX,poly.network
|
||||
- DOMAIN-SUFFIX,zkscan.io
|
||||
- DOMAIN-SUFFIX,zksync.io
|
||||
- DOMAIN-SUFFIX,boba.network
|
||||
|
||||
# > Binance
|
||||
- DOMAIN-SUFFIX,binance.cc
|
||||
- DOMAIN-SUFFIX,binance.cloud
|
||||
- DOMAIN-SUFFIX,binance.com
|
||||
- DOMAIN-SUFFIX,binance.im
|
||||
- DOMAIN-SUFFIX,binance.me
|
||||
- DOMAIN-SUFFIX,binance.us
|
||||
- DOMAIN-SUFFIX,bnappzh.co
|
||||
- DOMAIN-SUFFIX,bnappzh.com
|
||||
- DOMAIN-SUFFIX,bnbstatic.com
|
||||
- DOMAIN-SUFFIX,bntrace.com
|
||||
- DOMAIN-SUFFIX,binance.charity
|
||||
- DOMAIN-SUFFIX,binance.co
|
||||
- DOMAIN-SUFFIX,binance.info
|
||||
- DOMAIN-SUFFIX,binance.net
|
||||
- DOMAIN-SUFFIX,binance.org
|
||||
- DOMAIN-SUFFIX,binance.vision
|
||||
- DOMAIN-SUFFIX,binanceapi.com
|
||||
- DOMAIN-SUFFIX,binancezh.be
|
||||
- DOMAIN-SUFFIX,binancezh.biz
|
||||
- DOMAIN-SUFFIX,binancezh.cc
|
||||
- DOMAIN-SUFFIX,binancezh.co
|
||||
- DOMAIN-SUFFIX,binancezh.com
|
||||
- DOMAIN-SUFFIX,binancezh.info
|
||||
- DOMAIN-SUFFIX,binancezh.ink
|
||||
- DOMAIN-SUFFIX,binancezh.kim
|
||||
- DOMAIN-SUFFIX,binancezh.link
|
||||
- DOMAIN-SUFFIX,binancezh.live
|
||||
- DOMAIN-SUFFIX,binancezh.mobi
|
||||
- DOMAIN-SUFFIX,binancezh.net
|
||||
- DOMAIN-SUFFIX,binancezh.pro
|
||||
- DOMAIN-SUFFIX,binancezh.sh
|
||||
- DOMAIN-SUFFIX,binancezh.top
|
||||
- DOMAIN-SUFFIX,bnappzh.mobi
|
||||
- DOMAIN-SUFFIX,bsc.getblock.io
|
||||
- DOMAIN-SUFFIX,bscscan.com
|
||||
- PROCESS-NAME,Binance.exe
|
||||
- DOMAIN-KEYWORD,binance
|
||||
|
||||
# > Huobi
|
||||
- DOMAIN-SUFFIX,hbabit.com
|
||||
- DOMAIN-SUFFIX,hbfile.net
|
||||
- DOMAIN-SUFFIX,huobi.com
|
||||
- DOMAIN-SUFFIX,huobi.me
|
||||
- DOMAIN-SUFFIX,huobi.pro
|
||||
- DOMAIN-SUFFIX,huobi.sc
|
||||
- DOMAIN-SUFFIX,huobiasia.vip
|
||||
- DOMAIN-SUFFIX,huobigroup.com
|
||||
- DOMAIN-SUFFIX,huobitoken.com
|
||||
- DOMAIN-SUFFIX,heco-scan.com
|
||||
- DOMAIN-SUFFIX,hecoview.com
|
||||
- DOMAIN-SUFFIX,hbfile.net
|
||||
- DOMAIN-SUFFIX,huobi.br.com
|
||||
- DOMAIN-SUFFIX,bitderiv.com
|
||||
- DOMAIN-SUFFIX,hecochain.com
|
||||
- DOMAIN-SUFFIX,huobi.ws
|
||||
- DOMAIN-SUFFIX,huobi.ug
|
||||
- DOMAIN-SUFFIX,huobi.co.ma
|
||||
- DOMAIN-SUFFIX,huobi.br.com
|
||||
- PROCESS-NAME,Huobi.exe
|
||||
- DOMAIN-KEYWORD,huobi
|
||||
|
||||
# > OKX
|
||||
- DOMAIN-SUFFIX,okex.com
|
||||
- DOMAIN-SUFFIX,okx.com
|
||||
- PROCESS-NAME,OKX.exe
|
||||
- DOMAIN-KEYWORD,okx
|
||||
|
||||
# > asproex
|
||||
- DOMAIN-SUFFIX,asproex.com
|
||||
- DOMAIN-SUFFIX,asproexapi.com
|
||||
|
||||
# > bitflyer
|
||||
- DOMAIN-SUFFIX,bitflyer.com
|
||||
- DOMAIN-SUFFIX,bitflyer.jp
|
||||
|
||||
# > bitsquare
|
||||
- DOMAIN-SUFFIX,bisq.io
|
||||
- DOMAIN-SUFFIX,bisq.network
|
||||
- DOMAIN-SUFFIX,bitsquare.io
|
||||
|
||||
# > coinone
|
||||
- DOMAIN-SUFFIX,coinone.co.kr
|
||||
- DOMAIN-SUFFIX,coinonecore.com
|
||||
- DOMAIN-SUFFIX,coinonecorp.com
|
||||
|
||||
# > ethereum
|
||||
- DOMAIN-SUFFIX,devcon.org
|
||||
- DOMAIN-SUFFIX,ethereum.foundation
|
||||
- DOMAIN-SUFFIX,ethereum.org
|
||||
- DOMAIN-SUFFIX,etherscan.io
|
||||
- DOMAIN-SUFFIX,nansen.ai
|
||||
- DOMAIN-SUFFIX,ethgasstation.info
|
||||
- DOMAIN-SUFFIX,watchtheburn.com
|
||||
- DOMAIN-SUFFIX,flashbots.net
|
||||
- DOMAIN-SUFFIX,cryptofees.info
|
||||
- DOMAIN-SUFFIX,etherscan.io
|
||||
- DOMAIN-SUFFIX,ethereum-magicians.org
|
||||
- DOMAIN-SUFFIX,vitalik.ca
|
||||
- DOMAIN-SUFFIX,ethfans.org
|
||||
- DOMAIN-SUFFIX,ethereum.cn
|
||||
- DOMAIN-SUFFIX,ethereum.stackexchange.com
|
||||
- DOMAIN-SUFFIX,etherscan.com
|
||||
- DOMAIN-SUFFIX,parity.io
|
||||
- DOMAIN-SUFFIX,ethernodes.org
|
||||
|
||||
# > localbitcoins
|
||||
- DOMAIN-SUFFIX,localbitcoins.com
|
||||
- DOMAIN-SUFFIX,localbitcoinschain.com
|
||||
|
||||
# > zb
|
||||
- DOMAIN-SUFFIX,zb.app
|
||||
- DOMAIN-SUFFIX,zb.com
|
||||
- DOMAIN-SUFFIX,zb.io
|
||||
- DOMAIN-SUFFIX,zb.live
|
||||
|
||||
# > Analysis
|
||||
- DOMAIN-SUFFIX,aicoin.com
|
||||
- DOMAIN-SUFFIX,aimoon.com
|
||||
- DOMAIN-SUFFIX,coingecko.com
|
||||
- DOMAIN-SUFFIX,coinmarketcap.com
|
||||
- DOMAIN-SUFFIX,glassnode.com
|
||||
- DOMAIN-SUFFIX,coinmetrics.io
|
||||
- DOMAIN-SUFFIX,tokenview.com
|
||||
- DOMAIN-SUFFIX,oklink.com
|
||||
- DOMAIN-SUFFIX,blockchair.com
|
||||
- DOMAIN-SUFFIX,intotheblock.com
|
||||
- DOMAIN-SUFFIX,bytetree.com
|
||||
- DOMAIN-SUFFIX,coin.dance
|
||||
- DOMAIN-SUFFIX,defieye.io
|
||||
- DOMAIN-SUFFIX,duneanalytics.com
|
||||
- DOMAIN-SUFFIX,tokenterminal.com
|
||||
- DOMAIN-SUFFIX,dapp.review
|
||||
- DOMAIN-SUFFIX,dappradar.com
|
||||
- DOMAIN-SUFFIX,stateofthedapps.com
|
||||
- DOMAIN-SUFFIX,thegraph.com
|
||||
- DOMAIN-SUFFIX,debank.com
|
||||
- DOMAIN-SUFFIX,vfat.tools
|
||||
- DOMAIN-SUFFIX,loanscan.io
|
||||
- DOMAIN-SUFFIX,defirate.com
|
||||
- DOMAIN-SUFFIX,defipulse.com
|
||||
- DOMAIN-SUFFIX,apy999.com
|
||||
- DOMAIN-SUFFIX,defieye.io
|
||||
- DOMAIN-SUFFIX,dextools.io
|
||||
- DOMAIN-SUFFIX,tradingview.com
|
||||
- DOMAIN-SUFFIX,dcabtc.com
|
||||
- DOMAIN-SUFFIX,chainalysis.com
|
||||
- DOMAIN-SUFFIX,cryptoquant.com
|
||||
- DOMAIN-SUFFIX,viewbase.com
|
||||
- DOMAIN-SUFFIX,bitcoinity.org
|
||||
- DOMAIN-SUFFIX,cryptocompare.com
|
||||
- DOMAIN-SUFFIX,coincodex.com
|
||||
- DOMAIN-SUFFIX,cointrendz.com
|
||||
- DOMAIN-SUFFIX,coincheckup.com
|
||||
- DOMAIN-SUFFIX,thetie.io
|
||||
- DOMAIN-SUFFIX,cryptorank.io
|
||||
- DOMAIN-SUFFIX,tradeblock.com
|
||||
- DOMAIN-SUFFIX,nyctale.io
|
||||
- DOMAIN-SUFFIX,dovemetrics.com
|
||||
- DOMAIN-SUFFIX,cryptorank.io
|
||||
- DOMAIN-SUFFIX,icodrops.com
|
||||
- DOMAIN-SUFFIX,chainbroker.io
|
||||
- DOMAIN-SUFFIX,crunchbase.com
|
||||
- DOMAIN-SUFFIX,defillama.com
|
||||
- DOMAIN-SUFFIX,coinowo.com
|
||||
- DOMAIN-SUFFIX,earni.fi
|
||||
- DOMAIN-SUFFIX,dropsearn.com
|
||||
- DOMAIN-SUFFIX,bitcoin.it
|
||||
- DOMAIN-SUFFIX,bitcoinmagazine.com
|
||||
- DOMAIN-SUFFIX,blockchain.com
|
||||
- DOMAIN-SUFFIX,tronscan.org
|
||||
|
||||
# > POOL
|
||||
- DOMAIN-SUFFIX,btc.com
|
||||
- DOMAIN-SUFFIX,f2pool.com
|
||||
- DOMAIN-SUFFIX,cbeci.org
|
||||
- DOMAIN-SUFFIX,digiconomist.net
|
||||
- DOMAIN-SUFFIX,1ml.com
|
||||
- DOMAIN-SUFFIX,bitcoinvisuals.com
|
||||
- DOMAIN-SUFFIX,crypto51.app
|
||||
- DOMAIN-SUFFIX,masternodes.online
|
||||
- DOMAIN-SUFFIX,bitnodes.earn.com
|
||||
- DOMAIN-SUFFIX,poolin.com
|
||||
- DOMAIN-SUFFIX,ethermine.org
|
||||
- DOMAIN-SUFFIX,ewapool.net
|
||||
|
||||
# > FTX
|
||||
- DOMAIN-SUFFIX,ftx.com
|
||||
|
||||
# > Metamask
|
||||
- DOMAIN-KEYWORD,metamask
|
||||
- DOMAIN,token-api.metaswap.codefi.network
|
||||
- DOMAIN,min-api.cryptocompare.com
|
||||
|
||||
# > NFT
|
||||
- DOMAIN-SUFFIX,opensea.io
|
||||
- DOMAIN-SUFFIX,nftscan.com
|
||||
- DOMAIN-SUFFIX,makersplace.com
|
||||
- DOMAIN-SUFFIX,nonfungible.com
|
||||
- DOMAIN-SUFFIX,cryptoslam.io
|
||||
- DOMAIN-SUFFIX,cryptoart.io
|
||||
- DOMAIN-SUFFIX,nftcalendar.io
|
||||
- DOMAIN-SUFFIX,nftgo.io
|
||||
|
||||
# > IPFS
|
||||
- DOMAIN-SUFFIX,filecoin.io
|
||||
- DOMAIN-SUFFIX,docs.lotu.sh
|
||||
- DOMAIN-SUFFIX,ipfs.io
|
||||
- DOMAIN-SUFFIX,docs.ipfs.io
|
||||
- DOMAIN-SUFFIX,discuss.ipfs.io
|
||||
|
||||
# > EOS
|
||||
- DOMAIN-SUFFIX,eos.io
|
||||
- DOMAIN-SUFFIX,developers.eos.io
|
||||
- DOMAIN-SUFFIX,block.one
|
||||
- DOMAIN-SUFFIX,eostracker.io
|
||||
- DOMAIN-SUFFIX,eosflare.io
|
||||
- DOMAIN-SUFFIX,eospark.com
|
||||
- DOMAIN-SUFFIX,bloks.io
|
||||
|
||||
# > Lightning
|
||||
- DOMAIN-SUFFIX,lightning.engineering
|
||||
- DOMAIN-SUFFIX,lightning.community
|
||||
- DOMAIN-SUFFIX,acinq.co
|
||||
- DOMAIN-SUFFIX,1ml.com
|
||||
|
||||
# > Token
|
||||
- DOMAIN-SUFFIX,tokenpocket.pro
|
||||
- DOMAIN-SUFFIX,token.im
|
||||
- DOMAIN-SUFFIX,phantom.app
|
||||
- DOMAIN-SUFFIX,tronlink.org
|
||||
- DOMAIN-SUFFIX,myetherwallet.com
|
||||
- DOMAIN-SUFFIX,jaxx.io
|
||||
- DOMAIN-SUFFIX,trustwalletapp.com
|
||||
|
||||
# > Gate
|
||||
- DOMAIN-SUFFIX,gate.ac
|
||||
- DOMAIN-SUFFIX,gate.io
|
||||
|
||||
# > Mexc
|
||||
- DOMAIN-SUFFIX,mexc.com
|
||||
|
||||
# > Dapp
|
||||
- DOMAIN-SUFFIX,sushi.com
|
||||
- DOMAIN-SUFFIX,uniswap.org
|
||||
- DOMAIN-SUFFIX,sunswap.com
|
||||
- DOMAIN-SUFFIX,traderjoexyz.com
|
||||
- DOMAIN-SUFFIX,raydium.io
|
||||
- DOMAIN-SUFFIX,synthetix.io
|
||||
- DOMAIN-SUFFIX,aave.com
|
||||
- DOMAIN-SUFFIX,compound.finance
|
||||
- DOMAIN-SUFFIX,makerdao.com
|
||||
- DOMAIN-SUFFIX,wbtc.network
|
||||
- DOMAIN-SUFFIX,pancakeswap.finance
|
||||
- DOMAIN-SUFFIX,pancakeswap.com
|
||||
- DOMAIN-SUFFIX,mdex.co
|
||||
- DOMAIN-SUFFIX,mdex.one
|
||||
- DOMAIN-SUFFIX,mdex.com
|
||||
- DOMAIN-SUFFIX,mdex.me
|
||||
- DOMAIN-SUFFIX,1inch.io
|
@ -1,25 +0,0 @@
|
||||
payload:
|
||||
# > DAZN
|
||||
# - USER-AGENT,DAZN*
|
||||
|
||||
- PROCESS-NAME,com.dazn
|
||||
|
||||
- DOMAIN-KEYWORD,voddazn
|
||||
|
||||
- DOMAIN-SUFFIX,dazn.com
|
||||
- DOMAIN-SUFFIX,dazn-api.com
|
||||
- DOMAIN-SUFFIX,dazndn.com
|
||||
- DOMAIN-SUFFIX,daznedge.net
|
||||
- DOMAIN-SUFFIX,daznfeeds.com
|
||||
- DOMAIN-SUFFIX,daznservices.com
|
||||
- DOMAIN-SUFFIX,indazn.com
|
||||
- DOMAIN-SUFFIX,indaznlab.com
|
||||
|
||||
- DOMAIN,daznfeeds.com.edgekey.net
|
||||
- DOMAIN,dca-lm-livedazn.secure.footprint.net
|
||||
- DOMAIN,h-dazn.online-metrix.net
|
||||
- DOMAIN,images-daznservices-com.cdn.ampproject.org
|
||||
- DOMAIN,d151l6v8er5bdm.cloudfront.net
|
||||
|
||||
- IP-CIDR,185.42.236.0/24,no-resolve
|
||||
- IP-CIDR,185.42.238.0/24,no-resolve
|
@ -1,8 +0,0 @@
|
||||
payload:
|
||||
# > Discord
|
||||
- DOMAIN-SUFFIX,discord.com
|
||||
- DOMAIN-SUFFIX,discord.gg
|
||||
- DOMAIN-SUFFIX,discord.media
|
||||
- DOMAIN-SUFFIX,discordapp.com
|
||||
- DOMAIN-SUFFIX,discordapp.net
|
||||
- DOMAIN-SUFFIX,discordstatus.com
|
@ -1,11 +0,0 @@
|
||||
payload:
|
||||
# > Discovery Plus
|
||||
- PROCESS-NAME,com.discovery.discoveryplus.mobile
|
||||
- DOMAIN-SUFFIX,content-ause1-ur-discovery1.uplynk.com
|
||||
- DOMAIN-SUFFIX,disco-api.com
|
||||
- DOMAIN-SUFFIX,discoveryplus.com
|
||||
- DOMAIN-SUFFIX,fwmrm.net
|
||||
- DOMAIN-SUFFIX,getblueshift.com
|
||||
- DOMAIN-SUFFIX,litix.io
|
||||
- DOMAIN-SUFFIX,mobile-collector.newrelic.com
|
||||
- DOMAIN-SUFFIX,uplynk.com
|
@ -1,21 +0,0 @@
|
||||
payload:
|
||||
# > Disney Plus
|
||||
# - USER-AGENT,Disney*
|
||||
|
||||
- PROCESS-NAME,com.disney.disneyplus
|
||||
|
||||
- DOMAIN-SUFFIX,adobedtm.com
|
||||
- DOMAIN-SUFFIX,bam.nr-date.net
|
||||
- DOMAIN-SUFFIX,bamgrid.com
|
||||
- DOMAIN-SUFFIX,braze.com
|
||||
- DOMAIN-SUFFIX,cdn.optimizely.com
|
||||
- DOMAIN-SUFFIX,d9.flashtalking.com
|
||||
- DOMAIN-SUFFIX,disney.demdex.net
|
||||
- DOMAIN-SUFFIX,disney.my.sentry.io
|
||||
- DOMAIN-SUFFIX,disneyplus.bn5x.net
|
||||
- DOMAIN-SUFFIX,disneyplus.com
|
||||
- DOMAIN-SUFFIX,disneyplus.com.ssl.sc.omtrdc.net
|
||||
- DOMAIN-SUFFIX,disney-plus.net
|
||||
- DOMAIN-SUFFIX,disney-portal.my.onetrust.com
|
||||
- DOMAIN-SUFFIX,dssott.com
|
||||
- DOMAIN-SUFFIX,registerdisney.go.com
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user