mirror of
https://github.com/darkclip/netlist.git
synced 2026-11-28 04:59:53 +08:00
delete sha
This commit is contained in:
1 parent
84881b3560
commit
62dd05536c
4 files changed
+8
-107
No files matched your search
@@ -0,0 +1,62 @@
|
||||
name: build-mosdns
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
paths:
|
||||
- ".github/workflows/build-mosdns.yml"
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 16 * * *"
|
||||
|
||||
jobs:
|
||||
build-mosdns:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Checkout reference branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: loyalsoldier/v2ray-rules-dat
|
||||
ref: release
|
||||
path: ref
|
||||
- name: Checkout target branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: mosdns
|
||||
path: target
|
||||
- name: Clean target branch
|
||||
continue-on-error: true
|
||||
run: rm target/*
|
||||
- name: Rebuild target branch
|
||||
run: |
|
||||
cp mosdns/config.yml target/config.yml
|
||||
./raydata.py ref/geoip.dat -c CN -o target/rule/chinaip.txt geoip
|
||||
./raydata.py ref/geosite.dat -c CN -o target/rule/chinasite.txt geosite --formatter mosdns/format.json
|
||||
./raydata.py ref/geosite.dat -c ALIBABA -o target/rule/chinasite.txt geosite --formatter mosdns/format.json
|
||||
./raydata.py ref/geosite.dat -c ALIBABACLOUD -o target/rule/chinasite.txt geosite --formatter mosdns/format.json
|
||||
./raydata.py ref/geosite.dat -c ALIYUN -o target/rule/chinasite.txt geosite --formatter mosdns/format.json
|
||||
mkdir target/tmp
|
||||
cd target
|
||||
tar -cf mosdns.tar tmp rule *.yml
|
||||
rm tmp rule *.yml -r
|
||||
- name: Push to target branch
|
||||
continue-on-error: true
|
||||
run: |
|
||||
cd target
|
||||
git config --global user.name "${GITHUB_ACTOR}"
|
||||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -m "update $(date +%Y-%m-%d)"
|
||||
git push -q
|
||||
@@ -0,0 +1,152 @@
|
||||
log:
|
||||
level: info
|
||||
|
||||
api:
|
||||
http: :8080
|
||||
|
||||
include: []
|
||||
|
||||
plugins:
|
||||
- tag: hosts
|
||||
type: hosts
|
||||
args:
|
||||
files:
|
||||
- './rule/hosts.txt'
|
||||
|
||||
- tag: lazy_cache
|
||||
type: cache
|
||||
args:
|
||||
size: 102400
|
||||
lazy_cache_ttl: 259200
|
||||
dump_file: './tmp/cache.dump'
|
||||
dump_interval: 600
|
||||
|
||||
- tag: whitelist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- './rule/whitelist.txt'
|
||||
|
||||
- tag: blocklist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- './rule/blocklist.txt'
|
||||
|
||||
- tag: greylist
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- './rule/greylist.txt'
|
||||
|
||||
- tag: chinasite
|
||||
type: domain_set
|
||||
args:
|
||||
files:
|
||||
- './rule/chinasite.txt'
|
||||
|
||||
- tag: chinaip
|
||||
type: ip_set
|
||||
args:
|
||||
files:
|
||||
- './rule/chinaip.txt'
|
||||
|
||||
- tag: forward_remote
|
||||
type: forward
|
||||
args:
|
||||
concurrent: 4
|
||||
upstreams:
|
||||
- addr: '1.1.1.1'
|
||||
- addr: '8.8.8.8'
|
||||
# - addr: 'https://1.1.1.1/dns-query'
|
||||
# dial_addr: '1.1.1.1'
|
||||
# bootstrap: '223.5.5.5:53'
|
||||
# enable_pipeline: true
|
||||
# max_conns: 2
|
||||
# insecure_skip_verify: false
|
||||
# idle_timeout: 10
|
||||
# enable_http3: true
|
||||
|
||||
- tag: remote_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- exec: ecs 8.209.36.0/23 240b:4000::/32
|
||||
- exec: $forward_remote
|
||||
|
||||
- tag: local_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- exec: forward 223.5.5.5:53
|
||||
|
||||
- tag: has_resp_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- matches: has_resp
|
||||
exec: accept
|
||||
|
||||
- tag: has_china_resp_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- matches: '!resp_ip $chinaip'
|
||||
exec: drop_resp
|
||||
- matches: has_resp
|
||||
exec: accept
|
||||
|
||||
- tag: query_is_whitelist_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $whitelist
|
||||
exec: $local_sequence
|
||||
|
||||
- tag: reject_blocklist
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $blocklist
|
||||
exec: reject 3
|
||||
|
||||
- tag: query_is_greylist_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $greylist
|
||||
exec: $remote_sequence
|
||||
|
||||
- tag: query_is_china_domain
|
||||
type: sequence
|
||||
args:
|
||||
- matches: qname $chinasite
|
||||
exec: $local_sequence
|
||||
|
||||
- tag: main_sequence
|
||||
type: sequence
|
||||
args:
|
||||
- exec: $hosts
|
||||
- exec: jump has_resp_sequence
|
||||
- matches:
|
||||
- '!qname $blocklist'
|
||||
exec: $lazy_cache
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_whitelist_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $reject_blocklist
|
||||
- exec: $query_is_greylist_domain
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $query_is_china_domain
|
||||
- exec: jump has_china_resp_sequence
|
||||
- exec: $remote_sequence
|
||||
- exec: jump has_resp_sequence
|
||||
- exec: $local_sequence
|
||||
|
||||
- tag: udp_server
|
||||
type: udp_server
|
||||
args:
|
||||
entry: main_sequence
|
||||
listen: :53
|
||||
|
||||
- tag: http_server
|
||||
type: http_server
|
||||
args:
|
||||
entries:
|
||||
- path: /dns-query
|
||||
exec: main_sequence
|
||||
listen: :80
|
||||
idle_timeout: 10
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"prefix": {
|
||||
"0": "keyword:",
|
||||
"1": "regexp:",
|
||||
"2": "domain:",
|
||||
"3": "full:"
|
||||
},
|
||||
"suffix": {
|
||||
"0": "",
|
||||
"1": "",
|
||||
"2": "",
|
||||
"3": ""
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user