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 +4 -4
- data/app/helpers/uploadbox/img_helper.rb +2 -2
- data/app/views/uploadbox/images/_uploads_many.slim +4 -4
- data/app/views/uploadbox/images/_uploads_one.slim +2 -2
- data/lib/generators/uploadbox/image/templates/initializers/uploadbox.rb +10 -10
- data/lib/uploadbox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b14b3a91e04db2760f426eff8cb487bf999b2625
|
4
|
+
data.tar.gz: 8b3d1c63566a298ca49e67e7560d1953ded27d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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:
|
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://#{
|
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="#{
|
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://#{
|
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="#{
|
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://#{
|
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="#{
|
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
|
-
|
11
|
-
|
11
|
+
CarrierWave.configure do |config|
|
12
|
+
config.storage = :fog
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
20
|
-
|
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?
|
data/lib/uploadbox/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|