update 2023-04-20 09:17:54

This commit is contained in:
github-actions[bot] 2023-04-20 09:17:54 +08:00
parent ba33817f27
commit 7b15205502
4 changed files with 17 additions and 144 deletions

View File

@ -104,6 +104,18 @@ if (match(proxy_mode), /tun/) {
/* UCI config end */
/* Config helper start */
function parse_port(strport) {
if (type(strport) !== 'array' || isEmpty(strport))
return null;
let ports = [];
for (let i in strport)
push(ports, int(i));
return ports;
}
function generate_outbound(node) {
if (type(node) !== 'object' || isEmpty(node))
return null;
@ -243,18 +255,6 @@ function get_resolver(cfg) {
else
return 'cfg-' + cfg + '-dns';
}
function parse_port(strport) {
if (type(strport) !== 'array' || isEmpty(strport))
return null;
let ports = [];
for (let i in strport)
push(ports, int(i));
return ports;
}
/* Config helper end */
const config = {};

View File

@ -16,7 +16,7 @@ plugins:
files:
- "/var/mosdns/geosite_cn.txt"
# 国内ip
# 国内 IP
- tag: geoip_cn
type: ip_set
args:
@ -30,62 +30,6 @@ plugins:
files:
- "/var/mosdns/geosite_geolocation-!cn.txt"
# 白名单 加入的域名始终允许使用 “本地 DNS” 进行解析
- tag: whitelist
type: domain_set
args:
files:
- "/etc/mosdns/rule/whitelist.txt"
# 黑名单 加入的域名将屏蔽 DNS 解析
- tag: blocklist
type: domain_set
args:
files:
- "/etc/mosdns/rule/blocklist.txt"
# 灰名单 加入的域名始终使用 “远程 DNS” 进行解析
- tag: greylist
type: domain_set
args:
files:
- "/etc/mosdns/rule/greylist.txt"
# DDNS域名 加入的域名始终使用 “本地 DNS” 进行解析,并且修改 TTL 为 5 秒,解析结果不进行缓存
- tag: ddnslist
type: domain_set
args:
files:
- "/etc/mosdns/rule/ddnslist.txt"
# 自定义 Hosts 重写
- tag: hosts
type: hosts
args:
files:
- "/etc/mosdns/rule/hosts.txt"
# 重定向请求的域名
- tag: redirect
type: redirect
args:
files:
- "/etc/mosdns/rule/redirect.txt"
# PTR 黑名单 加入的域名将阻止 PTR 请求
- tag: local_ptr
type: domain_set
args:
files:
- "/etc/mosdns/rule/local-ptr.txt"
# 屏蔽失效/威胁 URL
- tag: sp_low
type: domain_set
args:
files:
- "/usr/share/mosdns/sp_low.tdata"
# 缓存
- tag: lazy_cache
type: cache
@ -112,18 +56,6 @@ plugins:
- addr: tls://8.8.8.8
enable_pipeline: false
# 修改ttl默认0 不修改ttl
- tag: modify_ttl
type: sequence
args:
- exec: ttl 0-0
# 修改 ddns 域名 ttl默认 5秒
- tag: modify_ddns_ttl
type: sequence
args:
- exec: ttl 5-5
# 国内解析
- tag: local_sequence
type: sequence
@ -137,14 +69,10 @@ plugins:
- exec: prefer_ipv4
- exec: $forward_remote
# 有响应则修改 TTL 并终止返回
# 有响应终止返回
- tag: has_resp_sequence
type: sequence
args:
- matches: qname $ddnslist
exec: $modify_ddns_ttl
- matches: "!qname $ddnslist"
exec: $modify_ttl
- matches: has_resp
exec: accept
@ -172,13 +100,6 @@ plugins:
threshold: 500
always_standby: true
# 查询 DDNS 域名
- tag: query_is_ddns_domain
type: sequence
args:
- matches: qname $ddnslist
exec: $local_sequence
# 查询国内域名
- tag: query_is_local_domain
type: sequence
@ -193,60 +114,13 @@ plugins:
- matches: qname $geosite_no_cn
exec: $remote_sequence
# 查询白名单
- tag: query_is_whitelist_domain
type: sequence
args:
- matches: qname $whitelist
exec: $local_sequence
# 查询灰名单
- tag: query_is_greylist_domain
type: sequence
args:
- matches: qname $greylist
exec: $remote_sequence
# 拒绝名单
- tag: query_is_reject_domain
type: sequence
args:
- matches: qname $blocklist
exec: reject 3
- matches: qname $sp_low
exec: reject 3
- matches:
- qtype 12
- qname $local_ptr
exec: reject 3
- matches: qtype 65
exec: reject 3
# 主要的运行逻辑插件
# sequence 插件中调用的插件 tag 必须在 sequence 前定义,
# 否则 sequence 找不到对应插件。
- tag: main_sequence
type: sequence
args:
- exec: $hosts
- exec: jump has_resp_sequence
# 非 “拒绝名单” 或 “DDNS域名” 则启用缓存
- matches:
- "!qname $ddnslist"
- "!qname $blocklist"
- "!qname $sp_low"
- "!qname $local_ptr"
exec: $lazy_cache
- exec: $redirect
- exec: jump has_resp_sequence
- exec: $query_is_ddns_domain
- exec: jump has_resp_sequence
- exec: $query_is_whitelist_domain
- exec: jump has_resp_sequence
- exec: $query_is_reject_domain
- exec: jump has_resp_sequence
- exec: $query_is_greylist_domain
- exec: jump has_resp_sequence
- exec: $lazy_cache
- exec: $query_is_local_domain
- exec: jump has_resp_sequence
- exec: $query_is_no_local_domain

View File

@ -910,7 +910,6 @@ function to_check_self()
end
local local_version = get_version()
local remote_version = sys.exec("echo -n $(grep 'PKG_VERSION' /tmp/passwall_makefile|awk -F '=' '{print $2}')")
.. "-" .. sys.exec("echo -n $(grep 'PKG_RELEASE' /tmp/passwall_makefile|awk -F '=' '{print $2}')")
local has_update = compare_versions(local_version, "<", remote_version)
if not has_update then

View File

@ -12,13 +12,13 @@ PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
include $(INCLUDE_DIR)/package.mk
GEOIP_VER:=202304130041
GEOIP_VER:=202304200041
GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
define Download/geoip
URL:=https://github.com/v2fly/geoip/releases/download/$(GEOIP_VER)/
URL_FILE:=geoip.dat
FILE:=$(GEOIP_FILE)
HASH:=1bb3d15876748dbf0eaebb54261c8f00d24af0d53412a023577a74bfc3ce2607
HASH:=9c67762b4c4bbe357016e8ef3780601865ce6acba119ac10affc14d7e3ab68c0
endef
GEOSITE_VER:=20230419102532