akkoma/lib/pleroma
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
..
gopher formatting 2018-09-10 00:28:40 +00:00
http http: fix TLS server name indication 2018-08-24 20:04:50 +00:00
plugs Update legacy passwords automatically. 2018-09-05 22:30:14 +02:00
uploaders Uploaders.S3: Replace unsafe characters in object key 2018-09-24 15:38:32 +02:00
web twitter api: add no_rich_text option to userview for account prefs 2018-09-22 03:24:40 +00:00
activity.ex activity: drop recipients_to/recipients_cc fields 2018-08-29 18:41:02 +00:00
application.ex Migrate to comeonin 4 and Cachex 3 2018-05-20 20:08:40 +02:00
filter.ex [MastodonAPI] Add filters 2018-08-27 15:09:05 +02:00
formatter.ex everywhere: use Pleroma.HTML module instead of HtmlSanitizeEx directly 2018-09-10 00:14:47 +00:00
html.ex html: twittertext: add missing catchall scrub function 2018-09-22 03:45:35 +00:00
list.ex MastoAPI: Add streaming for lists. 2018-05-30 16:48:59 +03:00
notification.ex do not create notification for yourself 2018-05-11 11:31:17 +02:00
object.ex object: add helper functions to handle various forms of a given object and return a normalized one 2018-06-27 13:06:52 +00:00
PasswordResetToken.ex Format the code. 2018-03-30 15:01:53 +02:00
repo.ex Phoenix skeleton 2017-03-17 17:09:58 +01:00
stats.ex Clean up unused aliases and imports 2018-05-04 21:25:31 +00:00
upload.ex Add backend failure handling with :ok | :error so the uploader can handle it. 2018-08-29 22:07:28 -03:00
user.ex user: add User.html_filter_policy() 2018-09-22 02:53:00 +00:00
user_invite_token.ex Token-generating task 2018-06-17 14:30:07 +03:00