-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c92ede5
commit b55fb4f
Showing
22 changed files
with
654 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
--- | ||
listen_port: "{% if local_dns|d(false)|bool == true %}5353{% else %}53{% endif %}" | ||
dingo_flags: -gdns:auto -port {{ listen_port }} -bind {{ local_service_ip }} | ||
# the version used if the latest unavailable (in case of Github API rate limited) | ||
dnscrypt_proxy_version: 2.0.10 | ||
apparmor_enabled: true | ||
dingo_version_if_latest_unavailable: 0.13 | ||
dns_encryption: true | ||
dns_encryption_provider: default | ||
dns_encryption_servers: | ||
cloudflare: | ||
ipv4: | ||
- 1.1.1.1@853 | ||
- 1.0.0.1@853 | ||
ipv6: | ||
- 2606:4700:4700::1111@853 | ||
- 2606:4700:4700::1001@853 | ||
dns_encryption_provider: "*" |
23 changes: 23 additions & 0 deletions
23
roles/dns_encryption/files/apparmor.profile.dnscrypt-proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <tunables/global> | ||
|
||
/usr/sbin/dnscrypt-proxy { | ||
#include <abstractions/base> | ||
#include <abstractions/nameservice> | ||
#include <abstractions/openssl> | ||
|
||
capability chown, | ||
capability dac_override, | ||
capability net_bind_service, | ||
capability setgid, | ||
capability setuid, | ||
capability sys_resource, | ||
|
||
/etc/dnscrypt-proxy.toml r, | ||
/etc/ld.so.cache r, | ||
/usr/sbin/dnscrypt-proxy mr, | ||
/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv r, | ||
/usr/local/lib/{@{multiarch}/,}libldns.so* mr, | ||
/usr/local/lib/{@{multiarch}/,}libsodium.so* mr, | ||
/run/dnscrypt-proxy.pid rw, | ||
/run/systemd/notify rw, | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
|
||
# PROVIDE: dnscrypt-proxy | ||
# REQUIRE: LOGIN | ||
# BEFORE: securelevel | ||
# KEYWORD: shutdown | ||
|
||
# Add the following lines to /etc/rc.conf to enable `dnscrypt-proxy': | ||
# | ||
# dnscrypt_proxy_enable="YES" | ||
# dnscrypt_proxy_flags="<set as needed>" | ||
# | ||
# See rsync(1) for rsyncd_flags | ||
# | ||
|
||
. /etc/rc.subr | ||
|
||
name="dnscrypt-proxy" | ||
rcvar=dnscrypt_proxy_enable | ||
load_rc_config "$name" | ||
pidfile="/var/run/$name.pid" | ||
start_cmd=dnscrypt_proxy_start | ||
stop_postcmd=dnscrypt_proxy_stop | ||
|
||
: ${dnscrypt_proxy_enable="NO"} | ||
: ${dnscrypt_proxy_flags="-config /usr/local/etc/dnscrypt-proxy/dnscrypt-proxy.toml"} | ||
|
||
dnscrypt_proxy_start() { | ||
echo "Starting dnscrypt-proxy..." | ||
touch ${pidfile} | ||
/usr/sbin/daemon -cS -T dnscrypt-proxy -p ${pidfile} /usr/dnscrypt-proxy/freebsd-amd64/dnscrypt-proxy ${dnscrypt_proxy_flags} | ||
} | ||
|
||
dnscrypt_proxy_stop() { | ||
[ -f ${pidfile} ] && rm ${pidfile} | ||
} | ||
|
||
run_rc_command "$1" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
- name: FreeBSD | Ensure that the required directories exist | ||
file: | ||
path: "{{ item }}" | ||
state: directory | ||
with_items: | ||
- "{{ config_prefix|default('/') }}etc/dnscrypt-proxy/" | ||
- /usr/dnscrypt-proxy/ | ||
|
||
- name: Required tools installed | ||
package: | ||
name: gtar | ||
|
||
- name: FreeBSD | Retrive the latest versions | ||
uri: | ||
url: https://api.github.com/repos/jedisct1/dnscrypt-proxy/releases/latest | ||
register: dnscrypt_proxy_latest | ||
ignore_errors: true | ||
|
||
- name: FreeBSD | Set default dnscrypt-proxy assets | ||
set_fact: | ||
dnscrypt_proxy_latest: | ||
json: | ||
assets: | ||
- name: "dnscrypt-proxy-freebsd_amd64-{{ dnscrypt_proxy_version }}.tar.gz" | ||
browser_download_url: "https://github.com/jedisct1/dnscrypt-proxy/releases/download/{{ dnscrypt_proxy_version }}/dnscrypt-proxy-freebsd_amd64-{{ dnscrypt_proxy_version }}.tar.gz" | ||
when: dnscrypt_proxy_latest.failed | ||
|
||
- name: FreeBSD | Download the latest archive | ||
get_url: | ||
url: "{{ item['browser_download_url'] }}" | ||
dest: "/tmp/dnscrypt-proxy-freebsd_amd64-{{ dnscrypt_proxy_version }}.tar.gz" | ||
mode: '0755' | ||
force: true | ||
with_items: "{{ dnscrypt_proxy_latest['json']['assets'] }}" | ||
no_log: true | ||
when: '"freebsd_amd64" in item.name' | ||
notify: restart dnscrypt-proxy | ||
|
||
- name: FreeBSD | Extract the latest archive | ||
unarchive: | ||
remote_src: true | ||
src: /tmp/dnscrypt-proxy-freebsd_amd64-{{ dnscrypt_proxy_version }}.tar.gz | ||
dest: /usr/dnscrypt-proxy | ||
|
||
- name: FreeBSD | Configure rc script | ||
copy: | ||
src: rc.dnscrypt-proxy.sh | ||
dest: /usr/local/etc/rc.d/dnscrypt-proxy | ||
mode: "0755" | ||
notify: restart dnscrypt-proxy |
Oops, something went wrong.