76 Commits

Author SHA1 Message Date
Jerome Jutteau
17d5977bf8 [TASK] Fix php-cs-fixer errors
Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2022-08-25 00:08:43 +02:00
Jerome Jutteau
bfbbf72959 [TASK] rework user auth
This is a cleaner way to upload files and also prepare for #311.

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2022-08-24 22:09:15 +02:00
Asharas
bb49c0bb63 Fix JIRAFEAU_UPLOAD_PASSWD use.
Variable in help is described as JIRAFEAU_UPLOAD_PASSWD but both tested
and assigned variables have the wrong name.
2022-07-11 14:10:28 +00:00
Oskar Fagerfjäll
3e84a5debe fix spelling mistakes 2022-04-07 07:32:53 +00:00
sam lt
507be5f97b fix 2 minor typos 2022-04-07 07:31:48 +00:00
Edwin Bos
c7f776c8b9 Implement expiry after a fortnight (2 weeks). 2022-04-07 07:30:17 +00:00
Sven Dickert
cea71d42c3 fix #178 "Delete via API does not work" 2021-01-31 17:40:26 +00:00
Jerome Jutteau
beae768cc7 [FEATURE] allow admin to not log users IP in Jirafeau
New option 'store_uploader_ip' set to true by default.

closes #248

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2020-12-30 10:32:04 +01:00
Jerome Jutteau
b6f423726c [TASK] run php-cs-fixer
php-cs-fixer fix --rules=@PSR2 .

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2020-12-05 13:45:04 +01:00
Jerome Jutteau
d598ed64ed [TASK] centralize error reporting config
Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2020-12-05 11:53:40 +01:00
Jerome Jutteau
7caac04de6 [BUGFIX] remove useless ob_flush
- Could generate notices which corrupt files
- Does not seem to be effective

https://www.php.net/manual/en/function.ob-flush.php#109699

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2020-11-20 19:22:08 +01:00
Jerome Jutteau
3426456f3f [BUFIX] fix bash script to send files
Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2020-11-20 18:25:25 +01:00
Jerome Jutteau
78a1c41c40 [TASK] fix email of Jérôme Jutteau
Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2020-11-15 21:44:21 +01:00
Jerome Jutteau
a9ab012f12 [TASK] remove outdated comment
fixes #232
2020-11-15 21:16:30 +01:00
flsabourin
7991901d3f Add Upload password capabilities 2020-06-27 21:17:07 +02:00
Erik Lundin
208418c2e0 Make one time download optional 2020-04-07 22:17:15 +02:00
Jerome Jutteau
ecfc8a70b8 [FEATURE] Support diffent types of file hashing
Useful to avoid hash efforts on large files.

ref #206

Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2019-12-04 22:34:30 +01:00
Jerome Jutteau
5d7c0d3ce0 [TASK] mass renaming md5 -> hash
Signed-off-by: Jerome Jutteau <jerome@jutteau.fr>
2019-12-04 21:33:44 +01:00
Jerome Jutteau
0d312b3c20 [TASK] Refactor server send limitation functions
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2018-05-11 23:57:50 +02:00
Jerome Jutteau
3017f09505 [TASK] clean some spaces and tabs
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2018-05-11 23:57:50 +02:00
Matthieu
d5b85f9c7b [FEATURE] Add encryption support to bash script 2018-02-08 13:26:19 +01:00
Jerome Jutteau
379a0267c2 [TASK] Remove Alias support
Some time ago, this was a weird idea.
It's useless to keep this, it's just dead garbage code.

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2017-09-07 16:06:02 +00:00
Jerome Jutteau
75c98902b1 [BUGFIX] Prevent object ProgressEvent Error
This is done by removing unnecessary usage of web_root URL.

closes #127

Signed-off-by: Jerome Jutteau <j.jutteau@gmail.com>
2017-07-09 14:18:34 +02:00
Marc Hauswirth
f65244fc26 ip or password (see issue 107) 2017-02-23 18:34:20 +01:00
Dan Untenzu
96707e02b8 [FEATURE] Switch to PSR-2
Convert all PHP files to PSR-2, which defined
a basic Coding Style Guide for PHP projects.

