Skip to content

Commit

Permalink
url_from_doh_provider[doh_provider] (#95)
Browse files Browse the repository at this point in the history
Co-authored-by: c.geary <[email protected]>
  • Loading branch information
chadgeary and c.geary committed Sep 4, 2023
1 parent 41036aa commit beec888
Show file tree
Hide file tree
Showing 14 changed files with 209 additions and 289 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*-setup-*.sh
*-init-*.yml
*.swp
.vscode
40 changes: 16 additions & 24 deletions etc/aws-two-instances/playbooks/cloudblock_aws_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
become: true
tasks:

- name: Custom facts
ansible.builtin.set_fact:
url_from_doh:
adguard: https://dns.adguard.com/dns-query
cloudflare: https://cloudflare-dns.com/dns-query
cloudflare-security: https://security.cloudflare-dns.com/dns-query
cloudflare-family: https://family.cloudflare-dns.com/dns-query
applied-privacy: https://doh.applied-privacy.net/query
google: https://dns.google/dns-query
hurricane-electric: https://ordns.he.net/dns-query
pi-dns: https://doh.pi-dns.com/dns-query
quad9-recommended: https://dns.quad9.net/dns-query
libre-dns: https://doh.libredns.gr/dns-query
opendns: https://doh.opendns.com/dns-query

- name: Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
Expand Down Expand Up @@ -113,29 +128,6 @@
- httpd-ssl.conf
- httpd.conf

- name: DoH Endpoints
ansible.builtin.blockinfile:
create: true
mode: '0644'
path: /opt/cloudflared/endpoints
block: |
adguard https://dns.adguard.com/dns-query
cloudflare https://cloudflare-dns.com/dns-query
cloudflare-security https://security.cloudflare-dns.com/dns-query
cloudflare-family https://family.cloudflare-dns.com/dns-query
applied-privacy https://doh.applied-privacy.net/query
google https://dns.google/dns-query
hurricane-electric https://ordns.he.net/dns-query
pi-dns https://doh.pi-dns.com/dns-query
quad9-recommended https://dns.quad9.net/dns-query
libre-dns https://doh.libredns.gr/dns-query
opendns https://doh.opendns.com/dns-query
- name: Set DoH URL from DoH provider var
ansible.builtin.shell: |
awk '/{{ doh_provider }}/ { print $2 }' /opt/cloudflared/endpoints
register: doh_url

- name: Cloudflared Dockerfile
ansible.builtin.blockinfile:
create: true
Expand All @@ -149,7 +141,7 @@
apt-get install -y wget && \
wget https://github.com/cloudflare/cloudflared/releases/download/2020.10.2/cloudflared-linux-amd64 --directory-prefix=/usr/local/bin/ && \
chmod 555 /usr/local/bin/cloudflared-linux-amd64
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-amd64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ doh_url.stdout }}"]
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-amd64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ url_from_doh_provider[doh_provider] }}"]
register: cloudflared_doh_dockerfile

- name: Check cloudflared image exists
Expand Down
40 changes: 16 additions & 24 deletions etc/aws-two-instances/playbooks/cloudblock_aws_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
become: true
tasks:

- name: Custom facts
ansible.builtin.set_fact:
url_from_doh:
adguard: https://dns.adguard.com/dns-query
cloudflare: https://cloudflare-dns.com/dns-query
cloudflare-security: https://security.cloudflare-dns.com/dns-query
cloudflare-family: https://family.cloudflare-dns.com/dns-query
applied-privacy: https://doh.applied-privacy.net/query
google: https://dns.google/dns-query
hurricane-electric: https://ordns.he.net/dns-query
pi-dns: https://doh.pi-dns.com/dns-query
quad9-recommended: https://dns.quad9.net/dns-query
libre-dns: https://doh.libredns.gr/dns-query
opendns: https://doh.opendns.com/dns-query

- name: Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
Expand Down Expand Up @@ -113,29 +128,6 @@
- httpd-ssl.conf
- httpd.conf

