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> |
ae608622 EF |
4 | ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il> |
5 | ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is> | |
eac5d425 | 6 | ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> |
b2fb40de | 7 | ;;; Copyright © 2017, 2018 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) |
44d10b1f | 43 | #:use-module (gnu packages python-xyz) |
b8ea5204 | 44 | #:use-module (gnu packages qt) |
b2e3dd94 | 45 | #:use-module (gnu packages autotools) |
cc2b77df | 46 | #:use-module (gnu packages tls) |
b2e3dd94 | 47 | #:use-module (gnu packages w3m)) |
7f08437b LC |
48 | |
49 | (define-public tor | |
50 | (package | |
51 | (name "tor") | |
eac5d425 | 52 | (version "0.3.4.10") |
7f08437b LC |
53 | (source (origin |
54 | (method url-fetch) | |
0ab57b0d | 55 | (uri (string-append "https://dist.torproject.org/tor-" |
7f08437b LC |
56 | version ".tar.gz")) |
57 | (sha256 | |
58 | (base32 | |
eac5d425 | 59 | "12i51i6swkdpnbcpa6f1csc00q177sbjnw2x31j53glxshmwpv5d")))) |
7f08437b | 60 | (build-system gnu-build-system) |
249eb389 | 61 | (arguments |
54727850 | 62 | `(#:configure-flags (list "--enable-gcc-hardening" |
249eb389 | 63 | "--enable-linker-hardening"))) |
8850303e | 64 | (native-inputs |
6c97f17f | 65 | `(("pkg-config" ,pkg-config) |
4105f13b | 66 | ("python" ,python-2))) ; for tests |
7f08437b LC |
67 | (inputs |
68 | `(("zlib" ,zlib) | |
69 | ("openssl" ,openssl) | |
7e9e1a36 | 70 | ("libevent" ,libevent) |
6c97f17f TGR |
71 | ("libseccomp" ,libseccomp) |
72 | ("xz" ,xz) | |
73 | ("zstd" ,zstd))) | |
0ab57b0d | 74 | (home-page "https://www.torproject.org/") |
9e771e3b | 75 | (synopsis "Anonymous network router to improve privacy on the Internet") |
7f08437b LC |
76 | (description |
77 | "Tor protects you by bouncing your communications around a distributed | |
78 | network of relays run by volunteers all around the world: it prevents | |
79 | somebody watching your Internet connection from learning what sites you | |
80 | visit, and it prevents the sites you visit from learning your physical | |
35b9e423 | 81 | location. Tor works with many of your existing applications, including |
7f08437b | 82 | web browsers, instant messaging clients, remote login, and other |
fc9286d0 | 83 | applications based on the TCP protocol. |
55b27569 | 84 | |
fc9286d0 | 85 | To @code{torify} applications (to take measures to ensure that an application, |
86 | which has not been designed for use with Tor such as ssh, will use only Tor for | |
87 | internet connectivity, and also ensures that there are no leaks from DNS, UDP or | |
88 | the application layer) you need to install @code{torsocks}.") | |
71794d7b | 89 | (license license:bsd-3))) |
4f7e152b LC |
90 | |
91 | (define-public torsocks | |
92 | (package | |
93 | (name "torsocks") | |
15c661ec | 94 | (version "2.3.0") |
4f7e152b | 95 | (source (origin |
91988aee | 96 | (method url-fetch) |
97 | (uri (string-append "https://people.torproject.org/~dgoulet/" | |
d77ade87 | 98 | "torsocks/torsocks-" version ".tar.xz")) |
ba583bd2 LC |
99 | (sha256 |
100 | (base32 | |
15c661ec | 101 | "08inrkap29gikb6sdmb58z43hw4abwrfw7ny40c4xzdkss0vkwdr")))) |
4f7e152b | 102 | (build-system gnu-build-system) |
f3cf25c3 | 103 | (inputs |
15c661ec | 104 | `(("libcap" ,libcap))) |
f3cf25c3 EB |
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" | |
15c661ec TGR |
110 | (("getcap=.*") |
111 | (string-append "getcap=" (which "getcap") "\n"))) | |
f3cf25c3 | 112 | #t))))) |
91988aee | 113 | (home-page "https://www.torproject.org/") |
4f7e152b LC |
114 | (synopsis "Use socks-friendly applications with Tor") |
115 | (description | |
116 | "Torsocks allows you to use most socks-friendly applications in a safe | |
117 | way with Tor. It ensures that DNS requests are handled safely and explicitly | |
118 | rejects UDP traffic from the application you're using.") | |
ba583bd2 LC |
119 | |
120 | ;; All the files explicitly say "version 2 only". | |
71794d7b | 121 | (license license:gpl2))) |
b2e3dd94 LC |
122 | |
123 | (define-public privoxy | |
124 | (package | |
125 | (name "privoxy") | |
be4f8391 | 126 | (version "3.0.28") |
b2e3dd94 LC |
127 | (source (origin |
128 | (method url-fetch) | |
129 | (uri (string-append "mirror://sourceforge/ijbswa/Sources/" | |
130 | version "%20%28stable%29/privoxy-" | |
131 | version "-stable-src.tar.gz")) | |
132 | (sha256 | |
133 | (base32 | |
be4f8391 | 134 | "0jl2yav1qzqnaqnnx8i6i53ayckkimcrs3l6ryvv7bda6v08rmxm")))) |
b2e3dd94 LC |
135 | (build-system gnu-build-system) |
136 | (arguments | |
ae5c6fca LC |
137 | '(;; The default 'sysconfdir' is $out/etc; change that to |
138 | ;; $out/etc/privoxy. | |
139 | #:configure-flags (list (string-append "--sysconfdir=" | |
140 | (assoc-ref %outputs "out") | |
141 | "/etc/privoxy")) | |
b2e3dd94 LC |
142 | #:tests? #f)) |
143 | (inputs | |
144 | `(("w3m" ,w3m) | |
145 | ("pcre" ,pcre) | |
146 | ("zlib" ,zlib) | |
147 | ("autoconf" ,autoconf) | |
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") | |
b2fb40de | 163 | (version "1.3.1") |
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 EF |
171 | (sha256 |
172 | (base32 | |
b2fb40de | 173 | "02zic4cxwrcfdg22dq9c2rzni3l18wynjxd38scc59s37vlw7w2r")))) |
b8ea5204 EF |
174 | (build-system python-build-system) |
175 | (arguments | |
176 | `(#:phases | |
177 | (modify-phases %standard-phases | |
178 | (add-after 'unpack 'fix-install-path | |
179 | (lambda* (#:key outputs #:allow-other-keys) | |
180 | (let* ((out (assoc-ref outputs "out")) | |
181 | (onionshare (string-append out "/share/onionshare"))) | |
b2fb40de | 182 | (substitute* '("setup.py" "onionshare/common.py") |
e5a12fba EF |
183 | (("sys.prefix,") (string-append "'" out "',"))) |
184 | (substitute* "setup.py" | |
185 | ;; for the nautilus plugin | |
186 | (("/usr/share/nautilus") "share/nautilus")) | |
b2fb40de EB |
187 | (substitute* "install/onionshare.desktop" |
188 | (("/usr") out)) | |
189 | #t))) | |
b8ea5204 EF |
190 | (delete 'check) |
191 | (add-before 'strip 'tests | |
192 | ;; After all the patching we run the tests after installing. | |
193 | ;; This is also a known issue: | |
194 | ;; https://github.com/micahflee/onionshare/issues/284 | |
68e7632d | 195 | (lambda _ |
b2fb40de | 196 | (invoke "pytest" "test") |
68e7632d | 197 | #t))))) |
b8ea5204 | 198 | (native-inputs |
b2fb40de | 199 | `(("python-pytest" ,python-pytest))) |
b8ea5204 EF |
200 | (inputs |
201 | `(("python-flask" ,python-flask) | |
202 | ("python-nautilus" ,python-nautilus) | |
203 | ("python-sip" ,python-sip) | |
204 | ("python-stem" ,python-stem) | |
205 | ("python-pyqt" ,python-pyqt))) | |
206 | (home-page "https://onionshare.org/") | |
207 | (synopsis "Securely and anonymously share files") | |
208 | (description "OnionShare lets you securely and anonymously share files of | |
209 | any size. It works by starting a web server, making it accessible as a Tor | |
210 | hidden service, and generating an unguessable URL to access and download the | |
211 | files. It doesn't require setting up a server on the internet somewhere or | |
212 | using a third party filesharing service. You host the file on your own computer | |
213 | and use a Tor hidden service to make it temporarily accessible over the | |
214 | internet. The other user just needs to use Tor Browser to download the file | |
215 | from you.") | |
71794d7b TGR |
216 | (license (list license:gpl3+ |
217 | license:bsd-3)))) ; onionshare/socks.py | |
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+))) |