Commit Graph

70 Commits (6262ceeb704c9636f09c25e856638ee4441b58d9)

Author SHA1 Message Date
Matt Jankowski c875dfc90b
Fix `Lint/UnusedBlockArgument` cop (#27777) 1 year ago
Claire 8acc75435b
Change S3 checksum mode to be disabled by default (#27007) 1 year ago
Claire 4bc0dd751c
Add `S3_DISABLE_CHECKSUM_MODE` environment variable for compatibility with some S3-compatible providers (#26435) 1 year ago
Misty De Méo b848ba3867
Paperclip: add support for Azure blob storage (#23607) 1 year ago
Claire dc8f1fbd97
Merge pull request from GHSA-9928-3cp5-93fm
* Fix attachments getting processed despite failing content-type validation

* Add a restrictive ImageMagick security policy tailored for Mastodon

* Fix misdetection of MP3 files with large cover art

* Reject unprocessable audio/video files instead of keeping them unchanged
2 years ago
Nick Schonning c0b9664a31
Autofix Rubocop spacing in config (#25022) 2 years ago
Matt Jankowski d9a958fcf7
Fix Performance/RedundantMerge cop (#24817) 2 years ago
Matt Jankowski d902a707a3
Fix Rails/CompactBlank cop (#24690) 2 years ago
Claire e084b5b82d
Fix user archive takeout when using OpenStack Swift or S3 providers with no ACL support (#24200) 2 years ago
Jamie Hoyle de137e6bb0
Added support for specifying S3 storage classes in environment (#22480) 2 years ago
Matt Corallo 9d039209cc
Add `Cache-Control` header to openstack-stored files (#20610)
When storing files in S3, paperclip is configured with a Cache-Control header
indicating the file is immutable, however no such header was added when using
OpenStack storage.

Luckily Paperclip's fog integration makes this trivial, with a simple
`fog_file` `Cache-Control` default doing the trick.
2 years ago
David Hewitt 290d78cea4
Allow unsetting x-amz-acl S3 Permission headers (#20510)
Some "S3 Compatible" storage providers (Cloudflare R2 is one such example) don't support setting ACLs on individual uploads with the `x-amz-acl` header, and instead just have a visibility for the whole bucket. To support uploads to such providers without getting unsupported errors back, lets use a black `S3_PERMISSION` env var to indicate that these headers shouldn't be sent.

This is tested as working with Cloudflare R2.
2 years ago
Holger 39b489ba4c
fix: `s3_force_single_request` not parsed (#17922) 3 years ago
Eugen Rochko 3f2533ca8e
Fix autoloading deprecation warnings from Rails 6 (#16010) 4 years ago
Eugen Rochko 1045549f85
Add stoplight for object storage failures, return HTTP 503 (#13043) 4 years ago
Eugen Rochko df1653174b
Add cache buster feature for media files (#15155)
Nginx can be configured to bypass proxy cache when a special header
is in the request. If the response is cacheable, it will replace
the cache for that request. Proxy caching of media files is
desirable when using object storage as a way of minimizing bandwidth
costs, but has the drawback of leaving deleted media files for
a configured amount of cache time. A cache buster can make those
media files immediately unavailable. This especially makes sense
when suspending and unsuspending an account.
4 years ago
tateisu 7919418e4c
add S3_READ_TIMEOUT environment variable (#14952) 4 years ago
Eugen Rochko 7aaf2b44ec
Fix remote files not using Content-Type header, streaming (#14184) 5 years ago
Takeshi Umeda 8e056bd82e
Fix csv upload (#13835) 5 years ago
mayaeh acc367fd14
Fix naming issue (#13551) 5 years ago
Eugen Rochko c3ca3801f2
Add separate cache directory for non-local uploads (#12821) 5 years ago
Eugen Rochko 49b2f7c0a2
Fix base64-encoded file uploads not being possible (#12748)
Fix #3804, Fix #5776
5 years ago
Eugen Rochko 17159625b3
Add `S3_OVERRIDE_PATH_STYLE` environment variable (#12594)
To support Exoscale
5 years ago
Eugen Rochko f3d232381d
Add `tootctl media remove-orphans` (#12568) 5 years ago
tateisu f1ef777d40 add S3_OPEN_TIMEOUT environment variable (#12459) 5 years ago
Eugen Rochko 354fdd317e
Fix attachment not being re-downloaded even if file is not stored (#12125)
Change the behaviour of remotable concern. Previously, it would skip
downloading an attachment if the stored remote URL is identical to
the new one. Now it would not be skipped if the attachment is not
actually currently stored by Paperclip.
5 years ago
Eugen Rochko 086fc7ed77
Fix S3 adapter retrying failing uploads with exponential backoff (#12085)
The default limit of 10 retries with exponential backoff meant
that if the S3 server was timing out, you would be stuck with it
for much, much longer than the 5 second read timeout we expect.

The uploading happens within a database transaction, which means
a failing S3 server could negatively affect database performance
5 years ago
Yamagishi Kazutoshi b02169f124 Cast multipart threshold to integer (#11944) 5 years ago
Yamagishi Kazutoshi 172eaeba3f Add config of multipart threshold for S3 (#11924) 5 years ago
Eugen Rochko 4699cf853c
Add timeouts for S3 (#9842) 6 years ago
Nolan Lawson f05eb67081 Enable immutable caching for S3 objects (#9722)
I also added "public" here, as I can't think of a good reason not to add it. Perhaps it has some marginal benefit in that ISPs (or other proxies) can cache it for all users. The assets are certainly publicly available and the same for all users.
6 years ago
M Somerville 2bba6e582d Rename S3_CLOUDFRONT_HOST to S3_ALIAS_HOST. (#8423)
Still check for S3_CLOUDFRONT_HOST for existing installs.
6 years ago
ThibG f06fa09962 Revert to using Paperclip's filesystem storage, and fix dangling records in remove_remote (#8339)
* Fix uncaching worker

* Revert to using Paperclip's filesystem backend instead of fog-local

fog-local has lots of concurrency issues, causing failure to delete files,
dangling file records, and spurious errors UncacheMediaWorker
6 years ago
Hugo Gameiro ea4e243303 Improve OpenStack v3 compatibility (#7392)
* Update paperclip.rb

* Update .env.production.sample

* Update paperclip.rb
7 years ago
Yamagishi Kazutoshi 28384c1771 Revert "Revert "Upgrade Paperclip to version 6.0.0" (#6807)" (#6808)
This reverts commit 40871caa4b.
7 years ago
Eugen Rochko 40871caa4b
Revert "Upgrade Paperclip to version 6.0.0" (#6807)
* Revert "Bump version to 2.3.2rc1"

This reverts commit cdf8b92fea.

* Revert "Downgrade Dockerfile to Ruby 2.4.3 on Alpine 3.6 (#6806)"

This reverts commit 0074cad44f.

* Revert "Handle Mastodon::HostValidationError when pulling remoteable assets (#6782)"

This reverts commit 4a0a19fe54.

* Revert "Correct the reference to user's password in mastodon:add_user task (#6800)"

This reverts commit 338bff8b93.

* Revert "Upgrade Paperclip to version 6.0.0 (#6754)"

This reverts commit b88fcd53f7.
7 years ago
Yamagishi Kazutoshi b88fcd53f7 Upgrade Paperclip to version 6.0.0 (#6754) 7 years ago
THE BOSS ♨ 17e26f8afe Fix typo in paperclip.rb (#5936) 7 years ago
Yamagishi Kazutoshi b0db4dad79 Revert fog-aws (ref #5604) (#5934) 7 years ago
MitarashiDango cbbeec05be Fix spell miss (SWIIFT_OBJECT_URL -> SWIFT_OBJECT_URL) (#5617) 7 years ago
Yamagishi Kazutoshi 47b0c61853 Unify file upload to using fog (#5604) 7 years ago
Jeong Arm 9d97054fe6 Remove timestamps on any option (#5282) 7 years ago
Nishi, Keisuke 83ffc4dc07 Fix Paperclip::Fog always responds Not Found in OpenStack-v2 like ConoHa (#5155) 7 years ago
Patrick Figel 3018043fc2 Add OpenStack Keystone V3 support (#4889)
Keystone V2 is deprecated in favour of V3. This adds the necessary
connection parameters for establishing a V3 connection. Connections
to V2 endpoints are still possible and the configuration should
remain compatible.

This also introduces a SWIFT_REGION variable for multi-region
OpenStack environments and a SWIFT_CACHE_TTL that controls how long
tokens and other meta-data is cached for. Caching tokens avoids
rate-limiting errors that would result in media uploads becoming
unavailable during high load or when using tasks like
media:remove_remote. fog-openstack only supports token caching for
V3 endpoints, so a recommendation for using V3 was added.
7 years ago
Adam Thurlow 6994664a13 swift-enable the paperclip! 📎 (#2322) 7 years ago
alpaca-tc ee3e0a93f4 Fixes unknown mime type (#2822) 8 years ago
Ash Furrow 66b39ccaed Removes timestamp from URLs. (#2185) 8 years ago
tmyt 6c83fec971 Make configuarable s3_permissions for paperclip (#2139) 8 years ago
Yamagishi Kazutoshi 8b8e140c71 Change to switch signature version for Amazon S3 (#2124) 8 years ago
Eugen e09ab2c0bd Fix #1642, fix #1912 - Dictate content-type file extension (#2078)
* Fix #1642, fix #1912 - Previous change (#1718) did not modify how original file was saved on upload

* Fix for when file is missing
8 years ago