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
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).
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
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.
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).
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
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
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>
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>