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.
17 * Support for different authentication methods
19 It is possible to integrate your own authentication mechanisms. Such a
20 mechanism, needs to implement a single method and provide some JS, as well
21 as some template partial to render the common fields. For more information
22 have a look at the notes below.
24 * Simplepass mechanism: Uploading a file is protected by a common password
26 In order to prevent random Internet users to eat bandwidth and disk
27 space, uploading a file for sharing is protected by a common
30 * IMAP mechanism: Uploading is protected by an imap login
32 As a protection mechanism we can enable login via imap credentials. The user
33 will be asked to provide her imap credentials and we will perform an imap
34 login in order to authenticate the user.
36 * Mandatory expiration
38 When uploading, a time limit has to be specified. The file will be
39 unavailable once this limit has been reached.
41 During a configurable period of time, trying to download the file
42 will return a page saying "too late" instead of "not found".
44 * Support for one-time download
46 An user might want to allow exactly _one_ download of a file,
47 to more closely replace an email attachment. The file will be removed after
48 the first complete download and concurrent download are prevented.
52 If the web server tracks upload progress, users having javascript
53 enabled will see a nice progress bar during the file upload.
57 The application works fine without javascript or CSS.
59 * Download URL are hand-writing compatible
61 URLs generated to download files uses the Base32 character set. This
62 set is specifically designed to overcome misread of 'l', '1', '0' and
63 'O' characters. Coquelicot will automatically convert case and
64 ambiguous characters to facilitate URL exchanges through
67 * Files are stored encrypted on the server
69 While being uploaded, files are written to the disk using symmetric
70 encryption. The encryption key is _not_ stored directly by
71 Coquelicot. It is either generated randomly and given as part of the
72 download URL, or specified by the uploader.
74 * Download can be protected by a password
76 When uploading, a password can be specified which will be used as
77 the encryption key. In order to download the file, the password
78 must be entered through in a POST'ed form, preventing the password
79 from appearing in the server logs.
81 * Files are stored with a random name
83 To prevent disclosure of the shared file name, it is stored encrypted
84 together with the file content. On the server, this encrypted file is
85 stored with a random name.
87 * Download URLs do not reflect stored file names
89 The random names given in download URLs do not map directly to file
90 names on the server. This prevent server logs from giving a direct
91 mapping to the shared files.
93 * File content is zero'ed before removal
95 When a file has expired, it is removed from the server. In order
96 to make it harder to retrieve its content through filesystem
97 analysis, it is filled with zeros first.
102 Coquelicot is written in Ruby using the Sinatra web framework.
104 On Debian, one can fulfill its dependencies by issuing:
106 apt-get install libsinatra-ruby1.8 libopenssl-ruby1.8 \
107 libhaml-ruby1.8 liblockfile-ruby libgettext-ruby1.8 \
110 Then create the translation catalog through:
114 Finally you need to figure out the best way to host a Rack application
115 depending on your setup. *evil grin*
117 Coquelicot is intended to be run on a fully encrypted system and accessible
123 By default Coquelicot is configured to authenticate with the simplepass mechanism
124 and some other reasonable defaults.
125 It is possible to overwrite these settings from a configuration file named
126 settings.yml that will be used if it is present in the conf directory of the
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 password for the
135 simplepass mechanism.
137 * conf/settings-imap.yml: Necessary configuration for the imap authentication
140 You can copy one of these examples to conf/settings.yml and adjust them according
146 To cleanup files automatically when they expired, coquelicot comes with a cleanup script, that does the garbage collection for you. The easiest way is to add ext/coquelicot_gc.rb as a cron job that runs every 5 minutes (or so).
151 Coquelicot test suite is written using RSpec.
153 On Debian, you will need those extra packages:
155 apt-get install librspec-ruby1.8 libhpricot-ruby1.8
157 You will also need the unpackaged gems "timecop" and "rack-test".
159 Then, running the test suite is just a matter of typing:
161 spec test_coquelicot.rb
166 Jyraphe [1] is another free software web file sharing application.
167 Coquelicot provides a migration script to import Jyraphe 0.5 repositories in
168 `tools/migrate_jyraphe.rb`.
170 [1] http://home.gna.org/jyraphe/
175 * More flexible expiration
177 It might be interesting to also offer a calendar for specifying
178 an exact date after which the file will be unavailable.
180 * Hide file size (padding)
182 There is currently a real close mapping from original file size to
183 stored file size. Original file size will also be recorded in server
184 logs. Padding could be used to improve this situation.
188 Most Ruby stuff is installed using Gem, so Coquelicot should be one.
192 A Debian package would be nice to spread Coquelicot setups.
194 * Describe more setups
196 Describe how to setup Coquelicot with mod_passenger, Mongrel and
202 Files are stored in the directory specified by the 'depot_path'
205 The format is the following:
209 Salt: <8 bytes stored as Base64>
210 Expire-at: <expiration time in seconds since epoch>
214 Encryption is done using OpenSSL. Cipher is AES-256-CBC with key and IV
215 created using the pbkdf2_hmac_sha1() implementation of PKCS5. The later
216 is fed using the former 'Salt' and the given passphrase.
218 Once decrypted, content has the following format:
221 Created-at: <upload time in seconds since epoch>
222 Filename: "<original file name>"
223 Content-Type: "<MIME type>"
224 Length: <file length is bytes>
225 One-time-only: <true|false>
227 <original bytes forming the file content>
229 Headers must be parseable using the YAML standard.
231 File are truncated to zero length when they are "expired".
233 In order to map download URLs to file name, a simple text file ".links"
234 is used. It contains a line for each file in the form:
236 <URL name> <file name>
238 Authentication Mechanisms
239 -------------------------
241 It is possible to authenticate users against your own common authentication
244 Such an authentication mechanism needs to provide the following 3 files:
246 * lib/coquelicot/auth/METHOD.rb
247 * public/javascripts/coquelicot.auth.METHOD.js
248 * views/auth/METHOD.haml
250 Their responsibilities are as followed:
252 lib/coquelicot/auth/METHOD.rb:
254 A module implementing the actual authentication. This module must
255 implement one method called `authenticate` which will get all the
256 parameters as an argument. To simplify your interaction with the field
257 `upload_token`, that might be serialized as json, we deserialize it prior
258 to passing it to the `authenticate` method.
260 public/javascripts/coquelicot.auth.METHOD.js:
262 We expect 2 javascript methods in that file:
264 * authenticationData(): Return a hash of all the necessary data to
265 authenticate on the app side.
266 * authenticationFocus(): Set the focus on the first authentication form
269 views/auth/METHOD.haml:
271 Render the necessary form fields that will be used for authentication.
273 The authentication method can be set in the application settings
274 including mandatory options for this method.
279 Coquelicot © 2010 potager.org <jardiniers@potager.org>
280 mh © 2011 immerda.ch <mh+coquelicot@immerda.ch>
282 Coquelicot is distributed under the GNU Affero General Public License
283 version 3. See LICENSE for details.