- name: DoH Endpoints
ansible.builtin.blockinfile:
create: true
mode: '0644'
path: /opt/cloudflared/endpoints
block: |
adguard https://dns.adguard.com/dns-query
cloudflare https://cloudflare-dns.com/dns-query
cloudflare-security https://security.cloudflare-dns.com/dns-query
cloudflare-family https://family.cloudflare-dns.com/dns-query
applied-privacy https://doh.applied-privacy.net/query
google https://dns.google/dns-query
hurricane-electric https://ordns.he.net/dns-query
pi-dns https://doh.pi-dns.com/dns-query
quad9-recommended https://dns.quad9.net/dns-query
libre-dns https://doh.libredns.gr/dns-query
opendns https://doh.opendns.com/dns-query
- name: Set DoH URL from DoH provider var
ansible.builtin.shell: |
awk '/{{ doh_provider }}/ { print $2 }' /opt/cloudflared/endpoints
register: doh_url

- name: Cloudflared Dockerfile
ansible.builtin.blockinfile:
create: true
Expand All @@ -149,7 +141,7 @@
apt-get install -y wget && \
wget https://github.com/cloudflare/cloudflared/releases/download/2020.10.2/cloudflared-linux-arm64 --directory-prefix=/usr/local/bin/ && \
chmod 555 /usr/local/bin/cloudflared-linux-arm64
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-arm64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ doh_url.stdout }}"]
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-arm64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ url_from_doh_provider[doh_provider] }}"]
register: cloudflared_doh_dockerfile

- name: Check cloudflared image exists
Expand Down
40 changes: 16 additions & 24 deletions playbooks/cloudblock_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
become: true
tasks:

- name: Custom facts
ansible.builtin.set_fact:
url_from_doh:
adguard: https://dns.adguard.com/dns-query
cloudflare: https://cloudflare-dns.com/dns-query
cloudflare-security: https://security.cloudflare-dns.com/dns-query
cloudflare-family: https://family.cloudflare-dns.com/dns-query
applied-privacy: https://doh.applied-privacy.net/query
google: https://dns.google/dns-query
hurricane-electric: https://ordns.he.net/dns-query
pi-dns: https://doh.pi-dns.com/dns-query
quad9-recommended: https://dns.quad9.net/dns-query
libre-dns: https://doh.libredns.gr/dns-query
opendns: https://doh.opendns.com/dns-query

- name: Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
Expand Down Expand Up @@ -137,29 +152,6 @@
- httpd-ssl.conf
- httpd.conf

- name: DoH Endpoints
ansible.builtin.blockinfile:
create: true
mode: '0644'
path: /opt/cloudflared/endpoints
block: |
adguard https://dns.adguard.com/dns-query
cloudflare https://cloudflare-dns.com/dns-query
cloudflare-security https://security.cloudflare-dns.com/dns-query
cloudflare-family https://family.cloudflare-dns.com/dns-query
applied-privacy https://doh.applied-privacy.net/query
google https://dns.google/dns-query
hurricane-electric https://ordns.he.net/dns-query
pi-dns https://doh.pi-dns.com/dns-query
quad9-recommended https://dns.quad9.net/dns-query
libre-dns https://doh.libredns.gr/dns-query
opendns https://doh.opendns.com/dns-query
- name: Set DoH URL from DoH provider var
ansible.builtin.shell: |
awk '/{{ doh_provider }}/ { print $2 }' /opt/cloudflared/endpoints
register: doh_url

- name: Cloudflared Dockerfile
ansible.builtin.blockinfile:
create: true
Expand All @@ -173,7 +165,7 @@
apt-get install -y wget && \
wget https://github.com/cloudflare/cloudflared/releases/download/2023.6.1/cloudflared-linux-amd64 --directory-prefix=/usr/local/bin/ && \
chmod 555 /usr/local/bin/cloudflared-linux-amd64
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-amd64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ doh_url.stdout }}"]
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-amd64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ url_from_doh_provider[doh_provider] }}"]
register: cloudflared_doh_dockerfile

