Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch image.rb to google storage via fog library #9807

Merged
merged 24 commits into from
Jul 17, 2021
Merged

Conversation

jywarren
Copy link
Member

Fixes #9760

@gitpod-io
Copy link

gitpod-io bot commented Jun 15, 2021

has_attached_file :photo, styles: { thumb: '200x150>', medium: '500x375>', large: '800x600>' },
:fog_credentials => { :provider => 'Google',
:google_storage_access_key_id => ENV["GOOGLE_STORAGE_KEY"],
:google_storage_secret_access_key => ENV["GOOGLE_STORAGE_SECRET"]}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inside } missing.

app/models/image.rb Outdated Show resolved Hide resolved
app/models/image.rb Outdated Show resolved Hide resolved
app/models/image.rb Outdated Show resolved Hide resolved
app/models/image.rb Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #9807 (b2e28ea) into main (3d3de3f) will decrease coverage by 2.63%.
The diff coverage is 100.00%.

❗ Current head b2e28ea differs from pull request most recent head c9ac585. Consider uploading reports for the commit c9ac585 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9807      +/-   ##
==========================================
- Coverage   82.26%   79.63%   -2.64%     
==========================================
  Files          98       98              
  Lines        5960     5980      +20     
==========================================
- Hits         4903     4762     -141     
- Misses       1057     1218     +161     
Impacted Files Coverage Δ
app/models/image.rb 82.50% <100.00%> (ø)
app/channels/application_cable/channel.rb 0.00% <0.00%> (-100.00%) ⬇️
app/channels/application_cable/connection.rb 0.00% <0.00%> (-100.00%) ⬇️
app/channels/user_channel.rb 0.00% <0.00%> (-83.34%) ⬇️
app/channels/user_notification_channel.rb 0.00% <0.00%> (-83.34%) ⬇️
app/channels/room_channel.rb 0.00% <0.00%> (-71.43%) ⬇️
app/helpers/comment_helper.rb 34.61% <0.00%> (-65.39%) ⬇️
app/controllers/comment_controller.rb 65.87% <0.00%> (-16.67%) ⬇️
app/controllers/subscription_controller.rb 64.64% <0.00%> (-11.12%) ⬇️
app/controllers/questions_controller.rb 79.72% <0.00%> (-9.46%) ⬇️
... and 14 more

app/models/image.rb Outdated Show resolved Hide resolved
app/models/image.rb Outdated Show resolved Hide resolved
app/models/image.rb Outdated Show resolved Hide resolved
app/models/image.rb Outdated Show resolved Hide resolved
@icarito
Copy link
Member

icarito commented Jun 15, 2021

Ok then we'll test this in unstable as discussed!

@jywarren
Copy link
Member Author

Tried this out- existing images look good but uploading didn't seem to work:

https://unstable.publiclab.org/notes/keshav_sethi0004/06-07-2020/gsoc-2020-week-5-coding-period-week-1-spam-management-dashboard#c26975

https://storage.googleapis.com/production-public-files/public/system/images/photos/000/039/685/original/PXL_20210610_011822610.jpg

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Details>No such object: production-public-files/public/system/images/photos/000/039/685/original/PXL_20210610_011822610.jpg</Details>
</Error>

@jywarren
Copy link
Member Author

@jywarren
Copy link
Member Author

We should check the logs, it seems the app is returning a success response so it thinks the file exists and succeeded. The url format looks good. Wonder whats wrong?

@jywarren
Copy link
Member Author

Here are the Rails logs for the upload:


