Kim Alvefur
0a5ac437b9
mod_http_file_share: Fix traceback on missing file-type
...
attempt to index a nil value (local 'filetype') casued by the :gsub call
5 years ago
Kim Alvefur
b01915e81c
mod_http_file_share: Allow credentials via CORS (needed for auth token)
5 years ago
Kim Alvefur
900fe6a1cb
mod_http_file_share: Return a message from the base URL
5 years ago
Kim Alvefur
3151984042
mod_http_file_share: Prevent attempt to upload again after completion
5 years ago
Kim Alvefur
9501c7b976
mod_http_file_share: Support sending 100 Continue
...
E.g. curl will ask for this when sending large uploads. Removes a delay
while it waits for an error or go-agead.
5 years ago
Kim Alvefur
cdbb77ccbf
mod_http_file_share: Collect cache hit/miss statistics for downloads
5 years ago
Kim Alvefur
e45dee37bd
mod_http_file_share: Measure how long it takes to prune expired files
5 years ago
Kim Alvefur
da5cd9c963
mod_http_file_share: Collect statistics of files uploaded
5 years ago
Kim Alvefur
5d9802727b
mod_http_file_share: Reorder arguments
...
'filetype' is optional, so having it last seems sensible.
'slot' is pretty important, so moving it earlier seems sensible.
5 years ago
Kim Alvefur
f5baa83714
mod_http_file_share: Update cached value while it is reasonably fresh
...
This should ensure that cache entries until the oldest file that counted
to the last 24h becomes older than 24h.
5 years ago
Kim Alvefur
864708efb7
mod_http_file_share: Cache quotas to avoid hitting storage
5 years ago
Kim Alvefur
855542e2ca
mod_http_file_share: Split out some variables for later reuse
5 years ago
Kim Alvefur
4d3ffbf0f7
mod_http_file_share: Add support for daily upload quotas.
...
Daily instead of total quotas, should be more efficient to calculate.
Still O(n), but a smaller n. Less affected by total retention period.
5 years ago
Kim Alvefur
b1b3f09a5c
mod_http_file_share: Add missing semicolon
...
Last comma or semicolon isn't required but makes the diffs nicer once
you add another item after it.
5 years ago
Kim Alvefur
1998e74fd4
mod_http_file_share: Clarify log message
...
No expired ... what? Could be inferred from the module logging it, but
better to be explicit.
5 years ago
Kim Alvefur
88ce2f1c94
mod_http_file_share: Indicate missing token via WWW-Authenticate header
5 years ago
Kim Alvefur
610278afa0
mod_http_file_share: Clarify message about missing Authorization header
5 years ago
Kim Alvefur
0289a561e6
mod_http_file_share: Allow started uploads to complete after token expired
...
Otherwise uploads taking longer than 5 minutes would be rejected on
completion, and that's probably annoying.
Thanks jonas’
5 years ago
Kim Alvefur
fab6ebb1e6
mod_http_file_share: Serve configurable set of safe mime types inline (thanks jonas’)
...
Otherwise people complain about browser 'Save as' dialog.
5 years ago
Kim Alvefur
22e4d92ce5
mod_http_file_share: Cache file metadata
...
For faster access by avoiding archive ID.
No benchmarks were harmed in the making of this commit.
... no benchmarks were performed at all.
5 years ago
Kim Alvefur
318d357557
mod_http_file_share: Extract all file properties into variables earlier
...
A step towards adding caching, which will unpack into the same
variables.
5 years ago
Kim Alvefur
217450a727
mod_http_file_share: Fix the obligatory misplaced closing bracket (thanks scansion)
5 years ago
Kim Alvefur
2cff8727c7
mod_http_file_share: Insert pauses to avoid blocknig for long periods
...
Similar to the mod_mam cleanup job
5 years ago
Kim Alvefur
395de7cde5
mod_http_file_share: Add support for removing old files (default 2 weeks)
5 years ago
Kim Alvefur
da882b75ab
mod_http_file_share: More security headers
5 years ago
Kim Alvefur
6ce4972bf4
mod_http_file_share: Strip authorization type prefix a bit earlier
5 years ago
Kim Alvefur
3abab1efc3
mod_http_file_share: Factor out function for generating full filename
5 years ago
Kim Alvefur
17a85e6d3b
mod_http_file_share: Use '.bin' file extension
...
Distinct from '.dat' used by datamanager / internal stortage for Lua
object storage so that they can't easily be loaded by accident that way.
5 years ago
Kim Alvefur
e4a97b8e7a
mod_http_file_share: Validate file size early in HTTP PUT request
5 years ago
Kim Alvefur
93494930ea
mod_http_file_share: Move Authorization type string
...
It belongs with the header more than the token itself
5 years ago
Kim Alvefur
943dc18486
mod_http_file_share: Add some logging
5 years ago
Kim Alvefur
5a99373c07
mod_http_file_share: Handle content-type being optional
5 years ago
Kim Alvefur
3ab51f6864
mod_http_file_share: Reject invalid file sizes
5 years ago
Kim Alvefur
debea1badc
mod_http_file_share: Fix name of max-file-size tag
5 years ago
Kim Alvefur
78b0c08aac
mod_http_file_share: Expand registry to fix extra tag
...
Error registry compact format doesn't support extra.tag so needs to be
the more verbose format
5 years ago
Kim Alvefur
987976f20f
mod_http_file_share: Verify final file size on completion of upload
5 years ago
Kim Alvefur
456ca909e2
mod_http_file_share: Add file type filter
...
Unlike mod_http_upload, this can't be bypassed by uploading with a
different file extension.
5 years ago
Kim Alvefur
a98f3a3e64
mod_http_file_share: Add file size limit (default 10M)
5 years ago
Kim Alvefur
ea3b09dea8
mod_http_file_share: Validate that filename does not contain '/'
5 years ago
Kim Alvefur
62f77b9ac9
mod_http_file_share: Return proper error if unauthorized
5 years ago
Kim Alvefur
112b174e2d
mod_http_file_share: Add basic access control
...
Partly lifted from mod_external_services
5 years ago
Kim Alvefur
c26e8b4898
mod_http_file_share: Add support for external file upload service
...
PUT /upload/:slot/:filename
Authorization: Bearer JWT{ uploader, filename, filesize, filetype, exp }
5 years ago
Kim Alvefur
4be9b33741
mod_http_file_share: Let's write another XEP-0363 implementation
...
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
5 years ago