From 4e3a28945d23b0165a44eb1e8d0858d30726affe Mon Sep 17 00:00:00 2001 From: Akiyamov <116005851+Akiyamov@users.noreply.github.com> Date: Sun, 3 Nov 2024 00:55:18 +0500 Subject: [PATCH] Change release name, ask for parallelism, add Xray example --- .github/workflows/worker.yml | 2 +- README.md | 41 ++++++++++++++++++++++++++++++++++-- get_ech.sh | 14 ++++++++---- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git a/.github/workflows/worker.yml b/.github/workflows/worker.yml index 28cbbaf..58f0da8 100644 --- a/.github/workflows/worker.yml +++ b/.github/workflows/worker.yml @@ -51,7 +51,7 @@ jobs: run: | no_ech_length=$(wc -l domains_noech.lst | tr ' ' '\n' | head -1) ech_length=$(wc -l domains_ech.lst | tr ' ' '\n' | head -1) - release_date=$(date +'%d-%m-%y') + release_date=$(date +'%d-%m-%y-%H-%M') gh release create "$release_date" \ amnezia.json \ diff --git a/README.md b/README.md index cf7c6f9..74240b7 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ ### Прямые ссылки на файлы +* V2fly/Xray DAT https://github.com/Akiyamov/singbox-ech-list/releases/latest/download/ech.dat * Sing-box ECH Rule-set https://github.com/Akiyamov/singbox-ech-list/releases/latest/download/domains_ech.srs * Sing-box NoECH Rule-set https://github.com/Akiyamov/singbox-ech-list/releases/latest/download/domains_noech.srs * AmneziaVPN NoECH JSON https://github.com/Akiyamov/singbox-ech-list/releases/latest/download/amnezia.json @@ -24,7 +25,32 @@ ### Xray -TBD +
+ Нажмите сюда, чтоб раскрыть + +Закинуть [DAT файл](https://github.com/Akiyamov/singbox-ech-list/releases/latest/download/ech.dat) в /usr/share/xray и в конфиге `routing` прописать: +```json +"routing": { + "domainStrategy": "IPIfNonMatch", + "rules": [ + { + "type": "field", + "outboundTag": "proxy", + "domain": [ + "ext:ech.dat:domains_noech" + ] + }, + { + "type": "field", + "outboundTag": "freedom", + "domain": [ + "ext:ech.dat:domains_ech" + ] + } + ] +} +``` +
### Sing-box @@ -104,4 +130,15 @@ start () { fi } ``` - \ No newline at end of file + + +## Как запустить у себя + +Нужно поставить следующие пакеты: + +* wget +* jq +* parallel +* bind-tools + +После этого можно запускать скрипт. \ No newline at end of file diff --git a/get_ech.sh b/get_ech.sh index 6004b5a..178d09f 100755 --- a/get_ech.sh +++ b/get_ech.sh @@ -2,17 +2,22 @@ # Checking dependencies if ! command -v jq &> /dev/null; then - echo "Package \"jq\" is not installed. Please install \"jq\" to continue" + echo "Package \"jq\" is not installed. Please install \"jq\" to continue." exit 1 fi if ! command -v dig &> /dev/null; then - echo "Package \"dig\" is not installed. Please install \"dig\" to continue" + echo "Package \"dig\" is not installed. Please install \"dnsutils\" to continue." exit 1 fi if ! command -v parallel &> /dev/null; then - echo "Package \"parallel\" is not installed. Sequential mode will be used" + read -p "Package \"parallel\" is not installed. Script will need 4 hours to complete in sequential mode. Are you sure? (y/N)" seq_choice + case "$seq_choice" in + y|Y ) echo "Running script in sequential mode.";; + n|N ) echo "Aborting script." && exit 1;; + * ) echo "Invalid response." && exit 1;; + esac fi # Getting a file with blocked domains @@ -26,6 +31,7 @@ wget -qO domains_all.lst https://github.com/1andrevich/Re-filter-lists/releases/ > domains_noech.json > amnezia.json +parallel_requests=10 number_of_domains=$(wc -l < domains_all.lst) start_time=`date +%s` @@ -47,7 +53,7 @@ export -f process_domain # Selecting a processing method depending on the presence of a dependency if command -v parallel &> /dev/null; then - cat domains_all.lst | parallel -j 4 process_domain + cat domains_all.lst | parallel -j $parallel_requests process_domain else while IFS= read -r domain; do process_domain "$domain"