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) |
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") | |
eac5d425 | 51 | (version "0.3.4.10") |
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 | |
eac5d425 | 58 | "12i51i6swkdpnbcpa6f1csc00q177sbjnw2x31j53glxshmwpv5d")))) |
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 | |
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") | |
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 | |
119 | way with Tor. It ensures that DNS requests are handled safely and explicitly | |
120 | rejects 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") | |
be4f8391 | 128 | (version "3.0.28") |
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 | |
be4f8391 | 136 | "0jl2yav1qzqnaqnnx8i6i53ayckkimcrs3l6ryvv7bda6v08rmxm")))) |
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 | |
155 | for enhancing privacy, modifying web page data and HTTP headers, controlling | |
156 | access, and removing ads and other obnoxious Internet junk. Privoxy has a | |
157 | flexible configuration and can be customized to suit individual needs and | |
158 | tastes. It has application for both stand-alone systems and multi-user | |
159 | networks.") | |
71794d7b | 160 | (license license:gpl2+))) |
b8ea5204 EF |
161 | |
162 | (define-public onionshare | |
163 | (package | |
164 | (name "onionshare") | |
b2fb40de | 165 | (version "1.3.1") |
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 | |
b2fb40de | 175 | "02zic4cxwrcfdg22dq9c2rzni3l18wynjxd38scc59s37vlw7w2r")))) |
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"))) | |
b2fb40de | 184 | (substitute* '("setup.py" "onionshare/common.py") |
e5a12fba EF |
185 | (("sys.prefix,") (string-append "'" out "',"))) |
186 | (substitute* "setup.py" | |
187 | ;; for the nautilus plugin | |
188 | (("/usr/share/nautilus") "share/nautilus")) | |
b2fb40de EB |
189 | (substitute* "install/onionshare.desktop" |
190 | (("/usr") out)) | |
191 | #t))) | |
b8ea5204 EF |
192 | (delete 'check) |
193 | (add-before 'strip 'tests | |
194 | ;; After all the patching we run the tests after installing. | |
195 | ;; This is also a known issue: | |
196 | ;; https://github.com/micahflee/onionshare/issues/284 | |
68e7632d | 197 | (lambda _ |
b2fb40de | 198 | (invoke "pytest" "test") |
68e7632d | 199 | #t))))) |
b8ea5204 | 200 | (native-inputs |
b2fb40de | 201 | `(("python-pytest" ,python-pytest))) |
b8ea5204 EF |
202 | (inputs |
203 | `(("python-flask" ,python-flask) | |
204 | ("python-nautilus" ,python-nautilus) | |
205 | ("python-sip" ,python-sip) | |
206 | ("python-stem" ,python-stem) | |
207 | ("python-pyqt" ,python-pyqt))) | |
208 | (home-page "https://onionshare.org/") | |
209 | (synopsis "Securely and anonymously share files") | |
210 | (description "OnionShare lets you securely and anonymously share files of | |
211 | any size. It works by starting a web server, making it accessible as a Tor | |
212 | hidden service, and generating an unguessable URL to access and download the | |
213 | files. It doesn't require setting up a server on the internet somewhere or | |
214 | using a third party filesharing service. You host the file on your own computer | |
215 | and use a Tor hidden service to make it temporarily accessible over the | |
216 | internet. The other user just needs to use Tor Browser to download the file | |
217 | from you.") | |
71794d7b TGR |
218 | (license (list license:gpl3+ |
219 | license:bsd-3)))) ; onionshare/socks.py | |
61ac7544 TGR |
220 | |
221 | (define-public nyx | |
18ab54d4 TGR |
222 | (package |
223 | (name "nyx") | |
224 | (version "2.0.4") | |
225 | (source | |
226 | (origin | |
227 | (method url-fetch) | |
228 | (uri (pypi-uri name version)) | |
8edebd32 TGR |
229 | (patches |
230 | (search-patches "nyx-show-header-stats-with-python3.patch")) | |
18ab54d4 TGR |
231 | (sha256 |
232 | (base32 | |
233 | "0pm7vfcqr02pzqz4b2f6sw5prxxmgqwr1912am42xmy2i53n7nrq")))) | |
234 | (build-system python-build-system) | |
235 | (inputs | |
236 | `(("python-stem" ,python-stem))) | |
237 | (arguments | |
238 | `(#:phases | |
239 | (modify-phases %standard-phases | |
240 | (add-after 'install 'install-man-page | |
241 | (lambda* (#:key outputs #:allow-other-keys) | |
242 | (let* ((out (assoc-ref outputs "out")) | |
243 | (man (string-append out "/share/man"))) | |
244 | (install-file "nyx.1" (string-append man "/man1")) | |
245 | #t))) | |
246 | (add-after 'install 'install-sample-configuration | |
247 | (lambda* (#:key outputs #:allow-other-keys) | |
248 | (let* ((out (assoc-ref outputs "out")) | |
249 | (doc (string-append out "/share/doc/" ,name "-" ,version))) | |
250 | (install-file "web/nyxrc.sample" doc) | |
251 | #t)))) | |
252 | ;; XXX The tests seem to require more of a real terminal than the build | |
253 | ;; environment provides: | |
254 | ;; _curses.error: setupterm: could not find terminal | |
255 | ;; With TERM=linux, the tests try to move the cursor and still fail: | |
256 | ;; _curses.error: cbreak() returned ERR | |
257 | #:tests? #f)) | |
258 | (home-page "https://nyx.torproject.org/") | |
259 | (synopsis "Tor relay status monitor") | |
260 | (description | |
261 | "Nyx monitors the performance of relays participating in the | |
61ac7544 TGR |
262 | @uref{https://www.torproject.org/, Tor anonymity network}. It displays this |
263 | information visually and in real time, using a curses-based terminal interface. | |
264 | This makes Nyx well-suited for remote shell connections and servers without a | |
265 | graphical display. It's like @command{top} for Tor, providing detailed | |
266 | statistics and status reports on: | |
267 | ||
268 | @enumerate | |
269 | @item connections (with IP address, hostname, fingerprint, and consensus data), | |
270 | @item bandwidth, processor, and memory usage, | |
271 | @item the relay's current configuration, | |
272 | @item logged events, | |
273 | @item and much more. | |
274 | @end enumerate | |
275 | ||
276 | Potential client and exit connections are scrubbed of sensitive information.") | |
18ab54d4 | 277 | (license license:gpl3+))) |