diff options
| author | Mia Herkt <mia@0x0.st> | 2022-11-30 01:42:49 +0100 |
|---|---|---|
| committer | Mia Herkt <mia@0x0.st> | 2022-11-30 02:19:29 +0100 |
| commit | a182b6199b7f55eeb573dccd6ce7926c40043680 (patch) | |
| tree | 3c4faa600e40ab15befd731a085630c5b579dcf0 /templates | |
| parent | eb0b1d2f6992740e3b09bf383d8c0fa442faca55 (diff) | |
Allow management operations like deleting files
This introduces the X-Token header field in the response of newly
uploaded files as a simple way for users to manage their own files.
It does not need to be particularly secure.
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/401.html | 2 | ||||
| -rw-r--r-- | templates/index.html | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/templates/401.html b/templates/401.html new file mode 100644 index 0000000..672c7e4 --- /dev/null +++ b/templates/401.html @@ -0,0 +1,2 @@ +rm: cannot remove '{{ request.path.split("/")[1] }}': Permission denied + diff --git a/templates/index.html b/templates/index.html index 6f84f59..f315daf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,6 +20,11 @@ OR by setting "expires" to a timestamp in epoch milliseconds Expired files won't be removed immediately, but will be removed as part of the next purge. +Whenever a file that does not already exist or has expired is uploaded, +the HTTP response header includes an X-Token field. You can use this +to delete the file immediately: + curl -Ftoken=token_here -Fdelete= {{ fhost_url }}/abc.txt + {% set max_size = config["MAX_CONTENT_LENGTH"]|filesizeformat(True) %} Maximum file size: {{ max_size }} Not allowed: {{ config["FHOST_MIME_BLACKLIST"]|join(", ") }} |