Using the awesome friendsofphp/php-cs-fixer tool,
running with the @PSR2 ruleset.

1) script.php (no_spaces_after_function_name, braces)
2) f.php (indentation_type, no_spaces_after_function_name, braces)
3) install.php (indentation_type, function_declaration, elseif, no_spaces_after_function_name, braces)
4) lib/functions.php (no_spaces_inside_parenthesis, method_argument_space, function_declaration, elseif, no_spaces_after_function_name, lowercase_constants, lowercase_keywords, braces, single_blank_line_at_eof)
5) lib/functions.js.php (no_spaces_after_function_name)
6) lib/lang.php (function_declaration, no_spaces_after_function_name, lowercase_constants, no_closing_tag, braces, single_blank_line_at_eof)
7) lib/template/footer.php (braces)
8) lib/config.local.bak.php (method_argument_space, no_spaces_after_function_name, no_closing_tag, single_blank_line_at_eof)
9) lib/config.original.php (no_spaces_after_function_name, no_closing_tag, single_blank_line_at_eof)
0) lib/settings.php (indentation_type, no_spaces_after_function_name, braces)
1) lib/config.local.php (no_spaces_after_function_name, single_blank_line_at_eof)
2) index.php (indentation_type, no_spaces_after_function_name, braces)
3) admin.php (no_spaces_after_function_name, braces)
4) tos.php (no_spaces_after_function_name, no_closing_tag, single_blank_line_at_eof)

Refs #103
2017-02-23 18:34:20 +01:00
Dan Untenzu
bf0a496a10 [FEATURE] Replace all domain depended links
Replace all occurences of "web_root" (domain depended links)
with "JIRAFEAU_ABSPREFIX" (absolute links to the root level).

Links like "https://example.com/foo/functions.js" are replaced
with "/foo/functions.js".

Refs #79
2017-02-23 18:34:19 +01:00
Dan Untenzu
af7e43a4a3 [FEATURE] Move config include into settings file
Move the include of the original and the local
configuration file into the settings file to reduce one
includes in each file, have all settings in one place
and remove unneccessary code from the config file
(which makes it easier to copy and change it).
2017-01-19 19:03:03 +00:00
Dan Untenzu
351d2157ca [BUGFIX] Bash script: return download link to web view
The bash script uses the upload URL to build the download link.

So the user may share different links when using the bash script
or the webform. Besides that does the API page show the same
result for "download links" and "direct links", so the current
list makes no sense to the uploader.

The script should however link to the web view and
offer API commands additionally.

Refs #86
2017-01-19 18:53:35 +00:00
Dan Untenzu
11233d68c6 [BUGFIX] API: Set content type to plain text
Setting the content type to text only will
make some browsers to ignore the utf8 charset.

Set the default content type to "plain text"
to deliver UTF8 and avoid errors while generating
a bash script with special characters.
2017-01-19 18:53:35 +00:00
Dan Untenzu
7dd194ef30 [FEATURE] Bash script: Enhance help and add version
Enhance the help and show all available options in
a common structure.
Move description of available options to one place.

Also add the version of the Jirafeau version which
generated the bash script. This way a user may
find out about changes (because his script was
generated with Jirafeau 1.1.2, but the current version
on the server may be 3.2.5 already).
2017-01-19 18:53:35 +00:00
Jerome Jutteau
0f7a80a504 Fix missing quarter in possible values
Signed-off-by: Jerome Jutteau <j.jutteau@gmail.com>
2017-01-13 18:33:40 +00:00
Dan Untenzu
28606cf6b8 [FEATURE] Add »quarter« expiration time
Add »quarter« (3 x 1 Month = 90 days) as available expiration time.

This option is disabled by default.

