Commit Graph

11 Commits

Author SHA1 Message Date
href 97412d9f94
S3 Namespace 2019-01-21 14:42:16 +01:00
William Pitcock 980b5288ed update copyright years to 2019 2018-12-31 15:41:47 +00:00
William Pitcock 2791ce9a1f add license boilerplate to pleroma core 2018-12-23 20:56:42 +00:00
href 02d3dc6869
Uploads fun, part. 2 2018-11-30 18:02:37 +01:00
href b19597f602
reverse proxy / uploads 2018-11-30 18:00:47 +01:00
William Pitcock 36825932eb s3 uploader: add new feature to force public attachment URIs to go through media proxy 2018-10-29 18:00:59 +00:00
Martin Kühl f77ec96707 Uploaders.S3: Replace unsafe characters in object key
According to [the S3 docs][s3], the characters safe for use in object keys are:

* 0-9
* a-z
* A-Z
* !
* -
* _
* .
* *
* '
* (
* )

(The / character is not listed but mentioned being safe outside of the list.)

Several characters that are valid in filenames can cause problems, for example
spaces are not valid in URLs and need to be escaped,
sequences of spaces can become squeezed by S3,
some characters like \ are documented to require “significant special handling”.

To avoid these problems, this change encodes the filename
before using it as part of the S3 object name
by replacing all characters except those documented as “safe” with dashes.

[s3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
2018-09-24 15:38:32 +02:00
Thurloat af01f0196a Add backend failure handling with :ok | :error so the uploader can handle it.
defaulting to :ok, since that's the currently level of error handling.
2018-08-29 22:07:28 -03:00
Thurloat 8d2d7a8859 Implement uploader behaviour
run formatter <#
2018-08-28 09:57:41 -03:00
Thurloat 0df558a6a5 cleaning up a bit. 2018-08-27 22:45:53 -03:00
Thurloat 709816a0f8 example of flexible storage backends 2018-08-27 22:20:54 -03:00