2018-01-24 14:44:32 +01:00
|
|
|
[Unit]
|
2018-03-26 20:48:22 +02:00
|
|
|
Description=DNSCrypt-proxy client
|
|
|
|
Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Use systemd sockets. Disable on TCP_NODELAY fail. Then define ip address in dnscrypt-proxy.toml.
|
2018-01-24 14:44:32 +01:00
|
|
|
Requires=dnscrypt-proxy.socket
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Start service after the network is online.
|
|
|
|
## Requires a wait service such as NetworkManager or systemd-networkd.
|
|
|
|
## Verify using:
|
|
|
|
## systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service
|
|
|
|
## Then enable:
|
|
|
|
## systemctl enable NetworkManager-wait-online.service
|
|
|
|
## Or alternatively:
|
|
|
|
## systemctl enable systemd-networkd-wait-online.service
|
2018-04-18 18:31:58 +02:00
|
|
|
After=network-online.target
|
2018-04-20 07:00:24 +02:00
|
|
|
Wants=network-online.target
|
|
|
|
|
|
|
|
## DNSCrypt-proxy provides and requires name resolution.
|
2018-01-24 14:44:32 +01:00
|
|
|
Before=nss-lookup.target
|
2018-02-02 15:51:38 +01:00
|
|
|
Wants=nss-lookup.target
|
2018-01-24 14:44:32 +01:00
|
|
|
|
|
|
|
[Service]
|
2018-04-20 07:00:24 +02:00
|
|
|
## Set O_NONBLOCK flag for socket unit.
|
2018-01-24 14:44:32 +01:00
|
|
|
NonBlocking=true
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Execute dnscrypt-proxy with configuration file.
|
2018-03-26 20:48:22 +02:00
|
|
|
ExecStart=/usr/bin/dnscrypt-proxy --config /etc/dnscrypt-proxy/dnscrypt-proxy.toml
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Make /home, /root and /run/user read only.
|
2018-03-26 20:48:22 +02:00
|
|
|
ProtectHome=yes
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Make Linux control groups read only.
|
2018-03-26 20:48:22 +02:00
|
|
|
ProtectControlGroups=yes
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Deny explicit module loading.
|
2018-03-26 20:48:22 +02:00
|
|
|
ProtectKernelModules=yes
|
2018-03-24 19:06:40 +01:00
|
|
|
|
2018-04-20 07:00:24 +02:00
|
|
|
## Run dnscrypt-proxy as unprivileged user with
|
|
|
|
## temporary assigned UID/GID. See man:systemd.exec
|
|
|
|
## for more info. Requires systemd 232+.
|
2018-03-26 20:48:22 +02:00
|
|
|
DynamicUser=yes
|
|
|
|
CacheDirectory=dnscrypt-proxy
|
|
|
|
LogsDirectory=dnscrypt-proxy
|
|
|
|
RuntimeDirectory=dnscrypt-proxy
|
|
|
|
|
|
|
|
[Install]
|
2018-04-20 07:00:24 +02:00
|
|
|
## Install socket unit.
|
2018-03-26 20:48:22 +02:00
|
|
|
Also=dnscrypt-proxy.socket
|
2018-04-20 07:00:24 +02:00
|
|
|
|
|
|
|
## Create symlink for systemd to pull in the unit when starting multi-user.target
|
|
|
|
## Can be found in /etc/systemd/system/multi-user.target.wants/
|
2018-03-26 20:48:22 +02:00
|
|
|
WantedBy=multi-user.target
|