aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_file_share.lua
Commit message (Collapse)AuthorAgeFilesLines
...
* mod_http_file_share: Report number of items in caches to statsmanagerKim Alvefur2021-03-281-0/+8
| | | | | | This is neat, O(1) reporting, why don't we do this everywhere? Gives you an idea of how much stuff is in the caches, which may help inform decisions on whether the size is appropriate.
* mod_http_file_share: Skip removal of nothingKim Alvefur2021-02-261-5/+9
| | | | | In case none of the expired files could be deleted then it's a waste of an API call to try to remove any of the metadata at all.
* mod_http_file_share: Remove correct entries when not all expired files were ↵Kim Alvefur2021-02-251-10/+20
| | | | | | | | | | | | | | | | | | | | | | | deleted If any of the expired files could not be deleted then we should not forget about that, we should complain loudly and try again. The code got this backwards and would have removed only the entries referring to still existing files. Test procedure: 1. Upload a file 2. chown root:root http_file_share/ 3. In uploads.list, decrease 'when' enough to ensure expiry 4. Reload mod_http_file_share 5. Should see an error in the logs about failure to delete the file 6. Should see that the metadata in uploads.list is still there 7. chown http_file_share/ back to the previous owner 8. Reload mod_http_file_share 9. Should see logs about successful removal of expired file 10. Should see that the metadata in uploads.list is gone 11. Should see that the file was deleted
* mod_http_file_share: Fix traceback on missing file-typeKim Alvefur2021-02-241-1/+4
| | | | attempt to index a nil value (local 'filetype') casued by the :gsub call
* mod_http_file_share: Allow credentials via CORS (needed for auth token)Kim Alvefur2021-02-231-0/+3
|
* mod_http_file_share: Return a message from the base URLKim Alvefur2021-02-211-0/+9
|
* mod_http_file_share: Prevent attempt to upload again after completionKim Alvefur2021-02-131-0/+9
|
* mod_http_file_share: Support sending 100 ContinueKim Alvefur2021-02-131-0/+3
| | | | | E.g. curl will ask for this when sending large uploads. Removes a delay while it waits for an error or go-agead.
* mod_http_file_share: Collect cache hit/miss statistics for downloadsKim Alvefur2021-02-021-1/+5
|
* mod_http_file_share: Measure how long it takes to prune expired filesKim Alvefur2021-02-021-0/+3
|
* mod_http_file_share: Collect statistics of files uploadedKim Alvefur2021-02-021-0/+3
|
* mod_http_file_share: Reorder argumentsKim Alvefur2021-01-311-2/+2
| | | | | 'filetype' is optional, so having it last seems sensible. 'slot' is pretty important, so moving it earlier seems sensible.
* mod_http_file_share: Update cached value while it is reasonably freshKim Alvefur2021-01-311-5/+10
| | | | | This should ensure that cache entries until the oldest file that counted to the last 24h becomes older than 24h.
* mod_http_file_share: Cache quotas to avoid hitting storageKim Alvefur2021-01-311-2/+12
|
* mod_http_file_share: Split out some variables for later reuseKim Alvefur2021-01-311-1/+3
|
* mod_http_file_share: Add support for daily upload quotas.Kim Alvefur2021-01-311-0/+19
| | | | | Daily instead of total quotas, should be more efficient to calculate. Still O(n), but a smaller n. Less affected by total retention period.
* mod_http_file_share: Add missing semicolonKim Alvefur2021-01-311-1/+1
| | | | | Last comma or semicolon isn't required but makes the diffs nicer once you add another item after it.
* mod_http_file_share: Clarify log messageKim Alvefur2021-01-301-1/+1
| | | | | No expired ... what? Could be inferred from the module logging it, but better to be explicit.
* mod_http_file_share: Indicate missing token via WWW-Authenticate headerKim Alvefur2021-01-291-0/+1
|
* mod_http_file_share: Clarify message about missing Authorization headerKim Alvefur2021-01-291-1/+1
|
* mod_http_file_share: Allow started uploads to complete after token expiredKim Alvefur2021-01-281-1/+1
| | | | | | | Otherwise uploads taking longer than 5 minutes would be rejected on completion, and that's probably annoying. Thanks jonas’
* mod_http_file_share: Serve configurable set of safe mime types inline ↵Kim Alvefur2021-01-281-1/+8
| | | | | | (thanks jonas’) Otherwise people complain about browser 'Save as' dialog.
* mod_http_file_share: Cache file metadataKim Alvefur2021-01-281-9/+38
| | | | | | | | For faster access by avoiding archive ID. No benchmarks were harmed in the making of this commit. ... no benchmarks were performed at all.
* mod_http_file_share: Extract all file properties into variables earlierKim Alvefur2021-01-281-4/+12
| | | | | A step towards adding caching, which will unpack into the same variables.
* mod_http_file_share: Fix the obligatory misplaced closing bracket (thanks ↵Kim Alvefur2021-01-271-1/+1
| | | | scansion)
* mod_http_file_share: Insert pauses to avoid blocknig for long periodsKim Alvefur2021-01-271-0/+8
| | | | Similar to the mod_mam cleanup job
* mod_http_file_share: Add support for removing old files (default 2 weeks)Kim Alvefur2021-01-271-1/+59
|
* mod_http_file_share: More security headersKim Alvefur2021-01-271-2/+4
|
* mod_http_file_share: Strip authorization type prefix a bit earlierKim Alvefur2021-01-271-2/+5
|
* mod_http_file_share: Factor out function for generating full filenameKim Alvefur2021-01-271-2/+6
|
* mod_http_file_share: Use '.bin' file extensionKim Alvefur2021-01-271-2/+3
| | | | | Distinct from '.dat' used by datamanager / internal stortage for Lua object storage so that they can't easily be loaded by accident that way.
* mod_http_file_share: Validate file size early in HTTP PUT requestKim Alvefur2021-01-271-0/+5
|
* mod_http_file_share: Move Authorization type stringKim Alvefur2021-01-271-2/+2
| | | | It belongs with the header more than the token itself
* mod_http_file_share: Add some loggingKim Alvefur2021-01-271-0/+14
|
* mod_http_file_share: Handle content-type being optionalKim Alvefur2021-01-271-2/+2
|
* mod_http_file_share: Reject invalid file sizesKim Alvefur2021-01-271-0/+4
|
* mod_http_file_share: Fix name of max-file-size tagKim Alvefur2021-01-271-1/+1
|
* mod_http_file_share: Expand registry to fix extra tagKim Alvefur2021-01-271-5/+6
| | | | | Error registry compact format doesn't support extra.tag so needs to be the more verbose format
* mod_http_file_share: Verify final file size on completion of uploadKim Alvefur2021-01-271-0/+5
|
* mod_http_file_share: Add file type filterKim Alvefur2021-01-261-0/+6
| | | | | Unlike mod_http_upload, this can't be bypassed by uploading with a different file extension.
* mod_http_file_share: Add file size limit (default 10M)Kim Alvefur2021-01-261-0/+13
|
* mod_http_file_share: Validate that filename does not contain '/'Kim Alvefur2021-01-261-0/+6
|
* mod_http_file_share: Return proper error if unauthorizedKim Alvefur2021-01-261-1/+5
|
* mod_http_file_share: Add basic access controlKim Alvefur2021-01-261-1/+7
| | | | Partly lifted from mod_external_services
* mod_http_file_share: Add support for external file upload serviceKim Alvefur2021-01-261-2/+8
| | | | | PUT /upload/:slot/:filename Authorization: Bearer JWT{ uploader, filename, filesize, filetype, exp }
* mod_http_file_share: Let's write another XEP-0363 implementationKim Alvefur2021-01-261-0/+191
This variant is meant to improve upon mod_http_upload in some ways: * Handle files much of arbitrary size efficiently * Allow GET and PUT URLs to be different * Remember Content-Type sent by client * Avoid dependency on mod_http_files * Built-in way to delegate storage to another httpd