Commit 0d11df9d authored by nanahira's avatar nanahira

clean useless and add smartdns.external

parent 72f9e651
......@@ -18,9 +18,7 @@
- wenyuanji.com
- wenaihouse.com
bridges: []
dnsmasq:
mycardDomains: true
gfwlistIPSet: false
dnsmasq: {}
tasks:
- name: git-registry.mycard.moe hosts
become: true
......
......@@ -47,7 +47,13 @@ dhcp-boot=tag:efi64-1-{{interface}},netboot.xyz.efi,,{{ address }}
dhcp-boot=tag:efi64-2-{{interface}},netboot.xyz.efi,,{{ address }}
{% endmacro %}
# 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
{% endif %}
no-resolv
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 %}
......
version: '2.4'
services:
{% if not (smartdns.external is defined and smartdns.external) %}
smartdns:
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
{% endif %}
network_mode: host
command: -f -x -c /etc/smartdns/smartdns.conf
volumes:
- ./smartdns:/etc/smartdns:ro
- ./smartdns-cache:/tmp/smartdns-cache
{% endif %}
dnsmasq:
restart: always
{% if ansible_architecture == 'aarch64' %}
image: git-registry.mycard.moe/nanahira/dnsmasq:original-arm
{% else %}
image: git-registry.mycard.moe/nanahira/dnsmasq:original
{% endif %}
network_mode: host
cap_add:
- NET_ADMIN
......
......@@ -13,7 +13,7 @@ download_repo() {
# download_repo chnroutes2 https://github.com/misakaio/chnroutes2.git
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
make smartdns
......@@ -27,7 +27,7 @@ grep -P '^bogus-nxdomain=.+$' dnsmasq-china-list/bogus-nxdomain.china.conf | sed
# python3 route_helper.py
# 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=2.0.36
......
......@@ -22,33 +22,13 @@
src: ../files/dnsmasq/smartdns.conf.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/smartdns.conf'
notify: restart_dnsmasq
when: not (smartdns.external is defined and smartdns.external)
- name: smartdns china list
copy:
src: ../data/china-list.conf
dest: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/smartdns/china-list.conf'
notify: restart_dnsmasq
- name: update dnsmasq.d
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
when: not (smartdns.external is defined and smartdns.external)
- name: start dnsmasq
docker_compose:
project_src: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq'
......
......@@ -74,6 +74,8 @@ vars:
- username: user
password: pass
smartdns:
external: null # 完全不使用 smartdns
# - 114.114.114.114#53
disable_ipv6: false # 是否禁用IPv6解析
tls_dns:
- 8.8.8.8
......@@ -85,8 +87,6 @@ vars:
- 114.114.114.114
- 223.5.5.5
dnsmasq:
gfwlistIPSet: false # 导入 gfwlist ipset
mycardDomains: false # 导入 MCNetwork 内网域名
extraInterfaces: [] # 额外监听的网卡
kms: localhost # kms 服务器的地址,localhost 为自己搭建
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