[7912c979-d527-49fd-b78f-e97ede025ee4] Processing by ImagesController#create as JSON
[7912c979-d527-49fd-b78f-e97ede025ee4]   Parameters: {"uid"=>"1", "image"=>{"photo"=>#<ActionDispatch::Http::UploadedFile:0x00
007f016be18160 @tempfile=#<Tempfile:/tmp/RackMultipart20210617-3597-qxssed.jpg>, @original_filename="PXL_20210610_011822610.jp
g", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"image[photo]\"; filename=\"PXL_20210610_01182
2610.jpg\"\r\nContent-Type: image/jpeg\r\n">}}
[7912c979-d527-49fd-b78f-e97ede025ee4] [paperclip] Trying to link /tmp/RackMultipart20210617-3597-qxssed.jpg to /tmp/2dc06304b
a68b6eb7be46deb4c10885920210617-3597-1vxrxh9.jpg
[7912c979-d527-49fd-b78f-e97ede025ee4] [paperclip] Trying to link /tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxrxh9.j
pg to /tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1wefp3t.jpg
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: file -b --mime '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1wefp3t.j
pg'
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/2dc06304ba68b6eb7be46deb4
c10885920210617-3597-1vxrxh9.jpg[0]' 2>/dev/null
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: identify -format %m '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxr
xh9.jpg[0]'
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: convert '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxrxh9.jpg[0]' 
-auto-orient -resize "200x150>" '/tmp/473d4bdb9c5b36f63d38026c8de3278220210617-3597-1trlpiq'
[7912c979-d527-49fd-b78f-e97ede025ee4] [paperclip] Trying to link /tmp/473d4bdb9c5b36f63d38026c8de3278220210617-3597-1trlpiq t
o /tmp/c672fcdc5e1ae82e957844125759c1d320210617-3597-1edaa8n
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/2dc06304ba68b6eb7be46deb4
c10885920210617-3597-1vxrxh9.jpg[0]' 2>/dev/null
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: identify -format %m '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxr
xh9.jpg[0]'
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: convert '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxrxh9.jpg[0]' 
-auto-orient -resize "500x375>" '/tmp/473d4bdb9c5b36f63d38026c8de3278220210617-3597-ajre7e'
[7912c979-d527-49fd-b78f-e97ede025ee4] [paperclip] Trying to link /tmp/473d4bdb9c5b36f63d38026c8de3278220210617-3597-ajre7e to
 /tmp/ab4648842bc8076ecaeaf0cc7af086ac20210617-3597-1ke7emr
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/2dc06304ba68b6eb7be46deb4
c10885920210617-3597-1vxrxh9.jpg[0]' 2>/dev/null
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: identify -format %m '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxr
xh9.jpg[0]'
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: convert '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxrxh9.jpg[0]' 
-auto-orient -resize "800x600>" '/tmp/473d4bdb9c5b36f63d38026c8de3278220210617-3597-1yvqrkp'
[7912c979-d527-49fd-b78f-e97ede025ee4] [paperclip] Trying to link /tmp/473d4bdb9c5b36f63d38026c8de3278220210617-3597-1yvqrkp t
o /tmp/50017c6366a5ce88a96b7dca0d1f333f20210617-3597-1ar3bv8
[7912c979-d527-49fd-b78f-e97ede025ee4] [paperclip] Trying to link /tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1vxrxh9.j
pg to /tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1yy1cq9.jpg
[7912c979-d527-49fd-b78f-e97ede025ee4] Command :: file -b --mime '/tmp/2dc06304ba68b6eb7be46deb4c10885920210617-3597-1yy1cq9.j
pg'
[7912c979-d527-49fd-b78f-e97ede025ee4] Completed 200 OK in 2645ms (Views: 0.4ms | ActiveRecord: 292.9ms)
[85af9bc3-5cf9-4425-b104-cf04f14a1850] Started GET "/i/39685" for 72.92.236.166 at 2021-06-17 11:55:16 +0000
[85af9bc3-5cf9-4425-b104-cf04f14a1850] Processing by ImagesController#shortlink as HTML
[85af9bc3-5cf9-4425-b104-cf04f14a1850]   Parameters: {"id"=>"39685"}
[85af9bc3-5cf9-4425-b104-cf04f14a1850] Redirected to https://unstable.publiclab.org/system/images/photos/000/039/685/original/
PXL_20210610_011822610.jpg

@jywarren
Copy link
Member Author

OK, strangely, there is already a file in that location, in Google Cloud storage:

https://storage.googleapis.com/production-public-files/public/system/images/photos/000/039/685/original/44.jpg

Created Dec 11 2020, last modified Jan 14, 2021, 12:35:23 PM

So... what's up?

Wait!!! OMG, it's because unstable is trying to upload into the same production google cloud image store -- we need a different one for the unstable site, i guess?

Or am I just looking in the wrong spot for the file?

@icarito
Copy link
Member

icarito commented Jun 18, 2021 via email

@jywarren
Copy link
Member Author

I found this log on uploading to unstable:

