Commit 0d11df9d authored by nanahira's avatar nanahira

clean useless and add smartdns.external

parent 72f9e651
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
- wenyuanji.com - wenyuanji.com
- wenaihouse.com - wenaihouse.com
bridges: [] bridges: []
dnsmasq: dnsmasq: {}
mycardDomains: true
gfwlistIPSet: false
tasks: tasks:
- name: git-registry.mycard.moe hosts - name: git-registry.mycard.moe hosts
become: true become: true
......
...@@ -47,7 +47,13 @@ dhcp-boot=tag:efi64-1-{{interface}},netboot.xyz.efi,,{{ address }} ...@@ -47,7 +47,13 @@ dhcp-boot=tag:efi64-1-{{interface}},netboot.xyz.efi,,{{ address }}
dhcp-boot=tag:efi64-2-{{interface}},netboot.xyz.efi,,{{ address }} dhcp-boot=tag:efi64-2-{{interface}},netboot.xyz.efi,,{{ address }}
{% endmacro %} {% endmacro %}
# MyCard NextGen Router DNSMasq config file # MyCard NextGen Router DNSMasq config file
{% if smartdns.external is defined and smartdns.external %}
{% for externalServer in smartdns.external %}
server={{ externalServer | regex_replace(':', '#') }}
{% endfor %}
{% else %}
server=127.0.0.1#55553 server=127.0.0.1#55553
{% endif %}
no-resolv no-resolv
strict-order strict-order
interface=lo{% for br in bridges %}{% if br.type != 'manual' and not (br.masq is defined and br.masq) %},{{br.name}}{% endif %}{% endfor %}{% if dnsmasq.extraInterfaces is defined %}{% for interface in dnsmasq.extraInterfaces %},{{interface}}{% endfor %}{% endif %} interface=lo{% for br in bridges %}{% if br.type != 'manual' and not (br.masq is defined and br.masq) %},{{br.name}}{% endif %}{% endfor %}{% if dnsmasq.extraInterfaces is defined %}{% for interface in dnsmasq.extraInterfaces %},{{interface}}{% endfor %}{% endif %}
......
version: '2.4' version: '2.4'
services: services:
{% if not (smartdns.external is defined and smartdns.external) %}
smartdns: smartdns:
restart: always restart: always
{% if ansible_architecture == 'aarch64' %}
image: git-registry.mycard.moe/nanahira/docker-smartdns:master-arm
{% else %}
image: git-registry.mycard.moe/nanahira/docker-smartdns image: git-registry.mycard.moe/nanahira/docker-smartdns
{% endif %}
network_mode: host network_mode: host
command: -f -x -c /etc/smartdns/smartdns.conf command: -f -x -c /etc/smartdns/smartdns.conf
volumes: volumes:
- ./smartdns:/etc/smartdns:ro - ./smartdns:/etc/smartdns:ro
- ./smartdns-cache:/tmp/smartdns-cache - ./smartdns-cache:/tmp/smartdns-cache
{% endif %}
dnsmasq: dnsmasq:
restart: always restart: always
{% if ansible_architecture == 'aarch64' %}
image: git-registry.mycard.moe/nanahira/dnsmasq:original-arm
{% else %}
image: git-registry.mycard.moe/nanahira/dnsmasq:original image: git-registry.mycard.moe/nanahira/dnsmasq:original
{% endif %}
network_mode: host network_mode: host
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
......
...@@ -13,7 +13,7 @@ download_repo() { ...@@ -13,7 +13,7 @@ download_repo() {
# download_repo chnroutes2 https://github.com/misakaio/chnroutes2.git # download_repo chnroutes2 https://github.com/misakaio/chnroutes2.git
download_repo dnsmasq-china-list https://code.mycard.moe/nanahira/dnsmasq-china-list download_repo dnsmasq-china-list https://code.mycard.moe/nanahira/dnsmasq-china-list
download_repo mycard-dnsmasq https://code.mycard.moe/mycard/dnsmasq # download_repo mycard-dnsmasq https://code.mycard.moe/mycard/dnsmasq
cd dnsmasq-china-list cd dnsmasq-china-list
make smartdns make smartdns
...@@ -27,7 +27,7 @@ grep -P '^bogus-nxdomain=.+$' dnsmasq-china-list/bogus-nxdomain.china.conf | sed ...@@ -27,7 +27,7 @@ grep -P '^bogus-nxdomain=.+$' dnsmasq-china-list/bogus-nxdomain.china.conf | sed
# python3 route_helper.py # python3 route_helper.py
# cd .. # cd ..
curl -sL https://cokebar.github.io/gfwlist2dnsmasq/dnsmasq_gfwlist_ipset.conf | grep -P '^ipset=' > ./data/gfwlist-ipset.conf # curl -sL https://cokebar.github.io/gfwlist2dnsmasq/dnsmasq_gfwlist_ipset.conf | grep -P '^ipset=' > ./data/gfwlist-ipset.conf
#MENU_VERSION=$(curl -sL "https://api.github.com/repos/netbootxyz/netboot.xyz/releases/latest" | jq -r '.tag_name') #MENU_VERSION=$(curl -sL "https://api.github.com/repos/netbootxyz/netboot.xyz/releases/latest" | jq -r '.tag_name')
#MENU_VERSION=2.0.36 #MENU_VERSION=2.0.36
......
...@@ -22,33 +22,13 @@ ...@@ -22,33 +22,13 @@
src: ../files/dnsmasq/smartdns.conf.j2 src: ../files/dnsmasq/smartdns.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/smartdns.conf' dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/smartdns.conf'
notify: restart_dnsmasq notify: restart_dnsmasq
when: not (smartdns.external is defined and smartdns.external)
- name: smartdns china list - name: smartdns china list
copy: copy:
src: ../data/china-list.conf src: ../data/china-list.conf
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/china-list.conf' dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/china-list.conf'
notify: restart_dnsmasq notify: restart_dnsmasq
- name: update dnsmasq.d when: not (smartdns.external is defined and smartdns.external)
synchronize:
src: ../mycard-dnsmasq/dnsmasq.d/
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d'
recursive: yes
verify_host: no
checksum: yes
archive: no
notify: restart_dnsmasq
when: dnsmasq.mycardDomains is defined and dnsmasq.mycardDomains
- name: gfwlist ipset
copy:
src: '../data/gfwlist-ipset.conf'
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
when: dnsmasq.gfwlistIPSet is defined and dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: gfwlist ipset clean
file:
path: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/dnsmasq.d/gfwlist-ipset.conf'
state: absent
when: dnsmasq.gfwlistIPSet is defined and not dnsmasq.gfwlistIPSet
notify: restart_dnsmasq
- name: start dnsmasq - name: start dnsmasq
docker_compose: docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq' project_src: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq'
......
...@@ -74,6 +74,8 @@ vars: ...@@ -74,6 +74,8 @@ vars:
- username: user - username: user
password: pass password: pass
smartdns: smartdns:
external: null # 完全不使用 smartdns
# - 114.114.114.114#53
disable_ipv6: false # 是否禁用IPv6解析 disable_ipv6: false # 是否禁用IPv6解析
tls_dns: tls_dns:
- 8.8.8.8 - 8.8.8.8
...@@ -85,8 +87,6 @@ vars: ...@@ -85,8 +87,6 @@ vars:
- 114.114.114.114 - 114.114.114.114
- 223.5.5.5 - 223.5.5.5
dnsmasq: dnsmasq:
gfwlistIPSet: false # 导入 gfwlist ipset
mycardDomains: false # 导入 MCNetwork 内网域名
extraInterfaces: [] # 额外监听的网卡 extraInterfaces: [] # 额外监听的网卡
kms: localhost # kms 服务器的地址,localhost 为自己搭建 kms: localhost # kms 服务器的地址,localhost 为自己搭建
aptCacher: 10.0.0.2 # apt-cacher-ng 的地址 aptCacher: 10.0.0.2 # apt-cacher-ng 的地址
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment