7 years agowhitespaces
Lunar [Wed, 13 Mar 2013 17:09:48 +0000 (18:09 +0100)]

7 years agocope with Sinatra more aggressively trying to guess Content-Type
Lunar [Wed, 13 Mar 2013 17:43:44 +0000 (18:43 +0100)]
cope with Sinatra more aggressively trying to guess Content-Type

It looks like recent Sinatra are now trying to guess Content-Type more
aggressively when using attachment. So we now set Content-Length and
Content-Type before calling Sinatra's methods in Application#send_stored_file.

7 years agostop recommending to use bundler --binstubs
Lunar [Wed, 13 Mar 2013 17:05:54 +0000 (18:05 +0100)]
stop recommending to use bundler --binstubs

As this actually overwrites bin/coquelicot and thus prevents the
software to work properly, it is a pretty bad idea.

7 years agofix app not starting when using Ruby 1.8
Lunar [Wed, 13 Mar 2013 17:00:52 +0000 (18:00 +0100)]
fix app not starting when using Ruby 1.8

It looks like wrapping the application inside a lambda is not supported when
using Ruby 1.8. So we skip the "half-close" monkeypatch when using something
before Ruby 1.9 and build the Rack application directly.

7 years agoadd a create_archive rake task to create source tarball
Lunar [Wed, 13 Mar 2013 15:02:35 +0000 (16:02 +0100)]
add a create_archive rake task to create source tarball

7 years agomention Coquelicot version in a meta generator header
Lunar [Wed, 13 Mar 2013 15:02:11 +0000 (16:02 +0100)]
mention Coquelicot version in a meta generator header

7 years agoadd TODO entry about using better encryption
Lunar [Wed, 13 Mar 2013 15:01:50 +0000 (16:01 +0100)]
add TODO entry about using better encryption

7 years agorephrase README section about the "download password" feature
Lunar [Wed, 13 Mar 2013 15:01:26 +0000 (16:01 +0100)]
rephrase README section about the "download password" feature

7 years agodo not include .gitignore, .placeholder files and coquelicot.git symlink in gem
Lunar [Wed, 13 Mar 2013 14:57:52 +0000 (15:57 +0100)]
do not include .gitignore, .placeholder files and coquelicot.git symlink in gem

7 years agoexplicitly add rake to development dependencies
Lunar [Wed, 13 Mar 2013 11:58:59 +0000 (12:58 +0100)]
explicitly add rake to development dependencies

7 years agobe more explicit when data collection and download passwords
Lunar [Wed, 13 Mar 2013 11:57:51 +0000 (12:57 +0100)]
be more explicit when data collection and download passwords

7 years agoadjust footer position in stylesheet
Lunar [Wed, 13 Mar 2013 11:56:45 +0000 (12:56 +0100)]
adjust footer position in stylesheet

7 years agoupdate TOOD entry in README about gemification
Lunar [Wed, 13 Mar 2013 11:56:33 +0000 (12:56 +0100)]
update TOOD entry in README about gemification

7 years agostop failing when rubygems or bundler cannot be loaded
Lunar [Wed, 13 Mar 2013 11:54:11 +0000 (12:54 +0100)]
stop failing when rubygems or bundler cannot be loaded

When installed from a system-wide package or from a Gem, Coquelicot might not
need Rubygems or Bundler to work. So we now try to load them, but we continue
if we can't, as maybe dependencies have been handled in another way.

7 years agoproperly set paths when using a configuration file
Lunar [Wed, 13 Mar 2013 11:53:30 +0000 (12:53 +0100)]
properly set paths when using a configuration file

7 years agoimplement better AGPL compliance
Lunar [Wed, 13 Mar 2013 11:39:58 +0000 (12:39 +0100)]
implement better AGPL compliance

We now detect if Coquelicot is running from a serviceable Git clone.
When it is the case, we offer to retrieve source using Git as we did

If there is a Git repository which is not usable, a warning is sent to the

In case source can't be provided by Git, we offer a link to an on-the-fly
created Gem that can be downloaded and unpacked. The version number of
the running software is mangled to add the server hostname and a date.

7 years agoadd a link to project homepage in README
Lunar [Wed, 13 Mar 2013 11:38:31 +0000 (12:38 +0100)]
add a link to project homepage in README

