4 Coquelicot is a "one-click" file sharing web application with a specific
5 focus on protecting users' privacy.
7 Basic principle: users can upload a file to the server, in return they
8 get a unique URL which can be shared with others in order to download
11 Coquelicot aims to protect, to some extend, users and system
12 administrators from disclosure of the files exchanged from passive and
13 not so active attackers.
18 * Support for different authentication methods
20 In order to prevent random Internet users to eat bandwidth and
21 disk space, Coquelicot limits upload to authenticated users.
22 It currently ships with two authentication mechanisms:
24 - "simplepass": users will need to provide a global, pre-shared,
26 - "imap": users will need to provide a login and a password,
27 those credentials will be used to authenticate against an existing
30 It is possible to integrate more authentication mechanisms by
31 implementing a single method, some Javascript, and a template partial
32 to render the common fields. For more information have a look at the
35 * Mandatory expiration
37 When uploading, a time limit has to be specified. The file will be
38 unavailable once this limit has been reached.
40 During a configurable period of time, trying to download the file
41 will return a page saying "too late" instead of "not found".
43 * Support for one-time download
45 An user might want to allow exactly _one_ download of a file, to more
46 closely replace an email attachment. The file will be removed after
47 the first complete download and concurrent downloads are prevented.
51 If the web server tracks upload progress, users having javascript
52 enabled will see a nice progress bar during the file upload.
56 The application works fine without javascript or CSS.
58 * Download URL are hand-writing compatible
60 URLs generated to download files uses the Base32 character set. This
61 set is specifically designed to overcome misread of 'l', '1', '0' and
62 'O' characters. Coquelicot will automatically convert case and
63 ambiguous characters to facilitate URL exchanges through
66 * Files are stored encrypted on the server
68 While being uploaded, files are written to the disk using symmetric
69 encryption. The encryption key is _not_ stored directly by
70 Coquelicot. It is either generated randomly and given as part of the
71 download URL, or specified by the uploader.
73 * Download can be protected by a password
75 When uploading, a password can be specified which will be used as
76 the encryption key. In order to download the file, the password
77 must be entered through in a POST'ed form, preventing the password
78 from appearing in the server logs.
80 * Files are stored with a random name
82 To prevent disclosure of the shared file name, it is stored encrypted
83 together with the file content. On the server, this encrypted file is
84 stored with a random name.
86 * Download URLs do not reflect stored file names
88 The random names given in download URLs do not map directly to file
89 names on the server. This prevent server logs from giving a direct
90 mapping to the shared files.
92 * File content is zero'ed before removal
94 When a file has expired, it is removed from the server. In order
95 to make it harder to retrieve its content through filesystem
96 analysis, it is filled with zeros first.
101 Coquelicot is written in Ruby using the Sinatra web framework.
103 On Debian, one can fulfill its dependencies by issuing:
105 apt-get install libsinatra-ruby1.8 libopenssl-ruby1.8 \
106 libhaml-ruby1.8 liblockfile-ruby libgettext-ruby1.8 \
109 Then create the translation catalog through:
113 Finally you need to figure out the best way to host a Rack application
114 depending on your setup. *evil grin*
116 Coquelicot is intended to be run on a fully encrypted system and accessible
122 By default Coquelicot is configured to authenticate with the
123 "simplepass" mechanism and some other reasonable defaults.
125 It is possible to overwrite these settings from a configuration file
126 named `settings.yml` that will be used if it is present in the `conf`
127 directory of the application.
129 All available settings with their default values are documented in
130 `conf/settings-default.yml`.
132 Further settings example:
134 * `conf/settings-simplepass.yml`: shows how to change the default
135 password for the "simplepass" mechanism.
137 * `conf/settings-imap.yml`: necessary configuration for the "imap"
138 authentication mechanism.
140 You can copy one of these examples to `conf/settings.yml` and adjust them
141 according to your environment.
146 To cleanup files automatically when they expired, coquelicot comes with
147 a cleanup script, that does the garbage collection for you. The easiest
148 way is to add `ext/coquelicot_gc.rb` as a cron job that runs every 5
154 Coquelicot test suite is written using RSpec.
156 As Coquelicot uses Bundle, you first need to install the proper
161 Then, running the test suite is just a matter of typing:
168 Jyraphe [1] is another free software web file sharing application.
169 Coquelicot provides a migration script to import Jyraphe 0.5 repositories in
170 `tools/migrate_jyraphe.rb`.
172 [1] http://home.gna.org/jyraphe/
177 * More flexible expiration
179 It might be interesting to also offer a calendar for specifying
180 an exact date after which the file will be unavailable.
182 * Hide file size (padding)
184 There is currently a real close mapping from original file size to
185 stored file size. Original file size will also be recorded in server
186 logs. Padding could be used to improve this situation.
190 Most Ruby stuff is installed using Gem, so Coquelicot should be one.
194 A Debian package would be nice to spread Coquelicot setups.
196 * Describe more setups
198 Describe how to setup Coquelicot with mod_passenger, Mongrel and
204 Files are stored in the directory specified by the 'depot_path'
207 The format is the following:
211 Salt: <8 bytes stored as Base64>
212 Expire-at: <expiration time in seconds since epoch>
216 Encryption is done using OpenSSL. Cipher is AES-256-CBC with key and IV
217 created using the pbkdf2_hmac_sha1() implementation of PKCS5. The later
218 is fed using the former 'Salt' and the given passphrase.
220 Once decrypted, content has the following format:
223 Created-at: <upload time in seconds since epoch>
224 Filename: "<original file name>"
225 Content-Type: "<MIME type>"
226 Length: <file length is bytes>
227 One-time-only: <true|false>
229 <original bytes forming the file content>
231 Headers must be parseable using the YAML standard.
233 File are truncated to zero length when they are "expired".
235 In order to map download URLs to file name, a simple text file ".links"
236 is used. It contains a line for each file in the form:
238 <URL name> <file name>
240 Authentication Mechanisms
241 -------------------------
243 It is possible to authenticate users against your own common authentication
246 Such an authentication mechanism needs to provide the following 3 files,
247 with the following responsabilities:
249 * `lib/coquelicot/auth/<METHOD>.rb`:
251 A module implementing the actual authentication. This module must
252 implement one method called `authenticate` which will get all the
253 parameters as an argument. To simplify your interaction with the
254 field `upload_token`, that might be serialized as json, we
255 deserialize it prior to passing it to the `authenticate` method.
257 * `public/javascripts/coquelicot.auth.<METHOD>.js:`
259 We expect 2 javascript methods in that file:
261 - `authenticationData()`: returns a hash of all the necessary data
262 to authenticate on the app side.
263 - `authenticationFocus()`: set the focus on the first authentication
266 * `views/auth/<METHOD>.haml`:
268 Render the necessary form fields that will be used for authentication.
270 The authentication method can be set in the application settings
271 including mandatory options for this method.
276 Coquelicot © 2010-2012 potager.org <jardiniers@potager.org>
277 © 2011 mh / immerda.ch <mh+coquelicot@immerda.ch>
279 Coquelicot is distributed under the GNU Affero General Public License
280 version 3. See LICENSE for details.