[cf35d0d4-b72f-4826-96d9-fce47858074b] Started POST "/images" for 190.13.155.140 at 2021-06-22 19:24:16 +0000
[cf35d0d4-b72f-4826-96d9-fce47858074b] Processing by ImagesController#create as JSON
[cf35d0d4-b72f-4826-96d9-fce47858074b]   Parameters: {"uid"=>"448589", "image"=>{"photo"=>#<ActionDispatch::Http::UploadedFile:0x00007f8126a38b68 @tempfile=#<Tempfile:/tmp/RackMultipart20210622-3551-1gjscco.jpg>, @original_filename="selfie.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"image[photo]\"; filename=\"selfie.jpg\"\r\nContent-Type: image/jpeg\r\n">}}
[cf35d0d4-b72f-4826-96d9-fce47858074b] [paperclip] Trying to link /tmp/RackMultipart20210622-3551-1gjscco.jpg to /tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg
[cf35d0d4-b72f-4826-96d9-fce47858074b] [paperclip] Trying to link /tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg to /tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-1jhbhin.jpg
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: file -b --mime '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-1jhbhin.jpg'
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]' 2>/dev/null
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: identify -format %m '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]'
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: convert '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]' -auto-orient -resize "200x150>" '/tmp/20b0c36a9e1d8c5d4f9e9222cac588f520210622-3551-txnmrs'
[cf35d0d4-b72f-4826-96d9-fce47858074b] [paperclip] Trying to link /tmp/20b0c36a9e1d8c5d4f9e9222cac588f520210622-3551-txnmrs to /tmp/b6ae7ad269c0517c1b200a325882455420210622-3551-1rybk5
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]' 2>/dev/null
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: identify -format %m '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]'
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: convert '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]' -auto-orient -resize "500x375>" '/tmp/20b0c36a9e1d8c5d4f9e9222cac588f520210622-3551-w599o5'
[cf35d0d4-b72f-4826-96d9-fce47858074b] [paperclip] Trying to link /tmp/20b0c36a9e1d8c5d4f9e9222cac588f520210622-3551-w599o5 to /tmp/3e79b286047fa0c5214b7fae1ac052a620210622-3551-1ok0dsw
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]' 2>/dev/null
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: identify -format %m '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]'
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: convert '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg[0]' -auto-orient -resize "800x600>" '/tmp/20b0c36a9e1d8c5d4f9e9222cac588f520210622-3551-1mb11ef'
[cf35d0d4-b72f-4826-96d9-fce47858074b] [paperclip] Trying to link /tmp/20b0c36a9e1d8c5d4f9e9222cac588f520210622-3551-1mb11ef to /tmp/6b4b73f4f6abc75d2ce73372f37362ab20210622-3551-jlkp78
[cf35d0d4-b72f-4826-96d9-fce47858074b] [paperclip] Trying to link /tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-lr6gpo.jpg to /tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-1h62l4c.jpg
[cf35d0d4-b72f-4826-96d9-fce47858074b] Command :: file -b --mime '/tmp/f510b87b8c2efb5562be8c33f2bcd30d20210622-3551-1h62l4c.jpg'
[cf35d0d4-b72f-4826-96d9-fce47858074b] Completed 200 OK in 760ms (Views: 0.8ms | ActiveRecord: 209.3ms)

@icarito
Copy link
Member

icarito commented Jun 22, 2021

It doesn't look like an error

I found this log on uploading to unstable:

@jywarren
Copy link
Member Author

@jywarren
Copy link
Member Author

