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