Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / vpn.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2016 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
6 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages vpn)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system python)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages gnupg)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages tls)
40 #:use-module (gnu packages xml))
41
42 (define-public gvpe
43 (package
44 (name "gvpe")
45 (version "3.0")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "mirror://gnu/gvpe/gvpe-"
49 version ".tar.gz"))
50 (sha256
51 (base32
52 "1v61mj25iyd91z0ir7cmradkkcm1ffbk52c96v293ibsvjs2s2hf"))))
53 (build-system gnu-build-system)
54 (home-page "http://software.schmorp.de/pkg/gvpe.html")
55 (inputs `(("openssl" ,openssl)
56 ("zlib" ,zlib)))
57 (synopsis "Secure VPN among multiple nodes over an untrusted network")
58 (description
59 "The GNU Virtual Private Ethernet creates a virtual network
60 with multiple nodes using a variety of transport protocols. It works
61 by creating encrypted host-to-host tunnels between multiple
62 endpoints.")
63 (license license:gpl3+)))
64
65 (define-public vpnc
66 (package
67 (name "vpnc")
68 (version "0.5.3")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-"
72 version ".tar.gz"))
73 (sha256 (base32
74 "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6"))
75 (patches (search-patches "vpnc-script.patch"))))
76 (build-system gnu-build-system)
77 (inputs `(("libgcrypt" ,libgcrypt)
78 ("perl" ,perl)
79
80 ;; The following packages provide commands that 'vpnc-script'
81 ;; expects.
82 ("net-tools" ,net-tools) ;ifconfig, route
83 ("iproute2" ,iproute))) ;ip
84 (arguments
85 `(#:tests? #f ; there is no check target
86 #:phases
87 (modify-phases %standard-phases
88 (replace 'configure
89 (lambda* (#:key outputs #:allow-other-keys)
90 (let ((out (assoc-ref outputs "out")))
91 (substitute* "Makefile"
92 (("PREFIX=/usr/local") (string-append "PREFIX=" out)))
93 (substitute* "Makefile"
94 (("ETCDIR=/etc/vpnc") (string-append "ETCDIR=" out
95 "/etc/vpnc"))))))
96 (add-after 'install 'wrap-vpnc-script
97 (lambda* (#:key inputs outputs #:allow-other-keys)
98 ;; Wrap 'etc/vpnc/vpnc-script' so that it finds the commands it
99 ;; needs. Assume coreutils/grep/sed are in $PATH.
100 (let ((out (assoc-ref outputs "out")))
101 (wrap-program (string-append out "/etc/vpnc/vpnc-script")
102 `("PATH" ":" prefix
103 (,(string-append (assoc-ref inputs "net-tools")
104 "/sbin")
105 ,(string-append (assoc-ref inputs "net-tools")
106 "/bin")
107 ,(string-append (assoc-ref inputs "iproute2")
108 "/sbin"))))))))))
109 (synopsis "Client for Cisco VPN concentrators")
110 (description
111 "vpnc is a VPN client compatible with Cisco's EasyVPN equipment.
112 It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only
113 shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES,
114 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace.
115 Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
116 (license license:gpl2+) ; some file are bsd-2, see COPYING
117 (home-page "http://www.unix-ag.uni-kl.de/~massar/vpnc/")))
118
119
120 (define-public openconnect
121 (package
122 (name "openconnect")
123 (version "7.08")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/"
127 "openconnect-" version ".tar.gz"))
128 (sha256 (base32
129 "00wacb79l2c45f94gxs63b9z25wlciarasvjrb8jb8566wgyqi0w"))))
130 (build-system gnu-build-system)
131 (inputs
132 `(("libxml2" ,libxml2)
133 ("gnutls" ,gnutls)
134 ("vpnc" ,vpnc)
135 ("zlib" ,zlib)))
136 (native-inputs
137 `(("gettext" ,gettext-minimal)
138 ("pkg-config" ,pkg-config)))
139 (arguments
140 `(#:configure-flags
141 `(,(string-append "--with-vpnc-script="
142 (assoc-ref %build-inputs "vpnc")
143 "/etc/vpnc/vpnc-script"))))
144 (synopsis "Client for Cisco VPN")
145 (description
146 "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is
147 supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500,
148 870, 880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers,
149 and probably others.")
150 (license license:lgpl2.1)
151 (home-page "http://www.infradead.org/openconnect/")))
152
153 (define-public openvpn
154 (package
155 (name "openvpn")
156 (version "2.4.3")
157 (source (origin
158 (method url-fetch)
159 (uri (string-append
160 "https://swupdate.openvpn.org/community/releases/openvpn-"
161 version ".tar.xz"))
162 (sha256
163 (base32
164 "1yrnvvnap2ghqas10l8jfg3njx57b8swh3n9wyp556qqgz4mzq8m"))))
165 (build-system gnu-build-system)
166 (arguments
167 '(#:configure-flags '("--enable-iproute2=yes")))
168 (native-inputs
169 `(("iproute2" ,iproute)))
170 (inputs
171 `(("lzo" ,lzo)
172 ("openssl" ,openssl)
173 ("linux-pam" ,linux-pam)))
174 (home-page "https://openvpn.net/")
175 (synopsis "Virtual private network daemon")
176 (description "OpenVPN implements virtual private network (VPN) techniques
177 for creating secure point-to-point or site-to-site connections in routed or
178 bridged configurations and remote access facilities. It uses a custom
179 security protocol that utilizes SSL/TLS for key exchange. It is capable of
180 traversing network address translators (NATs) and firewalls.")
181 (license license:gpl2)))
182
183 (define-public tinc
184 (package
185 (name "tinc")
186 (version "1.0.28")
187 (source (origin
188 (method url-fetch)
189 (uri (string-append "http://tinc-vpn.org/packages/"
190 name "-" version ".tar.gz"))
191 (sha256
192 (base32
193 "0i5kx3hza359nclyhb60kxlzqyx0phmg175350hww28g6scjcl0b"))))
194 (build-system gnu-build-system)
195 (arguments
196 '(#:configure-flags
197 '("--sysconfdir=/etc"
198 "--localstatedir=/var")))
199 (inputs `(("zlib" ,zlib)
200 ("lzo" ,lzo)
201 ("openssl" ,openssl)))
202 (home-page "http://tinc-vpn.org")
203 (synopsis "Virtual Private Network (VPN) daemon")
204 (description
205 "Tinc is a VPN that uses tunnelling and encryption to create a secure
206 private network between hosts on the internet.")
207 (license license:gpl2+)))
208
209 (define-public sshuttle
210 (package
211 (name "sshuttle")
212 (version "0.78.3")
213 (source
214 (origin
215 (method url-fetch)
216 (uri (pypi-uri name version))
217 (sha256
218 (base32
219 "12xyq5h77b57cnkljdk8qyjxzys512b73019s20x6ck5brj1m8wa"))))
220 (build-system python-build-system)
221 (native-inputs
222 `(("python-setuptools-scm" ,python-setuptools-scm)
223 ;; For tests only.
224 ("python-mock" ,python-mock)
225 ("python-pytest" ,python-pytest)
226 ("python-pytest-runner" ,python-pytest-runner)))
227 (home-page "https://github.com/sshuttle/sshuttle")
228 (synopsis "VPN that transparently forwards connections over SSH")
229 (description "sshuttle creates an encrypted virtual private network (VPN)
230 connection to any remote server to which you have secure shell (SSH) access.
231 The only requirement is a suitable version of Python on the server;
232 administrative privileges are required only on the client. Unlike most VPNs,
233 sshuttle forwards entire sessions, not packets, using kernel transparent
234 proxying. This makes it faster and more reliable than SSH's own tunneling and
235 port forwarding features. It can forward both TCP and UDP traffic, including
236 DNS domain name queries.")
237 (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’
238
239 (define-public sshoot
240 (package
241 (name "sshoot")
242 (version "1.2.6")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (pypi-uri name version))
247 (sha256
248 (base32
249 "1ccgh0hjyxrwkgy3hnxz3hgbjbs0lmfs25d5l5jam0xbpcpj63h0"))))
250 (build-system python-build-system)
251 (arguments
252 '(#:phases
253 (modify-phases %standard-phases
254 (add-after 'unpack 'patch-paths
255 (lambda _
256 (substitute* "sshoot/tests/test_manager.py"
257 (("/bin/sh") (which "sh")))
258 #t)))))
259 (inputs
260 `(("python-argcomplete" ,python-argcomplete)
261 ("python-prettytable" ,python-prettytable)
262 ("python-pyyaml" ,python-pyyaml)))
263 ;; For tests only.
264 (native-inputs
265 `(("python-fixtures" ,python-fixtures)
266 ("python-pbr" ,python-pbr)
267 ("python-testtools" ,python-testtools)))
268 (home-page "https://github.com/albertodonato/sshoot")
269 (synopsis "sshuttle VPN session manager")
270 (description "sshoot provides a command-line interface to manage multiple
271 @command{sshuttle} virtual private networks. It supports flexible profiles
272 with configuration options for most of @command{sshuttle}’s features.")
273 (license license:gpl3+)))