From 633d7e1337c86cb3ea30454560fb055166f7eea7f5595349022ba3785970114e Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Sat, 6 Aug 2016 14:58:36 +0000 Subject: [PATCH] Accepting request 417269 from home:MargueriteSu:branches:server:dns OBS-URL: https://build.opensuse.org/request/show/417269 OBS-URL: https://build.opensuse.org/package/show/server:dns/dnscrypt-proxy?expand=0&rev=10 --- dnscrypt-proxy.changes | 2 +- dnscrypt-proxy.service | 39 +++++++++++++++++++++++++++++++++++++++ dnscrypt-proxy.spec | 4 +++- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 dnscrypt-proxy.service diff --git a/dnscrypt-proxy.changes b/dnscrypt-proxy.changes index 72967fd..74a129c 100644 --- a/dnscrypt-proxy.changes +++ b/dnscrypt-proxy.changes @@ -11,7 +11,7 @@ Sat Aug 6 04:14:25 UTC 2016 - i@marguerite.su * Libevent was updated to version 2.0.23. * Certificates serial numbers are printed as a string if possible. * The list of known public resolvers was updated. -- use upstream's systemd service/socket, fix boo#977946 again +- add upstream's systemd socket, fix boo#977946 again ------------------------------------------------------------------- Thu Jun 9 09:59:26 UTC 2016 - i@marguerite.su diff --git a/dnscrypt-proxy.service b/dnscrypt-proxy.service new file mode 100644 index 0000000..14f00e0 --- /dev/null +++ b/dnscrypt-proxy.service @@ -0,0 +1,39 @@ +# This file is part of dnscrypt-proxy +# Author: Marguerite Su with some AUR references. +# Version: 1.7.0 +# Description: dnscrypt is a tool that encrypts your DNS queries in order to +# protect against man-in-the-middle attacks and DNS hijacking +# (commonly seen in China). It uses OpenDNS resolvers by default. +# It is BSD-licensed. +# In openSUSE it's licensed under SuSE-Permissive (non-free ware). +# For details, refer to its documentation. +[Unit] +Description=Secure connection between your computer and a DNS resolver +Documentation=man:dnscrypt-proxy(8) +Requires=dnscrypt-proxy.socket +After=network.target ntp.service +# NTP always has local servers, and there's nothing to encrypt for time. +# and ntp.service isn't native systemd service, if we start before it, +# it will take a long time to sync. just save 20000+ms on boot. +Before=nss-lookup.target + +[Service] +Type=forking +NonBlocking=true +PIDFile=/var/run/dnscrypt-proxy.pid +# Execute a wrapper that calls the dnscrypt-proxy with config from +# /etc/sysconfig/dnscrypt and substitutes defaults that cannot be passed +# to ExecStart in combination with EnvironmentFile +ExecStart=/usr/sbin/dnscrypt \ + --daemonize \ + --pidfile=/var/run/dnscrypt-proxy.pid \ + --user=dnscrypt \ + --resolvers-list=/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv \ + --logfile=/var/log/dnscrypt-proxy.log +# Automatically Restart +Restart=on-abort + +[Install] +Also=dnscrypt-proxy.socket +WantedBy=multi-user.target +Alias=dnscrypt.service diff --git a/dnscrypt-proxy.spec b/dnscrypt-proxy.spec index 32c4938..cc77c6d 100644 --- a/dnscrypt-proxy.spec +++ b/dnscrypt-proxy.spec @@ -25,11 +25,13 @@ Group: Productivity/Networking/DNS/Utilities #Git-Url: https://github.com/jedisct1/dnscrypt-proxy Url: https://dnscrypt.org Source: https://download.dnscrypt.org/dnscrypt-proxy/%{name}-%{version}.tar.bz2 +Source1: %{name}.service Source2: dnscrypt Source3: sysconfig.dnscrypt Source4: https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv BuildRequires: libsodium-devel BuildRequires: libtool +BuildRequires: pkg-config BuildRequires: shadow Requires(pre): fillup coreutils grep diffutils Provides: dnscrypt = %{version}-%{release} @@ -75,7 +77,7 @@ make %{?_smp_mflags} %make_install install -d -m 755 %{buildroot}%{_unitdir} -install -m 644 dnscrypt-proxy.service %{buildroot}%{_unitdir} +install -m 644 %{SOURCE1} %{buildroot}%{_unitdir} install -m 644 dnscrypt-proxy.socket %{buildroot}%{_unitdir} install -d -m 755 %{buildroot}%{_sbindir} install -m 755 %{SOURCE2} %{buildroot}%{_sbindir}