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) |
8850303e | 33 | #:use-module (gnu packages python) |
b8ea5204 | 34 | #:use-module (gnu packages qt) |
b2e3dd94 | 35 | #:use-module (gnu packages autotools) |
cc2b77df | 36 | #:use-module (gnu packages tls) |
b2e3dd94 | 37 | #:use-module (gnu packages w3m)) |
7f08437b LC |
38 | |
39 | (define-public tor | |
40 | (package | |
41 | (name "tor") | |
08703721 | 42 | (version "0.2.9.8") |
7f08437b LC |
43 | (source (origin |
44 | (method url-fetch) | |
0ab57b0d | 45 | (uri (string-append "https://dist.torproject.org/tor-" |
7f08437b LC |
46 | version ".tar.gz")) |
47 | (sha256 | |
48 | (base32 | |
08703721 | 49 | "0sklgmx4nikcfhqd606kvpwy1l8840w24ikli1xjjx25739k7pgv")))) |
7f08437b | 50 | (build-system gnu-build-system) |
8850303e MW |
51 | (native-inputs |
52 | `(("python" ,python-2))) ; for tests | |
7f08437b LC |
53 | (inputs |
54 | `(("zlib" ,zlib) | |
55 | ("openssl" ,openssl) | |
56 | ("libevent" ,libevent))) | |
0ab57b0d | 57 | (home-page "https://www.torproject.org/") |
9e771e3b | 58 | (synopsis "Anonymous network router to improve privacy on the Internet") |
7f08437b LC |
59 | (description |
60 | "Tor protects you by bouncing your communications around a distributed | |
61 | network of relays run by volunteers all around the world: it prevents | |
62 | somebody watching your Internet connection from learning what sites you | |
63 | visit, and it prevents the sites you visit from learning your physical | |
35b9e423 | 64 | location. Tor works with many of your existing applications, including |
7f08437b | 65 | web browsers, instant messaging clients, remote login, and other |
fc9286d0 | 66 | applications based on the TCP protocol. |
55b27569 | 67 | |
fc9286d0 | 68 | To @code{torify} applications (to take measures to ensure that an application, |
69 | which has not been designed for use with Tor such as ssh, will use only Tor for | |
70 | internet connectivity, and also ensures that there are no leaks from DNS, UDP or | |
71 | the application layer) you need to install @code{torsocks}.") | |
7f08437b | 72 | (license bsd-3))) |
4f7e152b LC |
73 | |
74 | (define-public torsocks | |
75 | (package | |
76 | (name "torsocks") | |
91988aee | 77 | (version "2.2.0") |
4f7e152b | 78 | (source (origin |
91988aee | 79 | (method url-fetch) |
80 | (uri (string-append "https://people.torproject.org/~dgoulet/" | |
81 | name "/" name "-" version ".tar.xz")) | |
ba583bd2 LC |
82 | (sha256 |
83 | (base32 | |
91988aee | 84 | "0byr9ga9w79qz4vp0m11sbmspad7fsal9wm67r4znzb7zb7cis19")))) |
4f7e152b | 85 | (build-system gnu-build-system) |
91988aee | 86 | (home-page "https://www.torproject.org/") |
4f7e152b LC |
87 | (synopsis "Use socks-friendly applications with Tor") |
88 | (description | |
89 | "Torsocks allows you to use most socks-friendly applications in a safe | |
90 | way with Tor. It ensures that DNS requests are handled safely and explicitly | |
91 | rejects UDP traffic from the application you're using.") | |
ba583bd2 LC |
92 | |
93 | ;; All the files explicitly say "version 2 only". | |
94 | (license gpl2))) | |
b2e3dd94 LC |
95 | |
96 | (define-public privoxy | |
97 | (package | |
98 | (name "privoxy") | |
a8f3d492 | 99 | (version "3.0.26") |
b2e3dd94 LC |
100 | (source (origin |
101 | (method url-fetch) | |
102 | (uri (string-append "mirror://sourceforge/ijbswa/Sources/" | |
103 | version "%20%28stable%29/privoxy-" | |
104 | version "-stable-src.tar.gz")) | |
105 | (sha256 | |
106 | (base32 | |
a8f3d492 | 107 | "1n4wpxmahl8m2y3d1azxa8lrdbpaad007k458skxrpz57ss1br2p")))) |
b2e3dd94 LC |
108 | (build-system gnu-build-system) |
109 | (arguments | |
ae5c6fca LC |
110 | '(;; The default 'sysconfdir' is $out/etc; change that to |
111 | ;; $out/etc/privoxy. | |
112 | #:configure-flags (list (string-append "--sysconfdir=" | |
113 | (assoc-ref %outputs "out") | |
114 | "/etc/privoxy")) | |
722ec722 MW |
115 | #:phases (alist-cons-after |
116 | 'unpack 'autoconf | |
b2e3dd94 LC |
117 | (lambda _ |
118 | ;; Unfortunately, this is not a tarball produced by | |
119 | ;; "make dist". | |
120 | (zero? (system* "autoreconf" "-vfi"))) | |
121 | %standard-phases) | |
122 | #:tests? #f)) | |
123 | (inputs | |
124 | `(("w3m" ,w3m) | |
125 | ("pcre" ,pcre) | |
126 | ("zlib" ,zlib) | |
127 | ("autoconf" ,autoconf) | |
128 | ("automake" ,automake))) | |
a8f3d492 | 129 | (home-page "https://www.privoxy.org") |
b2e3dd94 LC |
130 | (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy") |
131 | (description | |
132 | "Privoxy is a non-caching web proxy with advanced filtering capabilities | |
133 | for enhancing privacy, modifying web page data and HTTP headers, controlling | |
134 | access, and removing ads and other obnoxious Internet junk. Privoxy has a | |
135 | flexible configuration and can be customized to suit individual needs and | |
136 | tastes. It has application for both stand-alone systems and multi-user | |
137 | networks.") | |
138 | (license gpl2+))) | |
b8ea5204 EF |
139 | |
140 | (define-public onionshare | |
141 | (package | |
142 | (name "onionshare") | |
e5a12fba | 143 | (version "0.9.2") |
b8ea5204 EF |
144 | (source |
145 | (origin | |
146 | (method url-fetch) | |
147 | (uri (string-append "https://github.com/micahflee/onionshare/archive/v" | |
148 | version ".tar.gz")) | |
149 | (file-name (string-append name "-" version ".tar.gz")) | |
150 | (sha256 | |
151 | (base32 | |
e5a12fba | 152 | "02iv7dg15da57gy3zvfchnwwpr21n1gva7mqwpwr958ni2034smk")))) |
b8ea5204 EF |
153 | (build-system python-build-system) |
154 | (arguments | |
155 | `(#:phases | |
156 | (modify-phases %standard-phases | |
157 | (add-after 'unpack 'fix-install-path | |
158 | (lambda* (#:key outputs #:allow-other-keys) | |
159 | (let* ((out (assoc-ref outputs "out")) | |
160 | (onionshare (string-append out "/share/onionshare"))) | |
e5a12fba | 161 | (substitute* "onionshare/strings.py" |
b8ea5204 EF |
162 | ;; correct the locale directory |
163 | (("helpers.get_resource_path\\('locale'\\)") | |
164 | (string-append "'" onionshare "/locale'"))) | |
e5a12fba | 165 | (substitute* "onionshare/helpers.py" |
b8ea5204 | 166 | ;; correct the location of version.txt |
b8ea5204 EF |
167 | (("get_resource_path\\('version.txt'\\)") |
168 | (string-append "'" onionshare "/version.txt'")) | |
169 | (("get_resource_path\\('wordlist.txt'\\)") | |
170 | (string-append "'" onionshare "/wordlist.txt'"))) | |
e5a12fba | 171 | (substitute* "onionshare/web.py" |
b8ea5204 EF |
172 | ;; fix the location of the html files |
173 | (("helpers.get_resource_path\\('html/denied.html'\\)") | |
174 | (string-append "'" onionshare "/html/denied.html'")) | |
175 | (("helpers.get_resource_path\\('html/404.html'\\)") | |
176 | (string-append "'" onionshare "/html/404.html'")) | |
177 | (("helpers.get_resource_path\\('html/index.html'\\)") | |
178 | (string-append "'" onionshare "/html/index.html'"))) | |
e5a12fba EF |
179 | (substitute* "onionshare_gui/file_selection.py" |
180 | ;; fancy box image in the GUI | |
b8ea5204 EF |
181 | (("helpers.get_resource_path\\('images/drop_files.png'\\)") |
182 | (string-append "'" onionshare "/images/drop_files.png'"))) | |
e5a12fba | 183 | (substitute* "onionshare_gui/server_status.py" |
b8ea5204 EF |
184 | (("helpers.get_resource_path\\('images/server_stopped.png'\\)") |
185 | (string-append "'" onionshare "/images/server_stopped.png'")) | |
186 | (("helpers.get_resource_path\\('images/server_working.png'\\)") | |
187 | (string-append "'" onionshare "/images/server_working.png'")) | |
188 | (("helpers.get_resource_path\\('images/server_started.png'\\)") | |
189 | (string-append "'" onionshare "/images/server_started.png'"))) | |
e5a12fba EF |
190 | (substitute* "onionshare_gui/onionshare_gui.py" |
191 | ;; for the icon on the GUI | |
b8ea5204 EF |
192 | (("helpers.get_resource_path\\('images/logo.png'\\)") |
193 | (string-append "'" onionshare "/images/logo.png'"))) | |
e5a12fba EF |
194 | (substitute* '("setup.py" "onionshare/helpers.py") |
195 | (("sys.prefix,") (string-append "'" out "',"))) | |
196 | (substitute* "setup.py" | |
197 | ;; for the nautilus plugin | |
198 | (("/usr/share/nautilus") "share/nautilus")) | |
b8ea5204 EF |
199 | #t))) |
200 | (delete 'check) | |
201 | (add-before 'strip 'tests | |
202 | ;; After all the patching we run the tests after installing. | |
203 | ;; This is also a known issue: | |
204 | ;; https://github.com/micahflee/onionshare/issues/284 | |
b41a05ce | 205 | (lambda _ (zero? (system* "nosetests" "test"))))))) |
b8ea5204 EF |
206 | (native-inputs |
207 | `(("python-nose" ,python-nose))) | |
208 | (inputs | |
209 | `(("python-flask" ,python-flask) | |
210 | ("python-nautilus" ,python-nautilus) | |
211 | ("python-sip" ,python-sip) | |
212 | ("python-stem" ,python-stem) | |
213 | ("python-pyqt" ,python-pyqt))) | |
214 | (home-page "https://onionshare.org/") | |
215 | (synopsis "Securely and anonymously share files") | |
216 | (description "OnionShare lets you securely and anonymously share files of | |
217 | any size. It works by starting a web server, making it accessible as a Tor | |
218 | hidden service, and generating an unguessable URL to access and download the | |
219 | files. It doesn't require setting up a server on the internet somewhere or | |
220 | using a third party filesharing service. You host the file on your own computer | |
221 | and use a Tor hidden service to make it temporarily accessible over the | |
222 | internet. The other user just needs to use Tor Browser to download the file | |
223 | from you.") | |
c4605e4c EF |
224 | (license (list gpl3+ |
225 | bsd-3)))) ; onionshare/socks.py |