- name: Check cloudflared image exists
Expand Down
40 changes: 16 additions & 24 deletions playbooks/cloudblock_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
become: true
tasks:

- name: Custom facts
ansible.builtin.set_fact:
url_from_doh:
adguard: https://dns.adguard.com/dns-query
cloudflare: https://cloudflare-dns.com/dns-query
cloudflare-security: https://security.cloudflare-dns.com/dns-query
cloudflare-family: https://family.cloudflare-dns.com/dns-query
applied-privacy: https://doh.applied-privacy.net/query
google: https://dns.google/dns-query
hurricane-electric: https://ordns.he.net/dns-query
pi-dns: https://doh.pi-dns.com/dns-query
quad9-recommended: https://dns.quad9.net/dns-query
libre-dns: https://doh.libredns.gr/dns-query
opendns: https://doh.opendns.com/dns-query

- name: Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
Expand Down Expand Up @@ -140,29 +155,6 @@
- httpd-ssl.conf
- httpd.conf

- name: DoH Endpoints
ansible.builtin.blockinfile:
create: true
mode: '0644'
path: /opt/cloudflared/endpoints
block: |
adguard https://dns.adguard.com/dns-query
cloudflare https://cloudflare-dns.com/dns-query
cloudflare-security https://security.cloudflare-dns.com/dns-query
cloudflare-family https://family.cloudflare-dns.com/dns-query
applied-privacy https://doh.applied-privacy.net/query
google https://dns.google/dns-query
hurricane-electric https://ordns.he.net/dns-query
pi-dns https://doh.pi-dns.com/dns-query
quad9-recommended https://dns.quad9.net/dns-query
libre-dns https://doh.libredns.gr/dns-query
opendns https://doh.opendns.com/dns-query
- name: Set DoH URL from DoH provider var
ansible.builtin.shell: |
awk '/{{ doh_provider }}/ { print $2 }' /opt/cloudflared/endpoints
register: doh_url

- name: Cloudflared Dockerfile
ansible.builtin.blockinfile:
create: true
Expand All @@ -176,7 +168,7 @@
apt-get install -y wget && \
wget https://github.com/cloudflare/cloudflared/releases/download/2023.6.1/cloudflared-linux-arm64 --directory-prefix=/usr/local/bin/ && \
chmod 555 /usr/local/bin/cloudflared-linux-arm64
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-arm64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ doh_url.stdout }}"]
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-arm64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ url_from_doh_provider[doh_provider] }}"]
register: cloudflared_doh_dockerfile

- name: Check cloudflared image exists
Expand Down
40 changes: 16 additions & 24 deletions playbooks/cloudblock_aws_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
become: true
tasks:

- name: Custom facts
ansible.builtin.set_fact:
url_from_doh:
adguard: https://dns.adguard.com/dns-query
cloudflare: https://cloudflare-dns.com/dns-query
cloudflare-security: https://security.cloudflare-dns.com/dns-query
cloudflare-family: https://family.cloudflare-dns.com/dns-query
applied-privacy: https://doh.applied-privacy.net/query
google: https://dns.google/dns-query
hurricane-electric: https://ordns.he.net/dns-query
pi-dns: https://doh.pi-dns.com/dns-query
quad9-recommended: https://dns.quad9.net/dns-query
libre-dns: https://doh.libredns.gr/dns-query
opendns: https://doh.opendns.com/dns-query

- name: Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
Expand Down Expand Up @@ -113,29 +128,6 @@
- httpd-ssl.conf
- httpd.conf

