Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/shrinerb/shrine

File Attachment toolkit for Ruby applications
https://github.com/shrinerb/shrine

Fix some plugins changing visibility of methods

b1b0b0df80b2d344073d186d3d07a3f0abc64c3e authored over 9 years ago by Janko Marohnić <[email protected]>
Remove preserve_filename plugin

I don't think it's really necessary, because I can't think of a case
where the application would...

06b79a00fae262c724ca40ccde00313277570a25 authored over 9 years ago by Janko Marohnić <[email protected]>
Require again the IO object in Shrine#generate_uid

Later we may want to mix in the filenames to UIDs if it proves
necessary, so better to not have ...

875c24f95128d8f195ec79ac7d1174377c5b961c authored over 9 years ago by Janko Marohnić <[email protected]>
Add S3 storage

20d31dac30b24b7be7061b43900e00f2d74a8d40 authored over 9 years ago by Janko Marohnić <[email protected]>
Allow storages to support multiple deletes

Amazon S3 supports multiple deletes in a single HTTP request, so caring
about performance as we ...

d4b85cc08c9e5598a63434fe62c1604186671ebc authored over 9 years ago by Janko Marohnić <[email protected]>
Don't make UploadedFile#rewind redownload after

The contract is that Storage#open needs to return a valid IO object,
which means it will respond...

5eaa540eb3c7027c61ed47d0daa22de6a10183c1 authored over 9 years ago by Janko Marohnić <[email protected]>
Allow each test to set its own VCR cassette

6b9a2add70d51581b3f30f68bb50a0a91dfaa473 authored over 9 years ago by Janko Marohnić <[email protected]>
Pass metadata to Storage#upload

S3 for example will by default always set application/octet-stream
Content-Type header. However,...

5c2b55a6e62236a57601fe902f4608f4ceeab31b authored over 9 years ago by Janko Marohnić <[email protected]>
Add validation_helpers plugin

We also yield the record and the attachment name in the Shrine.validate
block, so that users can...

696f91bede41e2b4eb5c3bcf6cbc88231e679a1c authored over 9 years ago by Janko Marohnić <[email protected]>
Don't add Reform at the moment

I was trying to make the plugin, but I was getting errors, and the
internals of Reform were so c...

12c50c7f5bf50921ae371e08649eb55b172235e0 authored over 9 years ago by Janko Marohnić <[email protected]>
Rename endpoint plugin to "direct_upload"

"Endpoint" is too generic, from the name of the plugin you can't tell
what it does, just that it...

242eadd2d9d4e7c86b23a609203bd4e958aff364 authored over 9 years ago by Janko Marohnić <[email protected]>
Add back the ability to use Mime::Types

