asset_sync 2.13.1 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yaml +5 -1
- data/CHANGELOG.md +37 -1
- data/README.md +11 -0
- data/asset_sync.gemspec +2 -0
- data/lib/asset_sync/config.rb +23 -5
- data/lib/asset_sync/engine.rb +1 -0
- data/lib/asset_sync/storage.rb +3 -1
- data/lib/asset_sync/version.rb +1 -1
- data/lib/generators/asset_sync/templates/asset_sync.rb +5 -0
- data/lib/generators/asset_sync/templates/asset_sync.yml +5 -0
- data/spec/unit/google_spec.rb +22 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a42f7c7165955b9d333a17c2c734948699b76dfdc1682c37f3188af87896d72d
|
4
|
+
data.tar.gz: 7b0cec36a35ace13ceac1aa6e1681c608b3a4ef688ba8870d1d32e9c7d8160b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6ff1f9c5b9c9fa8dd53ee0000d00d42d9746801e9c5dd10400b8c18ae177c2dfd9f5f749bae52553c79550e71c5940771a069bfbe807af437744a61fc6fe72
|
7
|
+
data.tar.gz: 565480826f1820bbb8b4438886fa92d6f49369209ddbb0981f5cdb948b03d73ee5bbb4803febef56907d279a434cc819f2877804a7e5135ad28beb412c6a91ac
|
@@ -6,16 +6,20 @@ on:
|
|
6
6
|
- master
|
7
7
|
paths-ignore:
|
8
8
|
- 'README.md'
|
9
|
+
- 'CHANGELOG.md'
|
9
10
|
push:
|
10
11
|
branches:
|
11
12
|
- master
|
12
13
|
paths-ignore:
|
13
14
|
- 'README.md'
|
15
|
+
- 'CHANGELOG.md'
|
14
16
|
|
15
17
|
jobs:
|
16
18
|
unit_tests:
|
17
19
|
name: Unit Tests
|
18
|
-
|
20
|
+
# Homemade support for [ci skip] no longer needed
|
21
|
+
# https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/
|
22
|
+
# if: "contains(github.event.commits[0].message, '[ci skip]') == false"
|
19
23
|
strategy:
|
20
24
|
fail-fast: false
|
21
25
|
matrix:
|
data/CHANGELOG.md
CHANGED
@@ -18,6 +18,38 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
+
## [2.15.0] - 2021-08-05
|
22
|
+
|
23
|
+
### Added
|
24
|
+
|
25
|
+
- Add support for option `aws_acl`
|
26
|
+
(https://github.com/AssetSync/asset_sync/pull/420)
|
27
|
+
|
28
|
+
|
29
|
+
## [2.14.2] - 2021-05-31
|
30
|
+
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Add support for setting option `google_json_key_string` in YML (not new option)
|
34
|
+
(https://github.com/AssetSync/asset_sync/pull/419)
|
35
|
+
|
36
|
+
|
37
|
+
## [2.14.1] - 2021-05-14
|
38
|
+
|
39
|
+
### Added
|
40
|
+
|
41
|
+
- Add support for setting option `log_silently` in YML (not new option)
|
42
|
+
(https://github.com/AssetSync/asset_sync/pull/417)
|
43
|
+
|
44
|
+
|
45
|
+
## [2.14.0] - 2021-03-31
|
46
|
+
|
47
|
+
### Added
|
48
|
+
|
49
|
+
- Add support for fog option `google_json_key_string`
|
50
|
+
(https://github.com/AssetSync/asset_sync/pull/415)
|
51
|
+
|
52
|
+
|
21
53
|
## [2.13.1] - 2021-03-01
|
22
54
|
|
23
55
|
### Fixed
|
@@ -994,7 +1026,11 @@ Changes:
|
|
994
1026
|
* Merge branch 'sinatra'
|
995
1027
|
|
996
1028
|
|
997
|
-
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.
|
1029
|
+
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.15.0...HEAD
|
1030
|
+
[2.15.0]: https://github.com/AssetSync/asset_sync/compare/v2.14.2...v2.15.0
|
1031
|
+
[2.14.2]: https://github.com/AssetSync/asset_sync/compare/v2.14.1...v2.14.2
|
1032
|
+
[2.14.1]: https://github.com/AssetSync/asset_sync/compare/v2.14.0...v2.14.1
|
1033
|
+
[2.14.0]: https://github.com/AssetSync/asset_sync/compare/v2.13.1...v2.14.0
|
998
1034
|
[2.13.1]: https://github.com/AssetSync/asset_sync/compare/v2.13.0...v2.13.1
|
999
1035
|
[2.13.0]: https://github.com/AssetSync/asset_sync/compare/v2.12.1...v2.13.0
|
1000
1036
|
[2.12.1]: https://github.com/AssetSync/asset_sync/compare/v2.12.0...v2.12.1
|
data/README.md
CHANGED
@@ -239,6 +239,11 @@ AssetSync.configure do |config|
|
|
239
239
|
# Change AWS signature version. Default is 4
|
240
240
|
# config.aws_signature_version = 4
|
241
241
|
#
|
242
|
+
# Change canned ACL of uploaded object. Default is unset. Will override fog_public if set.
|
243
|
+
# Choose from: private | public-read | public-read-write | aws-exec-read |
|
244
|
+
# authenticated-read | bucket-owner-read | bucket-owner-full-control
|
245
|
+
# config.aws_acl = nil
|
246
|
+
#
|
242
247
|
# Change host option in fog (only if you need to)
|
243
248
|
# config.fog_host = 's3.amazonaws.com'
|
244
249
|
#
|
@@ -309,6 +314,11 @@ defaults: &defaults
|
|
309
314
|
# Change AWS signature version. Default is 4
|
310
315
|
# aws_signature_version: 4
|
311
316
|
#
|
317
|
+
# Change canned ACL of uploaded object. Default is unset. Will override fog_public if set.
|
318
|
+
# Choose from: private | public-read | public-read-write | aws-exec-read |
|
319
|
+
# authenticated-read | bucket-owner-read | bucket-owner-full-control
|
320
|
+
# aws_acl: null
|
321
|
+
#
|
312
322
|
# Change host option in fog (only if you need to)
|
313
323
|
# fog_host: "s3.amazonaws.com"
|
314
324
|
#
|
@@ -420,6 +430,7 @@ The blocks are run when local files are being scanned and uploaded
|
|
420
430
|
|
421
431
|
* **aws\_access\_key\_id**: your Amazon S3 access key
|
422
432
|
* **aws\_secret\_access\_key**: your Amazon S3 access secret
|
433
|
+
* **aws\_acl**: set [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl) of uploaded object, will override fog_public if set
|
423
434
|
|
424
435
|
#### Rackspace
|
425
436
|
|
data/asset_sync.gemspec
CHANGED
@@ -33,6 +33,8 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency "uglifier"
|
34
34
|
s.add_development_dependency "appraisal"
|
35
35
|
|
36
|
+
s.add_development_dependency "gem-release"
|
37
|
+
|
36
38
|
s.files = `git ls-files`.split("\n")
|
37
39
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
38
40
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
data/lib/asset_sync/config.rb
CHANGED
@@ -37,7 +37,15 @@ module AssetSync
|
|
37
37
|
attr_reader :fog_public # e.g. true, false, "default"
|
38
38
|
|
39
39
|
# Amazon AWS
|
40
|
-
attr_accessor :aws_access_key_id
|
40
|
+
attr_accessor :aws_access_key_id
|
41
|
+
attr_accessor :aws_secret_access_key
|
42
|
+
attr_accessor :aws_session_token
|
43
|
+
attr_accessor :aws_reduced_redundancy
|
44
|
+
attr_accessor :aws_iam_roles
|
45
|
+
attr_accessor :aws_signature_version
|
46
|
+
attr_accessor :aws_acl
|
47
|
+
|
48
|
+
# Fog
|
41
49
|
attr_accessor :fog_host # e.g. 's3.amazonaws.com'
|
42
50
|
attr_accessor :fog_port # e.g. '9000'
|
43
51
|
attr_accessor :fog_path_style # e.g. true
|
@@ -49,6 +57,7 @@ module AssetSync
|
|
49
57
|
# Google Storage
|
50
58
|
attr_accessor :google_storage_secret_access_key, :google_storage_access_key_id # when using S3 interop
|
51
59
|
attr_accessor :google_json_key_location # when using service accounts
|
60
|
+
attr_accessor :google_json_key_string # when using service accounts
|
52
61
|
attr_accessor :google_project # when using service accounts
|
53
62
|
|
54
63
|
# Azure Blob with Fog::AzureRM
|
@@ -71,8 +80,12 @@ module AssetSync
|
|
71
80
|
validates :rackspace_api_key, :presence => true, :if => :rackspace?
|
72
81
|
validates :google_storage_secret_access_key, :presence => true, :if => :google_interop?
|
73
82
|
validates :google_storage_access_key_id, :presence => true, :if => :google_interop?
|
74
|
-
validates :google_json_key_location, :presence => true, :if => :google_service_account?
|
75
83
|
validates :google_project, :presence => true, :if => :google_service_account?
|
84
|
+
validate(:if => :google_service_account?) do
|
85
|
+
unless google_json_key_location.present? || google_json_key_string.present?
|
86
|
+
errors.add(:base, 'must provide either google_json_key_location or google_json_key_string if using Google service account')
|
87
|
+
end
|
88
|
+
end
|
76
89
|
validates :concurrent_uploads, :inclusion => { :in => [true, false] }
|
77
90
|
|
78
91
|
def initialize
|
@@ -147,11 +160,11 @@ module AssetSync
|
|
147
160
|
end
|
148
161
|
|
149
162
|
def google_interop?
|
150
|
-
google? && google_json_key_location.nil?
|
163
|
+
google? && google_json_key_location.nil? && google_json_key_string.nil?
|
151
164
|
end
|
152
165
|
|
153
166
|
def google_service_account?
|
154
|
-
google? && google_json_key_location
|
167
|
+
google? && (google_json_key_location || google_json_key_string)
|
155
168
|
end
|
156
169
|
|
157
170
|
def azure_rm?
|
@@ -216,6 +229,7 @@ module AssetSync
|
|
216
229
|
self.aws_reduced_redundancy = yml["aws_reduced_redundancy"]
|
217
230
|
self.aws_iam_roles = yml["aws_iam_roles"]
|
218
231
|
self.aws_signature_version = yml["aws_signature_version"]
|
232
|
+
self.aws_acl = yml["aws_acl"]
|
219
233
|
self.rackspace_username = yml["rackspace_username"]
|
220
234
|
self.rackspace_auth_url = yml["rackspace_auth_url"] if yml.has_key?("rackspace_auth_url")
|
221
235
|
self.rackspace_api_key = yml["rackspace_api_key"]
|
@@ -223,13 +237,15 @@ module AssetSync
|
|
223
237
|
self.google_project = yml["google_project"] if yml.has_key?("google_project")
|
224
238
|
self.google_storage_secret_access_key = yml["google_storage_secret_access_key"] if yml.has_key?("google_storage_secret_access_key")
|
225
239
|
self.google_storage_access_key_id = yml["google_storage_access_key_id"] if yml.has_key?("google_storage_access_key_id")
|
240
|
+
self.google_json_key_string = yml["google_json_key_string"] if yml.has_key?("google_json_key_string")
|
226
241
|
self.existing_remote_files = yml["existing_remote_files"] if yml.has_key?("existing_remote_files")
|
227
242
|
self.gzip_compression = yml["gzip_compression"] if yml.has_key?("gzip_compression")
|
228
243
|
self.manifest = yml["manifest"] if yml.has_key?("manifest")
|
229
244
|
self.fail_silently = yml["fail_silently"] if yml.has_key?("fail_silently")
|
245
|
+
self.log_silently = yml["log_silently"] if yml.has_key?("log_silently")
|
230
246
|
self.always_upload = yml["always_upload"] if yml.has_key?("always_upload")
|
231
247
|
self.ignored_files = yml["ignored_files"] if yml.has_key?("ignored_files")
|
232
|
-
self.custom_headers
|
248
|
+
self.custom_headers = yml["custom_headers"] if yml.has_key?("custom_headers")
|
233
249
|
self.run_on_precompile = yml["run_on_precompile"] if yml.has_key?("run_on_precompile")
|
234
250
|
self.invalidate = yml["invalidate"] if yml.has_key?("invalidate")
|
235
251
|
self.cdn_distribution_id = yml['cdn_distribution_id'] if yml.has_key?("cdn_distribution_id")
|
@@ -292,6 +308,8 @@ module AssetSync
|
|
292
308
|
elsif google?
|
293
309
|
if google_json_key_location
|
294
310
|
options.merge!({:google_json_key_location => google_json_key_location, :google_project => google_project})
|
311
|
+
elsif google_json_key_string
|
312
|
+
options.merge!({:google_json_key_string => google_json_key_string, :google_project => google_project})
|
295
313
|
else
|
296
314
|
options.merge!({
|
297
315
|
:google_storage_secret_access_key => google_storage_secret_access_key,
|
data/lib/asset_sync/engine.rb
CHANGED
@@ -25,6 +25,7 @@ module AssetSync
|
|
25
25
|
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] if ENV.has_key?('AWS_SECRET_ACCESS_KEY')
|
26
26
|
config.aws_session_token = ENV['AWS_SESSION_TOKEN'] if ENV.has_key?('AWS_SESSION_TOKEN')
|
27
27
|
config.aws_signature_version = ENV['AWS_SIGNATURE_VERSION'] if ENV.has_key?('AWS_SIGNATURE_VERSION')
|
28
|
+
config.aws_acl = ENV['AWS_ACL'] if ENV.has_key?('AWS_ACL')
|
28
29
|
config.aws_reduced_redundancy = ENV['AWS_REDUCED_REDUNDANCY'] == true if ENV.has_key?('AWS_REDUCED_REDUNDANCY')
|
29
30
|
|
30
31
|
config.rackspace_username = ENV['RACKSPACE_USERNAME'] if ENV.has_key?('RACKSPACE_USERNAME')
|
data/lib/asset_sync/storage.rb
CHANGED
@@ -195,7 +195,9 @@ module AssetSync
|
|
195
195
|
|
196
196
|
# region fog_public
|
197
197
|
|
198
|
-
if config.
|
198
|
+
if config.aws? && config.aws_acl
|
199
|
+
file[:acl] = config.aws_acl
|
200
|
+
elsif config.fog_public.use_explicit_value?
|
199
201
|
file[:public] = config.fog_public.to_bool
|
200
202
|
end
|
201
203
|
|
data/lib/asset_sync/version.rb
CHANGED
@@ -11,6 +11,11 @@ if defined?(AssetSync)
|
|
11
11
|
# Change AWS signature version. Default is 4
|
12
12
|
# config.aws_signature_version = 4
|
13
13
|
#
|
14
|
+
# Change canned ACL of uploaded object. Default is unset. Will override fog_public if set.
|
15
|
+
# Choose from: private | public-read | public-read-write | aws-exec-read |
|
16
|
+
# authenticated-read | bucket-owner-read | bucket-owner-full-control
|
17
|
+
# config.aws_acl = nil
|
18
|
+
#
|
14
19
|
# Change host option in fog (only if you need to)
|
15
20
|
# config.fog_host = "s3.amazonaws.com"
|
16
21
|
#
|
@@ -10,6 +10,11 @@ defaults: &defaults
|
|
10
10
|
# Change AWS signature version. Default is 4
|
11
11
|
# aws_signature_version: 4
|
12
12
|
#
|
13
|
+
# Change canned ACL of uploaded object. Default is unset. Will override fog_public if set.
|
14
|
+
# Choose from: private | public-read | public-read-write | aws-exec-read |
|
15
|
+
# authenticated-read | bucket-owner-read | bucket-owner-full-control
|
16
|
+
# aws_acl: null
|
17
|
+
#
|
13
18
|
# Change host option in fog (only if you need to)
|
14
19
|
# fog_host: "s3.amazonaws.com"
|
15
20
|
#
|
data/spec/unit/google_spec.rb
CHANGED
@@ -99,6 +99,28 @@ describe AssetSync do
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
+
describe "when using service account with JSON key string" do
|
103
|
+
before(:each) do
|
104
|
+
AssetSync.configure do |config|
|
105
|
+
config.google_json_key_string = 'a-google-json-key-string'
|
106
|
+
config.google_project = 'a-google-project-name'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should configure google_json_key_string" do
|
111
|
+
expect(AssetSync.config.google_json_key_string).to eq("a-google-json-key-string")
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should return the correct fog_options" do
|
115
|
+
expected_fog_options = { google_json_key_string: "a-google-json-key-string",
|
116
|
+
google_project: 'a-google-project-name',
|
117
|
+
provider: "Google"}
|
118
|
+
expect(AssetSync.config.fog_options).to eq(expected_fog_options)
|
119
|
+
end
|
120
|
+
it "should not require that google_storage_secret_access_key or access_key_id be set" do
|
121
|
+
expect(AssetSync.config.valid?).to eq(true)
|
122
|
+
end
|
123
|
+
end
|
102
124
|
end
|
103
125
|
|
104
126
|
describe 'from yml' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Hamilton
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-08-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-core
|
@@ -195,6 +195,20 @@ dependencies:
|
|
195
195
|
- - ">="
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: '0'
|
198
|
+
- !ruby/object:Gem::Dependency
|
199
|
+
name: gem-release
|
200
|
+
requirement: !ruby/object:Gem::Requirement
|
201
|
+
requirements:
|
202
|
+
- - ">="
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: '0'
|
205
|
+
type: :development
|
206
|
+
prerelease: false
|
207
|
+
version_requirements: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '0'
|
198
212
|
description: After you run assets:precompile your compiled assets will be synchronised
|
199
213
|
with your S3 bucket.
|
200
214
|
email:
|
@@ -273,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
287
|
- !ruby/object:Gem::Version
|
274
288
|
version: '0'
|
275
289
|
requirements: []
|
276
|
-
rubygems_version: 3.2.
|
290
|
+
rubygems_version: 3.2.25
|
277
291
|
signing_key:
|
278
292
|
specification_version: 4
|
279
293
|
summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and
|