Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/dnscrypt-proxy/files/, net-dns/dnscrypt-proxy/
Date: Fri, 11 May 2018 09:36:50
Message-Id: 1526030686.63b61ddab4f32b66e1c02a449e8b629fbd498ee4.mgorny@gentoo
1 commit: 63b61ddab4f32b66e1c02a449e8b629fbd498ee4
2 Author: Georgy Yakovlev <ya <AT> sysdump <DOT> net>
3 AuthorDate: Fri May 11 02:38:11 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri May 11 09:24:46 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63b61dda
7
8 net-dns/dnscrypt-proxy: version bump to 2.0.12
9
10 Package-Manager: Portage-2.3.36, Repoman-2.3.9
11
12 net-dns/dnscrypt-proxy/Manifest | 1 +
13 .../dnscrypt-proxy/dnscrypt-proxy-2.0.12.ebuild | 97 ++++++++++++++++++++++
14 .../dnscrypt-proxy/files/dnscrypt-proxy-2.confd | 3 +
15 .../dnscrypt-proxy/files/dnscrypt-proxy-2.initd | 19 +++++
16 .../dnscrypt-proxy/files/dnscrypt-proxy-2.service | 39 +++++++++
17 .../dnscrypt-proxy/files/dnscrypt-proxy-2.socket | 21 +++++
18 6 files changed, 180 insertions(+)
19
20 diff --git a/net-dns/dnscrypt-proxy/Manifest b/net-dns/dnscrypt-proxy/Manifest
21 index 21c7549a544..fca34637fe1 100644
22 --- a/net-dns/dnscrypt-proxy/Manifest
23 +++ b/net-dns/dnscrypt-proxy/Manifest
24 @@ -1,2 +1,3 @@
25 DIST dnscrypt-proxy-1.9.5.tar.bz2 1290573 BLAKE2B 8f16fdb58012e00a8b58d36364377c3bc25158b9484a8df2bd6bc98d1c9cbf5ac758997e31f95ecaeb9da2f6b7272316c5a4a1c069a39549fbc1c1b136857da0 SHA512 84c0f7587521b3a198292cf20dd71cb592ccf8a9e003abbc62c5ca112f6c5ed27c49b1642cf91f403d52b4147e25f24af540b65cecfcf93814338329097df836
26 DIST dnscrypt-proxy-2.0.11.tar.gz 2774458 BLAKE2B 36c9109a682a0d70c32910a44a64f49ebf0a958660154c10bf3687da3fdaa405e8add43717267f30a79d96941160cda5994704060a78e2ee6bbeddc55ff87766 SHA512 5e306c3bff65d0375b650666e2191c6f54e72bb0d2d2f6f8f7b941ffc063eb7eb244a52eb69b0b008dc566e9a6ce8a8f75929edb6762fad4751d966aa2da98a0
27 +DIST dnscrypt-proxy-2.0.12.tar.gz 2775112 BLAKE2B c3a1085c7c4d005d323d2d3e803b7bce447b86a8f2e9bff0eb7e5e145d275dd19fe6913c805be9469ba0a492f7a479a146af56a769432d8120790375628bb936 SHA512 757a7a88e8f6ed61462736184f0ca8426c40f800f54727881412de44c527e4334a6b42aa6906c19ecf9287d462a1ec7bd55cb471781bd94c2a0faa8ad7055137
28
29 diff --git a/net-dns/dnscrypt-proxy/dnscrypt-proxy-2.0.12.ebuild b/net-dns/dnscrypt-proxy/dnscrypt-proxy-2.0.12.ebuild
30 new file mode 100644
31 index 00000000000..0b64d8b992e
32 --- /dev/null
33 +++ b/net-dns/dnscrypt-proxy/dnscrypt-proxy-2.0.12.ebuild
34 @@ -0,0 +1,97 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +EGO_PN="github.com/jedisct1/${PN}"
41 +
42 +inherit fcaps golang-build systemd user
43 +
44 +DESCRIPTION="A flexible DNS proxy, with support for encrypted DNS protocols"
45 +HOMEPAGE="https://github.com/jedisct1/dnscrypt-proxy"
46 +SRC_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
47 +
48 +LICENSE="ISC"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm ~x86"
51 +
52 +FILECAPS=( cap_net_bind_service+ep usr/bin/dnscrypt-proxy )
53 +PATCHES=( "${FILESDIR}"/config-full-paths-r10.patch )
54 +
55 +pkg_setup() {
56 + enewgroup dnscrypt-proxy
57 + enewuser dnscrypt-proxy -1 -1 /var/empty dnscrypt-proxy
58 +}
59 +
60 +src_prepare() {
61 + default
62 + # Create directory structure suitable for building
63 + mkdir -p "src/${EGO_PN%/*}" || die
64 + mv "${PN}" "src/${EGO_PN}" || die
65 + mv "vendor" "src/" || die
66 +}
67 +
68 +src_install() {
69 + dobin dnscrypt-proxy
70 +
71 + insinto /etc/dnscrypt-proxy
72 + newins "src/${EGO_PN}"/example-dnscrypt-proxy.toml dnscrypt-proxy.toml
73 + doins "src/${EGO_PN}"/example-{blacklist.txt,whitelist.txt}
74 + doins "src/${EGO_PN}"/example-{cloaking-rules.txt,forwarding-rules.txt}
75 +
76 + insinto "/usr/share/dnscrypt-proxy"
77 + doins -r "utils/generate-domains-blacklists/."
78 +
79 + newinitd "${FILESDIR}"/dnscrypt-proxy-2.initd dnscrypt-proxy
80 + newconfd "${FILESDIR}"/dnscrypt-proxy-2.confd dnscrypt-proxy
81 + systemd_newunit "${FILESDIR}"/dnscrypt-proxy-2.service dnscrypt-proxy.service
82 + systemd_newunit "${FILESDIR}"/dnscrypt-proxy-2.socket dnscrypt-proxy.socket
83 +
84 + einstalldocs
85 +}
86 +
87 +pkg_postinst() {
88 + fcaps_pkg_postinst
89 +
90 + if ! use filecaps; then
91 + ewarn "'filecaps' USE flag is disabled"
92 + ewarn "${PN} will fail to listen on port 53"
93 + ewarn "please do one the following:"
94 + ewarn "1) re-enable 'filecaps'"
95 + ewarn "2) change port to > 1024"
96 + ewarn "3) configure to run ${PN} as root (not recommended)"
97 + ewarn
98 + fi
99 +
100 + local v
101 + for v in ${REPLACING_VERSIONS}; do
102 + if [[ ${v} == 1.* ]] ; then
103 + elog "Version 2 is a complete rewrite of ${PN}"
104 + elog "please clean up old config/log files"
105 + elog
106 + fi
107 + if [[ ${v} == 2.* ]] ; then
108 + elog "As of version 2.0.12 of ${PN} runs as an 'dnscrypt-proxy' user/group"
109 + elog "you can remove obsolete 'dnscrypt' accounts from the system"
110 + elog
111 + fi
112 + done
113 +
114 + if systemd_is_booted || has_version sys-apps/systemd; then
115 + elog "Using systemd socket activation may cause issues with speed"
116 + elog "latency and reliability of ${PN} and is discouraged by upstream"
117 + elog "Existing installations advised to disable 'dnscrypt-proxy.socket'"
118 + elog "It is disabled by default for new installations"
119 + elog "check "$(systemd_get_systemunitdir)/${PN}.service" for details"
120 + elog
121 +
122 + fi
123 +
124 + elog "After starting the service you will need to update your"
125 + elog "/etc/resolv.conf and replace your current set of resolvers"
126 + elog "with:"
127 + elog
128 + elog "nameserver 127.0.0.1"
129 + elog
130 + elog "Also see https://github.com/jedisct1/${PN}/wiki"
131 +}
132
133 diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.confd b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.confd
134 new file mode 100644
135 index 00000000000..fb40827a77e
136 --- /dev/null
137 +++ b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.confd
138 @@ -0,0 +1,3 @@
139 +#DNSCRYPT_PROXY_OPTS="--config /etc/dnscrypt-proxy/dnscrypt-proxy.toml"
140 +#DNSCRYPT_PROXY_USER="dnscrypt-proxy"
141 +#DNSCRYPT_PROXY_GROUP="dnscrypt-proxy"
142
143 diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.initd b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.initd
144 new file mode 100644
145 index 00000000000..74c2dad63f7
146 --- /dev/null
147 +++ b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.initd
148 @@ -0,0 +1,19 @@
149 +#!/sbin/openrc-run
150 +# Copyright 1999-2018 Gentoo Foundation
151 +# Distributed under the terms of the GNU General Public License v2
152 +
153 +command="/usr/bin/dnscrypt-proxy"
154 +command_args="${DNSCRYPT_PROXY_OPTS:--config /etc/dnscrypt-proxy/dnscrypt-proxy.toml}"
155 +command_user="${DNSCRYPT_PROXY_USER:-dnscrypt-proxy}:${DNSCRYPT_PROXY_GROUP:-dnscrypt-proxy}"
156 +pidfile="/run/${RC_SVCNAME}.pid"
157 +start_stop_daemon_args="--background --make-pidfile"
158 +
159 +depend() {
160 + use net logger
161 + provide dns
162 +}
163 +
164 +start_pre() {
165 + checkpath -q -d -m 0775 -o "${command_user}" /var/cache/"${SVCNAME}"
166 + checkpath -q -d -m 0775 -o "${command_user}" /var/log/"${SVCNAME}"
167 +}
168
169 diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.service b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.service
170 new file mode 100644
171 index 00000000000..ed02955621b
172 --- /dev/null
173 +++ b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.service
174 @@ -0,0 +1,39 @@
175 +[Unit]
176 +Description=DNSCrypt-proxy client
177 +Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
178 +
179 +## systemd sockets - Do not enable unless you are very familiar with the systemd socket activation mechanism.
180 +## Always try without systemd sockets before reporting any issues related to speed, latency or reliability.
181 +## If you enable this, the `listen_addresses` list in the main configuration file can be empty.
182 +## Or, at least, the addresses it contains should not overlap with the systemd socket addresses.
183 +
184 +# Requires=dnscrypt-proxy.socket
185 +
186 +After=network.target
187 +Wants=network.target
188 +Before=nss-lookup.target
189 +Wants=nss-lookup.target
190 +
191 +[Service]
192 +ExecStart=/usr/bin/dnscrypt-proxy --config /etc/dnscrypt-proxy/dnscrypt-proxy.toml
193 +NonBlocking=true
194 +
195 +DynamicUser=yes
196 +
197 +ProtectControlGroups=yes
198 +ProtectKernelModules=yes
199 +ProtectKernelTunables=yes
200 +
201 +CacheDirectory=dnscrypt-proxy
202 +ConfigurationDirectory=dnscrypt-proxy
203 +LogsDirectory=dnscrypt-proxy
204 +RuntimeDirectory=dnscrypt-proxy
205 +
206 +## Allow binding to 127.0.0.1:53 as non-root user
207 +## without the .socket unit
208 +CapabilityBoundingSet=CAP_NET_BIND_SERVICE
209 +AmbientCapabilities=CAP_NET_BIND_SERVICE
210 +
211 +[Install]
212 +Also=dnscrypt-proxy.socket
213 +WantedBy=multi-user.target
214
215 diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.socket b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.socket
216 new file mode 100644
217 index 00000000000..ea38c90e8a5
218 --- /dev/null
219 +++ b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy-2.socket
220 @@ -0,0 +1,21 @@
221 +[Unit]
222 +Description=DNSCrypt-proxy socket
223 +Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
224 +
225 +[Socket]
226 +## Listen on TCP socket.
227 +ListenStream=127.0.0.1:53
228 +
229 +## Listen on UDP socket.
230 +ListenDatagram=127.0.0.1:53
231 +
232 +## Below options are valid only for TCP socket.
233 +## Applying them to UDP socket will result in warnings:
234 +## TCP_NODELAY failed: Protocol not available
235 +## TCP_DEFER_ACCEPT failed: Protocol not available
236 +## Those can be safely ignored.
237 +NoDelay=true
238 +DeferAcceptSec=1
239 +
240 +[Install]
241 +WantedBy=sockets.target