uploadbox 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a773cd441b95b22294bdd947ffe1bb636bec7e2c
4
- data.tar.gz: 450426b4ca359fde89277d12b6edb862179f3c20
3
+ metadata.gz: b14b3a91e04db2760f426eff8cb487bf999b2625
4
+ data.tar.gz: 8b3d1c63566a298ca49e67e7560d1953ded27d5b
5
5
  SHA512:
6
- metadata.gz: d7a82f04b033d92f1298c38ba9e0a0233136747b2a37a13713919bc3f5b3ff2a2e2929d4c8a4fa47b77d08600dcacd9e4c28fcbdc236a4b790f2fd7ce01cd967
7
- data.tar.gz: 217a1ba65fd177a1faa3b0a34aea30946334e834720ec6c5230536e1716fd4394391d936bf8c014c8afa5e3195871553a2aa839861c89639a64a820ee88820c5
6
+ metadata.gz: aab6b6bd767354eb9e9ac395360fc8ff2227de136febc4b6ab776647a70fc353a41c6d014f68f3c0c90e5c3e75a9cd07db321ab4fac9efc237da3c4a623b0231
7
+ data.tar.gz: 86522a625c4bf37beefcc5dbeb6985e4278e6aa138b5c5b6171058605c8cb9e348f38d5d428fcfff7f1c993bd52610049f64675b8669153c7c0996e416bf8b4d
@@ -9,7 +9,7 @@ module Uploadbox
9
9
  Base64.encode64(
10
10
  OpenSSL::HMAC.digest(
11
11
  OpenSSL::Digest::Digest.new('sha1'),
12
- ENV['S3_SECRET'],
12
+ CarrierWave::Uploader::Base.fog_credentials[:aws_access_key_id],
13
13
  s3_policy
14
14
  )
15
15
  ).gsub("\n", "")
@@ -31,7 +31,7 @@ module Uploadbox
31
31
  ["starts-with", "$key", 'uploads/'],
32
32
  ["content-length-range", 0, 500.megabytes],
33
33
  ["starts-with","$content-type",""],
34
- {bucket: ENV['S3_BUCKET']},
34
+ {bucket: CarrierWave::Uploader::Base.fog_directory},
35
35
  {acl: 'public-read'}
36
36
  ]
37
37
  }
@@ -15,10 +15,10 @@
15
15
  span.fileupload-exists = update_label
16
16
  i.icon.icon-plus-1 style="line-height: #{height}px; font-size: #{(width * 0.4).to_i}px"
17
17
 
18
- input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{ENV['S3_BUCKET']}.s3.amazonaws.com/" accept="image/png image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;" multiple="true"
18
+ input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{CarrierWave::Uploader::Base.fog_directory}.s3.amazonaws.com/" accept="image/png image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;" multiple="true"
19
19
  input type="hidden" name="policy" value="#{s3_policy}"
20
20
  input type="hidden" name="signature" value="#{s3_signature}"
21
- input type="hidden" name="AWSAccessKeyId" value="#{ENV['S3_KEY']}"
21
+ input type="hidden" name="AWSAccessKeyId" value="#{CarrierWave::Uploader::Base.fog_credentials[:aws_access_key_id]}"
22
22
  input type="hidden" name="acl" value="public-read"
23
23
  input type="hidden" name="key"
24
24
 
@@ -47,10 +47,10 @@
47
47
  span.fileupload-exists = update_label
48
48
  i.icon.icon-plus-1 style="line-height: #{height}px; font-size: #{(width * 0.4).to_i}px"
49
49
 
50
- input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{ENV['S3_BUCKET']}.s3.amazonaws.com/" accept="image/png image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;" multiple="true"
50
+ input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{CarrierWave::Uploader::Base.fog_directory}.s3.amazonaws.com/" accept="image/png image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;" multiple="true"
51
51
  input type="hidden" name="policy" value="#{s3_policy}"
52
52
  input type="hidden" name="signature" value="#{s3_signature}"
53
- input type="hidden" name="AWSAccessKeyId" value="#{ENV['S3_KEY']}"
53
+ input type="hidden" name="AWSAccessKeyId" value="#{CarrierWave::Uploader::Base.fog_credentials[:aws_access_key_id]}"
54
54
  input type="hidden" name="acl" value="public-read"
55
55
  input type="hidden" name="key"
56
56
 
@@ -20,10 +20,10 @@
20
20
  i.icon.icon-picture-1 style="line-height: #{height}px; font-size: #{(width * 0.4).to_i}px"
21
21
 
22
22
 
23
- input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{ENV['S3_BUCKET']}.s3.amazonaws.com/" data-secure-random="#{secure_random}" accept="image/png image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;"
23
+ input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{CarrierWave::Uploader::Base.fog_directory}.s3.amazonaws.com/" data-secure-random="#{secure_random}" accept="image/png image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;"
24
24
  input type="hidden" name="policy" value="#{s3_policy}"
25
25
  input type="hidden" name="signature" value="#{s3_signature}"
26
- input type="hidden" name="AWSAccessKeyId" value="#{ENV['S3_KEY']}"
26
+ input type="hidden" name="AWSAccessKeyId" value="#{CarrierWave::Uploader::Base.fog_credentials[:aws_access_key_id]}"
27
27
  input type="hidden" name="acl" value="public-read"
28
28
  input type="hidden" name="key" value="uploads/#{secure_random}/"
29
29
 
@@ -6,19 +6,19 @@ if Rails.env.production?
6
6
  REDIS = Redis.connect(url: ENV["REDISCLOUD_URL"])
7
7
  Resque.redis = REDIS
8
8
  Resque.after_fork = Proc.new { ActiveRecord::Base.establish_connection }
9
+ end
9
10
 
10
- CarrierWave.configure do |config|
11
- config.storage = :fog
11
+ CarrierWave.configure do |config|
12
+ config.storage = :fog
12
13
 
13
- config.fog_credentials = {
14
- provider: 'AWS',
15
- aws_access_key_id: ENV['S3_KEY'],
16
- aws_secret_access_key: ENV['S3_SECRET']
17
- }
14
+ config.fog_credentials = {
15
+ provider: 'AWS',
16
+ aws_access_key_id: ENV['S3_KEY'],
17
+ aws_secret_access_key: ENV['S3_SECRET']
18
+ }
18
19
 
19
- config.fog_directory = ENV['S3_BUCKET']
20
- config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
21
- end
20
+ config.fog_directory = ENV['S3_BUCKET']
21
+ config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
22
22
  end
23
23
 
24
24
  if Rails.env.test?
@@ -1,3 +1,3 @@
1
1
  module Uploadbox
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uploadbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julio Protzek
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-18 00:00:00.000000000 Z
12
+ date: 2013-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails