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> |
be866fb1 | 4 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
4cc4d363 | 5 | ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is> |
7f08437b LC |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | (define-module (gnu packages tor) | |
c4605e4c | 23 | #:use-module ((guix licenses) #:select (bsd-3 gpl3+ gpl2+ gpl2)) |
7f08437b LC |
24 | #:use-module (guix packages) |
25 | #:use-module (guix download) | |
ba583bd2 | 26 | #:use-module (guix git-download) |
7f08437b | 27 | #:use-module (guix build-system gnu) |
c4605e4c | 28 | #:use-module (guix build-system python) |
ba583bd2 | 29 | #:use-module (gnu packages) |
7f08437b LC |
30 | #:use-module (gnu packages libevent) |
31 | #:use-module (gnu packages compression) | |
b2e3dd94 | 32 | #:use-module (gnu packages pcre) |
ba583bd2 | 33 | #:use-module (gnu packages perl) |
8850303e | 34 | #:use-module (gnu packages python) |
b8ea5204 | 35 | #:use-module (gnu packages qt) |
b2e3dd94 | 36 | #:use-module (gnu packages autotools) |
cc2b77df | 37 | #:use-module (gnu packages tls) |
b2e3dd94 | 38 | #:use-module (gnu packages w3m)) |
7f08437b LC |
39 | |
40 | (define-public tor | |
41 | (package | |
42 | (name "tor") | |
00bfd498 | 43 | (version "0.2.8.9") |
7f08437b LC |
44 | (source (origin |
45 | (method url-fetch) | |
0ab57b0d | 46 | (uri (string-append "https://dist.torproject.org/tor-" |
7f08437b LC |
47 | version ".tar.gz")) |
48 | (sha256 | |
49 | (base32 | |
00bfd498 | 50 | "05jkvhbgyq81fcmk1xpl3yw97ljj5sg9pngl27zlmgl7p0xjfp1z")))) |
7f08437b | 51 | (build-system gnu-build-system) |
8850303e MW |
52 | (native-inputs |
53 | `(("python" ,python-2))) ; for tests | |
7f08437b LC |
54 | (inputs |
55 | `(("zlib" ,zlib) | |
56 | ("openssl" ,openssl) | |
57 | ("libevent" ,libevent))) | |
4f7e152b LC |
58 | |
59 | ;; TODO: Recommend `torsocks' since `torify' needs it. | |
60 | ||
0ab57b0d | 61 | (home-page "https://www.torproject.org/") |
9e771e3b | 62 | (synopsis "Anonymous network router to improve privacy on the Internet") |
7f08437b LC |
63 | (description |
64 | "Tor protects you by bouncing your communications around a distributed | |
65 | network of relays run by volunteers all around the world: it prevents | |
66 | somebody watching your Internet connection from learning what sites you | |
67 | visit, and it prevents the sites you visit from learning your physical | |
35b9e423 | 68 | location. Tor works with many of your existing applications, including |
7f08437b LC |
69 | web browsers, instant messaging clients, remote login, and other |
70 | applications based on the TCP protocol.") | |
71 | (license bsd-3))) | |
4f7e152b LC |
72 | |
73 | (define-public torsocks | |
74 | (package | |
75 | (name "torsocks") | |
ba583bd2 | 76 | (version "2.0.0") |
4f7e152b | 77 | (source (origin |
ba583bd2 LC |
78 | (method git-fetch) |
79 | (uri (git-reference | |
80 | (url "https://git.torproject.org/torsocks.git") | |
81 | (commit (string-append "v" version)))) | |
82 | (sha256 | |
83 | (base32 | |
84 | "0an2q5ail9z414riyjbkjkm29504hy778j914baz2gn5hlv2cfak")) | |
85 | (file-name (string-append name "-" version "-checkout")) | |
fc1adab1 | 86 | (patches (search-patches "torsocks-dns-test.patch")))) |
4f7e152b | 87 | (build-system gnu-build-system) |
ba583bd2 LC |
88 | (arguments |
89 | '(#:phases (modify-phases %standard-phases | |
90 | (add-before 'configure 'bootstrap | |
91 | (lambda _ | |
92 | (system* "autoreconf" "-vfi")))))) | |
93 | (native-inputs `(("autoconf" ,(autoconf-wrapper)) | |
94 | ("automake" ,automake) | |
95 | ("libtool" ,libtool) | |
96 | ("perl-test-harness" ,perl-test-harness))) | |
97 | (home-page "http://www.torproject.org/") | |
4f7e152b LC |
98 | (synopsis "Use socks-friendly applications with Tor") |
99 | (description | |
100 | "Torsocks allows you to use most socks-friendly applications in a safe | |
101 | way with Tor. It ensures that DNS requests are handled safely and explicitly | |
102 | rejects UDP traffic from the application you're using.") | |
ba583bd2 LC |
103 | |
104 | ;; All the files explicitly say "version 2 only". | |
105 | (license gpl2))) | |
b2e3dd94 LC |
106 | |
107 | (define-public privoxy | |
108 | (package | |
109 | (name "privoxy") | |
a8f3d492 | 110 | (version "3.0.26") |
b2e3dd94 LC |
111 | (source (origin |
112 | (method url-fetch) | |
113 | (uri (string-append "mirror://sourceforge/ijbswa/Sources/" | |
114 | version "%20%28stable%29/privoxy-" | |
115 | version "-stable-src.tar.gz")) | |
116 | (sha256 | |
117 | (base32 | |
a8f3d492 | 118 | "1n4wpxmahl8m2y3d1azxa8lrdbpaad007k458skxrpz57ss1br2p")))) |
b2e3dd94 LC |
119 | (build-system gnu-build-system) |
120 | (arguments | |
ae5c6fca LC |
121 | '(;; The default 'sysconfdir' is $out/etc; change that to |
122 | ;; $out/etc/privoxy. | |
123 | #:configure-flags (list (string-append "--sysconfdir=" | |
124 | (assoc-ref %outputs "out") | |
125 | "/etc/privoxy")) | |
722ec722 MW |
126 | #:phases (alist-cons-after |
127 | 'unpack 'autoconf | |
b2e3dd94 LC |
128 | (lambda _ |
129 | ;; Unfortunately, this is not a tarball produced by | |
130 | ;; "make dist". | |
131 | (zero? (system* "autoreconf" "-vfi"))) | |
132 | %standard-phases) | |
133 | #:tests? #f)) | |
134 | (inputs | |
135 | `(("w3m" ,w3m) | |
136 | ("pcre" ,pcre) | |
137 | ("zlib" ,zlib) | |
138 | ("autoconf" ,autoconf) | |
139 | ("automake" ,automake))) | |
a8f3d492 | 140 | (home-page "https://www.privoxy.org") |
b2e3dd94 LC |
141 | (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy") |
142 | (description | |
143 | "Privoxy is a non-caching web proxy with advanced filtering capabilities | |
144 | for enhancing privacy, modifying web page data and HTTP headers, controlling | |
145 | access, and removing ads and other obnoxious Internet junk. Privoxy has a | |
146 | flexible configuration and can be customized to suit individual needs and | |
147 | tastes. It has application for both stand-alone systems and multi-user | |
148 | networks.") | |
149 | (license gpl2+))) | |
b8ea5204 EF |
150 | |
151 | (define-public onionshare | |
152 | (package | |
153 | (name "onionshare") | |
154 | (version "0.9") | |
155 | (source | |
156 | (origin | |
157 | (method url-fetch) | |
158 | (uri (string-append "https://github.com/micahflee/onionshare/archive/v" | |
159 | version ".tar.gz")) | |
160 | (file-name (string-append name "-" version ".tar.gz")) | |
161 | (sha256 | |
162 | (base32 | |
163 | "0pc3xbq379415s0i0y6rz02hay20zbvgra1jmg4mgrl9vbdr8zmw")) | |
164 | (patches (search-patches "onionshare-fix-install-paths.patch")))) | |
165 | (build-system python-build-system) | |
166 | (arguments | |
167 | `(#:phases | |
168 | (modify-phases %standard-phases | |
169 | (add-after 'unpack 'fix-install-path | |
170 | (lambda* (#:key outputs #:allow-other-keys) | |
171 | (let* ((out (assoc-ref outputs "out")) | |
172 | (onionshare (string-append out "/share/onionshare"))) | |
173 | (substitute* | |
174 | "install/pyinstaller.spec" | |
175 | ;; inform onionshare where the 'resources' files are installed | |
176 | (("../resources") onionshare)) | |
177 | (substitute* | |
178 | "onionshare/strings.py" | |
179 | ;; correct the locale directory | |
180 | (("helpers.get_resource_path\\('locale'\\)") | |
181 | (string-append "'" onionshare "/locale'"))) | |
182 | (substitute* | |
183 | "onionshare/helpers.py" | |
184 | ;; correct the location of version.txt | |
185 | (("/usr") out) | |
186 | (("get_resource_path\\('version.txt'\\)") | |
187 | (string-append "'" onionshare "/version.txt'")) | |
188 | (("get_resource_path\\('wordlist.txt'\\)") | |
189 | (string-append "'" onionshare "/wordlist.txt'"))) | |
190 | (substitute* | |
191 | "onionshare/web.py" | |
192 | ;; fix the location of the html files | |
193 | (("helpers.get_resource_path\\('html/denied.html'\\)") | |
194 | (string-append "'" onionshare "/html/denied.html'")) | |
195 | (("helpers.get_resource_path\\('html/404.html'\\)") | |
196 | (string-append "'" onionshare "/html/404.html'")) | |
197 | (("helpers.get_resource_path\\('html/index.html'\\)") | |
198 | (string-append "'" onionshare "/html/index.html'"))) | |
199 | (substitute* | |
200 | "onionshare_gui/file_selection.py" | |
201 | (("helpers.get_resource_path\\('images/drop_files.png'\\)") | |
202 | (string-append "'" onionshare "/images/drop_files.png'"))) | |
203 | (substitute* | |
204 | "onionshare_gui/server_status.py" | |
205 | (("helpers.get_resource_path\\('images/server_stopped.png'\\)") | |
206 | (string-append "'" onionshare "/images/server_stopped.png'")) | |
207 | (("helpers.get_resource_path\\('images/server_working.png'\\)") | |
208 | (string-append "'" onionshare "/images/server_working.png'")) | |
209 | (("helpers.get_resource_path\\('images/server_started.png'\\)") | |
210 | (string-append "'" onionshare "/images/server_started.png'"))) | |
211 | (substitute* | |
212 | "onionshare_gui/onionshare_gui.py" | |
213 | (("helpers.get_resource_path\\('images/logo.png'\\)") | |
214 | (string-append "'" onionshare "/images/logo.png'"))) | |
215 | (substitute* | |
216 | "install/onionshare.desktop" | |
217 | (("/usr") out)) | |
218 | #t))) | |
219 | (delete 'check) | |
220 | (add-before 'strip 'tests | |
221 | ;; After all the patching we run the tests after installing. | |
222 | ;; This is also a known issue: | |
223 | ;; https://github.com/micahflee/onionshare/issues/284 | |
224 | (lambda _ (zero? (system* "nosetests" "test"))))) | |
225 | ;; can't compress the egg because it expects to find all the resources | |
226 | ;; inside the egg as though it were a folder. | |
227 | #:configure-flags '("--single-version-externally-managed" "--root=/") | |
228 | )) | |
229 | (native-inputs | |
230 | `(("python-nose" ,python-nose))) | |
231 | (inputs | |
232 | `(("python-flask" ,python-flask) | |
233 | ("python-nautilus" ,python-nautilus) | |
234 | ("python-sip" ,python-sip) | |
235 | ("python-stem" ,python-stem) | |
236 | ("python-pyqt" ,python-pyqt))) | |
237 | (home-page "https://onionshare.org/") | |
238 | (synopsis "Securely and anonymously share files") | |
239 | (description "OnionShare lets you securely and anonymously share files of | |
240 | any size. It works by starting a web server, making it accessible as a Tor | |
241 | hidden service, and generating an unguessable URL to access and download the | |
242 | files. It doesn't require setting up a server on the internet somewhere or | |
243 | using a third party filesharing service. You host the file on your own computer | |
244 | and use a Tor hidden service to make it temporarily accessible over the | |
245 | internet. The other user just needs to use Tor Browser to download the file | |
246 | from you.") | |
c4605e4c EF |
247 | (license (list gpl3+ |
248 | bsd-3)))) ; onionshare/socks.py |