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> |
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> |
7f08437b LC |
11 | ;;; |
12 | ;;; This file is part of GNU Guix. | |
13 | ;;; | |
14 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
15 | ;;; under the terms of the GNU General Public License as published by | |
16 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
17 | ;;; your option) any later version. | |
18 | ;;; | |
19 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
20 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;;; GNU General Public License for more details. | |
23 | ;;; | |
24 | ;;; You should have received a copy of the GNU General Public License | |
25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
26 | ||
27 | (define-module (gnu packages tor) | |
71794d7b | 28 | #:use-module ((guix licenses) #:prefix license:) |
7f08437b LC |
29 | #:use-module (guix packages) |
30 | #:use-module (guix download) | |
ba583bd2 | 31 | #:use-module (guix git-download) |
7f08437b | 32 | #:use-module (guix build-system gnu) |
c4605e4c | 33 | #:use-module (guix build-system python) |
ba583bd2 | 34 | #:use-module (gnu packages) |
f3cf25c3 | 35 | #:use-module (gnu packages base) |
7f08437b | 36 | #:use-module (gnu packages libevent) |
f3cf25c3 | 37 | #:use-module (gnu packages linux) |
ac257f12 | 38 | #:use-module (gnu packages check) |
7f08437b | 39 | #:use-module (gnu packages compression) |
b2e3dd94 | 40 | #:use-module (gnu packages pcre) |
6c97f17f | 41 | #:use-module (gnu packages pkg-config) |
8850303e | 42 | #:use-module (gnu packages python) |
4afdb792 | 43 | #:use-module (gnu packages python-crypto) |
1b2f753d | 44 | #:use-module (gnu packages python-web) |
44d10b1f | 45 | #:use-module (gnu packages python-xyz) |
b8ea5204 | 46 | #:use-module (gnu packages qt) |
b2e3dd94 | 47 | #:use-module (gnu packages autotools) |
cc2b77df | 48 | #:use-module (gnu packages tls) |
b2e3dd94 | 49 | #:use-module (gnu packages w3m)) |
7f08437b LC |
50 | |
51 | (define-public tor | |
52 | (package | |
53 | (name "tor") | |
4de63cf3 | 54 | (version "0.4.2.7") |
7f08437b LC |
55 | (source (origin |
56 | (method url-fetch) | |
0ab57b0d | 57 | (uri (string-append "https://dist.torproject.org/tor-" |
7f08437b LC |
58 | version ".tar.gz")) |
59 | (sha256 | |
60 | (base32 | |
4de63cf3 | 61 | "0v82ngwwmmcb7i9563bgsmrjy6xp83xyhqhaljygd0pkvlsxi886")))) |
7f08437b | 62 | (build-system gnu-build-system) |
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) | |
ec0de9d8 | 72 | ("zstd" ,zstd "lib"))) |
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 | |
77 | network of relays run by volunteers all around the world: it prevents | |
78 | somebody watching your Internet connection from learning what sites you | |
79 | visit, and it prevents the sites you visit from learning your physical | |
35b9e423 | 80 | location. Tor works with many of your existing applications, including |
7f08437b | 81 | web browsers, instant messaging clients, remote login, and other |
fc9286d0 | 82 | applications based on the TCP protocol. |
55b27569 | 83 | |
fc9286d0 | 84 | To @code{torify} applications (to take measures to ensure that an application, |
85 | which has not been designed for use with Tor such as ssh, will use only Tor for | |
86 | internet connectivity, and also ensures that there are no leaks from DNS, UDP or | |
87 | the 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") | |
15c661ec | 93 | (version "2.3.0") |
4f7e152b | 94 | (source (origin |
91988aee | 95 | (method url-fetch) |
96 | (uri (string-append "https://people.torproject.org/~dgoulet/" | |
d77ade87 | 97 | "torsocks/torsocks-" version ".tar.xz")) |
ba583bd2 LC |
98 | (sha256 |
99 | (base32 | |
15c661ec | 100 | "08inrkap29gikb6sdmb58z43hw4abwrfw7ny40c4xzdkss0vkwdr")))) |
4f7e152b | 101 | (build-system gnu-build-system) |
f3cf25c3 | 102 | (inputs |
15c661ec | 103 | `(("libcap" ,libcap))) |
f3cf25c3 EB |
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" | |
15c661ec TGR |
109 | (("getcap=.*") |
110 | (string-append "getcap=" (which "getcap") "\n"))) | |
f3cf25c3 | 111 | #t))))) |
91988aee | 112 | (home-page "https://www.torproject.org/") |
4f7e152b LC |
113 | (synopsis "Use socks-friendly applications with Tor") |
114 | (description | |
115 | "Torsocks allows you to use most socks-friendly applications in a safe | |
116 | way with Tor. It ensures that DNS requests are handled safely and explicitly | |
117 | rejects UDP traffic from the application you're using.") | |
ba583bd2 LC |
118 | |
119 | ;; All the files explicitly say "version 2 only". | |
71794d7b | 120 | (license license:gpl2))) |
b2e3dd94 LC |
121 | |
122 | (define-public privoxy | |
123 | (package | |
124 | (name "privoxy") | |
be4f8391 | 125 | (version "3.0.28") |
b2e3dd94 LC |
126 | (source (origin |
127 | (method url-fetch) | |
128 | (uri (string-append "mirror://sourceforge/ijbswa/Sources/" | |
129 | version "%20%28stable%29/privoxy-" | |
130 | version "-stable-src.tar.gz")) | |
131 | (sha256 | |
132 | (base32 | |
be4f8391 | 133 | "0jl2yav1qzqnaqnnx8i6i53ayckkimcrs3l6ryvv7bda6v08rmxm")))) |
b2e3dd94 LC |
134 | (build-system gnu-build-system) |
135 | (arguments | |
ae5c6fca LC |
136 | '(;; The default 'sysconfdir' is $out/etc; change that to |
137 | ;; $out/etc/privoxy. | |
138 | #:configure-flags (list (string-append "--sysconfdir=" | |
139 | (assoc-ref %outputs "out") | |
140 | "/etc/privoxy")) | |
b2e3dd94 LC |
141 | #:tests? #f)) |
142 | (inputs | |
143 | `(("w3m" ,w3m) | |
144 | ("pcre" ,pcre) | |
3926d0fc VL |
145 | ("zlib" ,zlib))) |
146 | (native-inputs | |
147 | `(("autoconf" ,autoconf) | |
b2e3dd94 | 148 | ("automake" ,automake))) |
a8f3d492 | 149 | (home-page "https://www.privoxy.org") |
b2e3dd94 LC |
150 | (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy") |
151 | (description | |
152 | "Privoxy is a non-caching web proxy with advanced filtering capabilities | |
153 | for enhancing privacy, modifying web page data and HTTP headers, controlling | |
154 | access, and removing ads and other obnoxious Internet junk. Privoxy has a | |
155 | flexible configuration and can be customized to suit individual needs and | |
156 | tastes. It has application for both stand-alone systems and multi-user | |
157 | networks.") | |
71794d7b | 158 | (license license:gpl2+))) |
b8ea5204 EF |
159 | |
160 | (define-public onionshare | |
161 | (package | |
162 | (name "onionshare") | |
3268fba3 | 163 | (version "2.2") |
b8ea5204 EF |
164 | (source |
165 | (origin | |
d123b094 RW |
166 | (method git-fetch) |
167 | (uri (git-reference | |
168 | (url "https://github.com/micahflee/onionshare.git") | |
169 | (commit (string-append "v" version)))) | |
170 | (file-name (git-file-name name version)) | |
b8ea5204 | 171 | (sha256 |
3268fba3 | 172 | (base32 "0m8ygxcyp3nfzzhxs2dfnpqwh1vx0aws44lszpnnczz4fks3a5j4")))) |
b8ea5204 EF |
173 | (build-system python-build-system) |
174 | (arguments | |
175 | `(#:phases | |
176 | (modify-phases %standard-phases | |
177 | (add-after 'unpack 'fix-install-path | |
178 | (lambda* (#:key outputs #:allow-other-keys) | |
179 | (let* ((out (assoc-ref outputs "out")) | |
180 | (onionshare (string-append out "/share/onionshare"))) | |
b2fb40de | 181 | (substitute* '("setup.py" "onionshare/common.py") |
e5a12fba EF |
182 | (("sys.prefix,") (string-append "'" out "',"))) |
183 | (substitute* "setup.py" | |
b6dc6aca | 184 | ;; For the nautilus plugin. |
e5a12fba | 185 | (("/usr/share/nautilus") "share/nautilus")) |
3268fba3 | 186 | (substitute* "install/org.onionshare.OnionShare.desktop" |
b2fb40de EB |
187 | (("/usr") out)) |
188 | #t))) | |
b8ea5204 | 189 | (delete 'check) |
4afdb792 | 190 | (add-before 'strip 'check |
b8ea5204 | 191 | ;; After all the patching we run the tests after installing. |
68e7632d | 192 | (lambda _ |
4afdb792 EB |
193 | (setenv "HOME" "/tmp") ; Some tests need a writable homedir |
194 | (invoke "pytest" "tests/") | |
68e7632d | 195 | #t))))) |
b8ea5204 | 196 | (native-inputs |
b2fb40de | 197 | `(("python-pytest" ,python-pytest))) |
b8ea5204 | 198 | (inputs |
4afdb792 EB |
199 | `(("python-pycrypto" ,python-pycrypto) |
200 | ("python-flask" ,python-flask) | |
3268fba3 | 201 | ("python-flask-httpauth" ,python-flask-httpauth) |
b8ea5204 EF |
202 | ("python-nautilus" ,python-nautilus) |
203 | ("python-sip" ,python-sip) | |
204 | ("python-stem" ,python-stem) | |
4afdb792 | 205 | ("python-pysocks" ,python-pysocks) |
b8ea5204 EF |
206 | ("python-pyqt" ,python-pyqt))) |
207 | (home-page "https://onionshare.org/") | |
208 | (synopsis "Securely and anonymously share files") | |
3268fba3 EB |
209 | (description "OnionShare is a tool for securely and anonymously sending |
210 | and receiving files using Tor onion services. It works by starting a web | |
211 | server directly on your computer and making it accessible as an unguessable | |
212 | Tor web address that others can load in a Tor-enabled web browser to download | |
213 | files from you, or upload files to you. It doesn't require setting up a | |
214 | separate server, using a third party file-sharing service, or even logging | |
215 | into an account.") | |
216 | ;; Bundled, minified jquery is expat licensed. | |
217 | (license (list license:gpl3+ license:expat)))) | |
61ac7544 TGR |
218 | |
219 | (define-public nyx | |
18ab54d4 TGR |
220 | (package |
221 | (name "nyx") | |
ab1019f1 | 222 | (version "2.1.0") |
18ab54d4 TGR |
223 | (source |
224 | (origin | |
225 | (method url-fetch) | |
226 | (uri (pypi-uri name version)) | |
227 | (sha256 | |
228 | (base32 | |
ab1019f1 | 229 | "02rrlllz2ci6i6cs3iddyfns7ang9a54jrlygd2jw1f9s6418ll8")))) |
18ab54d4 TGR |
230 | (build-system python-build-system) |
231 | (inputs | |
232 | `(("python-stem" ,python-stem))) | |
233 | (arguments | |
234 | `(#:phases | |
235 | (modify-phases %standard-phases | |
236 | (add-after 'install 'install-man-page | |
237 | (lambda* (#:key outputs #:allow-other-keys) | |
238 | (let* ((out (assoc-ref outputs "out")) | |
239 | (man (string-append out "/share/man"))) | |
240 | (install-file "nyx.1" (string-append man "/man1")) | |
241 | #t))) | |
242 | (add-after 'install 'install-sample-configuration | |
243 | (lambda* (#:key outputs #:allow-other-keys) | |
244 | (let* ((out (assoc-ref outputs "out")) | |
245 | (doc (string-append out "/share/doc/" ,name "-" ,version))) | |
246 | (install-file "web/nyxrc.sample" doc) | |
247 | #t)))) | |
248 | ;; XXX The tests seem to require more of a real terminal than the build | |
249 | ;; environment provides: | |
250 | ;; _curses.error: setupterm: could not find terminal | |
251 | ;; With TERM=linux, the tests try to move the cursor and still fail: | |
252 | ;; _curses.error: cbreak() returned ERR | |
253 | #:tests? #f)) | |
254 | (home-page "https://nyx.torproject.org/") | |
255 | (synopsis "Tor relay status monitor") | |
256 | (description | |
257 | "Nyx monitors the performance of relays participating in the | |
61ac7544 TGR |
258 | @uref{https://www.torproject.org/, Tor anonymity network}. It displays this |
259 | information visually and in real time, using a curses-based terminal interface. | |
260 | This makes Nyx well-suited for remote shell connections and servers without a | |
261 | graphical display. It's like @command{top} for Tor, providing detailed | |
262 | statistics and status reports on: | |
263 | ||
264 | @enumerate | |
265 | @item connections (with IP address, hostname, fingerprint, and consensus data), | |
266 | @item bandwidth, processor, and memory usage, | |
267 | @item the relay's current configuration, | |
268 | @item logged events, | |
269 | @item and much more. | |
270 | @end enumerate | |
271 | ||
272 | Potential client and exit connections are scrubbed of sensitive information.") | |
18ab54d4 | 273 | (license license:gpl3+))) |