Commit | Line | Data |
---|---|---|
49f24f41 AE |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> | |
b6bee63b | 3 | ;;; Copyright © 2013, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> |
d4bf49b1 | 4 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> |
feca8e2b | 5 | ;;; Copyright © 2015 Jeff Mickey <j@codemac.net> |
0d7f282b | 6 | ;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il> |
e4aa83be | 7 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
fa3346b8 | 8 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
01224157 | 9 | ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com> |
7ba2b274 | 10 | ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com> |
c1005113 | 11 | ;;; Copyright © 2019, 2020 Leo Famulari <leo@famulari.name> |
9fd6ad3e | 12 | ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com> |
b47e083b | 13 | ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> |
3b177a6c | 14 | ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re> |
49f24f41 AE |
15 | ;;; |
16 | ;;; This file is part of GNU Guix. | |
17 | ;;; | |
18 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
19 | ;;; under the terms of the GNU General Public License as published by | |
20 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
21 | ;;; your option) any later version. | |
22 | ;;; | |
23 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
24 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
26 | ;;; GNU General Public License for more details. | |
27 | ;;; | |
28 | ;;; You should have received a copy of the GNU General Public License | |
29 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
30 | ||
31 | (define-module (gnu packages vpn) | |
b5b73a82 | 32 | #:use-module ((guix licenses) #:prefix license:) |
49f24f41 AE |
33 | #:use-module (guix packages) |
34 | #:use-module (guix download) | |
06d91fd9 | 35 | #:use-module (guix git-download) |
7ba2b274 | 36 | #:use-module (guix build-system cmake) |
49f24f41 | 37 | #:use-module (guix build-system gnu) |
3b177a6c | 38 | #:use-module (guix build-system linux-module) |
5c863d57 | 39 | #:use-module (guix build-system python) |
49f24f41 | 40 | #:use-module (gnu packages) |
1b17c23e | 41 | #:use-module (gnu packages admin) |
06d91fd9 | 42 | #:use-module (gnu packages base) |
d084e71c | 43 | #:use-module (gnu packages bash) |
ac257f12 | 44 | #:use-module (gnu packages check) |
d084e71c | 45 | #:use-module (gnu packages dns) |
01224157 | 46 | #:use-module (gnu packages autotools) |
71f4b81a | 47 | #:use-module (gnu packages compression) |
1dba6407 | 48 | #:use-module (gnu packages gettext) |
49f24f41 | 49 | #:use-module (gnu packages gnupg) |
b47e083b | 50 | #:use-module (gnu packages guile) |
01224157 | 51 | #:use-module (gnu packages libevent) |
dc77f0d3 | 52 | #:use-module (gnu packages linux) |
aff0cce9 | 53 | #:use-module (gnu packages nss) |
71f4b81a AE |
54 | #:use-module (gnu packages perl) |
55 | #:use-module (gnu packages pkg-config) | |
5c863d57 | 56 | #:use-module (gnu packages python) |
44d10b1f | 57 | #:use-module (gnu packages python-xyz) |
a7fd7b68 | 58 | #:use-module (gnu packages tls) |
71f4b81a | 59 | #:use-module (gnu packages xml)) |
49f24f41 | 60 | |
7af8a9b7 LC |
61 | (define-public gvpe |
62 | (package | |
63 | (name "gvpe") | |
574d877e | 64 | (version "3.1") |
7af8a9b7 LC |
65 | (source (origin |
66 | (method url-fetch) | |
67 | (uri (string-append "mirror://gnu/gvpe/gvpe-" | |
68 | version ".tar.gz")) | |
69 | (sha256 | |
70 | (base32 | |
574d877e | 71 | "1cz8n75ksl0l908zc5l3rnfm1hv7130s2w8710799fr5sxrdbszi")))) |
7af8a9b7 LC |
72 | (build-system gnu-build-system) |
73 | (home-page "http://software.schmorp.de/pkg/gvpe.html") | |
574d877e | 74 | (native-inputs `(("pkg-config" ,pkg-config))) |
7af8a9b7 LC |
75 | (inputs `(("openssl" ,openssl) |
76 | ("zlib" ,zlib))) | |
77 | (synopsis "Secure VPN among multiple nodes over an untrusted network") | |
78 | (description | |
79 | "The GNU Virtual Private Ethernet creates a virtual network | |
80 | with multiple nodes using a variety of transport protocols. It works | |
81 | by creating encrypted host-to-host tunnels between multiple | |
82 | endpoints.") | |
83 | (license license:gpl3+))) | |
84 | ||
49f24f41 AE |
85 | (define-public vpnc |
86 | (package | |
87 | (name "vpnc") | |
88 | (version "0.5.3") | |
89 | (source (origin | |
90 | (method url-fetch) | |
594360f5 | 91 | (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-" |
49f24f41 AE |
92 | version ".tar.gz")) |
93 | (sha256 (base32 | |
101e67ac | 94 | "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6")))) |
49f24f41 AE |
95 | (build-system gnu-build-system) |
96 | (inputs `(("libgcrypt" ,libgcrypt) | |
42c97811 | 97 | ("perl" ,perl) |
101e67ac | 98 | ("vpnc-scripts" ,vpnc-scripts))) |
49f24f41 AE |
99 | (arguments |
100 | `(#:tests? #f ; there is no check target | |
49f24f41 | 101 | #:phases |
42c97811 | 102 | (modify-phases %standard-phases |
101e67ac | 103 | (add-after 'unpack 'use-store-paths |
42c97811 | 104 | (lambda* (#:key inputs outputs #:allow-other-keys) |
101e67ac TGR |
105 | (let ((out (assoc-ref outputs "out")) |
106 | (vpnc-scripts (assoc-ref inputs "vpnc-scripts"))) | |
107 | (substitute* "config.c" | |
108 | (("/etc/vpnc/vpnc-script") | |
109 | (string-append vpnc-scripts "/etc/vpnc/vpnc-script"))) | |
110 | (substitute* "Makefile" | |
111 | (("ETCDIR=.*") | |
112 | (string-append "ETCDIR=" out "/etc/vpnc\n")) | |
113 | (("PREFIX=.*") | |
114 | (string-append "PREFIX=" out "\n"))) | |
115 | #t))) | |
116 | (delete 'configure)))) ; no configure script | |
799dcdc4 | 117 | (synopsis "Client for Cisco VPN concentrators") |
49f24f41 AE |
118 | (description |
119 | "vpnc is a VPN client compatible with Cisco's EasyVPN equipment. | |
35b9e423 | 120 | It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only |
49f24f41 | 121 | shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES, |
35b9e423 | 122 | 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace. |
49f24f41 AE |
123 | Only \"Universal TUN/TAP device driver support\" is needed in the kernel.") |
124 | (license license:gpl2+) ; some file are bsd-2, see COPYING | |
d61043c7 | 125 | (home-page "https://www.unix-ag.uni-kl.de/~massar/vpnc/"))) |
71f4b81a | 126 | |
06d91fd9 | 127 | (define-public vpnc-scripts |
e3eaac98 | 128 | (let ((commit "1000e0f6dd7d6bff163169a46359211c1fc3a6d2")) |
06d91fd9 TGR |
129 | (package |
130 | (name "vpnc-scripts") | |
e3eaac98 | 131 | (version (string-append "20190116." (string-take commit 7))) |
06d91fd9 TGR |
132 | (source (origin |
133 | (method git-fetch) | |
134 | (uri | |
135 | (git-reference | |
136 | (url "git://git.infradead.org/users/dwmw2/vpnc-scripts.git") | |
137 | (commit commit))) | |
728ee9d6 | 138 | (file-name (git-file-name name version)) |
06d91fd9 TGR |
139 | (sha256 |
140 | (base32 | |
e3eaac98 | 141 | "1g41yarz2bl0f73kbjqnywr485ghanbp7nmspklfb0n07yp0z6ak")))) |
06d91fd9 | 142 | (build-system gnu-build-system) |
b6bee63b | 143 | (inputs `(("guile" ,guile-3.0) ; for the wrapper scripts |
b47e083b | 144 | ("coreutils" ,coreutils) |
06d91fd9 TGR |
145 | ("grep" ,grep) |
146 | ("iproute2" ,iproute) ; for ‘ip’ | |
147 | ("net-tools" ,net-tools) ; for ‘ifconfig’, ‘route’ | |
148 | ("sed" ,sed) | |
149 | ("which" ,which))) | |
150 | (arguments | |
151 | `(#:phases | |
152 | (modify-phases %standard-phases | |
153 | (add-after 'unpack 'use-relative-paths | |
154 | ;; Patch the scripts to work with and use relative paths. | |
155 | (lambda* _ | |
156 | (for-each (lambda (script) | |
157 | (substitute* script | |
158 | (("^PATH=.*") "") | |
92594b2e | 159 | (("/usr/s?bin/") "") |
06d91fd9 TGR |
160 | (("\\[ +-x +([^]]+) +\\]" _ command) |
161 | (string-append "command -v >/dev/null 2>&1 " | |
162 | command)))) | |
163 | (find-files "." "^vpnc-script")) | |
164 | #t)) | |
165 | (delete 'configure) ; no configure script | |
166 | (replace 'build | |
167 | (lambda _ | |
863501b7 | 168 | (invoke "gcc" "-o" "netunshare" "netunshare.c"))) |
06d91fd9 TGR |
169 | (replace 'install |
170 | ;; There is no Makefile; manually install the relevant files. | |
171 | (lambda* (#:key outputs #:allow-other-keys) | |
172 | (let* ((out (assoc-ref outputs "out")) | |
173 | (etc (string-append out "/etc/vpnc"))) | |
174 | (for-each (lambda (file) | |
175 | (install-file file etc)) | |
176 | (append (find-files "." "^vpnc-script") | |
177 | (list "netunshare" | |
178 | "xinetd.netns.conf"))) | |
179 | #t))) | |
180 | (add-after 'install 'wrap-scripts | |
181 | ;; Wrap scripts with paths to their common hard dependencies. | |
182 | ;; Optional dependencies will need to be installed by the user. | |
183 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
184 | (let ((out (assoc-ref outputs "out"))) | |
185 | (for-each | |
186 | (lambda (script) | |
b47e083b | 187 | (wrap-script (string-append out "/etc/vpnc/" script) |
06d91fd9 TGR |
188 | `("PATH" ":" prefix |
189 | ,(map (lambda (name) | |
190 | (let ((input (assoc-ref inputs name))) | |
191 | (string-append input "/bin:" | |
192 | input "/sbin"))) | |
193 | (list "coreutils" | |
194 | "grep" | |
195 | "iproute2" | |
196 | "net-tools" | |
197 | "sed" | |
198 | "which"))))) | |
b47e083b RW |
199 | (list "vpnc-script-ptrtd" |
200 | "vpnc-script-sshd" | |
201 | "vpnc-script")) | |
863501b7 | 202 | #t)))) |
06d91fd9 TGR |
203 | #:tests? #f)) ; no tests |
204 | (home-page "http://git.infradead.org/users/dwmw2/vpnc-scripts.git") | |
205 | (synopsis "Network configuration scripts for Cisco VPN clients") | |
206 | (description | |
207 | "This set of scripts configures routing and name services when invoked | |
208 | by the VPNC or OpenConnect Cisco @dfn{Virtual Private Network} (VPN) clients. | |
209 | ||
210 | The default @command{vpnc-script} automatically configures most common | |
211 | connections, and provides hooks for performing custom actions at various stages | |
212 | of the connection or disconnection process. | |
213 | ||
214 | Alternative scripts are provided for more complicated set-ups, or to serve as an | |
215 | example for writing your own. For example, @command{vpnc-script-sshd} contains | |
216 | the entire VPN in a network namespace accessible only through SSH.") | |
217 | (license license:gpl2+)))) | |
71f4b81a | 218 | |
01224157 PL |
219 | (define-public ocproxy |
220 | (package | |
221 | (name "ocproxy") | |
222 | (version "1.60") | |
223 | (source (origin | |
98ebc8fd EF |
224 | (method git-fetch) |
225 | (uri (git-reference | |
226 | (url "https://github.com/cernekee/ocproxy.git") | |
227 | (commit (string-append "v" version)))) | |
228 | (file-name (git-file-name name version)) | |
01224157 PL |
229 | (sha256 |
230 | (base32 | |
98ebc8fd | 231 | "03323nnhb4y9nzwva04mq7xg03dvdrgp689g89f69jqc261skcqx")))) |
01224157 PL |
232 | (build-system gnu-build-system) |
233 | (native-inputs | |
234 | `(("autoconf" ,autoconf) | |
235 | ("automake" ,automake))) | |
236 | (inputs | |
237 | `(("libevent" ,libevent))) | |
01224157 PL |
238 | (home-page "https://github.com/cernekee/ocproxy") |
239 | (synopsis "OpenConnect proxy") | |
240 | (description | |
241 | "User-level @dfn{SOCKS} and port forwarding proxy for OpenConnect based | |
242 | on LwIP. When using ocproxy, OpenConnect only handles network activity that | |
243 | the user specifically asks to proxy, so the @dfn{VPN} interface no longer | |
244 | \"hijacks\" all network traffic on the host.") | |
245 | (license license:bsd-3))) | |
246 | ||
71f4b81a AE |
247 | (define-public openconnect |
248 | (package | |
249 | (name "openconnect") | |
57b13d1c | 250 | (version "8.10") |
71f4b81a AE |
251 | (source (origin |
252 | (method url-fetch) | |
d4bf49b1 EB |
253 | (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/" |
254 | "openconnect-" version ".tar.gz")) | |
c383c36e | 255 | (sha256 |
57b13d1c | 256 | (base32 "1cdsx4nsrwawbsisfkldfc9i4qn60g03vxb13nzppr2br9p4rrih")))) |
71f4b81a | 257 | (build-system gnu-build-system) |
0d7f282b | 258 | (propagated-inputs |
c4c4cc05 | 259 | `(("libxml2" ,libxml2) |
a5ab71c7 | 260 | ("gnutls" ,gnutls-3.6.13) |
71f4b81a | 261 | ("zlib" ,zlib))) |
0d7f282b | 262 | (inputs |
1d7f3c00 TGR |
263 | `(("lz4" ,lz4) |
264 | ("vpnc-scripts" ,vpnc-scripts))) | |
c4c4cc05 | 265 | (native-inputs |
b94a6ca0 | 266 | `(("gettext" ,gettext-minimal) |
c4c4cc05 | 267 | ("pkg-config" ,pkg-config))) |
71f4b81a | 268 | (arguments |
d4bf49b1 EB |
269 | `(#:configure-flags |
270 | `(,(string-append "--with-vpnc-script=" | |
a6d06e86 | 271 | (assoc-ref %build-inputs "vpnc-scripts") |
d4bf49b1 | 272 | "/etc/vpnc/vpnc-script")))) |
799dcdc4 | 273 | (synopsis "Client for Cisco VPN") |
71f4b81a AE |
274 | (description |
275 | "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is | |
276 | supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500, | |
277 | 870, 880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers, | |
278 | and probably others.") | |
279 | (license license:lgpl2.1) | |
8b1d0ff4 | 280 | (home-page "https://www.infradead.org/openconnect/"))) |
dc77f0d3 DT |
281 | |
282 | (define-public openvpn | |
283 | (package | |
284 | (name "openvpn") | |
c5a2b701 | 285 | (version "2.4.9") |
dc77f0d3 DT |
286 | (source (origin |
287 | (method url-fetch) | |
288 | (uri (string-append | |
289 | "https://swupdate.openvpn.org/community/releases/openvpn-" | |
290 | version ".tar.xz")) | |
291 | (sha256 | |
292 | (base32 | |
c5a2b701 | 293 | "1qpbllwlha7cffsd5dlddb8rl22g9rar5zflkz1wrcllhvfkl7v4")))) |
dc77f0d3 DT |
294 | (build-system gnu-build-system) |
295 | (arguments | |
296 | '(#:configure-flags '("--enable-iproute2=yes"))) | |
297 | (native-inputs | |
298 | `(("iproute2" ,iproute))) | |
299 | (inputs | |
dee9a262 EF |
300 | `(("lz4" ,lz4) |
301 | ("lzo" ,lzo) | |
dc77f0d3 DT |
302 | ("openssl" ,openssl) |
303 | ("linux-pam" ,linux-pam))) | |
304 | (home-page "https://openvpn.net/") | |
305 | (synopsis "Virtual private network daemon") | |
9599339c TGR |
306 | (description |
307 | "OpenVPN implements virtual private network (@dfn{VPN}) techniques | |
dc77f0d3 DT |
308 | for creating secure point-to-point or site-to-site connections in routed or |
309 | bridged configurations and remote access facilities. It uses a custom | |
310 | security protocol that utilizes SSL/TLS for key exchange. It is capable of | |
9599339c | 311 | traversing network address translators (@dfn{NAT}s) and firewalls.") |
dc77f0d3 | 312 | (license license:gpl2))) |
feca8e2b JM |
313 | |
314 | (define-public tinc | |
315 | (package | |
316 | (name "tinc") | |
2b247e51 | 317 | (version "1.0.36") |
feca8e2b JM |
318 | (source (origin |
319 | (method url-fetch) | |
e81ddeda | 320 | (uri (string-append "https://tinc-vpn.org/packages/" |
657c3ff6 | 321 | "tinc-" version ".tar.gz")) |
feca8e2b JM |
322 | (sha256 |
323 | (base32 | |
2b247e51 | 324 | "021i2sl2mjscbm8g59d7vs74iw3gf0m48wg7w3zhwj6czarkpxs0")))) |
feca8e2b | 325 | (build-system gnu-build-system) |
7b770eca SB |
326 | (arguments |
327 | '(#:configure-flags | |
328 | '("--sysconfdir=/etc" | |
329 | "--localstatedir=/var"))) | |
feca8e2b JM |
330 | (inputs `(("zlib" ,zlib) |
331 | ("lzo" ,lzo) | |
332 | ("openssl" ,openssl))) | |
e81ddeda | 333 | (home-page "https://tinc-vpn.org") |
feca8e2b JM |
334 | (synopsis "Virtual Private Network (VPN) daemon") |
335 | (description | |
336 | "Tinc is a VPN that uses tunnelling and encryption to create a secure | |
337 | private network between hosts on the internet.") | |
338 | (license license:gpl2+))) | |
5c863d57 TGR |
339 | |
340 | (define-public sshuttle | |
341 | (package | |
342 | (name "sshuttle") | |
627c6531 | 343 | (version "0.78.5") |
5c863d57 TGR |
344 | (source |
345 | (origin | |
346 | (method url-fetch) | |
347 | (uri (pypi-uri name version)) | |
348 | (sha256 | |
349 | (base32 | |
627c6531 | 350 | "0vp13xwrhx4m6zgsyzvai84lkq9mzkaw47j58dk0ll95kaymk2x8")))) |
5c863d57 | 351 | (build-system python-build-system) |
c32863e0 TGR |
352 | (arguments |
353 | `(#:phases | |
354 | (modify-phases %standard-phases | |
355 | (add-after 'unpack 'patch-FHS-file-names | |
356 | (lambda _ | |
357 | (substitute* "sshuttle/client.py" | |
358 | (("/usr/bin/env") (which "env"))) | |
359 | (substitute* "sshuttle/ssh.py" | |
0e2d3ce2 | 360 | (("/bin/sh") "sh")) |
c32863e0 | 361 | #t))))) |
5c863d57 | 362 | (native-inputs |
3308591f | 363 | `(("python-setuptools-scm" ,python-setuptools-scm) |
5c863d57 | 364 | ;; For tests only. |
627c6531 | 365 | ("python-flake8", python-flake8) |
5c863d57 | 366 | ("python-mock" ,python-mock) |
627c6531 | 367 | ("python-pytest-cov" ,python-pytest-cov) |
3308591f | 368 | ("python-pytest-runner" ,python-pytest-runner))) |
5c863d57 TGR |
369 | (home-page "https://github.com/sshuttle/sshuttle") |
370 | (synopsis "VPN that transparently forwards connections over SSH") | |
371 | (description "sshuttle creates an encrypted virtual private network (VPN) | |
372 | connection to any remote server to which you have secure shell (SSH) access. | |
373 | The only requirement is a suitable version of Python on the server; | |
374 | administrative privileges are required only on the client. Unlike most VPNs, | |
375 | sshuttle forwards entire sessions, not packets, using kernel transparent | |
376 | proxying. This makes it faster and more reliable than SSH's own tunneling and | |
377 | port forwarding features. It can forward both TCP and UDP traffic, including | |
378 | DNS domain name queries.") | |
379 | (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’ | |
1ce6f33b TGR |
380 | |
381 | (define-public sshoot | |
382 | (package | |
383 | (name "sshoot") | |
3b4018d6 | 384 | (version "1.2.6") |
1ce6f33b TGR |
385 | (source |
386 | (origin | |
387 | (method url-fetch) | |
388 | (uri (pypi-uri name version)) | |
389 | (sha256 | |
390 | (base32 | |
3b4018d6 | 391 | "1ccgh0hjyxrwkgy3hnxz3hgbjbs0lmfs25d5l5jam0xbpcpj63h0")))) |
1ce6f33b | 392 | (build-system python-build-system) |
c0b12a60 MB |
393 | (arguments |
394 | '(#:phases | |
395 | (modify-phases %standard-phases | |
396 | (add-after 'unpack 'patch-paths | |
397 | (lambda _ | |
398 | (substitute* "sshoot/tests/test_manager.py" | |
399 | (("/bin/sh") (which "sh"))) | |
400 | #t))))) | |
1ce6f33b TGR |
401 | (inputs |
402 | `(("python-argcomplete" ,python-argcomplete) | |
403 | ("python-prettytable" ,python-prettytable) | |
404 | ("python-pyyaml" ,python-pyyaml))) | |
405 | ;; For tests only. | |
406 | (native-inputs | |
407 | `(("python-fixtures" ,python-fixtures) | |
408 | ("python-pbr" ,python-pbr) | |
409 | ("python-testtools" ,python-testtools))) | |
3b4018d6 | 410 | (home-page "https://github.com/albertodonato/sshoot") |
1ce6f33b TGR |
411 | (synopsis "sshuttle VPN session manager") |
412 | (description "sshoot provides a command-line interface to manage multiple | |
413 | @command{sshuttle} virtual private networks. It supports flexible profiles | |
414 | with configuration options for most of @command{sshuttle}’s features.") | |
415 | (license license:gpl3+))) | |
7ba2b274 MP |
416 | |
417 | (define-public badvpn | |
418 | (package | |
419 | (name "badvpn") | |
420 | (version "1.999.130") | |
421 | (source | |
422 | (origin | |
423 | (method git-fetch) | |
424 | (uri (git-reference | |
425 | (url "https://github.com/ambrop72/badvpn.git") | |
426 | (commit version))) | |
427 | (file-name (git-file-name name version)) | |
428 | (sha256 | |
429 | (base32 "0rm67xhi7bh3yph1vh07imv5y1pwyldvw3wa5bz471g8mnkc7d3c")))) | |
430 | (build-system cmake-build-system) | |
431 | (arguments | |
432 | '(#:tests? #f)) ; no tests | |
433 | (inputs | |
434 | `(("nspr" ,nspr) | |
435 | ("nss" ,nss) | |
436 | ("openssl" ,openssl))) | |
437 | (native-inputs | |
438 | `(("pkg-config" ,pkg-config))) | |
439 | (home-page "https://github.com/ambrop72/badvpn") | |
440 | (synopsis "Peer-to-peer virtual private network (VPN)") | |
441 | (description "@code{BadVPN} is a collection of virtual private | |
442 | network (VPN) tools. It includes: | |
443 | ||
444 | @enumerate | |
445 | @item NCD programming language.\n | |
446 | NCD (Network Configuration Daemon) is a daemon and programming/scripting | |
447 | language for configuration of network interfaces and other aspects of the | |
448 | operating system. | |
449 | @item Tun2socks network-layer proxifier.\n | |
450 | The tun2socks program socksifes TCP connections at the network layer. It | |
451 | implements a TUN device which accepts all incoming TCP connections (regardless | |
452 | of destination IP), and forwards the connections through a SOCKS server. | |
453 | @item Peer-to-peer VPN.\n | |
454 | The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers | |
455 | (VPN nodes). | |
456 | @end enumerate") | |
457 | ;; This project contains a bundled lwIP. lwIP is also released under the | |
458 | ;; 3-clause BSD license. | |
459 | (license license:bsd-3))) | |
7a0479bb | 460 | |
336d7644 | 461 | (define-public wireguard-linux-compat |
7a0479bb | 462 | (package |
336d7644 LF |
463 | (name "wireguard-linux-compat") |
464 | (version "1.0.20200401") | |
7a0479bb LF |
465 | (source (origin |
466 | (method url-fetch) | |
336d7644 LF |
467 | (uri (string-append "https://git.zx2c4.com/wireguard-linux-compat/" |
468 | "snapshot/wireguard-linux-compat-" version | |
469 | ".tar.xz")) | |
7a0479bb LF |
470 | (sha256 |
471 | (base32 | |
336d7644 | 472 | "0ymprz3h4b92wlcqm5k5vmcgap8pjv202bgkdx0axmp12n1lmyvx")))) |
3b177a6c BW |
473 | (build-system linux-module-build-system) |
474 | (outputs '("out" | |
475 | "kernel-patch")) | |
7a0479bb | 476 | (arguments |
336d7644 | 477 | `(#:tests? #f ; No test suite |
3b177a6c | 478 | #:modules ((guix build linux-module-build-system) |
7a0479bb LF |
479 | (guix build utils) |
480 | (ice-9 popen) | |
481 | (ice-9 textual-ports)) | |
482 | #:phases | |
483 | (modify-phases %standard-phases | |
3b177a6c BW |
484 | (add-before 'build 'change-directory |
485 | (lambda _ | |
486 | (chdir "./src") | |
487 | #t)) | |
488 | (add-after 'build 'build-patch | |
7a0479bb | 489 | (lambda* (#:key outputs #:allow-other-keys) |
3b177a6c | 490 | (let* ((patch-builder "../kernel-tree-scripts/create-patch.sh") |
7a0479bb LF |
491 | (port (open-input-pipe patch-builder)) |
492 | (str (get-string-all port))) | |
493 | (close-pipe port) | |
336d7644 | 494 | (call-with-output-file "wireguard.patch" |
7a0479bb LF |
495 | (lambda (port) |
496 | (format port "~a" str)))) | |
336d7644 | 497 | #t)) |
3b177a6c | 498 | (add-after 'install 'install-patch |
336d7644 LF |
499 | (lambda* (#:key outputs #:allow-other-keys) |
500 | (install-file "wireguard.patch" | |
3b177a6c BW |
501 | (assoc-ref %outputs "kernel-patch")) |
502 | #t)) | |
503 | ;; So that 'install-license-files' works... | |
504 | (add-before 'install-license-files 'reset-cwd | |
505 | (lambda _ | |
506 | (chdir "..") | |
336d7644 LF |
507 | #t))))) |
508 | (home-page "https://git.zx2c4.com/wireguard-linux-compat/") | |
509 | (synopsis "WireGuard kernel module for Linux 3.10 through 5.5") | |
3b177a6c BW |
510 | (description "This package contains an out-of-tree kernel patch and |
511 | a loadable module adding WireGuard to Linux kernel versions 3.10 through 5.5. | |
512 | WireGuard was added to Linux 5.6.") | |
7a0479bb | 513 | (license license:gpl2))) |
1b17c23e | 514 | |
10650b89 TGR |
515 | (define-public wireguard-tools |
516 | (package | |
517 | (name "wireguard-tools") | |
518 | (version "1.0.20200206") | |
519 | (source | |
520 | (origin | |
521 | (method git-fetch) | |
522 | (uri (git-reference | |
523 | (url "https://git.zx2c4.com/wireguard-tools.git") | |
524 | (commit (string-append "v" version)))) | |
525 | (file-name (git-file-name name version)) | |
526 | (sha256 | |
527 | (base32 "0ivc08lds5w39a6f2xdfih9wlk5g724hl3kpdvxvh5yff4l84qb7")))) | |
528 | (build-system gnu-build-system) | |
529 | (arguments | |
19781930 | 530 | `(#:make-flags |
10650b89 | 531 | (list "CC=gcc" |
c1005113 | 532 | "--directory=src" |
10650b89 TGR |
533 | "WITH_BASHCOMPLETION=yes" |
534 | ;; Install the ‘simple and dirty’ helper script wg-quick(8). | |
535 | "WITH_WGQUICK=yes" | |
536 | (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
537 | ;; Currently used only to create an empty /etc/wireguard directory. | |
538 | (string-append "SYSCONFDIR=no-thanks")) | |
19781930 LF |
539 | ;; The test suite is meant to be run interactively. It runs Clang's |
540 | ;; scan-build static analyzer and then starts a web server to display the | |
541 | ;; results. | |
542 | #:tests? #f | |
10650b89 TGR |
543 | #:phases |
544 | (modify-phases %standard-phases | |
c1005113 | 545 | ;; No configure script |
d084e71c BW |
546 | (delete 'configure) |
547 | (add-after 'install 'install-contrib-docs | |
548 | (lambda* (#:key outputs #:allow-other-keys) | |
549 | (let ((out (assoc-ref outputs "out"))) | |
550 | (copy-recursively "contrib/" | |
551 | (string-append out "/share/doc/wireguard-tools")) | |
552 | #t))) | |
553 | (add-after 'install 'wrap-wg-quick | |
554 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
555 | (let* ((out (assoc-ref outputs "out")) | |
556 | (inputs-sbin (map (lambda (input) | |
557 | (string-append (assoc-ref inputs input) "/sbin")) | |
558 | (list "resolvconf" "iproute" "procps" | |
559 | "iptables"))) | |
560 | (coreutils (string-append (assoc-ref inputs "coreutils") | |
561 | "/bin"))) | |
562 | (wrap-program (string-append out "/bin/wg-quick") | |
563 | `("PATH" ":" prefix ,(append inputs-sbin | |
564 | (list coreutils)))) | |
565 | #t)))))) | |
566 | (inputs | |
567 | `(("resolvconf" ,openresolv) | |
568 | ("coreutils" ,coreutils) | |
569 | ("bash" ,bash) ; for scripts using /dev/tcp | |
570 | ("procps" ,procps) | |
571 | ("iproute" ,iproute) | |
572 | ("iptables" ,iptables))) | |
10650b89 TGR |
573 | (home-page "https://www.wireguard.com/") |
574 | (synopsis "Tools for configuring WireGuard tunnels") | |
575 | (description | |
576 | "This package provides the user-space command-line tools for using and | |
577 | configuring WireGuard tunnels. | |
578 | ||
579 | WireGuard is a simple and fast general-purpose @acronym{VPN, Virtual Private | |
580 | Network} that securely encapsulates IP packets over UDP. It aims to be as easy | |
581 | to configure and deploy as SSH. VPN connections are made simply by exchanging | |
582 | public keys and can roam across IP addresses.") | |
583 | (license | |
584 | (list license:lgpl2.1+ ; src/netlink.h & contrib/embeddable-wg-library | |
585 | license:gpl2)))) ; everything else | |
586 | ||
336d7644 LF |
587 | (define-public wireguard |
588 | (deprecated-package "wireguard" wireguard-tools)) | |
589 | ||
1b17c23e TČ |
590 | (define-public xl2tpd |
591 | (package | |
592 | (name "xl2tpd") | |
1f3700a4 | 593 | (version "1.3.15") |
1b17c23e TČ |
594 | (source (origin |
595 | (method git-fetch) | |
596 | (uri (git-reference | |
597 | (url "https://github.com/xelerance/xl2tpd") | |
598 | (commit (string-append "v" version)))) | |
28341601 | 599 | (file-name (git-file-name name version)) |
1b17c23e TČ |
600 | (sha256 |
601 | (base32 | |
1f3700a4 | 602 | "0ppwza8nwm1av1vldw40gin9wrjrs4l9si50jad414js3k8ycaag")))) |
1b17c23e TČ |
603 | (build-system gnu-build-system) |
604 | (arguments | |
0309e004 | 605 | `(#:make-flags (list (string-append "PREFIX=" %output) |
1b17c23e TČ |
606 | "CC=gcc") |
607 | #:phases (modify-phases %standard-phases | |
14ccd8f8 TGR |
608 | (delete 'configure)) ; no configure script |
609 | #:tests? #f)) ; no tests provided | |
1b17c23e TČ |
610 | (inputs `(("libpcap" ,libpcap))) |
611 | (home-page "https://www.xelerance.com/software/xl2tpd/") | |
612 | (synopsis "Layer 2 Tunnelling Protocol Daemon (RFC 2661)") | |
613 | (description | |
614 | "xl2tpd is an implementation of the Layer 2 Tunnelling Protocol (RFC 2661). | |
615 | L2TP allows you to tunnel PPP over UDP.") | |
616 | (license license:gpl2))) |