mirror of
https://github.com/itdoginfo/ansible-openwrt-hirkn.git
synced 2025-12-26 17:23:36 +05:00
Compare commits
4 Commits
0.1.5
...
7f127fb08f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f127fb08f | ||
|
|
5625c795ba | ||
|
|
aae9c50f10 | ||
|
|
db0d06408a |
14
README.EN.md
14
README.EN.md
@@ -69,7 +69,7 @@ Wireguard, only domains, stubby, Russia, acces from wg network, host 192.168.1.1
|
|||||||
remote_user: root
|
remote_user: root
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- domain-routing-openwrt
|
- itdoginfo.domain_routing_openwrt
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
tunnel: wg
|
tunnel: wg
|
||||||
@@ -93,12 +93,22 @@ Sing-box, stubby, Russia
|
|||||||
remote_user: root
|
remote_user: root
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- domain-routing-openwrt
|
- itdoginfo.domain_routing_openwrt
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
tunnel: singbox
|
tunnel: singbox
|
||||||
dns_encrypt: stubby
|
dns_encrypt: stubby
|
||||||
country: russia-inside
|
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
|
License
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -81,6 +81,16 @@ Sing-box, stubby, Russia
|
|||||||
tunnel: singbox
|
tunnel: singbox
|
||||||
dns_encrypt: stubby
|
dns_encrypt: stubby
|
||||||
country: russia-inside
|
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]`
|
В inventory файле роутер обязательно должен быть в группе `[openwrt]`
|
||||||
|
|||||||
@@ -518,7 +518,12 @@ start () {
|
|||||||
EOF
|
EOF
|
||||||
cat << 'EOF' >> /etc/init.d/getdomains
|
cat << 'EOF' >> /etc/init.d/getdomains
|
||||||
count=0
|
count=0
|
||||||
|
maxCount=10
|
||||||
while true; do
|
while true; do
|
||||||
|
if [ ${count} -eq ${maxCount} ]; then
|
||||||
|
echo "Break on ${maxCount} attempt"
|
||||||
|
break
|
||||||
|
fi
|
||||||
if curl -m 3 github.com; then
|
if curl -m 3 github.com; then
|
||||||
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
|
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
- name: Restart sing-box
|
||||||
|
service:
|
||||||
|
name: sing-box
|
||||||
|
state: restarted
|
||||||
|
|
||||||
- name: Restart network
|
- name: Restart network
|
||||||
service:
|
service:
|
||||||
name: network
|
name: network
|
||||||
@@ -24,8 +29,3 @@
|
|||||||
service:
|
service:
|
||||||
name: dnsmasq
|
name: dnsmasq
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Restart sing-box
|
|
||||||
service:
|
|
||||||
name: sing-box
|
|
||||||
state: restarted
|
|
||||||
@@ -22,7 +22,12 @@ start () {
|
|||||||
DOMAINS=https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Ukraine/inside-dnsmasq-ipset.lst
|
DOMAINS=https://raw.githubusercontent.com/itdoginfo/allow-domains/main/Ukraine/inside-dnsmasq-ipset.lst
|
||||||
{% endif %}
|
{% endif %}
|
||||||
count=0
|
count=0
|
||||||
|
maxCount=10
|
||||||
while true; do
|
while true; do
|
||||||
|
if [ ${count} -eq ${maxCount} ]; then
|
||||||
|
echo "Break on ${maxCount} attempt"
|
||||||
|
break
|
||||||
|
fi
|
||||||
if curl -m 3 github.com; then
|
if curl -m 3 github.com; then
|
||||||
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
|
curl -f $DOMAINS --output /tmp/dnsmasq.d/domains.lst
|
||||||
break
|
break
|
||||||
@@ -46,7 +51,12 @@ start () {
|
|||||||
mkdir -p $dir
|
mkdir -p $dir
|
||||||
|
|
||||||
count=0
|
count=0
|
||||||
|
maxCount=10
|
||||||
while true; do
|
while true; do
|
||||||
|
if [ ${count} -eq ${maxCount} ]; then
|
||||||
|
echo "Break on ${maxCount} attempt"
|
||||||
|
break
|
||||||
|
fi
|
||||||
if curl -m 3 https://antifilter.download/; then
|
if curl -m 3 https://antifilter.download/; then
|
||||||
{% if list_subnet %}
|
{% if list_subnet %}
|
||||||
curl -f -z $dir/subnet.lst https://antifilter.download/list/subnet.lst --output $dir/subnet.lst
|
curl -f -z $dir/subnet.lst https://antifilter.download/list/subnet.lst --output $dir/subnet.lst
|
||||||
|
|||||||
Reference in New Issue
Block a user