1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
6 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages tor)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system python)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages libevent)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages pcre)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages qt)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages w3m))
46 (uri (string-append "https://dist.torproject.org/tor-"
50 "0h8kpn42mgpkzmnga143hi8nh0ai65ypxh7qhkwbb15j3wz2h4fn"))))
51 (build-system gnu-build-system)
53 `(#:configure-flags (list "--enable-expensive-hardening"
54 "--enable-gcc-hardening"
55 "--enable-linker-hardening")))
57 `(("python" ,python-2))) ; for tests
61 ("libevent" ,libevent)))
62 (home-page "https://www.torproject.org/")
63 (synopsis "Anonymous network router to improve privacy on the Internet")
65 "Tor protects you by bouncing your communications around a distributed
66 network of relays run by volunteers all around the world: it prevents
67 somebody watching your Internet connection from learning what sites you
68 visit, and it prevents the sites you visit from learning your physical
69 location. Tor works with many of your existing applications, including
70 web browsers, instant messaging clients, remote login, and other
71 applications based on the TCP protocol.
73 To @code{torify} applications (to take measures to ensure that an application,
74 which has not been designed for use with Tor such as ssh, will use only Tor for
75 internet connectivity, and also ensures that there are no leaks from DNS, UDP or
76 the application layer) you need to install @code{torsocks}.")
77 (license license:bsd-3)))
79 (define-public torsocks
85 (uri (string-append "https://people.torproject.org/~dgoulet/"
86 name "/" name "-" version ".tar.xz"))
89 "0byr9ga9w79qz4vp0m11sbmspad7fsal9wm67r4znzb7zb7cis19"))))
90 (build-system gnu-build-system)
91 (home-page "https://www.torproject.org/")
92 (synopsis "Use socks-friendly applications with Tor")
94 "Torsocks allows you to use most socks-friendly applications in a safe
95 way with Tor. It ensures that DNS requests are handled safely and explicitly
96 rejects UDP traffic from the application you're using.")
98 ;; All the files explicitly say "version 2 only".
99 (license license:gpl2)))
101 (define-public privoxy
107 (uri (string-append "mirror://sourceforge/ijbswa/Sources/"
108 version "%20%28stable%29/privoxy-"
109 version "-stable-src.tar.gz"))
112 "1n4wpxmahl8m2y3d1azxa8lrdbpaad007k458skxrpz57ss1br2p"))))
113 (build-system gnu-build-system)
115 '(;; The default 'sysconfdir' is $out/etc; change that to
117 #:configure-flags (list (string-append "--sysconfdir="
118 (assoc-ref %outputs "out")
120 #:phases (alist-cons-after
123 ;; Unfortunately, this is not a tarball produced by
125 (zero? (system* "autoreconf" "-vfi")))
132 ("autoconf" ,autoconf)
133 ("automake" ,automake)))
134 (home-page "https://www.privoxy.org")
135 (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy")
137 "Privoxy is a non-caching web proxy with advanced filtering capabilities
138 for enhancing privacy, modifying web page data and HTTP headers, controlling
139 access, and removing ads and other obnoxious Internet junk. Privoxy has a
140 flexible configuration and can be customized to suit individual needs and
141 tastes. It has application for both stand-alone systems and multi-user
143 (license license:gpl2+)))
145 (define-public onionshare
152 (uri (string-append "https://github.com/micahflee/onionshare/archive/v"
154 (file-name (string-append name "-" version ".tar.gz"))
157 "02iv7dg15da57gy3zvfchnwwpr21n1gva7mqwpwr958ni2034smk"))))
158 (build-system python-build-system)
161 (modify-phases %standard-phases
162 (add-after 'unpack 'fix-install-path
163 (lambda* (#:key outputs #:allow-other-keys)
164 (let* ((out (assoc-ref outputs "out"))
165 (onionshare (string-append out "/share/onionshare")))
166 (substitute* "onionshare/strings.py"
167 ;; correct the locale directory
168 (("helpers.get_resource_path\\('locale'\\)")
169 (string-append "'" onionshare "/locale'")))
170 (substitute* "onionshare/helpers.py"
171 ;; correct the location of version.txt
172 (("get_resource_path\\('version.txt'\\)")
173 (string-append "'" onionshare "/version.txt'"))
174 (("get_resource_path\\('wordlist.txt'\\)")
175 (string-append "'" onionshare "/wordlist.txt'")))
176 (substitute* "onionshare/web.py"
177 ;; fix the location of the html files
178 (("helpers.get_resource_path\\('html/denied.html'\\)")
179 (string-append "'" onionshare "/html/denied.html'"))
180 (("helpers.get_resource_path\\('html/404.html'\\)")
181 (string-append "'" onionshare "/html/404.html'"))
182 (("helpers.get_resource_path\\('html/index.html'\\)")
183 (string-append "'" onionshare "/html/index.html'")))
184 (substitute* "onionshare_gui/file_selection.py"
185 ;; fancy box image in the GUI
186 (("helpers.get_resource_path\\('images/drop_files.png'\\)")
187 (string-append "'" onionshare "/images/drop_files.png'")))
188 (substitute* "onionshare_gui/server_status.py"
189 (("helpers.get_resource_path\\('images/server_stopped.png'\\)")
190 (string-append "'" onionshare "/images/server_stopped.png'"))
191 (("helpers.get_resource_path\\('images/server_working.png'\\)")
192 (string-append "'" onionshare "/images/server_working.png'"))
193 (("helpers.get_resource_path\\('images/server_started.png'\\)")
194 (string-append "'" onionshare "/images/server_started.png'")))
195 (substitute* "onionshare_gui/onionshare_gui.py"
196 ;; for the icon on the GUI
197 (("helpers.get_resource_path\\('images/logo.png'\\)")
198 (string-append "'" onionshare "/images/logo.png'")))
199 (substitute* '("setup.py" "onionshare/helpers.py")
200 (("sys.prefix,") (string-append "'" out "',")))
201 (substitute* "setup.py"
202 ;; for the nautilus plugin
203 (("/usr/share/nautilus") "share/nautilus"))
206 (add-before 'strip 'tests
207 ;; After all the patching we run the tests after installing.
208 ;; This is also a known issue:
209 ;; https://github.com/micahflee/onionshare/issues/284
210 (lambda _ (zero? (system* "nosetests" "test")))))))
212 `(("python-nose" ,python-nose)))
214 `(("python-flask" ,python-flask)
215 ("python-nautilus" ,python-nautilus)
216 ("python-sip" ,python-sip)
217 ("python-stem" ,python-stem)
218 ("python-pyqt" ,python-pyqt)))
219 (home-page "https://onionshare.org/")
220 (synopsis "Securely and anonymously share files")
221 (description "OnionShare lets you securely and anonymously share files of
222 any size. It works by starting a web server, making it accessible as a Tor
223 hidden service, and generating an unguessable URL to access and download the
224 files. It doesn't require setting up a server on the internet somewhere or
225 using a third party filesharing service. You host the file on your own computer
226 and use a Tor hidden service to make it temporarily accessible over the
227 internet. The other user just needs to use Tor Browser to download the file
229 (license (list license:gpl3+
230 license:bsd-3)))) ; onionshare/socks.py
233 ;; The last ‘arm’ relase was 5 years ago. Meanwhile, python3 support has
234 ;; been added and the software was renamed to ‘nyx’.
235 (let ((commit "fea209127484d9b304b908a4711c9528b1d065bc")
236 (revision "1")) ; Guix package revision
239 (version (string-append "1.9-"
240 revision "." (string-take commit 7)))
244 (file-name (string-append name "-" version "-checkout"))
246 (url "https://git.torproject.org/nyx.git")
250 "1g0l4988076xg5gs0x0nxzlg58rfx5g5agmklvyh4yp03vxncdb9"))))
251 (build-system python-build-system)
253 `(("python-mock" ,python-mock)
254 ("python-pep8" ,python-pep8)
255 ("python-pyflakes" ,python-pyflakes)))
257 `(("python-stem" ,python-stem)))
260 (list (string-append "--man-page="
261 (assoc-ref %outputs "out")
262 "/share/man/man1/nyx.1")
263 (string-append "--sample-path="
264 (assoc-ref %outputs "out")
265 "/share/doc/nyx/nyxrc.sample"))
266 #:use-setuptools? #f ; setup.py still uses distutils
268 (modify-phases %standard-phases
271 (zero? (system* "./run_tests.py" "--unit")))))))
272 ;; A Nyx home page is ‘being worked on’. Use Arm's for now, which at
273 ;; least mentions the new source repository:
274 (home-page "http://www.atagar.com/arm/")
275 (synopsis "Tor relay status monitor")
276 (description "Nyx (formerly Anonymizing Relay Monitor or \"arm\")
277 monitors the performance of relays participating in the
278 @uref{https://www.torproject.org/, Tor anonymity network}. It displays this
279 information visually and in real time, using a curses-based terminal interface.
280 This makes Nyx well-suited for remote shell connections and servers without a
281 graphical display. It's like @command{top} for Tor, providing detailed
282 statistics and status reports on:
285 @item connections (with IP address, hostname, fingerprint, and consensus data),
286 @item bandwidth, processor, and memory usage,
287 @item the relay's current configuration,
292 Potential client and exit connections are scrubbed of sensitive information.")
293 (license license:gpl3+))))