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