gnu: bcachefs-tools: Update to 0.1-3.612f6b9.
[jackhill/guix/guix.git] / gnu / packages / tor.scm
CommitLineData
7f08437b 1;;; GNU Guix --- Functional package management for GNU
9355498d 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
722ec722 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
fd0dd2b2 4;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
3c986a7d 5;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
8574c822 6;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4afdb792 7;;; Copyright © 2017, 2018, 2019 Eric Bavier <bavier@member.fsf.org>
7e9e1a36 8;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
90664247 9;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
3926d0fc 10;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
e418c3d0 11;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
1239aabd 12;;; Copyright © 2020 André Batista <nandre@riseup.net>
7f08437b
LC
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages tor)
71794d7b 30 #:use-module ((guix licenses) #:prefix license:)
7f08437b 31 #:use-module (guix packages)
1239aabd 32 #:use-module (guix utils)
7f08437b 33 #:use-module (guix download)
ba583bd2 34 #:use-module (guix git-download)
7f08437b 35 #:use-module (guix build-system gnu)
c4605e4c 36 #:use-module (guix build-system python)
ba583bd2 37 #:use-module (gnu packages)
f3cf25c3 38 #:use-module (gnu packages base)
7f08437b 39 #:use-module (gnu packages libevent)
f3cf25c3 40 #:use-module (gnu packages linux)
ac257f12 41 #:use-module (gnu packages check)
7f08437b 42 #:use-module (gnu packages compression)
b2e3dd94 43 #:use-module (gnu packages pcre)
6c97f17f 44 #:use-module (gnu packages pkg-config)
8850303e 45 #:use-module (gnu packages python)
4afdb792 46 #:use-module (gnu packages python-crypto)
1b2f753d 47 #:use-module (gnu packages python-web)
44d10b1f 48 #:use-module (gnu packages python-xyz)
b8ea5204 49 #:use-module (gnu packages qt)
b2e3dd94 50 #:use-module (gnu packages autotools)
cc2b77df 51 #:use-module (gnu packages tls)
b2e3dd94 52 #:use-module (gnu packages w3m))
7f08437b
LC
53
54(define-public tor
55 (package
56 (name "tor")
66479da5 57 (version "0.4.4.6")
7f08437b
LC
58 (source (origin
59 (method url-fetch)
0ab57b0d 60 (uri (string-append "https://dist.torproject.org/tor-"
7f08437b
LC
61 version ".tar.gz"))
62 (sha256
63 (base32
66479da5 64 "1p0zpqmbskygx0wmiijhprg8r45n2wqbbjl7kv4gbb83b0alq5az"))))
7f08437b 65 (build-system gnu-build-system)
28740402
TGR
66 (arguments
67 `(#:configure-flags
68 (list "--enable-lzma"
69 "--enable-zstd")))
8850303e 70 (native-inputs
6c97f17f 71 `(("pkg-config" ,pkg-config)
28740402 72 ("python" ,python))) ; for tests
7f08437b 73 (inputs
28740402 74 `(("libevent" ,libevent)
6c97f17f 75 ("libseccomp" ,libseccomp)
28740402 76 ("openssl" ,openssl)
6c97f17f 77 ("xz" ,xz)
28740402 78 ("zlib" ,zlib)
ec0de9d8 79 ("zstd" ,zstd "lib")))
0ab57b0d 80 (home-page "https://www.torproject.org/")
9e771e3b 81 (synopsis "Anonymous network router to improve privacy on the Internet")
7f08437b
LC
82 (description
83 "Tor protects you by bouncing your communications around a distributed
84network of relays run by volunteers all around the world: it prevents
85somebody watching your Internet connection from learning what sites you
86visit, and it prevents the sites you visit from learning your physical
35b9e423 87location. Tor works with many of your existing applications, including
7f08437b 88web browsers, instant messaging clients, remote login, and other
fc9286d0 89applications based on the TCP protocol.
55b27569 90
1239aabd
AB
91This package is the full featured @code{tor} which is needed for running
92relays, bridges or directory authorities. If you just want to access the Tor
93network or to setup an onion service you may install @code{tor-client}
94instead.")
95 (license license:bsd-3)))
96
97(define-public tor-client
98 (package
99 (inherit tor)
100 (name "tor-client")
101 (arguments
102 (substitute-keyword-arguments (package-arguments tor)
103 ((#:configure-flags flags)
104 (append flags
105 '("--disable-module-relay")))))
106 (synopsis "Client to the anonymous Tor network")
107 (description
108 "Tor protects you by bouncing your communications around a distributed
109network of relays run by volunteers all around the world: it prevents
110somebody watching your Internet connection from learning what sites you
111visit, and it prevents the sites you visit from learning your physical
112location. Tor works with many of your existing applications, including
113web browsers, instant messaging clients, remote login, and other
114applications based on the TCP protocol.
115
fc9286d0 116To @code{torify} applications (to take measures to ensure that an application,
117which has not been designed for use with Tor such as ssh, will use only Tor for
118internet connectivity, and also ensures that there are no leaks from DNS, UDP or
1239aabd
AB
119the application layer) you need to install @code{torsocks}.
120
121This package only provides a client to the Tor Network.")))
4f7e152b
LC
122
123(define-public torsocks
124 (package
125 (name "torsocks")
15c661ec 126 (version "2.3.0")
4f7e152b 127 (source (origin
91988aee 128 (method url-fetch)
129 (uri (string-append "https://people.torproject.org/~dgoulet/"
d77ade87 130 "torsocks/torsocks-" version ".tar.xz"))
ba583bd2
LC
131 (sha256
132 (base32
15c661ec 133 "08inrkap29gikb6sdmb58z43hw4abwrfw7ny40c4xzdkss0vkwdr"))))
4f7e152b 134 (build-system gnu-build-system)
f3cf25c3 135 (inputs
15c661ec 136 `(("libcap" ,libcap)))
f3cf25c3
EB
137 (arguments
138 `(#:phases (modify-phases %standard-phases
139 (add-after 'build 'absolutize
140 (lambda* (#:key inputs #:allow-other-keys)
141 (substitute* "src/bin/torsocks"
15c661ec
TGR
142 (("getcap=.*")
143 (string-append "getcap=" (which "getcap") "\n")))
f3cf25c3 144 #t)))))
91988aee 145 (home-page "https://www.torproject.org/")
4f7e152b
LC
146 (synopsis "Use socks-friendly applications with Tor")
147 (description
148 "Torsocks allows you to use most socks-friendly applications in a safe
149way with Tor. It ensures that DNS requests are handled safely and explicitly
150rejects UDP traffic from the application you're using.")
ba583bd2
LC
151
152 ;; All the files explicitly say "version 2 only".
71794d7b 153 (license license:gpl2)))
b2e3dd94
LC
154
155(define-public privoxy
156 (package
157 (name "privoxy")
8574c822 158 (version "3.0.31")
b2e3dd94
LC
159 (source (origin
160 (method url-fetch)
161 (uri (string-append "mirror://sourceforge/ijbswa/Sources/"
162 version "%20%28stable%29/privoxy-"
163 version "-stable-src.tar.gz"))
164 (sha256
165 (base32
8574c822 166 "1sq4s0h73r7mynl8s0ynn3a6zl98j06nb2nqx2j254n7maijjxq7"))))
b2e3dd94
LC
167 (build-system gnu-build-system)
168 (arguments
ae5c6fca
LC
169 '(;; The default 'sysconfdir' is $out/etc; change that to
170 ;; $out/etc/privoxy.
171 #:configure-flags (list (string-append "--sysconfdir="
172 (assoc-ref %outputs "out")
e418c3d0 173 "/etc/privoxy")
70feedbb 174 "--localstatedir=/var"
a5ec9f78 175 "--with-brotli"
70feedbb 176 "--with-openssl")
e418c3d0
BW
177 #:tests? #f ; no test suite
178 #:phases
179 (modify-phases %standard-phases
180 (add-after 'unpack 'patch-default-logging
181 (lambda _
182 (with-fluids ((%default-port-encoding "ISO-8859-1"))
183 ;; Do not create /var/run nor /var/log/privoxy/logfile.
184 (substitute* "GNUmakefile.in"
185 (("(logfile \\|\\| exit )1" _ match)
186 (string-append match "0"))
187 (("(\\$\\(DESTDIR\\)\\$\\(SHARE_DEST\\)) \\\\" _ match)
188 match)
189 ((".*\\$\\(LOG_DEST\\) \\$\\(DESTDIR\\)\\$\\(PID_DEST\\).*")
190 ""))
191 ;; Disable logging in the default configuration to allow for
192 ;; non-root users using it as is.
193 (substitute* "config"
194 (("^logdir") "#logdir")
195 (("^logfile") "#logfile")))
196 #t)))))
b2e3dd94 197 (inputs
a5ec9f78
TGR
198 `(("brotli" ,brotli)
199 ("openssl" ,openssl)
b2e3dd94 200 ("pcre" ,pcre)
70feedbb 201 ("w3m" ,w3m)
3926d0fc
VL
202 ("zlib" ,zlib)))
203 (native-inputs
204 `(("autoconf" ,autoconf)
b2e3dd94 205 ("automake" ,automake)))
a8f3d492 206 (home-page "https://www.privoxy.org")
b2e3dd94
LC
207 (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy")
208 (description
209 "Privoxy is a non-caching web proxy with advanced filtering capabilities
210for enhancing privacy, modifying web page data and HTTP headers, controlling
211access, and removing ads and other obnoxious Internet junk. Privoxy has a
212flexible configuration and can be customized to suit individual needs and
213tastes. It has application for both stand-alone systems and multi-user
214networks.")
71794d7b 215 (license license:gpl2+)))
b8ea5204
EF
216
217(define-public onionshare
218 (package
219 (name "onionshare")
3268fba3 220 (version "2.2")
b8ea5204
EF
221 (source
222 (origin
d123b094
RW
223 (method git-fetch)
224 (uri (git-reference
b0e7b699 225 (url "https://github.com/micahflee/onionshare")
d123b094
RW
226 (commit (string-append "v" version))))
227 (file-name (git-file-name name version))
b8ea5204 228 (sha256
3268fba3 229 (base32 "0m8ygxcyp3nfzzhxs2dfnpqwh1vx0aws44lszpnnczz4fks3a5j4"))))
b8ea5204
EF
230 (build-system python-build-system)
231 (arguments
232 `(#:phases
233 (modify-phases %standard-phases
234 (add-after 'unpack 'fix-install-path
235 (lambda* (#:key outputs #:allow-other-keys)
236 (let* ((out (assoc-ref outputs "out"))
237 (onionshare (string-append out "/share/onionshare")))
b2fb40de 238 (substitute* '("setup.py" "onionshare/common.py")
e5a12fba
EF
239 (("sys.prefix,") (string-append "'" out "',")))
240 (substitute* "setup.py"
b6dc6aca 241 ;; For the nautilus plugin.
e5a12fba 242 (("/usr/share/nautilus") "share/nautilus"))
3268fba3 243 (substitute* "install/org.onionshare.OnionShare.desktop"
b2fb40de
EB
244 (("/usr") out))
245 #t)))
b8ea5204 246 (delete 'check)
4afdb792 247 (add-before 'strip 'check
b8ea5204 248 ;; After all the patching we run the tests after installing.
68e7632d 249 (lambda _
4afdb792
EB
250 (setenv "HOME" "/tmp") ; Some tests need a writable homedir
251 (invoke "pytest" "tests/")
68e7632d 252 #t)))))
b8ea5204 253 (native-inputs
b2fb40de 254 `(("python-pytest" ,python-pytest)))
b8ea5204 255 (inputs
7e5d56ee 256 `(("python-pycryptodome" ,python-pycryptodome)
4afdb792 257 ("python-flask" ,python-flask)
3268fba3 258 ("python-flask-httpauth" ,python-flask-httpauth)
b8ea5204
EF
259 ("python-nautilus" ,python-nautilus)
260 ("python-sip" ,python-sip)
261 ("python-stem" ,python-stem)
4afdb792 262 ("python-pysocks" ,python-pysocks)
b8ea5204
EF
263 ("python-pyqt" ,python-pyqt)))
264 (home-page "https://onionshare.org/")
265 (synopsis "Securely and anonymously share files")
3268fba3
EB
266 (description "OnionShare is a tool for securely and anonymously sending
267and receiving files using Tor onion services. It works by starting a web
268server directly on your computer and making it accessible as an unguessable
269Tor web address that others can load in a Tor-enabled web browser to download
270files from you, or upload files to you. It doesn't require setting up a
271separate server, using a third party file-sharing service, or even logging
272into an account.")
273 ;; Bundled, minified jquery is expat licensed.
274 (license (list license:gpl3+ license:expat))))
61ac7544
TGR
275
276(define-public nyx
18ab54d4
TGR
277 (package
278 (name "nyx")
ab1019f1 279 (version "2.1.0")
18ab54d4
TGR
280 (source
281 (origin
282 (method url-fetch)
283 (uri (pypi-uri name version))
284 (sha256
285 (base32
ab1019f1 286 "02rrlllz2ci6i6cs3iddyfns7ang9a54jrlygd2jw1f9s6418ll8"))))
18ab54d4
TGR
287 (build-system python-build-system)
288 (inputs
289 `(("python-stem" ,python-stem)))
290 (arguments
291 `(#:phases
292 (modify-phases %standard-phases
293 (add-after 'install 'install-man-page
294 (lambda* (#:key outputs #:allow-other-keys)
295 (let* ((out (assoc-ref outputs "out"))
296 (man (string-append out "/share/man")))
297 (install-file "nyx.1" (string-append man "/man1"))
298 #t)))
299 (add-after 'install 'install-sample-configuration
300 (lambda* (#:key outputs #:allow-other-keys)
301 (let* ((out (assoc-ref outputs "out"))
302 (doc (string-append out "/share/doc/" ,name "-" ,version)))
303 (install-file "web/nyxrc.sample" doc)
304 #t))))
305 ;; XXX The tests seem to require more of a real terminal than the build
306 ;; environment provides:
307 ;; _curses.error: setupterm: could not find terminal
308 ;; With TERM=linux, the tests try to move the cursor and still fail:
309 ;; _curses.error: cbreak() returned ERR
310 #:tests? #f))
311 (home-page "https://nyx.torproject.org/")
312 (synopsis "Tor relay status monitor")
313 (description
314 "Nyx monitors the performance of relays participating in the
61ac7544
TGR
315@uref{https://www.torproject.org/, Tor anonymity network}. It displays this
316information visually and in real time, using a curses-based terminal interface.
317This makes Nyx well-suited for remote shell connections and servers without a
318graphical display. It's like @command{top} for Tor, providing detailed
319statistics and status reports on:
320
321@enumerate
322@item connections (with IP address, hostname, fingerprint, and consensus data),
323@item bandwidth, processor, and memory usage,
324@item the relay's current configuration,
325@item logged events,
326@item and much more.
327@end enumerate
328
329Potential client and exit connections are scrubbed of sensitive information.")
18ab54d4 330 (license license:gpl3+)))