Commit Graph

27 Commits

Author SHA1 Message Date
Travis Burtrum c82f00c288 Add support for uploading/downloading to/from subdirectories 2015-08-27 00:41:31 -04:00
Lars Bensmann d7badc97fe Allow bare jids (users) in whitelist
Allow more fine-grained control via the whitelist feature.
2015-08-04 14:40:48 +02:00
Daniel Gultsch 8c5cca8a0a bugfix 2015-07-29 01:02:24 +02:00
Daniel Gultsch ceaa132978 fixed typo 2015-07-28 22:17:28 +02:00
Daniel Gultsch 48de2ee744 use new config value names in server 2015-07-28 22:16:32 +02:00
evildad 62e78d3061 Update server.py 2015-07-28 21:48:00 +02:00
Lars Bensmann f4b4284536 Add expiry and user quotas
Expiry and user quotas are controlled by four config options:

```expire_interval``` determines how often (in seconds) files should be
deleted. As every expiry run needs to check all uploaded files of all
users this should not be set too small.

Files older than ```expire_maxage``` (in seconds) will be deleted by an
expiry run. Set this to ```0``` to disable deletions based on file age.

After an expiry run at most ```user_quota_soft``` space (in bytes) will be
occupied per user. The oldest files will be deleted first until the occupied
space is less than ```user_quota_soft```. Set this to ```0``` to disable
file deletions based on a users occupied space.

```user_quota_hard``` sets a hard limit how much space (in bytes) a user
may occupy. If an upload would make his files exceed this size it will be
rejected. This setting is not dependend on ```expire_interval```. Set
this to ```0``` to disable upload rejection based on occupied space.

```expire_maxage``` and ```user_quota_soft``` depend on ```expire_interval```.

```user_quota_hard``` is honoured even without expiry runs. But some kind
of expiry is recommended otherwise a user will not be able to upload
anymore files once his hard quota is reached.

The difference between ```user_quota_hard``` and ```user_quota_soft```
determines how much a user may upload per ```expire_interval```.
2015-07-28 00:07:07 +02:00
Lars Bensmann 5ede0f9a7a Just send Content-disposition: attachment-Header if content is no image
Content-disposition: attachment prevents most code to be executed in the
browser (Java being an exception), but this is not needed for images and
makes viewing images in clients that don't show the pictures inline even
more complicated.

(Also this PR removes unused imports).
2015-07-26 20:51:18 +02:00
Daniel Gultsch 6d8993145b Merge branch 'master' of github.com:siacs/HttpUploadComponent 2015-07-24 17:48:14 +02:00
Daniel Gultsch 96b39250b2 fixed small files not working 2015-07-24 17:46:32 +02:00
Daniel Gultsch 2678c0d2b8 Merge pull request #16 from SamWhited/head_fix
Don't duplicate HEAD/GET response code
2015-07-23 10:02:20 +02:00
Daniel Gultsch bd4e1e4c5a Merge pull request #15 from SamWhited/mime_types
Set content-type header based on mime-type
2015-07-23 10:01:57 +02:00
Daniel Gultsch db06e3edfc Merge pull request #14 from SamWhited/fix_file_leak
Fix a file handle leak
2015-07-23 10:01:30 +02:00
Sam Whited 5a0566688a Don't duplicate HEAD/GET response code 2015-07-23 00:43:36 -05:00
Sam Whited 63124a3026 Set content-type header based on mime-type
Fixes #7
2015-07-22 22:42:28 -05:00
Sam Whited f397219c27 Fix a file handle leak 2015-07-22 22:21:28 -05:00
Sam Whited 50f0a6fec6 Add proper error for FileNotFoundError in Python 2 2015-07-22 22:10:52 -05:00
Sam Whited f8bc7c6242 Make HTTP address configurable 2015-07-22 01:15:39 -05:00
Lars Bensmann c3b41b2415 Make configfile and logfile configurable via commandline options
Use argparse to parse --config und --logfile so it can be better used from
a startup script.

Add Debian startup-script in contrib/
2015-07-18 14:04:17 +02:00
Daniel Gultsch 8bd4ad6803 optional ssl support (recommended) 2015-07-10 14:28:59 +02:00
Daniel Gultsch c09664797d some security patches and further python 2 compat
Thank you Lars Bensmann
2015-07-09 08:52:48 +02:00
Daniel Gultsch ac12bf5c54 Merge pull request #6 from SamWhited/hashbang
Add a hashbang
2015-07-04 23:36:32 +02:00
Sam Whited 1f66775c81 File handling tweaks
Fix vulnerability where a specially crafted path could lead to the user
accessing things in the root file directory
2015-07-04 16:27:00 -05:00
Sam Whited d917a9eb18 Add a hashbang 2015-07-04 14:41:45 -05:00
Sam Whited 683775d6dd Add a systemd init script 2015-07-04 13:45:27 -05:00
Sam Whited af00bb7562 Add Python 2 support
Add requirements file for reproducible builds
2015-07-04 13:28:52 -05:00
Daniel Gultsch 3b341972b0 inital commit 2015-06-28 11:21:30 +02:00