Refs #87
2017-01-13 18:00:33 +00:00
Dan Untenzu
dfa4d53376 [FEATURE] Set default expiration time in config
Enable the admin to set a default expiration time
in the configuration time. This way the upload form
may offer "hour", "day", "month" as available expiration
times and "day" is preselected.

Default in the original configuration is "month".

Refs #57
2017-01-13 17:48:19 +00:00
Dan Untenzu
a68b1acc7e [FEATURE] Streamline default expiration date
The bash script sets the expiration date to "none"
by default. The web form has "month" as default however.

Streamline the default expiration date and set the bash
to month as well.

This also avoids an error if the bash script is run
for the first time ever with default settings, since
the expiration time "none" is not allowed then.

Refs #85
2017-01-13 17:47:15 +00:00
François Boulogne
43ad1d1e82 Add link title + direct download link 2016-03-01 21:45:14 +01:00
François Boulogne
b02ef679e1 Add more informative error codes 2016-01-17 21:14:56 -05:00
François Boulogne
53f707de7e Enhance information about API 2015-12-25 17:21:49 -05:00
Jerome Jutteau
65a2f5a4f5 add a sleep() when a bad password is provided 2015-11-13 21:57:49 +01:00
Spanti Nicola (RyDroid)
60530d95cc Minor changes to some PHP files 2015-07-11 16:24:31 +02:00
Jerome Jutteau
17a39eda25 script.php: fix typo
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-07-07 00:56:58 +02:00
Jerome Jutteau
a7fb5680f6 remove scripting interface documentation
This will reduce translation work and avoid out of date documentation.
This first commit updates translation template.
Will still needt to remove translation from other files.

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-07-07 00:10:28 +02:00
Jerome Jutteau
d98c495abf add an alias system to the API.
This alias system permits to create an "alias" to an uploaded file.
This permits to upload some new content and update the alias to the new
content.

This will permits to implement a lot of services, for example:
- Storing a live chat between two people
- Update a list of files
- Put a whole website and update it

A few notes:

- An alias MUST point to an existing upload at his creation or update.
- Alias are not protected against reading but are protected against updates
  and deletion using a password. The destination of the alias can still be
  protected by a password.
- Alias can be updated to change it's target and/or change the password.
- Alias names and passwords must be between 8 and 32 characters.

Some examples:

- Create an alias:

curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     -F "destination=13dA8apU" \
     -F "password=my-very-secret-password" \
     http://my-host/jirafeau/script.php?alias_create=1
=> OK

- Get an alias

curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     http://my-host/jirafeau/script.php?alias_get=1
=> 13dA8apU

- Update an alias:
curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     -F "destination=2Ab6f17o" \
     -F "password=my-new-password" \
     http://my-host/jirafeau/script.php?alias_update=1
=> OK

- Access to alias using the web interface, let's go to:
http://couak.net/jirafeau-dev/f.php?h=my-awsome-alias

- Delete an alias:
curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     -F "password=my-new-password" \
     http://my-host/jirafeau/script.php?alias_delete=1
=> OK

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-07-06 23:54:04 +02:00
Jerome Jutteau
d9647e1afe manage visitor IP behind reverse proxies, refs #36
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-05-07 12:50:04 +02:00
Jerome Jutteau
364d1c4437 add optional IP authentication for uploaders
closes #34

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-04-27 20:10:23 +02:00
Julien Malik
4907042203 typo : transfert / transfer 2015-03-22 23:59:36 +01:00
Julien Malik
63719dc2b2 typo : transfert / transfer 2015-03-22 23:58:45 +01:00
Julien Malik
9ec4f08e55 typo : transfert / transfer 2015-03-22 23:57:11 +01:00
Julien Malik
fcf9eb2998 typo : Get a generated scripts/Get a generated script 2015-03-22 23:52:34 +01:00
Julien Malik
652b90a655 typo : succeded/succeeded 2015-03-22 23:51:51 +01:00
Julien Malik
8b600187ed fix typo : lenght/length 2015-03-22 22:15:31 +01:00