Progress: |========ERROR ImageTest#test_upload_via_datauri/dataurl (1.43s)
Minitest::UnexpectedError:         NameError: uninitialized constant Fog
            test/unit/image_test.rb:14:in `block in <class:ImageTest>'

@icarito
Copy link
Member

icarito commented Jun 30, 2021

Testing with new HMAC keys, (https://cloud.google.com/storage/docs/authentication/managing-hmackeys#create) after debugging issues with dependencies and configuration.

@icarito
Copy link
Member

icarito commented Jun 30, 2021

Okay it seems the authentication went fine now, but now we're getting:

web_1      | [4e964513-ee0f-472b-8a92-4652f40bffb8] [paperclip] saving images/photos/000/039/705/original/índice.jpg   
web_1      | App 3636 output: [fog][WARNING] Unrecognized arguments: local_root                        
web_1      | [4e964513-ee0f-472b-8a92-4652f40bffb8] Completed 500 Internal Server Error in 1696ms (ActiveRecord: 198.6ms)     
web_1      | [4e964513-ee0f-472b-8a92-4652f40bffb8] Sending event 606c240061b54ef8bb7b2d6eb77f442c to Sentry                  
web_1      | [4e964513-ee0f-472b-8a92-4652f40bffb8]                              
web_1      | [4e964513-ee0f-472b-8a92-4652f40bffb8] Excon::Error::BadRequest (Expected(200) <=> Actual(400 Bad Request)
web_1      | excon.error.response
web_1      |   :body          => "<?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Messa
ge><Details>Cannot insert legacy ACL for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storag
e/docs/uniform-bucket-level-access</Details></Error>"                                                                       
web_1      |   :cookies       => [              
web_1      |   ]                                                           
web_1      |   :headers       => {                                        
web_1      |     "Alt-Svc"              => "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"
; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
web_1      |     "Content-Length"       => "298"                                                                              
web_1      |     "Content-Type"         => "application/xml; charset=UTF-8"
web_1      |     "Date"                 => "Wed, 30 Jun 2021 13:27:56 GMT"
web_1      |     "Server"               => "UploadServer"                        
web_1      |     "Vary"                 => "Origin"
web_1      |     "X-GUploader-UploadID" => "ABg5-UyFXWe4eAIG2MR5i7LHhfYLoSQKQGy5UBiAd62FJ9OZS6oj6vL270ErAfSo6Z03PmrC1IyydIs9kRycewb-YMlJ6-Ey
Jw"
web_1      |   }
web_1      |   :host          => "production-public-files.storage.googleapis.com"
web_1      |   :local_address => "172.19.0.5"
web_1      |   :local_port    => 54676
web_1      |   :path          => "/images%2Fphotos%2F000%2F039%2F705%2Foriginal%2F%C3%ADndice.jpg"
web_1      |   :port          => 443
web_1      |   :reason_phrase => "Bad Request"
web_1      |   :remote_ip     => "142.250.80.16"
web_1      |   :status        => 400
web_1      |   :status_line   => "HTTP/1.1 400 Bad Request\r\n"
web_1      | ):

@icarito
Copy link
Member

icarito commented Jun 30, 2021

so it looks like the local_root variables is required when using fog-local but rejected when using fog-google

@icarito
Copy link
Member

icarito commented Jun 30, 2021

Looks like the problem wasn't local_root, will restore it for now and figure out the actual problem.

web_1      | [82e9879b-4558-4d97-b359-4306843c2902] [paperclip] saving images/photos/000/039/706/original/publiclab.png            [70/1934]
web_1      | [82e9879b-4558-4d97-b359-4306843c2902] Completed 500 Internal Server Error in 2169ms (ActiveRecord: 612.6ms)                   
web_1      | [82e9879b-4558-4d97-b359-4306843c2902] Sending event 68d1e4c30ad145b385ca290b8dce2dd7 to Sentry                                
web_1      | [82e9879b-4558-4d97-b359-4306843c2902]                                                                                         
web_1      | [82e9879b-4558-4d97-b359-4306843c2902] Excon::Error::BadRequest (Expected(200) <=> Actual(400 Bad Request)                     
web_1      | excon.error.response                                                                                                           
web_1      |   :body          => "<?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Mess$
ge><Details>Cannot insert legacy ACL for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/stora$
e/docs/uniform-bucket-level-access</Details></Error>"                                                                                       
web_1      |   :cookies       => [                                                                          
web_1      |   ]                                                                                                                            
web_1      |   :headers       => {                                                                    
web_1      |     "Alt-Svc"              => "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\$
; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""                              
web_1      |     "Content-Length"       => "298"                                           
web_1      |     "Content-Type"         => "application/xml; charset=UTF-8"                                         
web_1      |     "Date"                 => "Wed, 30 Jun 2021 14:44:03 GMT"                                                                  
web_1      |     "Server"               => "UploadServer"                                                   
web_1      |     "Vary"                 => "Origin"                                                    
web_1      |     "X-GUploader-UploadID" => "ABg5-UzYoFFjaa5iSmawrabiqbJb0VUg4L5J2BfEgKHEWiry13kAaZ_J59gU5OgRrdHgh5tQ5J46qDjAMt1wDYfiiD8"
web_1      |   }                                                                                        
web_1      |   :host          => "production-public-files.storage.googleapis.com"                     
web_1      |   :local_address => "172.21.0.5"                                                 
web_1      |   :local_port    => 52138                                                            
web_1      |   :path          => "/images%2Fphotos%2F000%2F039%2F706%2Foriginal%2Fpubliclab.png"  
web_1      |   :port          => 443                                                                  
web_1      |   :reason_phrase => "Bad Request"                                                                       
web_1      |   :remote_ip     => "142.250.80.16"                                                           
web_1      |   :status        => 400                                                                 
web_1      |   :status_line   => "HTTP/1.1 400 Bad Request\r\n"                                               
web_1      | ):                                                                                      
web_1      | [82e9879b-4558-4d97-b359-4306843c2902]                                                
web_1      | [82e9879b-4558-4d97-b359-4306843c2902] app/controllers/images_controller.rb:37:in `create' 

