gnu: youtube-viewer: Update to 3.5.0.
[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>
ae608622
EF
4;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
5;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
0d92d2ad 6;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
f3cf25c3 7;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
7e9e1a36 8;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
90664247 9;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7f08437b
LC
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages tor)
71794d7b 27 #:use-module ((guix licenses) #:prefix license:)
7f08437b
LC
28 #:use-module (guix packages)
29 #:use-module (guix download)
ba583bd2 30 #:use-module (guix git-download)
7f08437b 31 #:use-module (guix build-system gnu)
c4605e4c 32 #:use-module (guix build-system python)
ba583bd2 33 #:use-module (gnu packages)
f3cf25c3 34 #:use-module (gnu packages base)
7f08437b 35 #:use-module (gnu packages libevent)
f3cf25c3 36 #:use-module (gnu packages linux)
ac257f12 37 #:use-module (gnu packages check)
7f08437b 38 #:use-module (gnu packages compression)
b2e3dd94 39 #:use-module (gnu packages pcre)
6c97f17f 40 #:use-module (gnu packages pkg-config)
8850303e 41 #:use-module (gnu packages python)
1b2f753d 42 #:use-module (gnu packages python-web)
b8ea5204 43 #:use-module (gnu packages qt)
b2e3dd94 44 #:use-module (gnu packages autotools)
cc2b77df 45 #:use-module (gnu packages tls)
b2e3dd94 46 #:use-module (gnu packages w3m))
7f08437b
LC
47
48(define-public tor
49 (package
50 (name "tor")
3995e854 51 (version "0.3.4.9")
7f08437b
LC
52 (source (origin
53 (method url-fetch)
0ab57b0d 54 (uri (string-append "https://dist.torproject.org/tor-"
7f08437b
LC
55 version ".tar.gz"))
56 (sha256
57 (base32
3995e854 58 "0jhnvnp08hsfrzgsvg5xnfxyaw3nzgg9h24cwbwnz6iby20i05qs"))))
7f08437b 59 (build-system gnu-build-system)
249eb389 60 (arguments
54727850 61 `(#:configure-flags (list "--enable-gcc-hardening"
249eb389 62 "--enable-linker-hardening")))
8850303e 63 (native-inputs
6c97f17f 64 `(("pkg-config" ,pkg-config)
4105f13b 65 ("python" ,python-2))) ; for tests
7f08437b
LC
66 (inputs
67 `(("zlib" ,zlib)
68 ("openssl" ,openssl)
7e9e1a36 69 ("libevent" ,libevent)
6c97f17f
TGR
70 ("libseccomp" ,libseccomp)
71 ("xz" ,xz)
72 ("zstd" ,zstd)))
0ab57b0d 73 (home-page "https://www.torproject.org/")
9e771e3b 74 (synopsis "Anonymous network router to improve privacy on the Internet")
7f08437b
LC
75 (description
76 "Tor protects you by bouncing your communications around a distributed
77network of relays run by volunteers all around the world: it prevents
78somebody watching your Internet connection from learning what sites you
79visit, and it prevents the sites you visit from learning your physical
35b9e423 80location. Tor works with many of your existing applications, including
7f08437b 81web browsers, instant messaging clients, remote login, and other
fc9286d0 82applications based on the TCP protocol.
55b27569 83
fc9286d0 84To @code{torify} applications (to take measures to ensure that an application,
85which has not been designed for use with Tor such as ssh, will use only Tor for
86internet connectivity, and also ensures that there are no leaks from DNS, UDP or
87the application layer) you need to install @code{torsocks}.")
71794d7b 88 (license license:bsd-3)))
4f7e152b
LC
89
90(define-public torsocks
91 (package
92 (name "torsocks")
91988aee 93 (version "2.2.0")
4f7e152b 94 (source (origin
91988aee 95 (method url-fetch)
96 (uri (string-append "https://people.torproject.org/~dgoulet/"
97 name "/" name "-" version ".tar.xz"))
ba583bd2
LC
98 (sha256
99 (base32
91988aee 100 "0byr9ga9w79qz4vp0m11sbmspad7fsal9wm67r4znzb7zb7cis19"))))
4f7e152b 101 (build-system gnu-build-system)
f3cf25c3
EB
102 (inputs
103 `(("which" ,which)
104 ("libcap" ,libcap)))
105 (arguments
106 `(#:phases (modify-phases %standard-phases
107 (add-after 'build 'absolutize
108 (lambda* (#:key inputs #:allow-other-keys)
109 (substitute* "src/bin/torsocks"
110 (("getcap=`.*`")
111 (string-append "getcap=" (which "getcap")))
112 (("`which")
113 (string-append "`" (which "which"))))
114 #t)))))
91988aee 115 (home-page "https://www.torproject.org/")
4f7e152b
LC
116 (synopsis "Use socks-friendly applications with Tor")
117 (description
118 "Torsocks allows you to use most socks-friendly applications in a safe
119way with Tor. It ensures that DNS requests are handled safely and explicitly
120rejects UDP traffic from the application you're using.")
ba583bd2
LC
121
122 ;; All the files explicitly say "version 2 only".
71794d7b 123 (license license:gpl2)))
b2e3dd94
LC
124
125(define-public privoxy
126 (package
127 (name "privoxy")
a8f3d492 128 (version "3.0.26")
b2e3dd94
LC
129 (source (origin
130 (method url-fetch)
131 (uri (string-append "mirror://sourceforge/ijbswa/Sources/"
132 version "%20%28stable%29/privoxy-"
133 version "-stable-src.tar.gz"))
134 (sha256
135 (base32
a8f3d492 136 "1n4wpxmahl8m2y3d1azxa8lrdbpaad007k458skxrpz57ss1br2p"))))
b2e3dd94
LC
137 (build-system gnu-build-system)
138 (arguments
ae5c6fca
LC
139 '(;; The default 'sysconfdir' is $out/etc; change that to
140 ;; $out/etc/privoxy.
141 #:configure-flags (list (string-append "--sysconfdir="
142 (assoc-ref %outputs "out")
143 "/etc/privoxy"))
b2e3dd94
LC
144 #:tests? #f))
145 (inputs
146 `(("w3m" ,w3m)
147 ("pcre" ,pcre)
148 ("zlib" ,zlib)
149 ("autoconf" ,autoconf)
150 ("automake" ,automake)))
a8f3d492 151 (home-page "https://www.privoxy.org")
b2e3dd94
LC
152 (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy")
153 (description
154 "Privoxy is a non-caching web proxy with advanced filtering capabilities
155for enhancing privacy, modifying web page data and HTTP headers, controlling
156access, and removing ads and other obnoxious Internet junk. Privoxy has a
157flexible configuration and can be customized to suit individual needs and
158tastes. It has application for both stand-alone systems and multi-user
159networks.")
71794d7b 160 (license license:gpl2+)))
b8ea5204
EF
161
162(define-public onionshare
163 (package
164 (name "onionshare")
e5a12fba 165 (version "0.9.2")
b8ea5204
EF
166 (source
167 (origin
d123b094
RW
168 (method git-fetch)
169 (uri (git-reference
170 (url "https://github.com/micahflee/onionshare.git")
171 (commit (string-append "v" version))))
172 (file-name (git-file-name name version))
b8ea5204
EF
173 (sha256
174 (base32
d123b094 175 "1nzr6m3jp04p1i8b652s27zv0xhybl3zwcn5r6l9h0f7d7x4iglv"))))
b8ea5204
EF
176 (build-system python-build-system)
177 (arguments
178 `(#:phases
179 (modify-phases %standard-phases
180 (add-after 'unpack 'fix-install-path
181 (lambda* (#:key outputs #:allow-other-keys)
182 (let* ((out (assoc-ref outputs "out"))
183 (onionshare (string-append out "/share/onionshare")))
e5a12fba 184 (substitute* "onionshare/strings.py"
b8ea5204
EF
185 ;; correct the locale directory
186 (("helpers.get_resource_path\\('locale'\\)")
187 (string-append "'" onionshare "/locale'")))
e5a12fba 188 (substitute* "onionshare/helpers.py"
b8ea5204 189 ;; correct the location of version.txt
b8ea5204
EF
190 (("get_resource_path\\('version.txt'\\)")
191 (string-append "'" onionshare "/version.txt'"))
192 (("get_resource_path\\('wordlist.txt'\\)")
193 (string-append "'" onionshare "/wordlist.txt'")))
e5a12fba 194 (substitute* "onionshare/web.py"
b8ea5204
EF
195 ;; fix the location of the html files
196 (("helpers.get_resource_path\\('html/denied.html'\\)")
197 (string-append "'" onionshare "/html/denied.html'"))
198 (("helpers.get_resource_path\\('html/404.html'\\)")
199 (string-append "'" onionshare "/html/404.html'"))
200 (("helpers.get_resource_path\\('html/index.html'\\)")
201 (string-append "'" onionshare "/html/index.html'")))
e5a12fba
EF
202 (substitute* "onionshare_gui/file_selection.py"
203 ;; fancy box image in the GUI
b8ea5204
EF
204 (("helpers.get_resource_path\\('images/drop_files.png'\\)")
205 (string-append "'" onionshare "/images/drop_files.png'")))
e5a12fba 206 (substitute* "onionshare_gui/server_status.py"
b8ea5204
EF
207 (("helpers.get_resource_path\\('images/server_stopped.png'\\)")
208 (string-append "'" onionshare "/images/server_stopped.png'"))
209 (("helpers.get_resource_path\\('images/server_working.png'\\)")
210 (string-append "'" onionshare "/images/server_working.png'"))
211 (("helpers.get_resource_path\\('images/server_started.png'\\)")
212 (string-append "'" onionshare "/images/server_started.png'")))
e5a12fba
EF
213 (substitute* "onionshare_gui/onionshare_gui.py"
214 ;; for the icon on the GUI
b8ea5204
EF
215 (("helpers.get_resource_path\\('images/logo.png'\\)")
216 (string-append "'" onionshare "/images/logo.png'")))
e5a12fba
EF
217 (substitute* '("setup.py" "onionshare/helpers.py")
218 (("sys.prefix,") (string-append "'" out "',")))
219 (substitute* "setup.py"
220 ;; for the nautilus plugin
221 (("/usr/share/nautilus") "share/nautilus"))
b8ea5204
EF
222 #t)))
223 (delete 'check)
224 (add-before 'strip 'tests
225 ;; After all the patching we run the tests after installing.
226 ;; This is also a known issue:
227 ;; https://github.com/micahflee/onionshare/issues/284
68e7632d
TGR
228 (lambda _
229 (invoke "nosetests" "test")
230 #t)))))
b8ea5204
EF
231 (native-inputs
232 `(("python-nose" ,python-nose)))
233 (inputs
234 `(("python-flask" ,python-flask)
235 ("python-nautilus" ,python-nautilus)
236 ("python-sip" ,python-sip)
237 ("python-stem" ,python-stem)
238 ("python-pyqt" ,python-pyqt)))
239 (home-page "https://onionshare.org/")
240 (synopsis "Securely and anonymously share files")
241 (description "OnionShare lets you securely and anonymously share files of
242any size. It works by starting a web server, making it accessible as a Tor
243hidden service, and generating an unguessable URL to access and download the
244files. It doesn't require setting up a server on the internet somewhere or
245using a third party filesharing service. You host the file on your own computer
246and use a Tor hidden service to make it temporarily accessible over the
247internet. The other user just needs to use Tor Browser to download the file
248from you.")
71794d7b
TGR
249 (license (list license:gpl3+
250 license:bsd-3)))) ; onionshare/socks.py
61ac7544
TGR
251
252(define-public nyx
18ab54d4
TGR
253 (package
254 (name "nyx")
255 (version "2.0.4")
256 (source
257 (origin
258 (method url-fetch)
259 (uri (pypi-uri name version))
8edebd32
TGR
260 (patches
261 (search-patches "nyx-show-header-stats-with-python3.patch"))
18ab54d4
TGR
262 (sha256
263 (base32
264 "0pm7vfcqr02pzqz4b2f6sw5prxxmgqwr1912am42xmy2i53n7nrq"))))
265 (build-system python-build-system)
266 (inputs
267 `(("python-stem" ,python-stem)))
268 (arguments
269 `(#:phases
270 (modify-phases %standard-phases
271 (add-after 'install 'install-man-page
272 (lambda* (#:key outputs #:allow-other-keys)
273 (let* ((out (assoc-ref outputs "out"))
274 (man (string-append out "/share/man")))
275 (install-file "nyx.1" (string-append man "/man1"))
276 #t)))
277 (add-after 'install 'install-sample-configuration
278 (lambda* (#:key outputs #:allow-other-keys)
279 (let* ((out (assoc-ref outputs "out"))
280 (doc (string-append out "/share/doc/" ,name "-" ,version)))
281 (install-file "web/nyxrc.sample" doc)
282 #t))))
283 ;; XXX The tests seem to require more of a real terminal than the build
284 ;; environment provides:
285 ;; _curses.error: setupterm: could not find terminal
286 ;; With TERM=linux, the tests try to move the cursor and still fail:
287 ;; _curses.error: cbreak() returned ERR
288 #:tests? #f))
289 (home-page "https://nyx.torproject.org/")
290 (synopsis "Tor relay status monitor")
291 (description
292 "Nyx monitors the performance of relays participating in the
61ac7544
TGR
293@uref{https://www.torproject.org/, Tor anonymity network}. It displays this
294information visually and in real time, using a curses-based terminal interface.
295This makes Nyx well-suited for remote shell connections and servers without a
296graphical display. It's like @command{top} for Tor, providing detailed
297statistics and status reports on:
298
299@enumerate
300@item connections (with IP address, hostname, fingerprint, and consensus data),
301@item bandwidth, processor, and memory usage,
302@item the relay's current configuration,
303@item logged events,
304@item and much more.
305@end enumerate
306
307Potential client and exit connections are scrubbed of sensitive information.")
18ab54d4 308 (license license:gpl3+)))