middleman-s3_sync 3.0.19 → 3.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/README.md +30 -1
- data/lib/middleman/s3_sync/options.rb +10 -0
- data/lib/middleman/s3_sync/resource.rb +10 -4
- data/lib/middleman/s3_sync/version.rb +1 -1
- data/middleman-s3_sync.gemspec +1 -0
- metadata +45 -31
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MTBmYWVhODUwNmQ0MjBmYzMxODc4MTY1OTIwOWY0OTE3M2NiYmZiOQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: feba18a50d23cb1fe77c28d22d2c57d025e0e2fc
|
4
|
+
data.tar.gz: 2070409846735a00a49617fbc77bfbb1d2cde82e
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NzhhYjM4NTRmMDg3ODg5NjlmMzM0MThkNTI0NjM0Mjc4MjM1N2ZkYjMxYWVi
|
11
|
-
MzE2OWQzYzllOWUyOWIzMzBmYTNmOGJlM2I4MjljZTllMTcxNGY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZWM2NzY1NTc4Njk1NjM3OGRiNTI1MGUyYjg0ZjRjZmUwYTliM2M3OGVmZjcx
|
14
|
-
OTdlNTBmNmY3NTVkY2U5NzI3Nzk3ZjZiNDJiMGE1ZmZjYTBmYzhkNzdjM2Jl
|
15
|
-
Njg4MWQwODk5NTYzZWQxN2ZmYzFlYTE2YWQ0YmM3Zjc3NDY3ODA=
|
6
|
+
metadata.gz: 76d95a583a6544dd8eef1e5919f100f506a214713ccaaff912e14c1930528c61e6c77ef738bf76b004cba22593094f9f1b7be8afd745fc68314bf8d377a5d234
|
7
|
+
data.tar.gz: 6fd91b181e957fcd30d4ab60e83fa4e4450c8cbe5a20c2453155318092ba01f88c644d78aa70a9bf76e26c488750e7ea6202c72d7df3f3eb23258844fa651afa
|
data/README.md
CHANGED
@@ -43,7 +43,9 @@ activate :s3_sync do |s3_sync|
|
|
43
43
|
s3_sync.prefer_gzip = true
|
44
44
|
s3_sync.path_style = true
|
45
45
|
s3_sync.reduced_redundancy_storage = false
|
46
|
-
|
46
|
+
s3_sync.acl = 'public-read'
|
47
|
+
s3_sync.encryption = false
|
48
|
+
end
|
47
49
|
```
|
48
50
|
|
49
51
|
You can then start synchronizing files with S3 through ```middleman s3_sync```.
|
@@ -61,6 +63,8 @@ The following defaults apply to the configuration items:
|
|
61
63
|
| prefer_gzip | ```true``` |
|
62
64
|
| reduced_redundancy_storage | ```false``` |
|
63
65
|
| path_style | ```true``` |
|
66
|
+
| encryption | ```false``` |
|
67
|
+
| acl | ```'public-read'``` |
|
64
68
|
|
65
69
|
You do not need to specify the settings that match the defaults. This
|
66
70
|
simplify the configuration of the extension:
|
@@ -187,6 +191,31 @@ are (I'm looking at you Chrome!). Setting the `Cache-Control` or
|
|
187
191
|
that stand between them and your content will behave the way you want
|
188
192
|
them to. YMMV.
|
189
193
|
|
194
|
+
### ACLs
|
195
|
+
|
196
|
+
```middleman-s3_sync``` will set the resources's ACL to ```public-read``` by default. You
|
197
|
+
can specificy a different ACL via the ```acl``` configuration option.
|
198
|
+
The valid values are:
|
199
|
+
|
200
|
+
* ```private```
|
201
|
+
* ```public-read```
|
202
|
+
* ```public-read-write```
|
203
|
+
* ```authenticated-read```
|
204
|
+
* ```bucket-owner-read```
|
205
|
+
* ```bucket-owner-full-control```
|
206
|
+
|
207
|
+
The full values and their semantics are [documented on AWS's
|
208
|
+
documentation
|
209
|
+
site](http://docs.aws.amazon.com/AmazonS3/latest/dev/ACLOverview.html#CannedACL).
|
210
|
+
|
211
|
+
### Encryption
|
212
|
+
|
213
|
+
You can ask Amazon to encrypt your files at rest by setting the
|
214
|
+
```encryption``` option to true. [Server side encryption is documented
|
215
|
+
on the AWS documentation
|
216
|
+
site](http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html)
|
217
|
+
.
|
218
|
+
|
190
219
|
### GZipped Content Encoding
|
191
220
|
|
192
221
|
You can set the ```prefer_gzip``` option to look for a gzipped version
|
@@ -3,12 +3,14 @@ module Middleman
|
|
3
3
|
class Options
|
4
4
|
attr_accessor \
|
5
5
|
:prefix,
|
6
|
+
:acl,
|
6
7
|
:bucket,
|
7
8
|
:region,
|
8
9
|
:aws_access_key_id,
|
9
10
|
:aws_secret_access_key,
|
10
11
|
:after_build,
|
11
12
|
:delete,
|
13
|
+
:encryption,
|
12
14
|
:existing_remote_file,
|
13
15
|
:build_dir,
|
14
16
|
:force,
|
@@ -22,6 +24,10 @@ module Middleman
|
|
22
24
|
self.read_config
|
23
25
|
end
|
24
26
|
|
27
|
+
def acl
|
28
|
+
@acl || 'public-read'
|
29
|
+
end
|
30
|
+
|
25
31
|
def add_caching_policy(content_type, options)
|
26
32
|
caching_policies[content_type.to_s] = BrowserCachePolicy.new(options)
|
27
33
|
end
|
@@ -46,6 +52,10 @@ module Middleman
|
|
46
52
|
@aws_secret_access_key || ENV['AWS_SECRET_ACCESS_KEY']
|
47
53
|
end
|
48
54
|
|
55
|
+
def encryption
|
56
|
+
@encryption.nil? ? false : @encryption
|
57
|
+
end
|
58
|
+
|
49
59
|
def delete
|
50
60
|
@delete.nil? ? true : @delete
|
51
61
|
end
|
@@ -21,8 +21,7 @@ module Middleman
|
|
21
21
|
attributes = {
|
22
22
|
:key => key,
|
23
23
|
:body => body,
|
24
|
-
:
|
25
|
-
:acl => 'public-read',
|
24
|
+
:acl => options.acl,
|
26
25
|
:content_type => content_type,
|
27
26
|
CONTENT_MD5_KEY => content_md5
|
28
27
|
}
|
@@ -40,6 +39,10 @@ module Middleman
|
|
40
39
|
attributes[:storage_class] = 'REDUCED_REDUNDANCY'
|
41
40
|
end
|
42
41
|
|
42
|
+
if options.encryption
|
43
|
+
attributes[:encryption] = 'AES256'
|
44
|
+
end
|
45
|
+
|
43
46
|
attributes
|
44
47
|
end
|
45
48
|
alias :attributes :to_h
|
@@ -53,8 +56,7 @@ module Middleman
|
|
53
56
|
say_status "content md5: #{content_md5.white}"
|
54
57
|
end
|
55
58
|
s3_resource.body = body
|
56
|
-
s3_resource.
|
57
|
-
s3_resource.acl = 'public-read'
|
59
|
+
s3_resource.acl = options.acl
|
58
60
|
s3_resource.content_type = content_type
|
59
61
|
s3_resource.metadata = { CONTENT_MD5_KEY => content_md5 }
|
60
62
|
|
@@ -71,6 +73,10 @@ module Middleman
|
|
71
73
|
s3_resource.storage_class = 'REDUCED_REDUNDANCY'
|
72
74
|
end
|
73
75
|
|
76
|
+
if options.encryption
|
77
|
+
s3_resource.encryption = 'AES256'
|
78
|
+
end
|
79
|
+
|
74
80
|
s3_resource.save
|
75
81
|
end
|
76
82
|
|
data/middleman-s3_sync.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
21
|
gem.add_runtime_dependency 'middleman-core', '>= 3.0.0'
|
22
|
+
gem.add_runtime_dependency 'unf'
|
22
23
|
gem.add_runtime_dependency 'fog', '>= 1.10.1'
|
23
24
|
gem.add_runtime_dependency 'map'
|
24
25
|
gem.add_runtime_dependency 'pmap'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-s3_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederic Jean
|
@@ -9,188 +9,202 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman-core
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 3.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 3.0.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: unf
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: fog
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
31
45
|
requirements:
|
32
|
-
- -
|
46
|
+
- - '>='
|
33
47
|
- !ruby/object:Gem::Version
|
34
48
|
version: 1.10.1
|
35
49
|
type: :runtime
|
36
50
|
prerelease: false
|
37
51
|
version_requirements: !ruby/object:Gem::Requirement
|
38
52
|
requirements:
|
39
|
-
- -
|
53
|
+
- - '>='
|
40
54
|
- !ruby/object:Gem::Version
|
41
55
|
version: 1.10.1
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: map
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
|
-
- -
|
60
|
+
- - '>='
|
47
61
|
- !ruby/object:Gem::Version
|
48
62
|
version: '0'
|
49
63
|
type: :runtime
|
50
64
|
prerelease: false
|
51
65
|
version_requirements: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
|
-
- -
|
67
|
+
- - '>='
|
54
68
|
- !ruby/object:Gem::Version
|
55
69
|
version: '0'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: pmap
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
59
73
|
requirements:
|
60
|
-
- -
|
74
|
+
- - '>='
|
61
75
|
- !ruby/object:Gem::Version
|
62
76
|
version: '0'
|
63
77
|
type: :runtime
|
64
78
|
prerelease: false
|
65
79
|
version_requirements: !ruby/object:Gem::Requirement
|
66
80
|
requirements:
|
67
|
-
- -
|
81
|
+
- - '>='
|
68
82
|
- !ruby/object:Gem::Version
|
69
83
|
version: '0'
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
85
|
name: ruby-progressbar
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
|
-
- -
|
88
|
+
- - '>='
|
75
89
|
- !ruby/object:Gem::Version
|
76
90
|
version: '0'
|
77
91
|
type: :runtime
|
78
92
|
prerelease: false
|
79
93
|
version_requirements: !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
|
-
- -
|
95
|
+
- - '>='
|
82
96
|
- !ruby/object:Gem::Version
|
83
97
|
version: '0'
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: colorize
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
87
101
|
requirements:
|
88
|
-
- -
|
102
|
+
- - '>='
|
89
103
|
- !ruby/object:Gem::Version
|
90
104
|
version: '0'
|
91
105
|
type: :runtime
|
92
106
|
prerelease: false
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
|
-
- -
|
109
|
+
- - '>='
|
96
110
|
- !ruby/object:Gem::Version
|
97
111
|
version: '0'
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: rake
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
101
115
|
requirements:
|
102
|
-
- -
|
116
|
+
- - '>='
|
103
117
|
- !ruby/object:Gem::Version
|
104
118
|
version: '0'
|
105
119
|
type: :development
|
106
120
|
prerelease: false
|
107
121
|
version_requirements: !ruby/object:Gem::Requirement
|
108
122
|
requirements:
|
109
|
-
- -
|
123
|
+
- - '>='
|
110
124
|
- !ruby/object:Gem::Version
|
111
125
|
version: '0'
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: pry
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
|
-
- -
|
130
|
+
- - '>='
|
117
131
|
- !ruby/object:Gem::Version
|
118
132
|
version: '0'
|
119
133
|
type: :development
|
120
134
|
prerelease: false
|
121
135
|
version_requirements: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
|
-
- -
|
137
|
+
- - '>='
|
124
138
|
- !ruby/object:Gem::Version
|
125
139
|
version: '0'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: pry-nav
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
|
-
- -
|
144
|
+
- - '>='
|
131
145
|
- !ruby/object:Gem::Version
|
132
146
|
version: '0'
|
133
147
|
type: :development
|
134
148
|
prerelease: false
|
135
149
|
version_requirements: !ruby/object:Gem::Requirement
|
136
150
|
requirements:
|
137
|
-
- -
|
151
|
+
- - '>='
|
138
152
|
- !ruby/object:Gem::Version
|
139
153
|
version: '0'
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: rspec
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|
143
157
|
requirements:
|
144
|
-
- -
|
158
|
+
- - '>='
|
145
159
|
- !ruby/object:Gem::Version
|
146
160
|
version: '0'
|
147
161
|
type: :development
|
148
162
|
prerelease: false
|
149
163
|
version_requirements: !ruby/object:Gem::Requirement
|
150
164
|
requirements:
|
151
|
-
- -
|
165
|
+
- - '>='
|
152
166
|
- !ruby/object:Gem::Version
|
153
167
|
version: '0'
|
154
168
|
- !ruby/object:Gem::Dependency
|
155
169
|
name: timerizer
|
156
170
|
requirement: !ruby/object:Gem::Requirement
|
157
171
|
requirements:
|
158
|
-
- -
|
172
|
+
- - '>='
|
159
173
|
- !ruby/object:Gem::Version
|
160
174
|
version: '0'
|
161
175
|
type: :development
|
162
176
|
prerelease: false
|
163
177
|
version_requirements: !ruby/object:Gem::Requirement
|
164
178
|
requirements:
|
165
|
-
- -
|
179
|
+
- - '>='
|
166
180
|
- !ruby/object:Gem::Version
|
167
181
|
version: '0'
|
168
182
|
- !ruby/object:Gem::Dependency
|
169
183
|
name: travis
|
170
184
|
requirement: !ruby/object:Gem::Requirement
|
171
185
|
requirements:
|
172
|
-
- -
|
186
|
+
- - '>='
|
173
187
|
- !ruby/object:Gem::Version
|
174
188
|
version: '0'
|
175
189
|
type: :development
|
176
190
|
prerelease: false
|
177
191
|
version_requirements: !ruby/object:Gem::Requirement
|
178
192
|
requirements:
|
179
|
-
- -
|
193
|
+
- - '>='
|
180
194
|
- !ruby/object:Gem::Version
|
181
195
|
version: '0'
|
182
196
|
- !ruby/object:Gem::Dependency
|
183
197
|
name: travis-lint
|
184
198
|
requirement: !ruby/object:Gem::Requirement
|
185
199
|
requirements:
|
186
|
-
- -
|
200
|
+
- - '>='
|
187
201
|
- !ruby/object:Gem::Version
|
188
202
|
version: '0'
|
189
203
|
type: :development
|
190
204
|
prerelease: false
|
191
205
|
version_requirements: !ruby/object:Gem::Requirement
|
192
206
|
requirements:
|
193
|
-
- -
|
207
|
+
- - '>='
|
194
208
|
- !ruby/object:Gem::Version
|
195
209
|
version: '0'
|
196
210
|
description: Only syncs files that have been updated to S3.
|
@@ -232,17 +246,17 @@ require_paths:
|
|
232
246
|
- lib
|
233
247
|
required_ruby_version: !ruby/object:Gem::Requirement
|
234
248
|
requirements:
|
235
|
-
- -
|
249
|
+
- - '>='
|
236
250
|
- !ruby/object:Gem::Version
|
237
251
|
version: '0'
|
238
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
253
|
requirements:
|
240
|
-
- -
|
254
|
+
- - '>='
|
241
255
|
- !ruby/object:Gem::Version
|
242
256
|
version: '0'
|
243
257
|
requirements: []
|
244
258
|
rubyforge_project:
|
245
|
-
rubygems_version: 2.
|
259
|
+
rubygems_version: 2.0.3
|
246
260
|
signing_key:
|
247
261
|
specification_version: 4
|
248
262
|
summary: Tries really, really hard not to push files to S3.
|