@icarito
Copy link
Member

icarito commented Jun 30, 2021

The docs say:

There are two ways to access Google Cloud Storage. The old S3 API and the new JSON API. Fog::Storage::Google will automatically direct you to the appropriate API based on the credentials you provide it.

    The XML API is almost identical to S3. Use Google's interoperability keys to access it.
    The new JSON API is faster and uses auth similarly to the rest of the Google Cloud APIs using a service account private key.

So I'm guessing the ACL error that happens with uniform bucket level access happens when using the XML S3 API... Will try the JSON one.

@codeclimate
Copy link

codeclimate bot commented Jul 17, 2021

Code Climate has analyzed commit c9ac585 and detected 0 issues on this pull request.

View more on Code Climate.

@jywarren
Copy link
Member Author

I think we're ready to go! The gitpod dev setup has no old images. Let's pass tests and merge, final check stable, and publish!

@jywarren jywarren merged commit 4a891dc into main Jul 17, 2021
@jywarren
Copy link
Member Author

Woohoo!! 🎉

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* switch image.rb to google storage via fog library

* Update app/models/image.rb

* Update app/models/image.rb

* Update app/models/image.rb

* Update image.rb

* Add missing env vars

* Add missing env vars to other environments

* Update paperclip.rb

* Update docker-compose-production.yml

* Update docker-compose-stable.yml

* Update docker-compose-unstable.yml

* install fog-google

* added local fog config and switch

* fixed local storage for dev

* fog_host relative

* revert fog-google to before double-splat bug

* Omit local_root parameter

* Revert "Omit local_root parameter"

This reverts commit 8406611.

* Add JSON key option to Google Cloud Storage config

* fixed display config with style, path

* google_project

* Update Gemfile

* remove XML keys

```
    google_storage_access_key_id: ENV["GOOGLE_STORAGE_KEY"] || '' ,
    google_storage_secret_access_key: ENV["GOOGLE_STORAGE_SECRET"] || ''
```

* Add path adjustment to fog storage provider

Co-authored-by: Sebastian Silva <[email protected]>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* switch image.rb to google storage via fog library

* Update app/models/image.rb

* Update app/models/image.rb

* Update app/models/image.rb

* Update image.rb

* Add missing env vars

* Add missing env vars to other environments

* Update paperclip.rb

* Update docker-compose-production.yml

* Update docker-compose-stable.yml

* Update docker-compose-unstable.yml

* install fog-google

* added local fog config and switch

* fixed local storage for dev

* fog_host relative

* revert fog-google to before double-splat bug

* Omit local_root parameter

* Revert "Omit local_root parameter"

This reverts commit 8406611.

* Add JSON key option to Google Cloud Storage config

* fixed display config with style, path

* google_project

* Update Gemfile

* remove XML keys

```
    google_storage_access_key_id: ENV["GOOGLE_STORAGE_KEY"] || '' ,
    google_storage_secret_access_key: ENV["GOOGLE_STORAGE_SECRET"] || ''
```

* Add path adjustment to fog storage provider

Co-authored-by: Sebastian Silva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement paperclip or other way to upload to Google Cloud Storage
3 participants