- name: DoH Endpoints
ansible.builtin.blockinfile:
create: true
mode: '0644'
path: /opt/cloudflared/endpoints
block: |
adguard https://dns.adguard.com/dns-query
cloudflare https://cloudflare-dns.com/dns-query
cloudflare-security https://security.cloudflare-dns.com/dns-query
cloudflare-family https://family.cloudflare-dns.com/dns-query
applied-privacy https://doh.applied-privacy.net/query
google https://dns.google/dns-query
hurricane-electric https://ordns.he.net/dns-query
pi-dns https://doh.pi-dns.com/dns-query
quad9-recommended https://dns.quad9.net/dns-query
libre-dns https://doh.libredns.gr/dns-query
opendns https://doh.opendns.com/dns-query
- name: Set DoH URL from DoH provider var
ansible.builtin.shell: |
awk '/{{ doh_provider }}/ { print $2 }' /opt/cloudflared/endpoints
register: doh_url

- name: Cloudflared Dockerfile
ansible.builtin.blockinfile:
create: true
Expand All @@ -149,7 +141,7 @@
apt-get install -y wget && \
wget https://github.com/cloudflare/cloudflared/releases/download/2023.6.1/cloudflared-linux-amd64 --directory-prefix=/usr/local/bin/ && \
chmod 555 /usr/local/bin/cloudflared-linux-amd64
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-amd64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ doh_url.stdout }}"]
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-amd64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ url_from_doh_provider[doh_provider] }}"]
register: cloudflared_doh_dockerfile

- name: Check cloudflared image exists
Expand Down
40 changes: 16 additions & 24 deletions playbooks/cloudblock_aws_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
become: true
tasks:

- name: Custom facts
ansible.builtin.set_fact:
url_from_doh:
adguard: https://dns.adguard.com/dns-query
cloudflare: https://cloudflare-dns.com/dns-query
cloudflare-security: https://security.cloudflare-dns.com/dns-query
cloudflare-family: https://family.cloudflare-dns.com/dns-query
applied-privacy: https://doh.applied-privacy.net/query
google: https://dns.google/dns-query
hurricane-electric: https://ordns.he.net/dns-query
pi-dns: https://doh.pi-dns.com/dns-query
quad9-recommended: https://dns.quad9.net/dns-query
libre-dns: https://doh.libredns.gr/dns-query
opendns: https://doh.opendns.com/dns-query

- name: Docker apt key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
Expand Down Expand Up @@ -113,29 +128,6 @@
- httpd-ssl.conf
- httpd.conf

- name: DoH Endpoints
ansible.builtin.blockinfile:
create: true
mode: '0644'
path: /opt/cloudflared/endpoints
block: |
adguard https://dns.adguard.com/dns-query
cloudflare https://cloudflare-dns.com/dns-query
cloudflare-security https://security.cloudflare-dns.com/dns-query
cloudflare-family https://family.cloudflare-dns.com/dns-query
applied-privacy https://doh.applied-privacy.net/query
google https://dns.google/dns-query
hurricane-electric https://ordns.he.net/dns-query
pi-dns https://doh.pi-dns.com/dns-query
quad9-recommended https://dns.quad9.net/dns-query
libre-dns https://doh.libredns.gr/dns-query
opendns https://doh.opendns.com/dns-query
- name: Set DoH URL from DoH provider var
ansible.builtin.shell: |
awk '/{{ doh_provider }}/ { print $2 }' /opt/cloudflared/endpoints
register: doh_url

- name: Cloudflared Dockerfile
ansible.builtin.blockinfile:
create: true
Expand All @@ -149,7 +141,7 @@
apt-get install -y wget && \
wget https://github.com/cloudflare/cloudflared/releases/download/2023.6.1/cloudflared-linux-arm64 --directory-prefix=/usr/local/bin/ && \
chmod 555 /usr/local/bin/cloudflared-linux-arm64
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-arm64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ doh_url.stdout }}"]
ENTRYPOINT ["/usr/local/bin/cloudflared-linux-arm64", "proxy-dns","--address", "{{ docker_doh }}", "--port", "53", "--upstream", "{{ url_from_doh_provider[doh_provider] }}"]
register: cloudflared_doh_dockerfile

- name: Check cloudflared image exists
Expand Down
Loading

0 comments on commit beec888

Please sign in to comment.