7 years agosupport multiple languages for about_text
Lunar [Sat, 9 Mar 2013 12:51:21 +0000 (13:51 +0100)]
support multiple languages for about_text

7 years agoreset session after testing language features in app
Lunar [Sat, 9 Mar 2013 12:26:42 +0000 (13:26 +0100)]
reset session after testing language features in app

The application will set save through a session cookie the preferred language.
In order to not have leaky tests, we now reset the session when we do not use
the default language.

7 years agofactor out 'browser prefers french' spec context
Lunar [Sat, 9 Mar 2013 11:59:13 +0000 (12:59 +0100)]
factor out 'browser prefers french' spec context

7 years agoadd test for the about_text setting
Lunar [Sat, 9 Mar 2013 11:50:39 +0000 (12:50 +0100)]
add test for the about_text setting

7 years agoadd more files to .gitignore
Lunar [Fri, 8 Mar 2013 21:40:20 +0000 (22:40 +0100)]
add more files to .gitignore

7 years agoupdate copyright years
Lunar [Fri, 8 Mar 2013 21:38:43 +0000 (22:38 +0100)]
update copyright years

7 years agomove to an all-in-one command shell interface
Lunar [Fri, 8 Mar 2013 21:21:23 +0000 (22:21 +0100)]
move to an all-in-one command shell interface

Instead of having several different commands, we now move to a model where
there is one `coquelicot` command with several sub-commands.

`coquelicot-collect-garbage` is replaced by `coquelicot gc`.

