Commit Graph

127 Commits

Author SHA1 Message Date
Robin Dupret
fb88ff78b3 Fix the migration class name
Due to Active Support auto loading feature, the migration class
shouldn't be name-spaced under the `ActiveStorage` constant, otherwise,
running the migrations would throw an error.
2017-07-06 23:01:40 +02:00
George Claghorn
a2e864fa13 Fix test
* S3 fails fast if the Content-MD5 header on an upload request is an
  invalid checksum. Send a valid but incorrect checksum.

* Rescue the service-specific exception and raise the generic one.
2017-07-06 15:31:31 -04:00
David Heinemeier Hansson
2afe0a7d90 Merge pull request #6 from johnwilliams/s3_integrity
Ensure S3 file integrity by sending checksum
2017-07-06 21:22:29 +02:00
John Williams
0eeb8f7cce Merge branch 'master' into s3_integrity 2017-07-06 14:04:58 -05:00
John Williams
f8539164c0 Send checksum to S3 to verify file integrity 2017-07-06 14:00:57 -05:00
George Claghorn
1a5219ce87 Style 2017-07-06 14:25:14 -04:00
George Claghorn
e08c2b231f Merge pull request #5 from SGospodinov/master
Adding server-side integrity check for GCS Service
2017-07-06 14:23:25 -04:00
Stanislav Gospodinov
d065a68616 Adding server side integrity check for GCS Service 2017-07-06 19:14:10 +01:00
George Claghorn
1378bbfcfb Merge pull request #4 from snuggs/patch-1
Fix hash usage consistency.
2017-07-06 12:15:01 -04:00
Ra'Shaun Stovall
ef3cdc82da Fix hash usage consistency.
Unless this was intentional, being consistent with:

https://github.com/rails/activestorage/blob/master/lib/active_storage/service/s3_service.rb#L8

Just showin' a lil' <3 while perusing the repo @dhh
2017-07-06 12:13:40 -04:00
David Heinemeier Hansson
fbeec41e56 Link up main models 2017-07-06 17:26:53 +02:00
David Heinemeier Hansson
8fb2e96724 Describe some of the design differences in AS 2017-07-06 17:25:40 +02:00
David Heinemeier Hansson
4f30570bd6 Merge pull request #3 from adrianpacala/format-readme-examples
Use correct syntax highlighting in erb block
2017-07-06 16:34:34 +02:00
Adrian Pacała
7bd2b3aaa2 Use correct syntax in erb block 2017-07-06 15:23:00 +01:00
David Heinemeier Hansson
37f7cf8daf Documentation, yo! 2017-07-06 16:04:08 +02:00
David Heinemeier Hansson
cd4c2a4d8e Helper methods are private 2017-07-06 16:01:18 +02:00
David Heinemeier Hansson
894e1e3183 Check integrity after uploads 2017-07-06 16:01:11 +02:00
David Heinemeier Hansson
ef07687262 Escape commands and paths 2017-07-06 15:43:14 +02:00
David Heinemeier Hansson
4191d1e675 Dropped from the interface 2017-07-06 15:42:09 +02:00
David Heinemeier Hansson
ecd07cd905 It's base64 now since the clouds expect that
Gotta please them clouds. SPEAK THE CLOUD.
2017-07-06 15:41:42 +02:00
David Heinemeier Hansson
8d17bb4bb0 Need the byte helpers 2017-07-06 15:41:22 +02:00
David Heinemeier Hansson
343a4b7308 There are two 2017-07-06 15:39:10 +02:00
David Heinemeier Hansson
152c4b0724 Compute checksum and byte_size client side
Then we can add integrity checks on uploads to prevent errors in
transport.
2017-07-06 15:38:01 +02:00
David Heinemeier Hansson
6de714a0ea Remember to add streaming 2017-07-06 15:35:58 +02:00
David Heinemeier Hansson
0ed18d9671 This is even more explaining and upload/download don't have some inherent need to synchronize chunk sizes anyway 2017-07-06 15:35:48 +02:00
David Heinemeier Hansson
89e8b86546 We have the technology! 2017-07-06 15:31:37 +02:00
David Heinemeier Hansson
f3aba78ce8 Convert magic number to constant 2017-07-06 15:22:40 +02:00
David Heinemeier Hansson
740960bc9f Clearer focus on cloud 2017-07-06 15:13:57 +02:00
David Heinemeier Hansson
ef91f61fe5 We are using the try operator 2017-07-06 15:12:53 +02:00
David Heinemeier Hansson
87ad273659 Extract configuration into config/storage_configuration.yml 2017-07-06 15:02:09 +02:00
David Heinemeier Hansson
6129a63764 Add task to install the migration needed 2017-07-06 13:58:47 +02:00
George Claghorn
7341d91009 Flesh out mirror tests 2017-07-06 07:53:26 -04:00
George Claghorn
a8e849bb0d Mirror: only hit all sites for upload and delete
The mirror service exists for the purpose of migration, where all blobs exist in the primary subservice and a subset of blobs exist in the secondary subservice. Since the primary subservice is the source of truth until a migration is completed, operations like existence checks need not be performed against the secondary subservices.
2017-07-06 07:30:21 -04:00
David Heinemeier Hansson
35d5bddabc Rename from Site to Service now that we're called Active Storage 2017-07-06 12:22:44 +02:00
David Heinemeier Hansson
b3a9f3556d Update README with new name 2017-07-06 11:34:21 +02:00
David Heinemeier Hansson
c624df326a ActiveVault -> ActiveStorage
Yaroslav agreed to hand over the gem name ❤️
2017-07-06 11:33:29 +02:00
George Claghorn
5869045f2e ActiveVault::Site::MirrorSite#url 2017-07-05 18:31:19 -04:00
David Heinemeier Hansson
abda6d784e Basic MirrorSite
Still need to convert it to threading
2017-07-05 18:57:45 +02:00
David Heinemeier Hansson
54886cb7b0 Record outstanding todos 2017-07-05 18:44:58 +02:00
David Heinemeier Hansson
e3ade5fd2d Default to purging later when the owning record is destroyed 2017-07-05 18:31:53 +02:00
David Heinemeier Hansson
c2fa570e2e Moving this to the macro definition 2017-07-05 18:31:53 +02:00
David Heinemeier Hansson
5492be5210 Bit further on the README 2017-07-05 18:31:53 +02:00
David Heinemeier Hansson
eefbdc2b9e Only purge if attached 2017-07-05 18:31:53 +02:00
David Heinemeier Hansson
7d3955e6f7 Avoid duplicate attachments 2017-07-05 18:31:53 +02:00
George Claghorn
ac796b8d92 Require the Active Support core extension used 2017-07-05 11:24:32 -04:00
George Claghorn
04dad4ee83 Fix test 2017-07-05 11:23:56 -04:00
David Heinemeier Hansson
5276323d40 Ensure the array is flat 2017-07-05 16:47:39 +02:00
David Heinemeier Hansson
c2dd4418f6 Slim down examples 2017-07-05 16:28:45 +02:00
David Heinemeier Hansson
3c9a28d6e4 Fix configuration names 2017-07-05 16:10:03 +02:00
David Heinemeier Hansson
b7cc003aa0 Attached one and many 2017-07-05 16:09:41 +02:00