gnu: Add goxel.
[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>
4de63cf3 6;;; Copyright © 2017, 2018, 2019, 2020 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")
5d5d68de 57 (version "0.4.3.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
5d5d68de 64 "0qmcrkjip0ywq77232m73pjwqiaj0q2klwklqlpbw575shvhcbba"))))
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")
be4f8391 158 (version "3.0.28")
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
be4f8391 166 "0jl2yav1qzqnaqnnx8i6i53ayckkimcrs3l6ryvv7bda6v08rmxm"))))
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
BW
173 "/etc/privoxy")
174 "--localstatedir=/var")
175 #:tests? #f ; no test suite
176 #:phases
177 (modify-phases %standard-phases
178 (add-after 'unpack 'patch-default-logging
179 (lambda _
180 (with-fluids ((%default-port-encoding "ISO-8859-1"))
181 ;; Do not create /var/run nor /var/log/privoxy/logfile.
182 (substitute* "GNUmakefile.in"
183 (("(logfile \\|\\| exit )1" _ match)
184 (string-append match "0"))
185 (("(\\$\\(DESTDIR\\)\\$\\(SHARE_DEST\\)) \\\\" _ match)
186 match)
187 ((".*\\$\\(LOG_DEST\\) \\$\\(DESTDIR\\)\\$\\(PID_DEST\\).*")
188 ""))
189 ;; Disable logging in the default configuration to allow for
190 ;; non-root users using it as is.
191 (substitute* "config"
192 (("^logdir") "#logdir")
193 (("^logfile") "#logfile")))
194 #t)))))
b2e3dd94
LC
195 (inputs
196 `(("w3m" ,w3m)
197 ("pcre" ,pcre)
3926d0fc
VL
198 ("zlib" ,zlib)))
199 (native-inputs
200 `(("autoconf" ,autoconf)
b2e3dd94 201 ("automake" ,automake)))
a8f3d492 202 (home-page "https://www.privoxy.org")
b2e3dd94
LC
203 (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy")
204 (description
205 "Privoxy is a non-caching web proxy with advanced filtering capabilities
206for enhancing privacy, modifying web page data and HTTP headers, controlling
207access, and removing ads and other obnoxious Internet junk. Privoxy has a
208flexible configuration and can be customized to suit individual needs and
209tastes. It has application for both stand-alone systems and multi-user
210networks.")
71794d7b 211 (license license:gpl2+)))
b8ea5204
EF
212
213(define-public onionshare
214 (package
215 (name "onionshare")
3268fba3 216 (version "2.2")
b8ea5204
EF
217 (source
218 (origin
d123b094
RW
219 (method git-fetch)
220 (uri (git-reference
b0e7b699 221 (url "https://github.com/micahflee/onionshare")
d123b094
RW
222 (commit (string-append "v" version))))
223 (file-name (git-file-name name version))
b8ea5204 224 (sha256
3268fba3 225 (base32 "0m8ygxcyp3nfzzhxs2dfnpqwh1vx0aws44lszpnnczz4fks3a5j4"))))
b8ea5204
EF
226 (build-system python-build-system)
227 (arguments
228 `(#:phases
229 (modify-phases %standard-phases
230 (add-after 'unpack 'fix-install-path
231 (lambda* (#:key outputs #:allow-other-keys)
232 (let* ((out (assoc-ref outputs "out"))
233 (onionshare (string-append out "/share/onionshare")))
b2fb40de 234 (substitute* '("setup.py" "onionshare/common.py")
e5a12fba
EF
235 (("sys.prefix,") (string-append "'" out "',")))
236 (substitute* "setup.py"
b6dc6aca 237 ;; For the nautilus plugin.
e5a12fba 238 (("/usr/share/nautilus") "share/nautilus"))
3268fba3 239 (substitute* "install/org.onionshare.OnionShare.desktop"
b2fb40de
EB
240 (("/usr") out))
241 #t)))
b8ea5204 242 (delete 'check)
4afdb792 243 (add-before 'strip 'check
b8ea5204 244 ;; After all the patching we run the tests after installing.
68e7632d 245 (lambda _
4afdb792
EB
246 (setenv "HOME" "/tmp") ; Some tests need a writable homedir
247 (invoke "pytest" "tests/")
68e7632d 248 #t)))))
b8ea5204 249 (native-inputs
b2fb40de 250 `(("python-pytest" ,python-pytest)))
b8ea5204 251 (inputs
4afdb792
EB
252 `(("python-pycrypto" ,python-pycrypto)
253 ("python-flask" ,python-flask)
3268fba3 254 ("python-flask-httpauth" ,python-flask-httpauth)
b8ea5204
EF
255 ("python-nautilus" ,python-nautilus)
256 ("python-sip" ,python-sip)
257 ("python-stem" ,python-stem)
4afdb792 258 ("python-pysocks" ,python-pysocks)
b8ea5204
EF
259 ("python-pyqt" ,python-pyqt)))
260 (home-page "https://onionshare.org/")
261 (synopsis "Securely and anonymously share files")
3268fba3
EB
262 (description "OnionShare is a tool for securely and anonymously sending
263and receiving files using Tor onion services. It works by starting a web
264server directly on your computer and making it accessible as an unguessable
265Tor web address that others can load in a Tor-enabled web browser to download
266files from you, or upload files to you. It doesn't require setting up a
267separate server, using a third party file-sharing service, or even logging
268into an account.")
269 ;; Bundled, minified jquery is expat licensed.
270 (license (list license:gpl3+ license:expat))))
61ac7544
TGR
271
272(define-public nyx
18ab54d4
TGR
273 (package
274 (name "nyx")
ab1019f1 275 (version "2.1.0")
18ab54d4
TGR
276 (source
277 (origin
278 (method url-fetch)
279 (uri (pypi-uri name version))
280 (sha256
281 (base32
ab1019f1 282 "02rrlllz2ci6i6cs3iddyfns7ang9a54jrlygd2jw1f9s6418ll8"))))
18ab54d4
TGR
283 (build-system python-build-system)
284 (inputs
285 `(("python-stem" ,python-stem)))
286 (arguments
287 `(#:phases
288 (modify-phases %standard-phases
289 (add-after 'install 'install-man-page
290 (lambda* (#:key outputs #:allow-other-keys)
291 (let* ((out (assoc-ref outputs "out"))
292 (man (string-append out "/share/man")))
293 (install-file "nyx.1" (string-append man "/man1"))
294 #t)))
295 (add-after 'install 'install-sample-configuration
296 (lambda* (#:key outputs #:allow-other-keys)
297 (let* ((out (assoc-ref outputs "out"))
298 (doc (string-append out "/share/doc/" ,name "-" ,version)))
299 (install-file "web/nyxrc.sample" doc)
300 #t))))
301 ;; XXX The tests seem to require more of a real terminal than the build
302 ;; environment provides:
303 ;; _curses.error: setupterm: could not find terminal
304 ;; With TERM=linux, the tests try to move the cursor and still fail:
305 ;; _curses.error: cbreak() returned ERR
306 #:tests? #f))
307 (home-page "https://nyx.torproject.org/")
308 (synopsis "Tor relay status monitor")
309 (description
310 "Nyx monitors the performance of relays participating in the
61ac7544
TGR
311@uref{https://www.torproject.org/, Tor anonymity network}. It displays this
312information visually and in real time, using a curses-based terminal interface.
313This makes Nyx well-suited for remote shell connections and servers without a
314graphical display. It's like @command{top} for Tor, providing detailed
315statistics and status reports on:
316
317@enumerate
318@item connections (with IP address, hostname, fingerprint, and consensus data),
319@item bandwidth, processor, and memory usage,
320@item the relay's current configuration,
321@item logged events,
322@item and much more.
323@end enumerate
324
325Potential client and exit connections are scrubbed of sensitive information.")
18ab54d4 326 (license license:gpl3+)))