Skip to content

Commit

Permalink
Change release name, ask for parallelism, add Xray example
Browse files Browse the repository at this point in the history
  • Loading branch information
Akiyamov authored Nov 2, 2024
1 parent aafad4b commit 4e3a289
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,40 @@

### Прямые ссылки на файлы

* 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
* DNSMasq+NFTables https://github.com/Akiyamov/singbox-ech-list/releases/latest/download/domains_noech_dnsmasq.lst

### Xray

TBD
<details>
<summary>Нажмите сюда, чтоб раскрыть</summary>

Закинуть [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"
]
}
]
}
```
</details>

### Sing-box

Expand Down Expand Up @@ -104,4 +130,15 @@ start () {
fi
}
```
</details>
</details>

## Как запустить у себя

Нужно поставить следующие пакеты:

* wget
* jq
* parallel
* bind-tools

После этого можно запускать скрипт.
14 changes: 10 additions & 4 deletions get_ech.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`

Expand All @@ -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"
Expand Down

0 comments on commit 4e3a289

Please sign in to comment.