Currently mime type would be saved on processed files (because Tempfiles
don't respond to #conte...

5ee3609583f6069adfbc612d228322e7a7bf1cae authored over 9 years ago by Janko Marohnić <[email protected]>
UploadedFile#content_type > UploadedFile#mime_type

"Content type" referes to the "Content-Type" header, which is whatever
the browser sends in head...

e0976d2a600d96b846f91b5a409da93ebc1e14bb authored over 9 years ago by Janko Marohnić <[email protected]>
Rename retry_uploads to retry

We might later support retries deletions, so we want to keep the name of
the plugin generic enough.

05aa67d76168d914752cd203ea4ce77ec8ed2005 authored over 9 years ago by Janko Marohnić <[email protected]>
Move linter into a subdirectory

7be5a34a74bf614786a6cb402e3a0ac60af777df authored over 9 years ago by Janko Marohnić <[email protected]>
Improve cleaning garbage and fix some bugs

Cached files are now automatically deleted when promoted, and keep_files
plugin receives a new :...

5b5f6eff8f88ec12311dbb42a91442de54ee3d95 authored over 9 years ago by Janko Marohnić <[email protected]>
Fix some plugins

* Fixed parallelize to work with moving

* Fixed logging to not make Shrine#store private (it's ...

6bf5bfcabd2b0caa0269a9f4f8d66168013dbf2c authored over 9 years ago by Janko Marohnić <[email protected]>
Transfer test suite to minitest/spec

I like the minitest/test style assertions, but I really need the
grouping so that I can organize...

710f5e8ba67737f6cb6f39bcf2b338ce464165da authored over 9 years ago by Janko Marohnić <[email protected]>
Revert making Shrine work on form objects

Users should make two separate uploaders for models and for forms,
because they will probably wa...

5d22abdafa935d4c627b58464562fbeafa61cad5 authored over 9 years ago by Janko Marohnić <[email protected]>
Refactor and trim down essential functionality

* `#cache` and `#store` accessors aren't necessary, they aren't special
to Shrine itself, but ...

15a9ebb417fedde1eae6c26fc6bedc51eeb32aba authored over 9 years ago by Janko Marohnić <[email protected]>
Test that endpoint errors have application/json

74248988844720c969dde13145a928e5e77d26ac authored over 9 years ago by Janko Marohnić <[email protected]>
Rebrand extract_content_type to real_content_type

We want to communicate to the users that content type detection provided
by base is not the real...

da7a9d166da0bb573e543239aabaaee7734ab3cf authored over 9 years ago by Janko Marohnić <[email protected]>
Add renew_metadata plugin

When your file is cached, attacker can change the metadata in the hidden
field. If a user loads ...

2c326d56eccc186544bf3d3914ddf4f4ae014c6b authored over 9 years ago by Janko Marohnić <[email protected]>
Remove the rack_file plugin

It's causing too many problems, we always have to check if a Hash is a
Rack File or versions, an...

d55b3ee7eb72e9dd8294acb4b3d386aef9cce0da authored over 9 years ago by Janko Marohnić <[email protected]>
Allow dimensions extraction only with FastImage

FastImage is the only gem that handles image bombs (a lot of pixels
compressed into small filesi...

ed57223d3828d21e7172805fe6415a897e21f276 authored over 9 years ago by Janko Marohnić <[email protected]>
Upgrade to Down which doesn't follow redirects

210bc284fd123b4853aea1fe21f337de27405bae authored over 9 years ago by Janko Marohnić <[email protected]>
Add logging plugin

90d8dd2a81902e1fe2c95ab2468a5aa6e862a1a3 authored over 9 years ago by Janko Marohnić <[email protected]>
Remove :return_url option from endpoint

When uploading to cache, the URL can easily be deducted from the ID
client side. They're a littl...

f2b73b8c303aa22e367c5b178fcaae256ebe59b2 authored over 9 years ago by Janko Marohnić <[email protected]>
Work around ActiveSupport breaking #to_json

ActiveSupport (which is loaded when requiring ActiveRecord) breaks the
recursive #to_json that i...

dec3a1cb147a82e7bc3feb55862f05503c9d4b5e authored over 9 years ago by Janko Marohnić <[email protected]>
Shrine#generate_uid doesn't need to accept a file

9ca3d9d6c54a3f9337876bae96cd7f502c47f8a6 authored over 9 years ago by Janko Marohnić <[email protected]>
Handle empty <image>_data column

If the column returns an empty string, it should be interpreted as nil.

ed82a2c28b8ef2dbdeb3a47b1e76f1ca43459f56 authored over 9 years ago by Janko Marohnić <[email protected]>
Return url inside uploaded file in endpoint

We put it outside so that it isn't saved. But then even if you're not
using :return_url you woul...

47a5002fe3b9fb88d15b1ab0f82ce2dba733cce2 authored over 9 years ago by Janko Marohnić <[email protected]>
Make Shrine work with form objects

649db64181e95e3e888ecb9050c5d6ab219a0d4d authored over 9 years ago by Janko Marohnić <[email protected]>
Add activerecord plugin

We also put replacing in `after_save`, because this is when no errors
should happen, and it's al...

cf49af00e623950c4bd54bca1e00dd4f51ae737f authored over 9 years ago by Janko Marohnić <[email protected]>
Improve naming in promote

2d765f3d878ab7ed8351dca868cb6839388134f0 authored over 9 years ago by Janko Marohnić <[email protected]>
Add parallelize plugin

48f1ede4e7a03a2f005e34f5406a9a586dcb3c3d authored over 9 years ago by Janko Marohnić <[email protected]>
Readability improvement

9a2ca715d2f325aa3808b70dda6baa4377b2869c authored over 9 years ago by Janko Marohnić <[email protected]>
Remove UploadedFile#path

It was meant for less copying during processing, but it's never a good
idea to modify the cached...

d71efe3fe3a4fc59a82a09754e9c3829afb61b07 authored over 9 years ago by Janko Marohnić <[email protected]>
Rewrite FileSystem storage with Pathname

This Ruby standard library makes dealing with paths much more concise
(no need to call everythin...

1c5b6b48323436698063afec69933f8a4d60e783 authored over 9 years ago by Janko Marohnić <[email protected]>
Properly test FileSystem#clean and fix a bug

7b10db7624837fdd6b75efa9b16587484926626e authored over 9 years ago by Janko Marohnić <[email protected]>
Improve code style on versions plugin

6c4381d122f0359d0559a520659ea41e421126f1 authored over 9 years ago by Janko Marohnić <[email protected]>
Add retry plugin

3dfda9c4af5a4f32f517ff10348f181aa46fbcc7 authored over 9 years ago by Janko Marohnić <[email protected]>
Make replacing idempotent

0a9c2e6159ae27541e9a77609c7a22926fd76a86 authored over 9 years ago by Janko Marohnić <[email protected]>
Make storing and deleting loggable, now for realz

Before versions and multiple_files could interfere with logging,
depending if they're loaded bef...

cf6da686c9bd3a2f1f0182e8a25e484795971cc6 authored over 9 years ago by Janko Marohnić <[email protected]>
Add background_delete plugin

This doesn't actually contain any background deleting logic, but it
can't know which library you...

0b6dfec3eecd52a4f861e7fdebec3222ffb50ec8 authored over 9 years ago by Janko Marohnić <[email protected]>
Add sequel plugin

d41c7c778cd9f9422977f629b8b5598d09ee5457 authored over 9 years ago by Janko Marohnić <[email protected]>
Copy validate block on inheritance

a9cc8d8b070a1f5b91b1c0b249718bb7fef91b67 authored over 9 years ago by Janko Marohnić <[email protected]>
Move Memory storage into tests

It shouldn't be in the core, because it isn't particularly useful. It's
still useful for us in t...

06cf418d8291fff173214b35bf790d34182d412b authored over 9 years ago by Janko Marohnić <[email protected]>
Refactor test setup

4042e74fe66dc3532cda7de8159d7104e4545d35 authored over 9 years ago by Janko Marohnić <[email protected]>
Extract Shrine::Utils into gem "down"

It always felt a bit weird, because it was part of the gem but wasn't
part of the plugin system....

def394ce43cfefed38852fad4d32c6760afd4dfe authored over 9 years ago by Janko Marohnić <[email protected]>
Small inlining of conditionals

1821d390661be6b7d6e744ebf91356336dd3789d authored over 9 years ago by Janko Marohnić <[email protected]>
Remove Attacher#data

No need to have it, and then the versions plugin has to implement it.
`to_json` already makes re...

fc73a2032407968a604e4fbd16565a41f2774d40 authored over 9 years ago by Janko Marohnić <[email protected]>
Separate out copying and moving

The concept of moving is already present in storage classes, so it makes
sense to also have it i...

93e732f65c8677fc49ab73279ca22954e971a807 authored over 9 years ago by Janko Marohnić <[email protected]>
Refactor moving plugin

cff4fdd28d337548243d17119d6685c8b82b089e authored over 9 years ago by Janko Marohnić <[email protected]>
Remove bang from Attacher#validate!

It isn't consistent with other methods, no need to have a bang.

d9585ae7aff5176259dbcf774c12d0a3f2ed0600 authored over 9 years ago by Janko Marohnić <[email protected]>
Make deleting backgroundable and loggable

9eeab5ff3a41d56a39b8de1649d83418de948554 authored over 9 years ago by Janko Marohnić <[email protected]>
Prepend version name to the filename

It's easier to read if version name is at the beginning than at the end.

239e8a84427d29177ee38f635c7e4db544714ea0 authored over 9 years ago by Janko Marohnić <[email protected]>
Add the :max_size option to remote_url

246dc42fb280a3991f4d5d39774c5429f6ab6d0f authored over 9 years ago by Janko Marohnić <[email protected]>
Make Shrine::Utils#download more robust

It can now catch invalid URLs, and transform them to Shrine::Error.
Furthermore, it will not swa...

661b83f0921142f7ee125565b01077ba80885def authored over 9 years ago by Janko Marohnić <[email protected]>
Refactor to allow processing files in any phase

We initially thought that users will only want to process on caching or
on storing. But there ar...

26cfa7a1f22b164a2148f67f4ffb2d22423e8f95 authored over 9 years ago by Janko Marohnić <[email protected]>
Add ability to extract dimensions with FastImage

It is possible to create so-called "image bombs", which are small in
filesize but very large in ...

f7923d0650bbb573feb1424eb2f603bc5f8dd86d authored over 9 years ago by Janko Marohnić <[email protected]>
Make endpoint's :max_size in bytes

This is a standard measure of size, it could confuse a lot of people if
they see a number in meg...

986e11ee97f655135fb3badf07f6edc7d43ba7ad authored over 9 years ago by Janko Marohnić <[email protected]>
Switch completely to symbols (again)

It was a wrong decision to switch to strings, this was just paranoia for
the Symbols DoS. We now...

34da8750ba985f667b9d11b2571f08a801feec48 authored over 9 years ago by Janko Marohnić <[email protected]>
Don't fail on missing versions

People may want to process and store some versions now, and then
continue processing other ones ...

a06586edd2a08e69b9f01c16497f3605dc8e4125 authored over 9 years ago by Janko Marohnić <[email protected]>
No need to allow deleting cache in background

Deleting cache only happens with the "moving" plugin, but then it's part
of "promoting". If a us...

e3c51daa874f70fc78b343dc08a7d6bf7bb93703 authored over 9 years ago by Janko Marohnić <[email protected]>
Generate pretty location from context

738dba1757c9a4c4340820a64928179a33cbed5a authored over 9 years ago by Janko Marohnić <[email protected]>
Don't preserve Tempfile filenames in location

These will usually be result of processing, and are ugly. The default
UUIDs are much prettier.

95eab57b075008498a3a484a7c77cfb9ac6b2786 authored over 9 years ago by Janko Marohnić <[email protected]>
Use symbols for version keys instead of strings

We switched to strings only because of security paranoia. But actually
the only vulnerable entry...

3deaffa439ae7591aa11f9f5467b24adc844157b authored over 9 years ago by Janko Marohnić <[email protected]>
Don't return url inside "data" in endpoint

If we return this inside the data, form submit would save the url into
the database. We don't wa...

8061cd3725c41fca3118c25b797895b12fe0eeae authored over 9 years ago by Janko Marohnić <[email protected]>
Refactor design for usage in background jobs

c9599a86b19730c025ea0322a72a1c8c704f141c authored over 9 years ago by Janko Marohnić <[email protected]>
Fix downloading encoded/decoded URIs

d943d81432cc48ebd91285fab34b7b317f590082 authored over 9 years ago by Janko Marohnić <[email protected]>
Use :location over #generate_location

We may need this certainty later, that when :location is passed in, it's
guaranteed that the fil...

40b5931ec88b5393ca55200a4593b66a5e0b0ef5 authored over 9 years ago by Janko Marohnić <[email protected]>
Add option to extract content type with `file`

af54ed87bb0c2fdeda62dca61dbb14debbe4a890 authored over 9 years ago by Janko Marohnić <[email protected]>
Add data_uri plugin

HTML5 canvas generates data URIs, which we want to allow users to be
able to upload.

3b4b84e110bba9f539a1443e17c4e9a3237daef4 authored over 9 years ago by Janko Marohnić <[email protected]>
Add the :max_size options to endpoint plugin

Since users can't control which filesizes they accept (like they can in
the attacher), it is goo...

3a36e1a207b74cff4c9050000ba6baa7cebeff46 authored over 9 years ago by Janko Marohnić <[email protected]>
Make FileSystem able to automatically clean itself

When users are looking at their cache directories, it's much nicer if
there are only folder whic...

4feff545bc6b57f2472e16b35507c9fadf1dc611 authored over 9 years ago by Janko Marohnić <[email protected]>
Add :permissions option to FileSystem storage

19c3279427c242eb4e45bae0e6ccdc568e518386 authored over 9 years ago by Janko Marohnić <[email protected]>
Include URL in message of failed download error

a8ceb96c447a50ffc65e3f4d66cfc0ac84b52075 authored over 9 years ago by Janko Marohnić <[email protected]>
Add :return_url options to endpoint

Often after uploading images to enpdoint AJAX, users will want to
display the uploaded images. S...

f5e5191efaa14c096ea17fda94771291f1495195 authored over 9 years ago by Janko Marohnić <[email protected]>
Make processing automatically load the move plugin

We want to delete the processed files after uploading, so for that we
use our awesome new "move"...

918f4558ae0fdca3202bf3d93a1ef8687d7dd162 authored over 9 years ago by Janko Marohnić <[email protected]>
Fix a Symbol DoS vulnerability

Attackers can simply change the cached hidden field to anything they
like, and we're calling #to...

796a187d5f92a824ac27b6f3b6746927b81627ed authored over 9 years ago by Janko Marohnić <[email protected]>
Forward URL arguments to the storage

Some storages may want to implement generating different URLs depending
on options provided. We ...

ba99a71a892393778256be09b9aaa10e15f3640f authored over 9 years ago by Janko Marohnić <[email protected]>
Require version names to be specified

Previously we were exposed to a DoS vulnerability, where attackers would
be able to simply dupli...

7f48a5be517fa1d4e2eb6f3e58e05ed474347eb2 authored over 9 years ago by Janko Marohnić <[email protected]>
Rename the gem to "Shrine"

"Uploadie" was just a temporary name until I come up with something
better. I feel really good a...

089341c630c52c8a23033a571d358db89b492e4f authored over 9 years ago by Janko Marohnić <[email protected]>
Add the delete_invalid plugin

Some people might have a problem with invalid files staying cached, so
for them we offer this pl...

38253b99379b6fe650700f20f187317e1582a135 authored over 9 years ago by Janko Marohnić <[email protected]>
Implement the concept of moving files

I believe this is a unique feature compared to other uploading
solutions. When you look at the F...

8e8a5feaea326f68fc1b07b9452f7111cd5de508 authored over 9 years ago by Janko Marohnić <[email protected]>
Write tests for FileSystem and Memory storages

4afc3193f6fc421fa9eb11d852fbbbf06dff6a07 authored over 9 years ago by Janko Marohnić <[email protected]>
Add a generic Linter for storages

The linter asserts functionality that Uploadie requires from a storage.
This is expected to be u...

fd891c37e9ca0dee7cba01cbbff5f35994409a4d authored over 9 years ago by Janko Marohnić <[email protected]>
Improve InvalidFile error message

We want to explicitly tell users that `read` needs to respond to two
arguments. We also want to ...

ffe243d98a28880ca3b48605f30c7503e4d78f75 authored over 9 years ago by Janko Marohnić <[email protected]>
Fix test hitting the network

357bc6148c0509d47e8e39fabfe0149870116ee9 authored over 9 years ago by Janko Marohnić <[email protected]>
Set the User-Agent when downloading

Some websites will return 403 if there is no User-Agent in the request.
open-uri sets "ruby", bu...

06a48a5d911955fc92e5293f446be6e89216b914 authored over 9 years ago by Janko Marohnić <[email protected]>
Improve error message for InvalidFile

a41ee3481627cb6cb2ef5345d643de28cd8bfe87 authored over 9 years ago by Janko Marohnić <[email protected]>
Fix subdirectory/host logic in FileSystem storage

8457f4a79b18a725e9e2516fa1440ac09fb99f14 authored over 9 years ago by Janko Marohnić <[email protected]>
No reason to explicitly reference top-level file

This was left over when we thought that it's going to be Uploadie::File,
but it turned out to be...

23f9cf76873c5e9857766c669e0346cb603db3fe authored over 9 years ago by Janko Marohnić <[email protected]>
Assert existence of storage in every plugin

We already have a dedicated method for this, which prints a nice error
message.

9820e68cfe79335238d690905261d6467f0dce7a authored over 9 years ago by Janko Marohnić <[email protected]>
Rebrand soft_delete plugin to keep_files

"Soft delete" is referred to when something looks like deleted, but
actually isn't. It's used fo...

a5f0ac2510fcc62d96ebbc3d4f622b84909d6806 authored over 9 years ago by Janko Marohnić <[email protected]>
Catch InvalidFile errors in endpoint plugin

We don't want that attackers are able to cause errors to your website
simply by passing somethin...

3c9d7e97c70e5ad0a214ab1c5da3d5463a0c1031 authored over 9 years ago by Janko Marohnić <[email protected]>
Add endpoint plugin

This plugin adds an endpoint which you can mount and use for
caching/storing files via AJAX. Kud...

0f5902f98fdedf665a9cc633406567f5a03eebcb authored over 9 years ago by Janko Marohnić <[email protected]>
Add an option to soft delete replaced files

If the developer wants to build an event store (a system where each
action is saved as an event,...

64f659b6801e8499685a288bd9fc0d27d8ac5789 authored over 9 years ago by Janko Marohnić <[email protected]>
Refactor tests

1870256aa71bf5013f00abe2bb714a5a461d45e5 authored over 9 years ago by Janko Marohnić <[email protected]>