`coquelicot-migrate-jyraphe` is replaced by coquelicot migrate-jyraphe`.

And two new sub-commands have been added: `start` and `stop`. They respectively
start and stop the Rainbows! web server, properly configured to run Coquelicot.

The configuration file for Coquelicot has gained new settings for web server

 * `pid`: a path to the pid file,
 * `log`: a path to the log file,
 * `listen`: addresses on which requests should be accepted.

All of them are passed unmodified to Rainbows!: they are provided for the
administrator's convenience in order to keep all settings for Coquelicot in a
single configuration file.

Because there is no different environment for development and production,
`show_exceptions` is also mentioned in the default configuration file. Its
default value has been adjusted to false.

7 years agoupdate all remaining dependencies
Lunar [Fri, 8 Mar 2013 18:33:57 +0000 (19:33 +0100)]
update all remaining dependencies

7 years agoupdate to Moneta 0.7 and its new API
Lunar [Fri, 8 Mar 2013 18:32:55 +0000 (19:32 +0100)]
update to Moneta 0.7 and its new API

We explicitly set a dependency on the new version instead of relying on 'upr'
depending on the moneta gem.

7 years agofix wrong removal of files which expired after the gone period
Lunar [Fri, 31 Aug 2012 11:03:22 +0000 (13:03 +0200)]
fix wrong removal of files which expired after the gone period

When expiration period is longer than the gone period, the files are kept
unmodified longer than the actual gone period. Previously, this would
get them erased, a serious bug.

Now we properly skip files that have not yet been erased (and truncated to zero
size) when looking for files that have been kept longer than the gone period.

7 years agodisplay nicer error messages in main app
Lunar [Mon, 9 Apr 2012 12:16:19 +0000 (14:16 +0200)]
display nicer error messages in main app

7 years agowarn users when they generate a download password
Lunar [Mon, 9 Apr 2012 10:51:47 +0000 (12:51 +0200)]
warn users when they generate a download password

7 years agoremove '5 minutes' option in 'available for'
Lunar [Mon, 9 Apr 2012 09:58:29 +0000 (11:58 +0200)]
remove '5 minutes' option in 'available for'

This is way too short for most downloads. For big files, it's even
worse as it is '5 minutes' since the very begining of the upload. That
means that if the upload itself is taking more than 5 minutes, the whole
transfer is useless.

7 years agovarious UI improvements
Lunar [Mon, 9 Apr 2012 09:57:40 +0000 (11:57 +0200)]
various UI improvements

7 years agoproperly i18n'ize Coquelicot::Rack::Upload
Lunar [Wed, 4 Apr 2012 17:02:52 +0000 (19:02 +0200)]
properly i18n'ize Coquelicot::Rack::Upload

7 years agoget an RSpec version with a working --backtrace
Lunar [Sat, 24 Mar 2012 15:32:30 +0000 (16:32 +0100)]
get an RSpec version with a working --backtrace

7 years agointernationalize error_for_empty
Lunar [Fri, 23 Mar 2012 18:35:42 +0000 (19:35 +0100)]
internationalize error_for_empty

7 years agointernationalize error_for_max_length
Lunar [Fri, 23 Mar 2012 18:26:30 +0000 (19:26 +0100)]
internationalize error_for_max_length

7 years agointernationalize Fixnum#as_size
Lunar [Fri, 23 Mar 2012 17:43:35 +0000 (18:43 +0100)]
internationalize Fixnum#as_size

7 years agoupdate and fix french translation
Lunar [Fri, 23 Mar 2012 17:57:21 +0000 (18:57 +0100)]
update and fix french translation

7 years agorefresh PO files
Lunar [Fri, 23 Mar 2012 17:49:16 +0000 (18:49 +0100)]
refresh PO files

7 years agoadd a page to help users understand what Coquelicot does and its limits
Lunar [Fri, 23 Mar 2012 16:01:22 +0000 (17:01 +0100)]
add a page to help users understand what Coquelicot does and its limits

7 years agorefresh PO files
Lunar [Fri, 23 Mar 2012 17:44:46 +0000 (18:44 +0100)]
refresh PO files

7 years agoallow users to select and retain a language
Lunar [Tue, 20 Mar 2012 17:47:19 +0000 (18:47 +0100)]
allow users to select and retain a language

Instead of relying purely on the `Accept-language` header and on an hidden
parameter, we now offer links for users to select one of the supported

This selection is then retained by using Sinatra cookie based sessions.

7 years agoimprove compatibility with Ruby 1.9.1 or later
Lunar [Tue, 20 Mar 2012 11:27:40 +0000 (12:27 +0100)]
improve compatibility with Ruby 1.9.1 or later

7 years agouppercase title in layout
Lunar [Mon, 12 Mar 2012 09:46:37 +0000 (10:46 +0100)]
uppercase title in layout

7 years agorewrite Jyraphe migration system
Lunar [Sun, 4 Mar 2012 10:01:08 +0000 (11:01 +0100)]
rewrite Jyraphe migration system

Instead of the old quickly hacked script, we now have a properly integated,
tested migration system to migrate from Jyraphe installations.

7 years agospec and implement coquelicot-collect-garbage
Lunar [Fri, 9 Mar 2012 14:18:07 +0000 (15:18 +0100)]
spec and implement coquelicot-collect-garbage

It is located in the bin/ directory and replaces the old ext/coquelicot_gc.rb.

7 years agoturn Coquelicot into a gem
Lunar [Fri, 9 Mar 2012 16:24:17 +0000 (17:24 +0100)]
turn Coquelicot into a gem

7 years agoissue a warning when Depot.gc! is unable to read a file
Lunar [Fri, 9 Mar 2012 16:36:22 +0000 (17:36 +0100)]
issue a warning when Depot.gc! is unable to read a file

7 years agoadd helper for specs testing std{out,err}
Lunar [Sat, 10 Mar 2012 10:06:37 +0000 (11:06 +0100)]
add helper for specs testing std{out,err}

7 years agoproperly half-close both sides of the HTTP connection
Lunar [Wed, 29 Feb 2012 21:19:03 +0000 (22:19 +0100)]
properly half-close both sides of the HTTP connection

Half-closing the write part first and draining our input makes sure the client
will properly receive an error message instead of TCP RST (a.k.a. "Connection
reset by peer") when we interrupt it in the middle of a POST request.

7 years agodisplay nicer error messages for POST /upload
Lunar [Tue, 28 Feb 2012 23:20:26 +0000 (00:20 +0100)]
display nicer error messages for POST /upload

We factor out view helpers in Coquelicot::Helpers in order to make them
available from both Coquelicot::Application and Coquelicot::Rack::Upload.

7 years agoalso protect requests other than POST /upload from too much input
Lunar [Tue, 28 Feb 2012 22:40:22 +0000 (23:40 +0100)]
also protect requests other than POST /upload from too much input

7 years agounwrap Upr::InputWrapper to detect a rewindable input
Lunar [Mon, 27 Feb 2012 22:32:50 +0000 (23:32 +0100)]
unwrap Upr::InputWrapper to detect a rewindable input

7 years agosmall cosmetic improvements for progress bar
Lunar [Mon, 27 Feb 2012 22:15:13 +0000 (23:15 +0100)]
small cosmetic improvements for progress bar

7 years agoadd support for upload progress using 'upr' gem
Lunar [Mon, 27 Feb 2012 15:53:21 +0000 (16:53 +0100)]
add support for upload progress using 'upr' gem

7 years agoallow to limit file size through the max_file_size setting
Lunar [Tue, 28 Feb 2012 18:26:47 +0000 (19:26 +0100)]
allow to limit file size through the max_file_size setting

7 years agoproperly handle large file uploads
Lunar [Sun, 26 Feb 2012 19:44:43 +0000 (20:44 +0100)]
properly handle large file uploads

Previously we were using Sinatra::Request to process file uploads. This class
derives from Rack::Request which creates a temporary file for each file
appearing in a POST request. This can be seen as a privacy breach, as it means
uploaded files were first written in clear text before being stored encrypted.
This can be mitigated by storing the tempfile on a "ramdisk", but then, memory
can pretty quick be a limit to the maximum uploaded file size.

But wait, there's more: Rack specify that `rack.input` must be a
seakable/rewindable IO-like object. In order to implement that, Rack webserver
will either buffer the input in memory (Webrick) or in a temporary file
(Thin, Passenger or Mongrel). So in most cases we had not one, but at least two
temporary files for each uploads.

In order to properly process uploaded file content as it arrives, we 1. switch
to use the "Rainbows!" webserver and 2. handle the POST request directly.

Rainbows! has a unique feature of being able to provide a non-buffered input.
While this breaks Rack specification, our own dedicated handler is written
specifically with this in mind.

Handling the POST request as its input flows requires to be careful with the
order in which fields appear in the `<form/>` tag (HTML specification specify
that they will be sent in that particular order). As we want to know all
options before writing the StoredFile, we need to have the `<input
type="file"/>` field at the end of our form. Along the same lines, we ensure
in `coquelicot.js` that hidden fields for authentication values are laid at the
verify begining of the upload `<form/>`.

Coquelicot::Rack::MultipartParser offers a generic interface to parse
`multipart/form-data` requests. It offers a simple DSL to specify which field
is expected, and to run specific block when they shows up.

Coquelicot::Rack::Upload replaces our old `post '/upload'` method. It handles
the request as a bare Rack middleware to be laid on top of the stack. Its code
borrows part of Sinatra's internals in order to get consistent coding

Huge kudos to Eric Wong for Rainbows! and Daniel Abrahamsson for
multipart-parser which both made this possible.

7 years agoenable Sinatra request logging in development config
Lunar [Sun, 18 Mar 2012 12:57:27 +0000 (13:57 +0100)]
enable Sinatra request logging in development config

7 years agoimplement file format 2.0
Lunar [Tue, 6 Mar 2012 23:30:26 +0000 (00:30 +0100)]
implement file format 2.0

We want to be able to write files for which we will not be sure of the size
before all its content has been written. Easiest way to achieve this is two
have two files instead of one: the first for the encrypted file content, and
the second with metadata (in clear and encrypted, as before).

StoredFile is still able to read files with format 1.0. New files will be
written using the 2.0 format.

7 years agodisplay the README in 'get /README'
Lunar [Tue, 28 Feb 2012 15:15:19 +0000 (16:15 +0100)]
display the README in 'get /README'

We introduce a dependency on maruku to parse Markdown and display the README.

This new (trivial) feature is spec'd in the new `spec/coquelicot/app_sec.rb`
which is the canonical file location.

We also introduce a new dependency on Capybara: its interface is so much nicer,
and ideally, most of the specs in `spec/coquelicot_spec.rb` will be rewriten
to use it instead of Rack::Test::Methods and Hpricot.

7 years agoimprove README
Lunar [Tue, 28 Feb 2012 15:14:11 +0000 (16:14 +0100)]
improve README

8 years agospec for different reference StoredFile with a new shiny helper
Lunar [Tue, 6 Mar 2012 21:37:32 +0000 (22:37 +0100)]
spec for different reference StoredFile with a new shiny helper

8 years agoalso return BadKey when OpenSSL raises a CipherError
Lunar [Sat, 17 Mar 2012 11:29:37 +0000 (12:29 +0100)]
also return BadKey when OpenSSL raises a CipherError

8 years agofactor out shared context for specs which needs a depot
Lunar [Mon, 12 Mar 2012 15:42:06 +0000 (16:42 +0100)]
factor out shared context for specs which needs a depot

8 years agoremove links in Depot#gc! when there is a link but no associated file
Lunar [Tue, 6 Mar 2012 16:03:47 +0000 (17:03 +0100)]
remove links in Depot#gc! when there is a link but no associated file

8 years agocosmetic rewrite of Depot#read_link
Lunar [Tue, 6 Mar 2012 15:27:10 +0000 (16:27 +0100)]
cosmetic rewrite of Depot#read_link

8 years agospecify and implement behaviour of Depot#get_file when there is a link with no matchi...
Lunar [Tue, 6 Mar 2012 16:03:00 +0000 (17:03 +0100)]
specify and implement behaviour of Depot#get_file when there is a link with no matching file

We modify callers in Coquelicot::Application to match the new behaviour.

8 years agospecify and implement behaviour of Depot#file_exists? when there is a link with no...
Lunar [Tue, 6 Mar 2012 15:41:51 +0000 (16:41 +0100)]
specify and implement behaviour of Depot#file_exists? when there is a link with no matching file

8 years agoproperly handle the case where we generate the same name than an already existing...
Lunar [Tue, 6 Mar 2012 15:23:11 +0000 (16:23 +0100)]
properly handle the case where we generate the same name than an already existing link

8 years agoadd some specs for Coquelicot::Depot
Lunar [Mon, 5 Mar 2012 18:25:23 +0000 (19:25 +0100)]
add some specs for Coquelicot::Depot

8 years agoproperly empty and remove files when Depot#gc! has not been called for a while
Lunar [Tue, 6 Mar 2012 16:05:34 +0000 (17:05 +0100)]
properly empty and remove files when Depot#gc! has not been called for a while

8 years agoadd Depot#size to get current files count
Lunar [Sat, 17 Mar 2012 10:41:41 +0000 (11:41 +0100)]
add Depot#size to get current files count

8 years agoDepot#files now returns an empty array for empty depots
Lunar [Tue, 28 Feb 2012 11:21:31 +0000 (12:21 +0100)]
Depot#files now returns an empty array for empty depots

In a brand new depot, there will not be any `.links` file. Instead of raising
an error, let's return an empty array instead, better reflecting the current
state of the depot.

8 years agoensure that StoredFile is providing correct content for small files
Lunar [Tue, 6 Mar 2012 10:11:31 +0000 (11:11 +0100)]
ensure that StoredFile is providing correct content for small files

8 years agoproperly delete file in case of errors in StoredFile.create
Lunar [Tue, 6 Mar 2012 16:14:29 +0000 (17:14 +0100)]
properly delete file in case of errors in StoredFile.create

This means that Depot.add_file does not have to care about removing leftover

8 years agodisplay 'not found' when a bad password is given in URL
Lunar [Fri, 16 Mar 2012 19:13:17 +0000 (20:13 +0100)]
display 'not found' when a bad password is given in URL

8 years agoraise BadKey in StoredFile#each if file has been opened without a password
Lunar [Tue, 6 Mar 2012 09:50:45 +0000 (10:50 +0100)]
raise BadKey in StoredFile#each if file has been opened without a password

8 years agouse File::EXCL|File::CREAT instead of locking when adding a new file to the depot
Lunar [Mon, 5 Mar 2012 16:31:12 +0000 (17:31 +0100)]
use File::EXCL|File::CREAT instead of locking when adding a new file to the depot

8 years agoadd specs for StoredFile
Lunar [Mon, 5 Mar 2012 15:52:36 +0000 (16:52 +0100)]
add specs for StoredFile

8 years agofactor out spec initialization in spec_helper
Lunar [Sat, 25 Feb 2012 09:17:53 +0000 (10:17 +0100)]
factor out spec initialization in spec_helper

This is an usual convention on how to use RSpec.

8 years agoimprove parsing of encrypted meta data for small files
Lunar [Sun, 4 Mar 2012 09:43:43 +0000 (10:43 +0100)]
improve parsing of encrypted meta data for small files

8 years agosmall style adjustments in StoredFile
Lunar [Sat, 17 Mar 2012 10:37:27 +0000 (11:37 +0100)]
small style adjustments in StoredFile

8 years agochange StoredFile.create interface
Lunar [Sat, 17 Mar 2012 10:26:17 +0000 (11:26 +0100)]
change StoredFile.create interface

What matters is actually how the caller will feed the file content, and not
where or how the StoredFile is written.

8 years agodo not hardcode key and IV length in StoredFile.get_cipher
Lunar [Mon, 5 Mar 2012 13:56:07 +0000 (14:56 +0100)]
do not hardcode key and IV length in StoredFile.get_cipher

8 years agoinstall 'sass' gem explicitly
Lunar [Tue, 28 Feb 2012 11:26:00 +0000 (12:26 +0100)]
install 'sass' gem explicitly

As said by Haml warning:

  Sass is in the process of being separated from Haml,
  and will no longer be bundled at all in Haml 3.2.0.
  Please install the 'sass' gem if you want to use Sass.

8 years agoremove useless url setting and base_href helper
Lunar [Tue, 28 Feb 2012 23:27:53 +0000 (00:27 +0100)]
remove useless url setting and base_href helper

Sinatra offers an `uri` helper which is there to properly compute
URLs for the application. We now use it instead of computing the `base_href` by
hand. We also remove the `url` setting as system administrators should properly
configure their `` and proxy to allow Sinatra to compute the right URL
for the application.

8 years agoMerge remote branch 'nadir/translations/de'
Lunar [Fri, 24 Feb 2012 20:52:50 +0000 (21:52 +0100)]
Merge remote branch 'nadir/translations/de'

8 years agoupdate main copyright in layout
Lunar [Fri, 24 Feb 2012 20:49:10 +0000 (21:49 +0100)]
update main copyright in layout

8 years agoUpdated german translation
Jake Santee [Fri, 24 Feb 2012 20:48:58 +0000 (21:48 +0100)]
Updated german translation

8 years agofix redirect after successful upload
Lunar [Fri, 24 Feb 2012 20:44:29 +0000 (21:44 +0100)]
fix redirect after successful upload

8 years agoimprove some strings after native speakers review
Lunar [Fri, 24 Feb 2012 20:13:23 +0000 (21:13 +0100)]
improve some strings after native speakers review

Many thanks to them!

8 years agoremove obsolete cruft in migrate_jyraphe
Lunar [Fri, 24 Feb 2012 19:37:46 +0000 (20:37 +0100)]
remove obsolete cruft in migrate_jyraphe

8 years agoimprove settings documentation
Lunar [Fri, 24 Feb 2012 19:33:16 +0000 (20:33 +0100)]
improve settings documentation

8 years agofix extra '/' appearing when using base_href
Lunar [Fri, 24 Feb 2012 19:13:00 +0000 (20:13 +0100)]
fix extra '/' appearing when using base_href

8 years agospec and document the 'url' setting
Lunar [Fri, 24 Feb 2012 18:55:03 +0000 (19:55 +0100)]
spec and document the 'url' setting

8 years agoMerge remote branch 'sarava/master'
Lunar [Fri, 24 Feb 2012 18:44:12 +0000 (19:44 +0100)]
Merge remote branch 'sarava/master'

8 years agoadd license headers on source files
Lunar [Fri, 24 Feb 2012 18:29:28 +0000 (19:29 +0100)]
add license headers on source files

8 years agoprevent password generator link from moving to another page
Lunar [Fri, 24 Feb 2012 18:01:41 +0000 (19:01 +0100)]
prevent password generator link from moving to another page

8 years agoproperly separate functions in javascript
Lunar [Fri, 24 Feb 2012 17:58:57 +0000 (18:58 +0100)]
properly separate functions in javascript

8 years agocosmetic improvements
Lunar [Fri, 24 Feb 2012 17:48:11 +0000 (18:48 +0100)]
cosmetic improvements

8 years agoswitch to FastGettext for translations
Lunar [Fri, 24 Feb 2012 16:25:20 +0000 (17:25 +0100)]
switch to FastGettext for translations

Using the 'po' backend of FastGettext gets us rid of having to manually build
'.mo' files upon installation.