4 Commits

Author SHA1 Message Date
Morozov Dmitriy
7f127fb08f Merge 5625c795ba into aae9c50f10 2024-06-03 11:56:19 +00:00
Morozov Dmitriy
5625c795ba ограничение количества попыток скачки списка доменов 2024-06-03 14:53:47 +03:00
itdoginfo
aae9c50f10 Fix examples 2024-05-06 14:05:03 +03:00
itdoginfo
db0d06408a Fix order 2024-05-06 13:48:30 +03:00
5 changed files with 61 additions and 26 deletions

View File

@@ -69,7 +69,7 @@ Wireguard, only domains, stubby, Russia, acces from wg network, host 192.168.1.1
remote_user: root
roles:
- domain-routing-openwrt
- itdoginfo.domain_routing_openwrt
vars:
tunnel: wg
@@ -93,12 +93,22 @@ Sing-box, stubby, Russia
remote_user: root
roles:
- domain-routing-openwrt
- itdoginfo.domain_routing_openwrt
vars:
tunnel: singbox
dns_encrypt: stubby
country: russia-inside
tasks:
- name: sing-box config
template:
src: "templates/openwrt-sing-box-json.j2"
dest: "/etc/sing-box/config.json"
mode: 0644
notify:
- Restart sing-box
- Restart network
```
License

View File

@@ -81,6 +81,16 @@ Sing-box, stubby, Russia
tunnel: singbox
dns_encrypt: stubby
country: russia-inside
tasks:
- name: sing-box config
template:
src: "templates/openwrt-sing-box-json.j2"
dest: "/etc/sing-box/config.json"
mode: 0644
notify:
- Restart sing-box
- Restart network
```
В inventory файле роутер обязательно должен быть в группе `[openwrt]`

View File

@@ -518,7 +518,12 @@ start () {
EOF
cat << 'EOF' >> /etc/init.d/getdomains
count=0
maxCount=10
while true; do
if [ ${count} -eq ${maxCount} ]; then
echo "Break on ${maxCount} attempt"
break
fi
if curl -m 3 github.com; then
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
break

View File

@@ -1,4 +1,9 @@
---
- name: Restart sing-box
service:
name: sing-box
state: restarted
- name: Restart network
service:
name: network
@@ -24,8 +29,3 @@
service:
name: dnsmasq
state: restarted
- name: Restart sing-box
service:
name: sing-box
state: restarted

View File

@@ -22,7 +22,12 @@ start () {
DOMAINS=https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Ukraine/inside-dnsmasq-ipset.lst
{% endif %}
count=0
maxCount=10
while true; do
if [ ${count} -eq ${maxCount} ]; then
echo "Break on ${maxCount} attempt"
break
fi
if curl -m 3 github.com; then
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
break
@@ -46,7 +51,12 @@ start () {
mkdir -p $dir
count=0
maxCount=10
while true; do
if [ ${count} -eq ${maxCount} ]; then
echo "Break on ${maxCount} attempt"
break
fi
if curl -m 3 https://antifilter.download/; then
{% if list_subnet %}
curl -f -z $dir/subnet.lst https://antifilter.download/list/subnet.lst --output $dir/subnet.lst