projects/guix·blob java-team · refs

1635 lines · 66.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <[email protected]>
3;;; Copyright © 2013, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès <[email protected]>
4;;; Copyright © 2014 Eric Bavier <[email protected]>
5;;; Copyright © 2015 Jeff Mickey <[email protected]>
6;;; Copyright © 2016, 2017, 2019, 2021, 2022, 2024 Efraim Flashner <[email protected]>
7;;; Copyright © 2016–2022, 2024 Tobias Geerinckx-Rice <[email protected]>
8;;; Copyright © 2017 Julien Lepiller <[email protected]>
9;;; Copyright © 2018, 2020 Pierre Langlois <[email protected]>
10;;; Copyright © 2018 Meiyo Peng <[email protected]>
11;;; Copyright © 2019, 2020 Leo Famulari <[email protected]>
12;;; Copyright © 2019 Rutger Helling <[email protected]>
13;;; Copyright © 2019 Ricardo Wurmus <[email protected]>
14;;; Copyright © 2020 Brice Waegeneire <[email protected]>
15;;; Copyright © 2020 Ryan Prior <[email protected]>
16;;; Copyright © 2020 Ivan Kozlov <[email protected]>
17;;; Copyright © 2020 David Dashyan <[email protected]>
18;;; Copyright © 2021 Domagoj Stolfa <[email protected]>
19;;; Copyright © 2021 Raghav Gururajan <[email protected]>
20;;; Copyright © 2021 jgart <[email protected]>
21;;; Copyright © 2022 Josselin Poiret <[email protected]>
22;;; Copyright © 2022 Lu hui <[email protected]>
23;;; Copyright © 2022, 2023 Maxim Cournoyer <[email protected]>
24;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ <[email protected]>
25;;; Copyright © 2022, 2025 Arun Isaac <[email protected]>
26;;; Copyright © 2024, 2025 Allan Adair <[email protected]>
27;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
28;;; Copyright © 2026 Cayetano Santos <[email protected]>
29;;;
30;;; This file is part of GNU Guix.
31;;;
32;;; GNU Guix is free software; you can redistribute it and/or modify it
33;;; under the terms of the GNU General Public License as published by
34;;; the Free Software Foundation; either version 3 of the License, or (at
35;;; your option) any later version.
36;;;
37;;; GNU Guix is distributed in the hope that it will be useful, but
38;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40;;; GNU General Public License for more details.
41;;;
42;;; You should have received a copy of the GNU General Public License
43;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45(define-module (gnu packages vpn)
46 #:use-module ((guix licenses) #:prefix license:)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix gexp)
50 #:use-module (guix git-download)
51 #:use-module (guix build-system cargo)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system copy)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system go)
56 #:use-module (guix build-system linux-module)
57 #:use-module (guix build-system pyproject)
58 #:use-module (guix build-system qt)
59 #:use-module (guix utils)
60 #:use-module (gnu packages)
61 #:use-module (gnu packages admin)
62 #:use-module (gnu packages authentication)
63 #:use-module (gnu packages base)
64 #:use-module (gnu packages bash)
65 #:use-module (gnu packages bison)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages dns)
68 #:use-module (gnu packages docbook)
69 #:use-module (gnu packages autotools)
70 #:use-module (gnu packages compression)
71 #:use-module (gnu packages crypto)
72 #:use-module (gnu packages curl)
73 #:use-module (gnu packages freedesktop)
74 #:use-module (gnu packages compiler-tools)
75 #:use-module (gnu packages gettext)
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages gl)
78 #:use-module (gnu packages glib)
79 #:use-module (gnu packages gnupg)
80 #:use-module (gnu packages golang-build)
81 #:use-module (gnu packages golang-crypto)
82 #:use-module (gnu packages golang-web)
83 #:use-module (gnu packages golang-xyz)
84 #:use-module (gnu packages groff)
85 #:use-module (gnu packages gtk)
86 #:use-module (gnu packages guile)
87 #:use-module (gnu packages hardware)
88 #:use-module (gnu packages kerberos)
89 #:use-module (gnu packages libevent)
90 #:use-module (gnu packages linux)
91 #:use-module (gnu packages multiprecision)
92 #:use-module (gnu packages ncurses)
93 #:use-module (gnu packages networking)
94 #:use-module (gnu packages nss)
95 #:use-module (gnu packages perl)
96 #:use-module (gnu packages pkg-config)
97 #:use-module (gnu packages polkit)
98 #:use-module (gnu packages python)
99 #:use-module (gnu packages python-build)
100 #:use-module (gnu packages python-crypto)
101 #:use-module (gnu packages python-xyz)
102 #:use-module (gnu packages python-web)
103 #:use-module (gnu packages qt)
104 #:use-module (gnu packages samba)
105 #:use-module (gnu packages security-token)
106 #:use-module (gnu packages sphinx)
107 #:use-module (gnu packages texinfo)
108 #:use-module (gnu packages tls)
109 #:use-module (gnu packages webkit)
110 #:use-module (gnu packages xml))
111
112(define-public amneziawg-linux-kernel-module
113 (package
114 (name "amneziawg-linux-kernel-module")
115 (version "3.1.20260906")
116 (source
117 (origin
118 (method git-fetch)
119 (uri (git-reference
120 (url
121 "https://github.com/amnezia-vpn/amneziawg-linux-kernel-module")
122 (commit (string-append "v" version))))
123 (file-name (git-file-name name version))
124 (sha256
125 (base32 "10iniwala2h6r05rjmyrrvy019xvd3k4s5kz8ass228ga0gi248c"))))
126 (build-system linux-module-build-system)
127 (arguments
128 (list
129 #:tests? #f ;; no test suite
130 #:modules '((guix build linux-module-build-system)
131 (guix build utils)
132 (ice-9 popen)
133 (ice-9 textual-ports))
134 #:phases
135 #~(modify-phases %standard-phases
136 (add-before 'build 'change-directory
137 (lambda _
138 (chdir "src")))
139 (add-after 'build 'build-patch
140 (lambda _
141 (let* ((patch-builder "../kernel-tree-scripts/create-patch.sh")
142 (port (open-input-pipe patch-builder))
143 (str (get-string-all port)))
144 (close-pipe port)
145 (call-with-output-file "wireguard.patch"
146 (lambda (port)
147 (format port "~a" str))))))
148 (add-after 'install 'install-patch
149 (lambda* (#:key outputs #:allow-other-keys)
150 (install-file "wireguard.patch"
151 (assoc-ref outputs "kernel-patch"))))
152 (add-before 'install-license-files 'reset-cwd
153 (lambda _
154 (chdir ".."))))))
155 (outputs '("out" "kernel-patch"))
156 (home-page "https://github.com/amnezia-vpn/amneziawg-linux-kernel-module")
157 (synopsis "AmneziaWG Linux kernel module")
158 (description "Linux kernel module for AmneziaWG support.")
159 (license license:gpl2)))
160
161(define-public amneziawg-tools
162 (package
163 (name "amneziawg-tools")
164 (version "3.1.20260812")
165 (source
166 (origin
167 (method git-fetch)
168 (uri (git-reference
169 (url "https://github.com/amnezia-vpn/amneziawg-tools")
170 (commit (string-append "v" version))))
171 (file-name (git-file-name name version))
172 (sha256
173 (base32 "12dwzcskssvkh3izgndhkcv2kqy633qmagl573k5wcfqr3gx4mxr"))))
174 (build-system gnu-build-system)
175 (arguments
176 (list
177 #:tests? #f ;test suite is meant to be run interactively
178 #:make-flags
179 #~(list "--directory=src"
180 "WITH_BASHCOMPLETION=yes"
181 "WITH_WGQUICK=yes"
182 (string-append "CC=" #$(cc-for-target))
183 (string-append "PREFIX=" #$output)
184 (string-append "SYSCONFDIR=no-thanks"))
185 #:phases
186 #~(modify-phases %standard-phases
187 (delete 'configure) ;no confiure
188 (add-after 'install 'install-contrib-docs
189 (lambda _
190 (copy-recursively "contrib/"
191 (string-append #$output
192 "/share/doc/amneziawg-tools"))))
193 (add-after 'install 'wrap-awg-quick
194 (lambda* (#:key inputs #:allow-other-keys)
195 (wrap-program (string-append #$output "/bin/awg-quick")
196 `("PATH" ":" prefix
197 (,(dirname (search-input-file inputs "/sbin/ip"))
198 ,(dirname (search-input-file inputs "/sbin/iptables"))
199 ,(dirname (search-input-file inputs "/sbin/sysctl"))
200 ,(dirname (search-input-file inputs "/sbin/resolvconf"))
201 ,(dirname (search-input-file inputs "/bin/amneziawg-go"))
202 ,(dirname (search-input-file inputs "/bin/cp"))))))))))
203 (inputs
204 (list amneziawg-go
205 bash-minimal
206 coreutils
207 iproute
208 iptables
209 openresolv
210 procps))
211 (home-page "https://github.com/amnezia-vpn/amneziawg-tools")
212 (synopsis "AmneziaWG fork of WireGuard tools")
213 (description
214 "This package provides user-space command-line tools for configuring
215AmneziaWG tunnels, a fork of @code{wireguard-tools} with support for the
216AmneziaWG protocol. AmneziaWG extends WireGuard with protection against
217detection by @acronym{DPI, Deep Packet Inspection} systems.")
218 (license license:gpl2)))
219
220(define-public bitmask
221 (package
222 (name "bitmask")
223 (version "0.21.11")
224 (source
225 (origin
226 (method git-fetch)
227 (uri
228 (git-reference
229 (url "https://0xacab.org/leap/bitmask-vpn")
230 (commit version)))
231 (file-name (git-file-name name version))
232 (sha256
233 (base32 "1zphigfrks1j3snbc748b3mk0qb1r7n2v7p7l6w1xiiil4dql6cs"))
234 (modules
235 '((guix build utils)))
236 (snippet
237 `(begin
238 (delete-file-recursively "branding/thirdparty")
239 (call-with-output-file "pkg/config/version/version.go"
240 (lambda (port)
241 (format port "package version~%~% var VERSION = ~s"
242 "0.21.11")))))))
243 (build-system go-build-system)
244 (arguments
245 `(#:imported-modules
246 ((guix build cmake-build-system)
247 (guix build copy-build-system)
248 (guix build qt-build-system)
249 (guix build qt-utils)
250 ,@%go-build-system-modules
251 ,@%pyproject-build-system-modules)
252 #:modules
253 (((guix build copy-build-system)
254 #:prefix copy:)
255 ((guix build pyproject-build-system)
256 #:prefix py:)
257 ((guix build qt-build-system)
258 #:prefix qt:)
259 (guix build utils)
260 (guix build go-build-system))
261 #:unpack-path "0xacab.org/leap/bitmask-vpn"
262 #:import-path "0xacab.org/leap/bitmask-vpn/cmd/bitmask-helper"
263 #:phases
264 (modify-phases %standard-phases
265 (add-after 'setup-go-environment 'insert-missing-sources
266 ;; For some reason this package is left out.
267 (lambda* (#:key inputs #:allow-other-keys)
268 (let* ((name "go-0xacab-org-leap-shapeshifter")
269 (shapeshifter (assoc-ref inputs name))
270 (shapeshifter-src (string-append shapeshifter "/src")))
271 (copy-recursively shapeshifter-src "src"))))
272 (add-after 'unpack 'patch
273 (lambda* (#:key inputs outputs #:allow-other-keys)
274 (with-directory-excursion "src/0xacab.org/leap/bitmask-vpn"
275 ;; Use 'emersion/go-autostart',
276 ;; instead of 'ProtonMail/go-autostart',
277 ;; as the latter no longer exists.
278 (substitute* (find-files "." "\\.go$")
279 (("github.com/ProtonMail/go-autostart")
280 "github.com/emersion/go-autostart"))
281 ;; Use correct paths for referenced items.
282 (let* ((out (assoc-ref outputs "out"))
283 (policy-dir (string-append out "/share/polkit-1/actions"))
284 (policy-file "se.leap.bitmask.policy")
285 (policy-path (string-append policy-dir "/" policy-file))
286 (pkttyagent (search-input-file inputs "/bin/pkttyagent"))
287 (openvpn (search-input-file inputs "/sbin/openvpn"))
288 (bitmask-root (string-append (assoc-ref outputs "out")
289 "/sbin/bitmask-root")))
290 (substitute* (find-files "." "(\\.go$|\\.policy$|bitmask-root)")
291 (("swhich\\(\"(ip|iptables|ip6tables|sysctl)\"\\)" _ bin)
292 (let ((sbin (string-append "/sbin/" bin)))
293 (format #f "~s" (search-input-file inputs sbin))))
294 (("/usr/(bin|lib|libexec)/.*(kit|agent|agent-1)") pkttyagent)
295 (("/usr/sbin/openvpn") openvpn)
296 (("/usr/sbin/bitmask-root") bitmask-root)
297 (("/usr/local/sbin/bitmask-root") bitmask-root)
298 (("/usr/share.*\\.policy") policy-path)))
299 (substitute* (find-files "." "\\.pro$")
300 ;; Use correct path for goshim files,
301 ;; which are generated in 'build-continued phase.
302 (("-L.*/lib") "-L./lib")
303 ;; FIXME: Unable to build i18n files.
304 (("TRANSLATIONS.*i18n.*$") "")
305 (("RESOURCES.*i18n.*$") "")))))
306 (add-after 'build 'build-continued
307 (lambda _
308 ;; Generate goshim library and header files.
309 (let* ((dir "src/0xacab.org/leap/bitmask-vpn")
310 (source (string-append dir "/gui/backend.go"))
311 (target (string-append dir "/lib/libgoshim.a")))
312 (mkdir-p (string-append dir "/lib"))
313 (invoke "go" "build" "-buildmode=c-archive" "-o" target source))
314 ;; Build bitmask application.
315 (with-directory-excursion "src/0xacab.org/leap/bitmask-vpn"
316 (delete-file "Makefile")
317 (invoke "qmake" "bitmask.pro")
318 (invoke "make"))))
319 (add-after 'check 'check-continued
320 (lambda* (#:key tests? #:allow-other-keys)
321 (when tests?
322 ;; Run bitmask test-suite.
323 (with-directory-excursion "src/0xacab.org/leap/bitmask-vpn"
324 (delete-file "Makefile")
325 (invoke "qmake" "test.pro")
326 ;; Tests require display-server.
327 (setenv "QT_QPA_PLATFORM" "offscreen")
328 ;; Tests look for $XDG_RUNTIME_DIR.
329 (setenv "XDG_RUNTIME_DIR" (getenv "TEMP"))
330 ;; Tests write to $HOME.
331 (setenv "HOME" (getenv "TEMP"))
332 (invoke "make" "check")))))
333 (add-after 'install 'install-continued
334 (lambda args
335 (apply (assoc-ref copy:%standard-phases 'install)
336 #:install-plan
337 ;; Install bitmask program.
338 '(("src/0xacab.org/leap/bitmask-vpn/release"
339 "bin"
340 #:include ("bitmask"))
341 ;; Install bitmask-root script.
342 ("src/0xacab.org/leap/bitmask-vpn/helpers"
343 "sbin"
344 #:include ("bitmask-root"))
345 ;; Install polkit-policy.
346 ("src/0xacab.org/leap/bitmask-vpn/helpers"
347 "share/polkit-1/actions"
348 #:include ("se.leap.bitmask.policy")))
349 args)))
350 (add-after 'install-continued 'post-install
351 (lambda* (#:key outputs #:allow-other-keys)
352 (let* ((out (assoc-ref outputs "out"))
353 (bitmask (string-append out "/bin/bitmask"))
354 (bitmask-root (string-append out "/sbin/bitmask-root")))
355 ;; Make bitmask-root script executable.
356 (chmod bitmask-root #o777))))
357 (add-after 'post-install 'python-wrap
358 (assoc-ref py:%standard-phases 'wrap))
359 (add-after 'python-wrap 'qt-wrap
360 (assoc-ref qt:%standard-phases 'qt-wrap)))))
361 (native-inputs
362 (list pkg-config))
363 (inputs
364 (list iproute
365 iptables
366 mesa
367 openvpn
368 polkit
369 procps
370 python
371 qtbase-5
372 qtdeclarative-5
373 qtgraphicaleffects
374 qtquickcontrols-5
375 qtquickcontrols2-5
376 qtsvg-5))
377 (propagated-inputs
378 (list go-0xacab-org-leap-shapeshifter
379 go-github-com-apparentlymart-go-openvpn-mgmt
380 go-github-com-emersion-go-autostart
381 go-github-com-keybase-go-ps
382 go-github-com-rakyll-statik
383 go-github-com-sevlyar-go-daemon
384 go-golang-org-x-sys))
385 (synopsis "Generic VPN client by LEAP")
386 (description "Bitmask, by @acronym{LEAP, LEAP Encryption Access Project},
387is an application to provide easy and secure encrypted communication with a
388@acronym{VPN, Virtual Private Network}. It allows you to select from a variety
389of trusted service provider all from one app. Current providers include Riseup
390Networks and The Calyx Institute, where the former is default.")
391 (home-page "https://bitmask.net/")
392 (license license:gpl3+)))
393
394(define-public gp-saml-gui
395 ;; No release.
396 (let ((commit "21cce40334791a533c7a263fe367f0ddc072d8fb")
397 (revision "2"))
398 (package
399 (name "gp-saml-gui")
400 (version (git-version "0.0.0" revision commit))
401 (home-page "https://github.com/dlenski/gp-saml-gui")
402 (source (origin
403 (method git-fetch)
404 (uri (git-reference
405 (url home-page)
406 (commit commit)))
407 (file-name (git-file-name name version))
408 (sha256
409 (base32
410 "0h3b6yj85mrx6xymi0mmq9x0sg506i8djdj4wy49ipip9xvdg7ql"))))
411 (build-system pyproject-build-system)
412 (arguments
413 (list
414 #:tests? #f ;no tests
415 #:phases
416 #~(modify-phases %standard-phases
417 (add-after 'wrap 'wrap-program
418 (lambda _
419 (let ((prog (string-append #$output "/bin/gp-saml-gui")))
420 (wrap-program prog
421 `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))
422 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))))))))))
423 (native-inputs
424 (list python-setuptools))
425 (inputs
426 (list bash-minimal
427 python-pygobject-3.50
428 python-urllib3
429 python-requests
430 webkitgtk-for-gtk3))
431 (propagated-inputs
432 (list openconnect))
433 (synopsis "Interactively authenticate to GlobalProtect VPNs that require SAML")
434 (description "This is a helper script to allow you to interactively login
435to a GlobalProtect VPN that uses SAML authentication, so that you can
436subsequently connect with OpenConnect.")
437 (license license:gpl3+))))
438
439(define-public gvpe
440 (package
441 (name "gvpe")
442 (version "3.1")
443 (source (origin
444 (method url-fetch)
445 (uri (string-append "mirror://gnu/gvpe/gvpe-"
446 version ".tar.gz"))
447 (sha256
448 (base32
449 "1cz8n75ksl0l908zc5l3rnfm1hv7130s2w8710799fr5sxrdbszi"))))
450 (build-system gnu-build-system)
451 (home-page "http://software.schmorp.de/pkg/gvpe.html")
452 (native-inputs (list pkg-config))
453 (inputs (list openssl zlib))
454 (synopsis "Secure VPN among multiple nodes over an untrusted network")
455 (description
456 "The GNU Virtual Private Ethernet creates a virtual network
457with multiple nodes using a variety of transport protocols. It works
458by creating encrypted host-to-host tunnels between multiple
459endpoints.")
460 (license license:gpl3+)))
461
462(define-public n2n
463 (package
464 (name "n2n")
465 (version "3.0")
466 (source (origin
467 (method git-fetch)
468 (uri (git-reference
469 (url "https://github.com/ntop/n2n")
470 (commit version)))
471 (file-name (git-file-name name version))
472 (sha256
473 (base32
474 "0kgqmqcn6s2y2rxa0i6myq3sgk2aliv1gkfhzvn32zgym9rrqy9r"))))
475 (build-system gnu-build-system)
476 (arguments
477 (list
478 #:make-flags
479 #~(list (string-append "PREFIX=" #$output)
480 (string-append "CC=" #$(cc-for-target)))
481 #:phases
482 #~(modify-phases %standard-phases
483 (add-before 'bootstrap 'move-configure
484 ;; Don't execute configure script in bootstrap.
485 (lambda _
486 (substitute* "autogen.sh"
487 (("./configure") ""))))
488 (add-before 'configure 'fix-configure
489 (lambda* (#:key inputs native-inputs #:allow-other-keys)
490 (substitute* "configure"
491 (("/bin/sh")
492 (search-input-file (or native-inputs inputs) "/bin/sh"))))))
493 #:tests? #f)) ;there is no check target
494 (native-inputs
495 (list autoconf automake bash-minimal pkg-config))
496 (home-page "https://github.com/ntop/n2n")
497 (synopsis "Peer-to-peer VPN client and server")
498 (description
499 "n2n is a light VPN software which makes it easy to create virtual
500networks bypassing intermediate firewalls.")
501 (license license:gpl3+)))
502
503(define-public libreswan
504 (package
505 (name "libreswan")
506 (version "5.4")
507 (source (origin
508 (method url-fetch)
509 (uri (string-append "https://download.libreswan.org/libreswan-"
510 version ".tar.gz"))
511 (sha256
512 (base32 "0md822vvlr7aq909j7agky410jm22hi3jnz04y8wq5jkcb7l0qyj"))))
513 (build-system gnu-build-system)
514 (arguments
515 (list
516 #:make-flags
517 #~(list "USE_DNSSEC=false" ; XXX: missing unbound-event.h
518 "USE_ML_KEM_768=false" ; enable with nss >= 3.118
519 "USE_ML_KEM_1024=false"
520 "NSS_LDFLAGS=-L`pkg-config --variable libdir nss` -lnss3"
521 ;; Vendored header apparently differs from kernel,
522 ;; includes additional definitions.
523 "USE_XFRM_HEADER_COPY=true"
524 ;; The following options are typically configured through
525 ;; linux.mk by reading /etc/os-release; provide them manually.
526 "LINUX_VARIANT=guix"
527 "LINUX_VERSION_CODENAME="
528 "LINUX_VERSION_ID="
529 "INITSYSTEM=none" ; should be shepherd
530 (string-append "CC=" #$(cc-for-target))
531 (string-append "PREFIX=" #$output)
532 "SYSCONFDIR=$(PREFIX)/etc"
533 "NSSDIR=$(PREFIX)/share/ipsec/nss")
534 #:phases
535 #~(modify-phases %standard-phases
536 (delete 'bootstrap)
537 (delete 'configure))))
538 (inputs (list curl
539 libcap-ng
540 libevent
541 libxcrypt
542 linux-pam
543 nss))
544 (native-inputs (list bison
545 docbook-xml-4.5
546 docbook-xsl
547 flex
548 pkg-config
549 xmlto))
550 (home-page "https://libreswan.org/")
551 (synopsis "IPSec/IKE protocol implementation")
552 (description "Libreswan is an implementation of the
553@acronym{IPSec,Internet Protocol Security} and
554@acronym{IKE,Internet Key Exchange} protocols.")
555 (license license:gpl2+)))
556
557(define-public strongswan
558 (package
559 (name "strongswan")
560 (version "5.9.14")
561 (source
562 (origin
563 (method url-fetch)
564 (uri (string-append "https://download.strongswan.org/strongswan-"
565 version ".tar.bz2"))
566 (sha256
567 (base32 "0y1nqd7vb4s6wzvyrbmxpbglw9wcvcypvjffqiklrcscvbfjg03j"))
568 (snippet
569 #~(begin
570 (use-modules (guix build utils))
571 (with-directory-excursion "src"
572 (for-each delete-file
573 '("starter/parser/lexer.c"
574 "libstrongswan/settings/settings_lexer.c"
575 "starter/parser/parser.c"
576 "starter/parser/parser.h"
577 "libstrongswan/settings/settings_parser.c"
578 "libstrongswan/settings/settings_parser.h"
579 "libstrongswan/plugins/bliss/bliss_huffman_code_1.c"
580 "libstrongswan/plugins/bliss/bliss_huffman_code_3.c"
581 "libstrongswan/plugins/bliss/bliss_huffman_code_4.c"
582 "libstrongswan/asn1/oid.c"
583 "libstrongswan/asn1/oid.h")))))))
584 (build-system gnu-build-system)
585 (arguments
586 `(#:phases
587 (modify-phases %standard-phases
588 (add-before 'build 'patch-command-file-names
589 (lambda* (#:key inputs #:allow-other-keys)
590 (substitute* "src/ipsec/_ipsec.in"
591 (("cat|kill|sleep|rm|uname" command)
592 (string-append (assoc-ref inputs "coreutils")
593 "/bin/" command)))
594 (substitute* "src/libstrongswan/utils/process.c"
595 (("/bin/sh")
596 (search-input-file inputs "/bin/sh")))
597
598 (substitute* "src/libstrongswan/tests/suites/test_process.c"
599 (("/bin/sh") (which "sh"))
600 (("/bin/echo") (which "echo"))
601 (("cat") (which "cat")))))
602 (add-before 'check 'set-up-test-environment
603 (lambda* (#:key inputs #:allow-other-keys)
604 (setenv "TZDIR"
605 (search-input-directory inputs "share/zoneinfo"))
606 ;; Speed-up the test suite on some of the architectures.
607 ,@(if (not (target-x86-64?))
608 `((setenv "TESTS_SUITES_EXCLUDE" "rsa"))
609 '()))))
610 #:configure-flags
611 (list
612 "--disable-ldap"
613 "--disable-mysql"
614 "--disable-systemd"
615
616 ;; Disable BSD-4 licensed plugins.
617 "--disable-blowfish"
618 "--disable-des"
619
620 ;; Make it usable. The default configuration is far too minimal to be
621 ;; used with most common VPN set-ups.
622 ;; See <https://wiki.strongswan.org/projects/strongswan/wiki/Autoconf>.
623 ;; AESNI expects on hardware support from x86 systems.
624 ,@(if (target-x86?)
625 `("--enable-aesni")
626 `("--disable-aesni"))
627 "--enable-attr-sql"
628 "--enable-chapoly"
629 "--enable-curl"
630 "--enable-dhcp"
631 "--enable-eap-aka"
632 "--enable-eap-aka-3gpp"
633 "--enable-eap-dynamic"
634 "--enable-eap-identity"
635 "--enable-eap-md5"
636 "--enable-eap-mschapv2"
637 "--enable-eap-peap"
638 "--enable-eap-radius"
639 "--enable-eap-sim"
640 "--enable-eap-sim-file"
641 "--enable-eap-simaka-pseudonym"
642 "--enable-eap-simaka-reauth"
643 "--enable-eap-simaka-sql"
644 "--enable-eap-tls"
645 "--enable-eap-tnc"
646 "--enable-eap-ttls"
647 "--enable-ext-auth"
648 "--enable-farp"
649 "--enable-ha"
650 "--enable-led"
651 "--enable-md4"
652 "--enable-mediation"
653 "--enable-openssl"
654 "--enable-soup"
655 "--enable-sql"
656 "--enable-sqlite"
657 "--enable-xauth-eap"
658 "--enable-xauth-noauth"
659 "--enable-xauth-pam"
660
661 ;; Use libcap by default.
662 "--with-capabilities=libcap")))
663 (inputs
664 (list coreutils
665 curl
666 gmp
667 libcap
668 libgcrypt
669 libsoup-minimal-2
670 linux-pam
671 openssl))
672 (native-inputs
673 (list bison coreutils flex perl pkg-config tzdata-for-tests))
674 (synopsis "IKEv1/v2 keying daemon")
675 (description "StrongSwan is an IPsec implementation originally based upon
676the FreeS/WAN project. It contains support for IKEv1, IKEv2, MOBIKE, IPv6,
677NAT-T and more.")
678 (home-page "https://strongswan.org/")
679 (license
680 (list license:gpl2+
681 ;; src/aikgen/*
682 ;; src/libcharon/plugins/dnscert/*
683 ;; src/libcharon/plugins/ext_auth/*
684 ;; src/libcharon/plugins/vici/ruby/*
685 ;; src/libcharon/plugins/xauth_pam/xauth_pam_listener.[ch]
686 license:expat
687 ;; src/include/sys/*
688 license:bsd-3
689 ;; src/libstrongswan/plugins/sha3/sha3_keccak.c
690 license:public-domain
691 ;; src/libstrongswan/plugins/pkcs11/pkcs11.h
692 (license:non-copyleft
693 "file://src/libstrongswan/plugins/pkcs11/pkcs11.h"
694 "pkcs11 contains an unknown permissive license. View the specific
695file for more details.")
696 ;; These files are not included in the
697 ;; build, they are disabled through
698 ;; options to ./configure
699 ;;
700 ;; src/libstrongswan/plugins/blowfish/bf_enc.c
701 ;; src/libstrongswan/plugins/blowfish/bf_locl.h
702 ;; src/libstrongswan/plugins/blowfish/bf_pi.h
703 ;; src/libstrongswan/plugins/blowfish/bf_skey.c
704 ;; src/libstrongswan/plugins/blowfish/blowfish_crypter.c
705 ;; src/libstrongswan/plugins/des/des_crypter.c
706 license:bsd-4))))
707
708(define-public vpnc
709 (package
710 (name "vpnc")
711 (version "0.5.3")
712 (source (origin
713 (method url-fetch)
714 (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-"
715 version ".tar.gz"))
716 (sha256 (base32
717 "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6"))))
718 (build-system gnu-build-system)
719 (native-inputs (append (list perl pkg-config vpnc-scripts)
720 (if (%current-target-system)
721 (list this-package)
722 '())))
723 (inputs (list libgcrypt vpnc-scripts))
724 (arguments
725 (list #:tests? #f ;; There is no check target
726 #:make-flags
727 #~(list (string-append "CC=" #$(cc-for-target))
728 (string-append "ETCDIR=" #$output "/etc/vpnc")
729 (string-append "PREFIX=" #$output))
730 #:phases
731 #~(modify-phases %standard-phases
732 (delete 'configure) ;; No configure script.
733 (add-after 'unpack 'use-store-paths
734 (lambda* (#:key inputs #:allow-other-keys)
735 (let ((vpnc-scripts (assoc-ref inputs "vpnc-scripts")))
736 (substitute* "config.c"
737 (("/etc/vpnc/vpnc-script")
738 (string-append vpnc-scripts
739 "/etc/vpnc/vpnc-script"))))))
740 (add-after 'unpack 'patch-Makefile
741 (lambda* (#:key target #:allow-other-keys)
742 (let* ((pkg-config #$(pkg-config-for-target))
743 (includedir (string-append pkg-config
744 " --variable=includedir"
745 " libgcrypt"))
746 (cflags (string-append pkg-config
747 " --cflags"
748 " libgcrypt"))
749 (libdir (string-append pkg-config
750 " --variable=libdir"
751 " libgcrypt"))
752 (libs (string-append pkg-config
753 " --libs"
754 " libgcrypt")))
755 (substitute* "Makefile"
756 (("\\$\\(shell libgcrypt-config --cflags\\)")
757 (string-append "-I$(shell " includedir ") "
758 "$(shell " cflags ")"))
759 (("\\$\\(shell libgcrypt-config --libs\\)")
760 (string-append
761 "-L$(shell " libdir ") "
762 "$(shell " libs ")")))
763 ;; When cross-compiling the manpage can't be generated as the
764 ;; Makefile needs to execute the resulting `vpnc' binary.
765 (when target
766 (substitute* "Makefile"
767 (("all : \\$\\(BINS\\) vpnc\\.8 vpnc-script")
768 "all : $(BINS) vpnc-script")
769 (("install -m644 vpnc\\.8.*") ""))))))
770 (add-after 'unpack 'install-manpage
771 (lambda* (#:key native-inputs inputs target
772 #:allow-other-keys)
773 ;; As the manpage is not generated. Instead install it from
774 ;; the input vpnc package.
775 (when target
776 (let* ((man (search-input-file
777 native-inputs "/share/man/man8/vpnc.8.zst"))
778 (output (string-append #$output "/share/man/man8")))
779 (install-file man output))))))))
780 (synopsis "Client for Cisco VPN concentrators")
781 (description
782 "vpnc is a VPN client compatible with Cisco's EasyVPN equipment.
783It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only
784shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES,
7851DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace.
786Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
787 (license (list license:gpl2+ license:bsd-2))
788 (home-page "https://www.unix-ag.uni-kl.de/~massar/vpnc/")))
789
790(define-public vpnc-scripts
791 (let ((commit "3885f8bbc4ae03fd6da0ada6de12f7223a59595c"))
792 (package
793 (name "vpnc-scripts")
794 (version (string-append "20200925." (string-take commit 7)))
795 (source (origin
796 (method git-fetch)
797 (uri
798 (git-reference
799 (url "git://git.infradead.org/users/dwmw2/vpnc-scripts.git")
800 (commit commit)))
801 (file-name (git-file-name name version))
802 (sha256
803 (base32
804 "1pmi4n58q81pmn9arvfixhvv6vkkf3rpwac3hwnwyl882q5q0ccx"))))
805 (build-system gnu-build-system)
806 (inputs (list guile-3.0 ; for the wrapper scripts
807 coreutils
808 grep
809 iproute ; for ‘ip’
810 net-tools ; for ‘ifconfig’, ‘route’
811 sed
812 which))
813 (arguments
814 `(#:phases
815 (modify-phases %standard-phases
816 (add-after 'unpack 'use-relative-paths
817 ;; Patch the scripts to work with and use relative paths.
818 (lambda* _
819 (for-each (lambda (script)
820 (substitute* script
821 (("^PATH=.*") "")
822 (("/usr/s?bin/") "")
823 (("\\[ +-x +([^]]+) +\\]" _ command)
824 (string-append "command -v >/dev/null 2>&1 "
825 command))))
826 (find-files "." "^vpnc-script"))
827 #t))
828 (delete 'configure) ; no configure script
829 (replace 'build
830 (lambda _
831 (invoke "gcc" "-g" "-O2"
832 "-Wno-error=implicit-function-declaration"
833 "-o" "netunshare" "netunshare.c")))
834 (replace 'install
835 ;; There is no Makefile; manually install the relevant files.
836 (lambda* (#:key outputs #:allow-other-keys)
837 (let* ((out (assoc-ref outputs "out"))
838 (etc (string-append out "/etc/vpnc")))
839 (for-each (lambda (file)
840 (install-file file etc))
841 (append (find-files "." "^vpnc-script")
842 (list "netunshare"
843 "xinetd.netns.conf")))
844 #t)))
845 (add-after 'install 'wrap-scripts
846 ;; Wrap scripts with paths to their common hard dependencies.
847 ;; Optional dependencies will need to be installed by the user.
848 (lambda* (#:key inputs outputs #:allow-other-keys)
849 (let ((out (assoc-ref outputs "out"))
850 (guile (search-input-file inputs "bin/guile")))
851 (for-each
852 (lambda (script)
853 (wrap-script (string-append out "/etc/vpnc/" script)
854 #:guile guile
855 `("PATH" ":" prefix
856 ,(map (lambda (name)
857 (let ((input (assoc-ref inputs name)))
858 (string-append input "/bin:"
859 input "/sbin")))
860 (list "coreutils"
861 "grep"
862 "iproute2"
863 "net-tools"
864 "sed"
865 "which")))))
866 (list "vpnc-script-ptrtd"
867 "vpnc-script-sshd"
868 "vpnc-script"))
869 #t))))
870 #:tests? #f)) ; no tests
871 (home-page "http://git.infradead.org/users/dwmw2/vpnc-scripts.git")
872 (synopsis "Network configuration scripts for Cisco VPN clients")
873 (description
874 "This set of scripts configures routing and name services when invoked
875by the VPNC or OpenConnect Cisco @dfn{Virtual Private Network} (VPN) clients.
876
877The default @command{vpnc-script} automatically configures most common
878connections, and provides hooks for performing custom actions at various stages
879of the connection or disconnection process.
880
881Alternative scripts are provided for more complicated set-ups, or to serve as an
882example for writing your own. For example, @command{vpnc-script-sshd} contains
883the entire VPN in a network namespace accessible only through SSH.")
884 (license license:gpl2+))))
885
886(define-public ocproxy
887 (package
888 (name "ocproxy")
889 (version "1.70")
890 (source (origin
891 (method git-fetch)
892 (uri (git-reference
893 (url "https://github.com/cernekee/ocproxy")
894 ;; Unreleased; 9 years old.
895 (commit "8f1542582e8381de6f19506a12c1c88af645db5c")))
896 (file-name (git-file-name name version))
897 (sha256
898 (base32
899 "18fbgi8n4w3vl3mm1hmydfzzyh0wqnnjxkfknhmqdn3x7kij2909"))))
900 (build-system gnu-build-system)
901 (native-inputs
902 (list autoconf automake))
903 (inputs
904 (list libevent))
905 (home-page "https://github.com/cernekee/ocproxy")
906 (synopsis "OpenConnect proxy")
907 (description
908 "User-level @dfn{SOCKS} and port forwarding proxy for OpenConnect based
909on LwIP. When using ocproxy, OpenConnect only handles network activity that
910the user specifically asks to proxy, so the @dfn{VPN} interface no longer
911\"hijacks\" all network traffic on the host.")
912 (license license:bsd-3)))
913
914(define-public openconnect
915 (let ((commit "549fd2d6c4606304e16e222e31b15c15d50e7729")
916 (revision "1"))
917 (package
918 (name "openconnect")
919 (version (git-version "9.12" revision commit))
920 (source (origin
921 (method git-fetch)
922 (uri (git-reference
923 (url "https://gitlab.com/openconnect/openconnect.git")
924 (commit commit)))
925 (file-name (git-file-name name version))
926 (sha256
927 (base32
928 "0zzhc25988wgw4nqrjmfcwpzs2cxmif0rjd2jc9h5hnnnh07x986"))))
929 (outputs '("out" "doc"))
930 (build-system gnu-build-system)
931 (arguments
932 (list
933 #:configure-flags
934 #~(list
935 (string-append
936 "--with-vpnc-script="
937 (search-input-file %build-inputs "etc/vpnc/vpnc-script")))))
938 (native-inputs
939 (list autoconf
940 automake
941 gettext-minimal
942 libtool
943 pkg-config
944 ;; To build documentation.
945 groff
946 python-minimal
947 ;; For unit tests.
948 socket-wrapper
949 uid-wrapper
950 python-flask))
951 (inputs
952 (list mit-krb5 ;for gssapi
953 tpm2-tss
954 lz4
955 vpnc-scripts))
956 (propagated-inputs
957 (list gnutls
958 libproxy
959 oath-toolkit ;for libpskc
960 pcsc-lite
961 stoken
962 libxml2
963 zlib))
964 (synopsis "Client for Cisco VPN")
965 (description
966 "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is
967supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500, 870,
968880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers, and probably
969others.")
970 (license license:lgpl2.1)
971 (home-page "https://www.infradead.org/openconnect/"))))
972
973(define-public openfortivpn
974 (package
975 (name "openfortivpn")
976 (version "1.24.1")
977 (source (origin
978 (method git-fetch)
979 (uri (git-reference
980 (url "https://github.com/adrienverge/openfortivpn")
981 (commit (string-append "v" version))))
982 (file-name (git-file-name name version))
983 (sha256
984 (base32
985 "17zcn13jyd2zs7v4r3hb8hcwcln4gch2gv3g752d3navz02q956c"))))
986 (build-system gnu-build-system)
987 (native-inputs (list autoconf automake perl pkg-config python-wrapper))
988 (inputs (list openssl ppp))
989 (home-page "https://github.com/adrienverge/openfortivpn")
990 (synopsis "Client for PPP+SSL VPN tunnel services")
991 (description "Openfortivpn is a client for PPP+SSL VPN tunnel services. It
992spawns a pppd process and operates the communication between the gateway and
993this process. It is compatible with Fortinet VPNs.")
994 (license license:gpl3+)))
995
996(define-public openvpn
997 (package
998 (name "openvpn")
999 (version "2.6.12")
1000 (source (origin
1001 (method url-fetch)
1002 (uri (string-append
1003 "https://swupdate.openvpn.org/community/releases/openvpn-"
1004 version ".tar.gz"))
1005 (sha256
1006 (base32
1007 "0a8r3bvg4aic9b7dix0h7990g3j1gq17wd3w6vqk8vk8xgfhyq8w"))))
1008 (build-system gnu-build-system)
1009 (arguments
1010 '(#:configure-flags '("--enable-iproute2=yes")))
1011 (native-inputs (list iproute pkg-config))
1012 (inputs (append (list lz4 lzo openssl linux-pam)
1013 (if (target-linux?) (list libcap-ng) '())))
1014 (home-page "https://openvpn.net/")
1015 (synopsis "Virtual private network daemon")
1016 (description
1017 "OpenVPN implements virtual private network (@dfn{VPN}) techniques
1018for creating secure point-to-point or site-to-site connections in routed or
1019bridged configurations and remote access facilities. It uses a custom
1020security protocol that utilizes SSL/TLS for key exchange. It is capable of
1021traversing network address translators (@dfn{NAT}s) and firewalls.")
1022 (license license:gpl2)))
1023
1024(define-public python-proton-core
1025 (package
1026 (name "python-proton-core")
1027 (version "0.7.4")
1028 (home-page "https://github.com/ProtonVPN/python-proton-core")
1029 (source
1030 (origin
1031 (method git-fetch)
1032 (uri (git-reference
1033 (url home-page)
1034 (commit (string-append "v" version))))
1035 (file-name (git-file-name name version))
1036 (sha256
1037 (base32 "17bxsk755fl6ahccpx05wr8szr9k6x12a68qncm1hfmlwqd4ag2r"))))
1038 (build-system pyproject-build-system)
1039 (arguments
1040 (list
1041 #:test-flags
1042 #~(list ;; XXX: Require network access.
1043 "--ignore=tests/test_alternativerouting.py"
1044 "--ignore=tests/test_session.py"
1045 "--ignore=tests/test_tlsverification.py"
1046 "-k" "not test_auto_works_on_prod")
1047 #:phases
1048 #~(modify-phases %standard-phases
1049 (add-before 'check 'prepare-tests
1050 (lambda _
1051 (setenv "HOME" (getcwd))
1052 (setenv "XDG_RUNTIME_DIR" (string-append (getcwd) "/.run")))))))
1053 (native-inputs
1054 (list gnupg
1055 python-pyotp
1056 python-pytest
1057 python-pyxdg
1058 python-setuptools))
1059 (propagated-inputs
1060 (list python-aiohttp
1061 python-bcrypt
1062 python-gnupg
1063 python-pyopenssl
1064 python-requests))
1065 (synopsis "Core logic used by the other Proton components")
1066 (description
1067 "This package is a core library used by other @code{python-proton-}
1068packages.")
1069 (license license:gpl3+)))
1070
1071(define-public python-proton-keyring-linux
1072 (package
1073 (name "python-proton-keyring-linux")
1074 (version "0.2.3")
1075 (home-page "https://github.com/ProtonVPN/python-proton-keyring-linux")
1076 (source
1077 (origin
1078 (method git-fetch)
1079 (uri (git-reference
1080 (url home-page)
1081 (commit (string-append "v" version))))
1082 (file-name (git-file-name name version))
1083 (sha256
1084 (base32 "1yfs8y959g9vlfj8b5gkz6yng22yp0j6yfc1g1zkh6a9h9r26g9s"))))
1085 (build-system pyproject-build-system)
1086 (native-inputs
1087 (list python-pytest python-setuptools))
1088 (propagated-inputs
1089 (list python-keyring
1090 python-proton-core))
1091 (synopsis "Proton keyring plugin")
1092 (description
1093 "This package provides a keyring plugin for Proton technologies.")
1094 (license license:gpl3+)))
1095
1096(define-public python-proton-vpn-api-core
1097 (package
1098 (name "python-proton-vpn-api-core")
1099 (version "5.2.3")
1100 (source
1101 (origin
1102 (method git-fetch)
1103 (uri (git-reference
1104 (url "https://github.com/ProtonVPN/python-proton-vpn-api-core")
1105 (commit (string-append "v" version))))
1106 (file-name (git-file-name name version))
1107 (sha256
1108 (base32 "0g42nrmr3sibjpm6alnsfrc9bjq49l5f7xrf5cgf7rgdimz0haqa"))))
1109 (build-system pyproject-build-system)
1110 (arguments
1111 (list
1112 #:phases
1113 #~(modify-phases %standard-phases
1114 (add-before 'check 'prepare-tests
1115 (lambda _
1116 (setenv "HOME" (getcwd))
1117 (setenv "XDG_RUNTIME_DIR" (string-append (getcwd) "/.run")))))))
1118 (native-inputs
1119 (list python-pytest
1120 python-pytest-asyncio
1121 python-pyxdg
1122 python-setuptools
1123 network-manager
1124 network-manager-openvpn))
1125 (propagated-inputs
1126 (list python-cryptography
1127 python-distro
1128 python-fido2
1129 python-sentry-sdk
1130 python-pynacl
1131 python-packaging
1132 python-proton-core
1133 python-proton-vpn-local-agent
1134 python-pygobject
1135 python-pycairo
1136 python-jinja2))
1137 (home-page "https://github.com/ProtonVPN/python-proton-vpn-api-core")
1138 (synopsis "Core logic used by the other Proton VPN components")
1139 (description
1140 "This package is a core library used by other @code{python-proton-vpn-}
1141packages.")
1142 (license license:gpl3+)))
1143
1144(define-public python-proton-vpn-local-agent
1145 (let* ((name "python-proton-vpn-local-agent")
1146 (version "1.6.0")
1147 (local-agent-version "0.10.1")
1148 (home-page "https://github.com/ProtonVPN/local-agent-rs")
1149 (base-origin
1150 (origin
1151 (method git-fetch)
1152 (uri (git-reference
1153 (url home-page)
1154 (commit version)))
1155 (file-name (git-file-name name version))
1156 (sha256
1157 (base32 "13ym2hhb5ndiffc8z551bb2hk2rdkld2r8cwhyq3nl5lma5z0kdf")))))
1158 (package
1159 (name name)
1160 (version version)
1161 (home-page home-page)
1162 (source base-origin)
1163 (build-system cargo-build-system)
1164 (arguments
1165 (list
1166 #:install-source? #false
1167 #:imported-modules `(,@%cargo-build-system-modules
1168 ,@%pyproject-build-system-modules)
1169 #:modules '((guix build cargo-build-system)
1170 ((guix build pyproject-build-system) #:prefix py:)
1171 (guix build utils))
1172 #:phases
1173 #~(modify-phases %standard-phases
1174 (add-after 'unpack 'chdir
1175 (lambda _
1176 (chdir "python-proton-vpn-local-agent")))
1177 ;; XXX: Inject the local_agent_rs crate as a vendored dependency
1178 ;; instead of using path=. Otherwise the 'package phase is broken.
1179 (add-after 'chdir 'patch-local-agent-rs-version
1180 (lambda _
1181 (substitute* "Cargo.toml"
1182 (("\\{ (path = \"\\.\\./local_agent_rs\") \\}")
1183 (format #f "{ version = ~s }" #$local-agent-version)))))
1184 ;; XXX: There is currently no proper way to install a wheel.
1185 (add-after 'install 'prepare-python-module-with-flit
1186 (lambda _
1187 (define (touch file)
1188 (call-with-output-file file (const #t)))
1189 (mkdir-p "python/proton/vpn/")
1190 (for-each touch '("python/proton/__init__.py"
1191 "python/proton/vpn/__init__.py"))
1192 (copy-file "target/release/libpython_proton_vpn_local_agent.so"
1193 ;; XXX: Install as .py or flit fails to do so.
1194 "python/proton/vpn/local_agent.py")
1195 (call-with-output-file "python/pyproject.toml"
1196 (lambda (port)
1197 (format port "\
1198[build-system]
1199requires = [\"flit_core\"]
1200build-backend = \"flit_core.buildapi\"
1201
1202[project]
1203name = ~s
1204version = ~s
1205description = ~s
1206
1207[tool.flit.module]
1208name = ~s~%"
1209 "proton_vpn_local_agent"
1210 #$version
1211 #$(package-description this-package)
1212 "proton.vpn.local_agent")))
1213 (chdir "python")))
1214 (add-after 'prepare-python-module-with-flit 'build-python-module
1215 (assoc-ref py:%standard-phases 'build))
1216 (add-after 'build-python-module 'install-python-module
1217 (assoc-ref py:%standard-phases 'install))
1218 (add-after 'install-python-module 'fix-python-installation
1219 (lambda* (#:key inputs outputs #:allow-other-keys)
1220 (with-directory-excursion (py:site-packages inputs outputs)
1221 (rename-file "proton/vpn/local_agent.py"
1222 "proton/vpn/local_agent.so")
1223 (substitute* (find-files "." "RECORD")
1224 (("proton/vpn/local_agent\\.py")
1225 "proton/vpn/local_agent.so")))))
1226 (add-after 'fix-python-installation 'add-install-to-pythonpath
1227 (assoc-ref py:%standard-phases 'add-install-to-pythonpath))
1228 (add-after 'add-install-to-pythonpath 'python-check
1229 (lambda args
1230 (chdir "..")
1231 (apply (assoc-ref py:%standard-phases 'check)
1232 (cons* #:test-flags (list) args)))))))
1233 (native-inputs
1234 (list python-flit-core
1235 python-pytest
1236 python-pytest-asyncio))
1237 (inputs
1238 (cons*
1239 (origin
1240 (inherit base-origin)
1241 (file-name (git-file-name "local_agent_rs" local-agent-version))
1242 (modules '((guix build utils)
1243 (ice-9 ftw)))
1244 (snippet
1245 #~(begin
1246 ;; Delete everything except for local_agent_rs itself:
1247 (for-each (lambda (file)
1248 (unless (member file '("." ".." "local_agent_rs"))
1249 (delete-file-recursively file)))
1250 (scandir "."))
1251 (for-each
1252 (lambda (file)
1253 (unless (member file '("." ".."))
1254 (rename-file (string-append "local_agent_rs/" file) file)))
1255 (scandir "local_agent_rs")))))
1256 python-wrapper
1257 (cargo-inputs 'python-proton-vpn-local-agent)))
1258 (synopsis "Communicate with a Proton LocalAgent")
1259 (description
1260 "This package contains a rust crate for communicating with a Proton
1261LocalAgent, server, and python-bindings for that crate.")
1262 (license license:gpl3+))))
1263
1264(define-public proton-vpn-cli
1265 (package
1266 (name "proton-vpn-cli")
1267 (version "1.0.1")
1268 (source
1269 (origin
1270 (method git-fetch)
1271 (uri (git-reference
1272 (url "https://github.com/ProtonVPN/proton-vpn-cli")
1273 (commit (string-append "v" version))))
1274 (file-name (git-file-name name version))
1275 (sha256
1276 (base32 "1x4smaayrprvlhcpmns5bnzpbhxj4jymnya5v3jvyrmpa2s34j8a"))))
1277 (build-system pyproject-build-system)
1278 (arguments
1279 (list
1280 #:phases
1281 #~(modify-phases %standard-phases
1282 (add-before 'build 'prepare-envs
1283 (lambda _
1284 (setenv "HOME" "/tmp")
1285 (setenv "XDG_RUNTIME_DIR" (string-append (getcwd) "/.run")))))))
1286 (native-inputs
1287 (list python-pytest
1288 python-pytest-asyncio
1289 python-pyxdg
1290 python-setuptools))
1291 (propagated-inputs
1292 (list python-click
1293 python-dbus-fast
1294 python-proton-core
1295 python-proton-keyring-linux
1296 python-proton-vpn-api-core
1297 python-proton-vpn-local-agent
1298 python-tabulate))
1299 (synopsis "Command-line client for ProtonVPN")
1300 (description
1301 "This is the official command-line interface for ProtonVPN, a secure
1302point-to-point virtual private networking (VPN) service with a gratis tier.
1303It can automatically find and connect to the fastest servers or use Tor over
1304VPN. The gratis tier offers unlimited bandwidth for up to 10 devices.")
1305 (home-page "https://github.com/ProtonVPN/linux-cli")
1306 (license license:gpl3+)))
1307
1308(define-deprecated-package protonvpn-cli proton-vpn-cli)
1309
1310(define-public tinc
1311 (package
1312 (name "tinc")
1313 (version "1.0.36")
1314 (source (origin
1315 (method url-fetch)
1316 (uri (string-append "https://tinc-vpn.org/packages/"
1317 "tinc-" version ".tar.gz"))
1318 (sha256
1319 (base32
1320 "021i2sl2mjscbm8g59d7vs74iw3gf0m48wg7w3zhwj6czarkpxs0"))))
1321 (build-system gnu-build-system)
1322 (arguments
1323 '(#:configure-flags
1324 '("--sysconfdir=/etc"
1325 "--localstatedir=/var")))
1326 (inputs (list zlib lzo openssl))
1327 (home-page "https://tinc-vpn.org")
1328 (synopsis "Virtual Private Network (VPN) daemon")
1329 (description
1330 "Tinc is a VPN that uses tunnelling and encryption to create a secure
1331private network between hosts on the internet.")
1332 (license license:gpl2+)))
1333
1334(define-public sshuttle
1335 (package
1336 (name "sshuttle")
1337 (version "1.3.2")
1338 (source
1339 (origin
1340 (method git-fetch)
1341 (uri (git-reference
1342 (url "https://github.com/sshuttle/sshuttle")
1343 (commit (string-append "v" version))))
1344 (file-name (git-file-name name version))
1345 (sha256
1346 (base32 "0v4z2w5kcrqkxsz1pgs1sqm1kx4yismjana2lxsq5zyfs3vn3y26"))))
1347 (build-system pyproject-build-system)
1348 (arguments
1349 (list #:modules
1350 `((guix build pyproject-build-system)
1351 (guix build utils)
1352 (ice-9 match)
1353 (srfi srfi-26))
1354 #:phases
1355 #~(modify-phases %standard-phases
1356 (add-after 'unpack 'patch-FHS-file-names
1357 (lambda* (#:key inputs #:allow-other-keys)
1358 (substitute* "sshuttle/client.py"
1359 (("(/usr)?(/bin/env)" _ _ command)
1360 (search-input-file inputs command)))
1361 (substitute* "sshuttle/ssh.py"
1362 (("/bin/sh" command)
1363 (search-input-file inputs command)))))
1364 (add-after 'install 'install-documentation
1365 (lambda _
1366 (with-directory-excursion "docs"
1367 (invoke "make" "info" "man")
1368 (with-directory-excursion "_build"
1369 (define (install-man-page file)
1370 (match (string-split file #\.)
1371 ((_ ... section)
1372 (install-file file
1373 (string-append #$output
1374 "/share/man/man"
1375 section)))))
1376
1377 (for-each install-man-page
1378 (find-files "man" "\\.[0-9]$"))
1379 (for-each (cut install-file <>
1380 (string-append #$output "/share/info"))
1381 (find-files "texinfo" "\\.info$")))))))))
1382 (native-inputs
1383 (list python-setuptools-scm
1384 ;; For tests only.
1385 python-hatchling
1386 python-mock
1387 python-pytest
1388 ;; For documentation only.
1389 python-sphinx
1390 texinfo))
1391 (home-page "https://github.com/sshuttle/sshuttle")
1392 (synopsis "VPN that transparently forwards connections over SSH")
1393 (description "sshuttle creates an encrypted virtual private network (VPN)
1394connection to any remote server to which you have secure shell (SSH) access.
1395The only requirement is a suitable version of Python on the server;
1396administrative privileges are required only on the client. Unlike most VPNs,
1397sshuttle forwards entire sessions, not packets, using kernel transparent
1398proxying. This makes it faster and more reliable than SSH's own tunneling and
1399port forwarding features. It can forward both TCP and UDP traffic, including
1400DNS domain name queries.")
1401 (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’
1402
1403(define-public sshoot
1404 (package
1405 (name "sshoot")
1406 (version "1.6.0")
1407 (source
1408 (origin
1409 (method git-fetch)
1410 (uri (git-reference
1411 (url "https://github.com/albertodonato/sshoot")
1412 (commit version)))
1413 (file-name (git-file-name name version))
1414 (sha256
1415 (base32 "0xyj1ahhkcc7m27ym7ch4dwp2x43v9mfs9aiqnnnkq226rydffjl"))))
1416 (build-system pyproject-build-system)
1417 (arguments
1418 (list
1419 #:phases
1420 #~(modify-phases %standard-phases
1421 (add-after 'unpack 'patch-paths
1422 (lambda* (#:key inputs #:allow-other-keys)
1423 (substitute* "tests/manager_test.py"
1424 (("/bin/sh")
1425 (search-input-file inputs "bin/sh"))))))))
1426 (inputs (list python-argcomplete python-prettytable python-pyyaml
1427 python-pyxdg python-toolrack))
1428 (native-inputs (list python-pytest python-pytest-mock python-setuptools))
1429 (home-page "https://github.com/albertodonato/sshoot")
1430 (synopsis "VPN session manager (sshuttle)")
1431 (description
1432 "sshoot provides a command-line interface to manage multiple
1433@command{sshuttle} virtual private networks. It supports flexible profiles
1434with configuration options for most of @command{sshuttle}’s features.")
1435 (license license:gpl3+)))
1436
1437(define-public badvpn
1438 (package
1439 (name "badvpn")
1440 (version "1.999.130")
1441 (source
1442 (origin
1443 (method git-fetch)
1444 (uri (git-reference
1445 (url "https://github.com/ambrop72/badvpn")
1446 (commit version)))
1447 (file-name (git-file-name name version))
1448 (sha256
1449 (base32 "0rm67xhi7bh3yph1vh07imv5y1pwyldvw3wa5bz471g8mnkc7d3c"))))
1450 (build-system cmake-build-system)
1451 (arguments
1452 '(#:tests? #f)) ; no tests
1453 (inputs
1454 (list nspr nss openssl))
1455 (native-inputs
1456 (list pkg-config))
1457 (home-page "https://github.com/ambrop72/badvpn")
1458 (synopsis "Peer-to-peer virtual private network (VPN)")
1459 (description "@code{BadVPN} is a collection of virtual private
1460network (VPN) tools. It includes:
1461
1462@enumerate
1463@item NCD programming language.\n
1464NCD (Network Configuration Daemon) is a daemon and programming/scripting
1465language for configuration of network interfaces and other aspects of the
1466operating system.
1467@item Tun2socks network-layer proxifier.\n
1468The tun2socks program socksifes TCP connections at the network layer. It
1469implements a TUN device which accepts all incoming TCP connections (regardless
1470of destination IP), and forwards the connections through a SOCKS server.
1471@item Peer-to-peer VPN.\n
1472The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
1473(VPN nodes).
1474@end enumerate")
1475 ;; This project contains a bundled lwIP. lwIP is also released under the
1476 ;; 3-clause BSD license.
1477 (license license:bsd-3)))
1478
1479(define-public wireguard-tools
1480 (package
1481 (name "wireguard-tools")
1482 (version "1.0.20260223")
1483 (source
1484 (origin
1485 (method git-fetch)
1486 (uri (git-reference
1487 (url "https://git.zx2c4.com/wireguard-tools.git")
1488 (commit (string-append "v" version))))
1489 (file-name (git-file-name name version))
1490 (sha256
1491 (base32 "1z2yl8crqwk064jki9avbnrhckja8526dyyqmgy2j135xxm9ri31"))))
1492 (build-system gnu-build-system)
1493 (arguments
1494 (list
1495 #:make-flags
1496 #~(list (string-append "CC=" #$(cc-for-target))
1497 "--directory=src"
1498 "WITH_BASHCOMPLETION=yes"
1499 ;; Install the ‘simple and dirty’ helper script wg-quick(8).
1500 "WITH_WGQUICK=yes"
1501 (string-append "PREFIX=" #$output)
1502 ;; Currently used only to create an empty /etc/wireguard directory.
1503 (string-append "SYSCONFDIR=no-thanks"))
1504 ;; The test suite is meant to be run interactively. It runs Clang's
1505 ;; scan-build static analyzer and then starts a web server to display the
1506 ;; results.
1507 #:tests? #f
1508 #:phases
1509 #~(modify-phases %standard-phases
1510 (delete 'configure) ; no configure script
1511 (add-after 'install 'install-contrib-docs
1512 (lambda _
1513 (copy-recursively
1514 "contrib/"
1515 (string-append #$output "/share/doc/wireguard-tools"))))
1516 (add-after 'install 'wrap-wg-quick
1517 (lambda* (#:key inputs #:allow-other-keys)
1518 (let* ((inputs-sbin (map (lambda (input)
1519 (string-append (assoc-ref inputs input)
1520 "/sbin"))
1521 (list "iproute"
1522 "iptables"
1523 "procps"
1524 "resolvconf")))
1525 (coreutils (string-append (assoc-ref inputs "coreutils")
1526 "/bin")))
1527 (wrap-program (string-append #$output "/bin/wg-quick")
1528 #:sh (search-input-file inputs "bin/bash")
1529 `("PATH" ":" prefix ,(append inputs-sbin
1530 (list coreutils))))))))))
1531 (inputs
1532 `(("resolvconf" ,openresolv)
1533 ("coreutils" ,coreutils)
1534 ("bash" ,bash) ; for scripts using /dev/tcp
1535 ("procps" ,procps)
1536 ("iproute" ,iproute)
1537 ("iptables" ,iptables)))
1538 (home-page "https://www.wireguard.com/")
1539 (synopsis "Tools for configuring WireGuard tunnels")
1540 (description
1541 "This package provides the user-space command-line tools for using and
1542configuring WireGuard tunnels.
1543
1544WireGuard is a simple and fast general-purpose @acronym{VPN, Virtual Private
1545Network} that securely encapsulates IP packets over UDP. It aims to be as easy
1546to configure and deploy as SSH. VPN connections are made simply by exchanging
1547public keys and can roam across IP addresses.")
1548 (license
1549 (list license:lgpl2.1+ ; src/netlink.h & contrib/embeddable-wg-library
1550 license:gpl2)))) ; everything else
1551
1552(define-public xl2tpd
1553 (package
1554 (name "xl2tpd")
1555 (version "1.3.20")
1556 (source (origin
1557 (method git-fetch)
1558 (uri (git-reference
1559 (url "https://github.com/xelerance/xl2tpd")
1560 (commit (string-append "v" version))))
1561 (file-name (git-file-name name version))
1562 (sha256
1563 (base32
1564 "11bg99wpjgw57rqr8mcrrbvs5n6787yfaygjbpj27zfvq8q092jg"))))
1565 (build-system gnu-build-system)
1566 (arguments
1567 (list
1568 #:make-flags
1569 #~(list (string-append "PREFIX=" #$output)
1570 (string-append "CC=" #$(cc-for-target)))
1571 #:phases
1572 #~(modify-phases %standard-phases
1573 (delete 'configure) ;no configure script
1574 (add-before 'build 'setup-environment
1575 (lambda* (#:key inputs #:allow-other-keys)
1576 (substitute* "l2tp.h"
1577 (("/usr/sbin/pppd")
1578 (search-input-file inputs "/sbin/pppd")))
1579 (setenv "KERNELSRC"
1580 (assoc-ref inputs "kernel-headers")))))
1581 #:tests? #f)) ; no tests provided
1582 (inputs (list libpcap ppp))
1583 (home-page "https://www.xelerance.com/software/xl2tpd/")
1584 (synopsis "Layer 2 Tunnelling Protocol Daemon (RFC 2661)")
1585 (description
1586 "xl2tpd is an implementation of the Layer 2 Tunnelling Protocol (RFC 2661).
1587L2TP allows you to tunnel PPP over UDP.")
1588 (license license:gpl2)))
1589
1590(define-public vpn-slice
1591 (package
1592 (name "vpn-slice")
1593 (version "0.16.1")
1594 (source
1595 (origin
1596 (method git-fetch)
1597 (uri (git-reference
1598 (url "https://github.com/dlenski/vpn-slice")
1599 (commit (string-append "v" version))))
1600 (file-name (git-file-name name version))
1601 (sha256
1602 (base32 "16shhgypw78d9982r7v293h8fbmpl4wvjb6076w66baincn599ag"))))
1603 (build-system pyproject-build-system)
1604 (arguments
1605 (list
1606 #:tests? #f ;No tests.
1607 #:phases
1608 #~(modify-phases %standard-phases
1609 (add-after 'unpack 'patch-FHS-file-names
1610 (lambda* (#:key inputs #:allow-other-keys)
1611 (substitute* "vpn_slice/linux.py"
1612 (("'/sbin/iptables'")
1613 (string-append
1614 "'" (search-input-file inputs "/sbin/iptables") "'"))
1615 (("'/sbin/ip'")
1616 (string-append
1617 "'" (search-input-file inputs "/sbin/ip") "'"))))))))
1618 (native-inputs (list python-setuptools python-wheel))
1619 (inputs (list python-dnspython python-setproctitle iproute iptables))
1620 (home-page "https://github.com/dlenski/vpn-slice")
1621 (synopsis "Split tunneling replacement for vpnc-script")
1622 (description
1623 "vpn-slice is a replacement for @command{vpnc-script} used by
1624@code{openconnect} and @code{vpnc}. Instead of trying to copy the behavior of
1625standard corporate VPN clients, which normally reroute all your network
1626traffic through the VPN, vpn-slice tries to minimize your contact with an
1627intrusive VPN. This is also known as a split-tunnel VPN, since it splits your
1628traffic between the VPN tunnel and your normal network interfaces.
1629
1630By default, vpn-slice only routes traffic for specific hosts or subnets
1631through the VPN. It automatically looks up named hosts, using the VPN's DNS
1632servers, and adds entries for them to your @file{/etc/hosts} (which it cleans
1633up after VPN disconnection), however it does not otherwise alter your
1634@file{/etc/resolv.conf} at all.")
1635 (license license:gpl3+)))