parlay

yet another gentoo overlay
git clone https://git.parazyd.org/parlay
Log | Files | Refs | README

commit ebe77a997f04d0f13e7411ebfb2dc1a52721cf26
parent 890b51eddb67bbcf9ff92807bb5355f4c9baa1bd
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 21 Feb 2017 18:03:48 +0100

net-dns/dnscrypt-proxy: Add 1.9.4

Diffstat:
Anet-dns/dnscrypt-proxy/Manifest | 1+
Anet-dns/dnscrypt-proxy/dnscrypt-proxy-1.9.4.ebuild | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anet-dns/dnscrypt-proxy/files/dnscrypt-proxy.confd | 13+++++++++++++
Anet-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anet-dns/dnscrypt-proxy/files/dnscrypt-proxy.service | 20++++++++++++++++++++
5 files changed, 159 insertions(+), 0 deletions(-)

diff --git a/net-dns/dnscrypt-proxy/Manifest b/net-dns/dnscrypt-proxy/Manifest @@ -0,0 +1 @@ +DIST dnscrypt-proxy-1.9.4.tar.bz2 1286263 SHA256 fdf4a708e7922e13b14555f315ca8d5361aec89b0595b06fdbbcaacfa4e6f11e SHA512 6fca8983b57810d3db297eb12c24ef9cbdafc56cd580d4c80ce3ece8a6520f27e3ba5be8390c58e0c30ba8d0b06e332daa33de3df228706d229b8cb211ca92fd WHIRLPOOL 3c301b80960b3fa9aaa96c8960a4f823427ef01a36faf53de2909d774d51113a3973cf70dd388385dbc7acc3d030e77d0433fb79ec703d959a02dd07dd3ce40a diff --git a/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.9.4.ebuild b/net-dns/dnscrypt-proxy/dnscrypt-proxy-1.9.4.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit systemd user + +DESCRIPTION="A tool for securing communications between a client and a DNS resolver" +HOMEPAGE="https://dnscrypt.org/" +SRC_URI="https://download.dnscrypt.org/${PN}/${P}.tar.gz" +SRC_URI="https://github.com/jedisct1/${PN}/releases/download/${PV}/${P}.tar.bz2" + +LICENSE="ISC" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="+plugins systemd static-libs" + +CDEPEND=" + dev-libs/libsodium + net-libs/ldns + systemd? ( sys-apps/systemd )" +RDEPEND="${CDEPEND}" +DEPEND="${CDEPEND} + virtual/pkgconfig" + +DOCS="AUTHORS ChangeLog NEWS README* THANKS *txt" + +pkg_setup() { + enewgroup dnscrypt + enewuser dnscrypt -1 -1 /var/empty dnscrypt +} + +src_configure() { + econf \ + $(use_enable plugins) \ + $(use_with systemd) \ + $(use_enable static-libs static) +} + +src_install() { + default + + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} + systemd_dounit "${FILESDIR}"/${PN}.service +} + +pkg_postinst() { + elog "After starting the service you will need to update your" + elog "/etc/resolv.conf and replace your current set of resolvers" + elog "with:" + elog + elog "nameserver <DNSCRYPT_LOCALIP>" + elog + elog "where <DNSCRYPT_LOCALIP> is what you supplied in" + elog "/etc/conf.d/dnscrypt-proxy, default is \"127.0.0.1\"." + elog + elog "Also see https://github.com/jedisct1/dnscrypt-proxy#usage." +} diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.confd b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.confd @@ -0,0 +1,13 @@ +DNSCRYPT_LOCALIP=127.0.0.1 +DNSCRYPT_LOCALPORT=53 +DNSCRYPT_USER=dnscrypt +DNSCRYPT_OPTIONS="--ephemeral-keys" +# Pick exactly ONE of the following sets: +# option 1) selection from CSV file, uses the first column as the key +DNSCRYPT_RESOLVER_NAME=cisco # Cisco OpenDNS +DNSCRYPT_RESOLVERS_LIST=/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv +# option 2) manually specified parameters +#DNSCRYPT_RESOLVERIP=203.0.133.53 +#DNSCRYPT_RESOLVERPORT=443 +#DNSCRYPT_PROVIDER_NAME=2.dnscrypt-cert.example.com +#DNSCRYPT_PROVIDER_KEY=1234:5678:90AB:CDEF:DEAD:BEEF:CAFE:BEA7:1234:5678:90AB:CDEF:DEAD:BEEF:CAFE:BEA7 diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.initd @@ -0,0 +1,65 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +DNSCRYPT_LOGFILE=${DNSCRYPT_LOGFILE:-syslog} +DNSCRYPT_RESOLVERS_LIST=${DNSCRYPT_RESOLVERS_LIST:-/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv} + +rundir=${rundir:-/var/run/dnscrypt-proxy} +pidfile=${pidfile:-${rundir}/dnscrypt-proxy.pid} +rundir=${rundir:-/var/run/dnscrypt-proxy} +runas_user=${runas_user:-dnscrypt} +runas_group=${runas_user:-dnscrypt} + +depend() { + use net + before dns + after logger +} + +start() { + if [ ! -d "${rundir}" ]; then + mkdir "${rundir}" + if [ -n "${runas_user}" ]; then + touch "${DNSCRYPT_LOGFILE}" + chown ${runas_user}:${runas_group} "${DNSCRYPT_LOGFILE}" + chown -R ${runas_user}:${runas_group} "${rundir}" + fi + fi + + if [ -n "$DNSCRYPT_RESOLVER_NAME" -a -n "$DNSCRYPT_RESOLVERIP" ]; then + eerror "You must set exactly one of DNSCRYPT_RESOLVER_NAME or DNSCRYPT_RESOLVERIP!" + return 1 + elif [ -n "$DNSCRYPT_RESOLVER_NAME" ]; then + resolver_opts="--resolvers-list=${DNSCRYPT_RESOLVERS_LIST} --resolver-name=${DNSCRYPT_RESOLVER_NAME}" + elif [ -n "$DNSCRYPT_RESOLVERIP" ]; then + resolver_opts="--resolver-address=${DNSCRYPT_RESOLVERIP}:${DNSCRYPT_RESOLVERPORT} --provider-name=${DNSCRYPT_PROVIDER_NAME} --provider-key=${DNSCRYPT_PROVIDER_KEY}" + else + eerror "You must set exactly one of DNSCRYPT_RESOLVER_NAME or DNSCRYPT_RESOLVERIP!" + return 1 + fi + + if [ "${DNSCRYPT_LOGFILE}" = syslog ]; then + logopt="--syslog" + else + logopt="--logfile='${DNSCRYPT_LOGFILE}'" + fi + ebegin "Starting dnscrypt-proxy" + start-stop-daemon --start --quiet \ + --exec /usr/sbin/dnscrypt-proxy \ + -- \ + $logopt \ + --pidfile="${pidfile}" \ + --daemonize --user=${runas_user} \ + --local-address=${DNSCRYPT_LOCALIP}:${DNSCRYPT_LOCALPORT} \ + $resolver_opts \ + ${DNSCRYPT_OPTIONS} + eend $? +} + +stop() { + ebegin "Stopping dnscrypt-proxy" + start-stop-daemon --stop --quiet --exec /usr/sbin/dnscrypt-proxy + eend $? +} diff --git a/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.service b/net-dns/dnscrypt-proxy/files/dnscrypt-proxy.service @@ -0,0 +1,20 @@ +[Unit] +Description=A tool for securing communications between a client and a DNS resolver + +[Service] +Type=forking +PIDFile=/var/run/dnscrypt-proxy.pid +EnvironmentFile=/etc/conf.d/dnscrypt-proxy +ExecStartPre=/bin/rm -f /var/run/dnscrypt-proxy.pid +ExecStart=/usr/sbin/dnscrypt-proxy --daemonize \ + --pidfile=/var/run/dnscrypt-proxy.pid \ + --logfile=/var/log/dnscrypt-proxy.log \ + --local-address=${DNSCRYPT_LOCALIP}:${DNSCRYPT_LOCALPORT} \ + --resolver-address=${DNSCRYPT_RESOLVERIP}:${DNSCRYPT_RESOLVERPORT} \ + --provider-name=${DNSCRYPT_PROVIDER_NAME} \ + --provider-key=${DNSCRYPT_PROVIDER_KEY} \ + --user=${DNSCRYPT_USER} +Restart=on-abort + +[Install] +WantedBy=multi-user.target