asset_sync 2.8.1 → 2.15.2
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 +68 -0
- data/.travis.yml +6 -21
- data/Appraisals +5 -13
- data/CHANGELOG.md +140 -1
- data/README.md +58 -6
- data/asset_sync.gemspec +4 -1
- data/gemfiles/rails_6_0.gemfile +1 -1
- data/gemfiles/{rails_4_2.gemfile → rails_6_1.gemfile} +1 -1
- data/lib/asset_sync/asset_sync.rb +10 -0
- data/lib/asset_sync/config.rb +69 -8
- data/lib/asset_sync/engine.rb +8 -0
- data/lib/asset_sync/storage.rb +76 -14
- data/lib/asset_sync/version.rb +1 -1
- data/lib/generators/asset_sync/install_generator.rb +21 -1
- data/lib/generators/asset_sync/templates/asset_sync.rb +18 -0
- data/lib/generators/asset_sync/templates/asset_sync.yml +13 -3
- data/spec/fixtures/backblaze_with_yml/config/asset_sync.yml +20 -0
- data/spec/integration/backblaze_intergration_spec.rb +74 -0
- data/spec/unit/backblaze_spec.rb +150 -0
- data/spec/unit/google_spec.rb +22 -0
- data/spec/unit/railsless_spec.rb +4 -3
- data/spec/unit/storage_spec.rb +150 -7
- metadata +40 -7
- data/gemfiles/rails_5_0.gemfile +0 -10
- data/gemfiles/rails_5_1.gemfile +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 637e59bd4543dca69ef7f27a5bb8e6759e1ab082d4279ac9fa34c93dfbb249f8
|
4
|
+
data.tar.gz: b6855c7789d2ab8ae49abf0d9606204239ab1949574af540b8e1aec60d79de87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0947b76c9abcd8aea09106f954f76acabbf3b35a782d6b9af531325590359b66a89d9cf8fdd608a9f763e8c7d63d707780993713f667d9a8be9c144a3e7641f7'
|
7
|
+
data.tar.gz: 50255f748090ce2c2923344b4878bf875e9886d59929dd2888ef91416ec86063988ca3e16ee6f71a94cda540a779e3474a6468a49af8901fbd3b19bc7cdeee24
|
@@ -0,0 +1,68 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
paths-ignore:
|
8
|
+
- 'README.md'
|
9
|
+
- 'CHANGELOG.md'
|
10
|
+
push:
|
11
|
+
branches:
|
12
|
+
- master
|
13
|
+
paths-ignore:
|
14
|
+
- 'README.md'
|
15
|
+
- 'CHANGELOG.md'
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
unit_tests:
|
19
|
+
name: Unit Tests
|
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"
|
23
|
+
strategy:
|
24
|
+
fail-fast: false
|
25
|
+
matrix:
|
26
|
+
os:
|
27
|
+
- ubuntu
|
28
|
+
ruby:
|
29
|
+
- 2.5
|
30
|
+
- 2.6
|
31
|
+
- 2.7
|
32
|
+
- 3.0
|
33
|
+
- jruby
|
34
|
+
gemfile:
|
35
|
+
- gemfiles/rails_5_2.gemfile
|
36
|
+
- gemfiles/rails_6_0.gemfile
|
37
|
+
- gemfiles/rails_6_1.gemfile
|
38
|
+
allow_failures:
|
39
|
+
- false
|
40
|
+
include:
|
41
|
+
- os: ubuntu
|
42
|
+
ruby: ruby-head
|
43
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
44
|
+
allow_failures: true
|
45
|
+
- os: ubuntu
|
46
|
+
ruby: jruby-head
|
47
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
48
|
+
allow_failures: true
|
49
|
+
exclude:
|
50
|
+
- os: ubuntu
|
51
|
+
ruby: 3.0
|
52
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
53
|
+
allow_failures: false
|
54
|
+
env:
|
55
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
56
|
+
ALLOW_FAILURES: "${{ matrix.allow_failures }}"
|
57
|
+
runs-on: ${{ matrix.os }}-latest
|
58
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
59
|
+
steps:
|
60
|
+
- name: Checkout
|
61
|
+
uses: actions/checkout@v2
|
62
|
+
- name: Setup Ruby
|
63
|
+
uses: ruby/setup-ruby@v1
|
64
|
+
with:
|
65
|
+
ruby-version: ${{ matrix.ruby }}
|
66
|
+
bundler-cache: true
|
67
|
+
- name: Test
|
68
|
+
run: bundle exec rake spec:unit || $ALLOW_FAILURES
|
data/.travis.yml
CHANGED
@@ -2,26 +2,26 @@
|
|
2
2
|
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
3
3
|
sudo: false
|
4
4
|
language: ruby
|
5
|
+
arch:
|
6
|
+
- amd64
|
7
|
+
- ppc64le
|
5
8
|
cache:
|
6
9
|
bundler: true
|
7
10
|
rvm:
|
8
|
-
- 2.3
|
9
|
-
- 2.4
|
10
11
|
- 2.5
|
11
12
|
- 2.6
|
13
|
+
- 2.7
|
12
14
|
- ruby-head
|
13
15
|
- jruby
|
14
16
|
- jruby-head
|
15
17
|
gemfile:
|
16
|
-
- gemfiles/rails_4_2.gemfile
|
17
|
-
- gemfiles/rails_5_0.gemfile
|
18
|
-
- gemfiles/rails_5_1.gemfile
|
19
18
|
- gemfiles/rails_5_2.gemfile
|
20
19
|
- gemfiles/rails_6_0.gemfile
|
20
|
+
- gemfiles/rails_6_1.gemfile
|
21
21
|
before_install:
|
22
22
|
# Cannot use bundler 2.x due to dependency (mainly rails 4.2)
|
23
23
|
# Solution from https://github.com/rails/rails/blob/4-2-stable/.travis.yml
|
24
|
-
- "travis_retry gem update --system
|
24
|
+
- "travis_retry gem update --system --no-doc || travis_retry gem update --system --no-rdoc --no-ri"
|
25
25
|
- "travis_retry gem install bundler -v '<2'"
|
26
26
|
env:
|
27
27
|
global:
|
@@ -32,23 +32,8 @@ env:
|
|
32
32
|
matrix:
|
33
33
|
fast_finish: true
|
34
34
|
allow_failures:
|
35
|
-
# bundler version conflict
|
36
|
-
- rvm: 2.3
|
37
|
-
gemfile: gemfiles/rails_4_2.gemfile
|
38
|
-
- rvm: 2.4
|
39
|
-
gemfile: gemfiles/rails_4_2.gemfile
|
40
|
-
- rvm: 2.5
|
41
|
-
gemfile: gemfiles/rails_4_2.gemfile
|
42
|
-
- rvm: jruby
|
43
|
-
gemfile: gemfiles/rails_4_2.gemfile
|
44
|
-
- gemfile: gemfiles/rails_6_0.gemfile
|
45
35
|
- rvm: ruby-head
|
46
36
|
- rvm: jruby-head
|
47
|
-
exclude:
|
48
|
-
- rvm: 2.3
|
49
|
-
gemfile: gemfiles/rails_6_0.gemfile
|
50
|
-
- rvm: 2.4
|
51
|
-
gemfile: gemfiles/rails_6_0.gemfile
|
52
37
|
notifications:
|
53
38
|
webhooks:
|
54
39
|
urls:
|
data/Appraisals
CHANGED
@@ -1,20 +1,12 @@
|
|
1
1
|
|
2
|
-
appraise "rails_4_2" do
|
3
|
-
gem "rails", "~> 4.2.0"
|
4
|
-
end
|
5
|
-
|
6
|
-
appraise "rails_5_0" do
|
7
|
-
gem "rails", "~> 5.0.0"
|
8
|
-
end
|
9
|
-
|
10
|
-
appraise "rails_5_1" do
|
11
|
-
gem "rails", "~> 5.1.0"
|
12
|
-
end
|
13
|
-
|
14
2
|
appraise "rails_5_2" do
|
15
3
|
gem "rails", "~> 5.2.0"
|
16
4
|
end
|
17
5
|
|
18
6
|
appraise "rails_6_0" do
|
19
|
-
gem "rails", "~> 6.0.0
|
7
|
+
gem "rails", "~> 6.0.0"
|
8
|
+
end
|
9
|
+
|
10
|
+
appraise "rails_6_1" do
|
11
|
+
gem "rails", "~> 6.1.0"
|
20
12
|
end
|
data/CHANGELOG.md
CHANGED
@@ -18,6 +18,130 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
+
## [2.15.2] - 2022-06-02
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- Fix incorrect commented code in asset_sync.yml
|
26
|
+
(https://github.com/AssetSync/asset_sync/pull/426)
|
27
|
+
|
28
|
+
|
29
|
+
## [2.15.1] - 2021-11-22
|
30
|
+
|
31
|
+
### Changed
|
32
|
+
|
33
|
+
- Update dev dependency `fog-azure-rm` to become `gitlab-fog-azure-rm`
|
34
|
+
|
35
|
+
### Fixed
|
36
|
+
|
37
|
+
- Fix YAML config file parsing with Psych v4
|
38
|
+
(https://github.com/AssetSync/asset_sync/pull/422)
|
39
|
+
|
40
|
+
|
41
|
+
## [2.15.0] - 2021-08-05
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
- Add support for option `aws_acl`
|
46
|
+
(https://github.com/AssetSync/asset_sync/pull/420)
|
47
|
+
|
48
|
+
|
49
|
+
## [2.14.2] - 2021-05-31
|
50
|
+
|
51
|
+
### Added
|
52
|
+
|
53
|
+
- Add support for setting option `google_json_key_string` in YML (not new option)
|
54
|
+
(https://github.com/AssetSync/asset_sync/pull/419)
|
55
|
+
|
56
|
+
|
57
|
+
## [2.14.1] - 2021-05-14
|
58
|
+
|
59
|
+
### Added
|
60
|
+
|
61
|
+
- Add support for setting option `log_silently` in YML (not new option)
|
62
|
+
(https://github.com/AssetSync/asset_sync/pull/417)
|
63
|
+
|
64
|
+
|
65
|
+
## [2.14.0] - 2021-03-31
|
66
|
+
|
67
|
+
### Added
|
68
|
+
|
69
|
+
- Add support for fog option `google_json_key_string`
|
70
|
+
(https://github.com/AssetSync/asset_sync/pull/415)
|
71
|
+
|
72
|
+
|
73
|
+
## [2.13.1] - 2021-03-01
|
74
|
+
|
75
|
+
### Fixed
|
76
|
+
|
77
|
+
- Fix "files to be uploaded list" generation for file names with dashes
|
78
|
+
(https://github.com/AssetSync/asset_sync/pull/414)
|
79
|
+
|
80
|
+
|
81
|
+
## [2.13.0] - 2020-12-14
|
82
|
+
|
83
|
+
### Added
|
84
|
+
|
85
|
+
- Add Backblaze B2 Cloud Storage support
|
86
|
+
(https://github.com/AssetSync/asset_sync/pull/410)
|
87
|
+
|
88
|
+
|
89
|
+
## [2.12.1] - 2020-06-17
|
90
|
+
|
91
|
+
### Fixed
|
92
|
+
|
93
|
+
- Fix initializer template in generator
|
94
|
+
(https://github.com/AssetSync/asset_sync/pull/404)
|
95
|
+
|
96
|
+
|
97
|
+
## [2.12.0] - 2020-06-11
|
98
|
+
|
99
|
+
### Added
|
100
|
+
|
101
|
+
- Add option `aws_session_token` to support AWS Temporary Security Credentials
|
102
|
+
(https://github.com/AssetSync/asset_sync/pull/403)
|
103
|
+
|
104
|
+
|
105
|
+
## [2.11.0] - 2020-03-13
|
106
|
+
|
107
|
+
### Added
|
108
|
+
|
109
|
+
- Add option `remote_file_list_cache_file_path` to skip scanning remote
|
110
|
+
(https://github.com/AssetSync/asset_sync/pull/400)
|
111
|
+
|
112
|
+
|
113
|
+
## [2.10.0] - 2020-02-26
|
114
|
+
|
115
|
+
### Added
|
116
|
+
|
117
|
+
- Add option `concurrent_uploads_max_threads` to limit number of threads for uploading files
|
118
|
+
(https://github.com/AssetSync/asset_sync/pull/398)
|
119
|
+
|
120
|
+
|
121
|
+
## [2.9.1] - 2020-02-20
|
122
|
+
|
123
|
+
### Fixed
|
124
|
+
|
125
|
+
- Fix uploading of sprockets manifest file
|
126
|
+
(https://github.com/AssetSync/asset_sync/pull/397)
|
127
|
+
|
128
|
+
|
129
|
+
## [2.9.0] - 2020-01-15
|
130
|
+
|
131
|
+
### Added
|
132
|
+
|
133
|
+
- Add option `concurrent_uploads` to improve speed of uploading
|
134
|
+
(https://github.com/AssetSync/asset_sync/pull/393)
|
135
|
+
|
136
|
+
|
137
|
+
## [2.8.2] - 2019-12-27
|
138
|
+
|
139
|
+
### Changed
|
140
|
+
|
141
|
+
- Use `delete_multiple_objects` when storage is `aws`
|
142
|
+
(https://github.com/AssetSync/asset_sync/pull/392)
|
143
|
+
|
144
|
+
|
21
145
|
## [2.8.1] - 2019-07-25
|
22
146
|
|
23
147
|
### Changed
|
@@ -922,7 +1046,22 @@ Changes:
|
|
922
1046
|
* Merge branch 'sinatra'
|
923
1047
|
|
924
1048
|
|
925
|
-
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.
|
1049
|
+
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.15.2...HEAD
|
1050
|
+
[2.15.2]: https://github.com/AssetSync/asset_sync/compare/v2.15.1...v2.15.2
|
1051
|
+
[2.15.1]: https://github.com/AssetSync/asset_sync/compare/v2.15.0...v2.15.1
|
1052
|
+
[2.15.0]: https://github.com/AssetSync/asset_sync/compare/v2.14.2...v2.15.0
|
1053
|
+
[2.14.2]: https://github.com/AssetSync/asset_sync/compare/v2.14.1...v2.14.2
|
1054
|
+
[2.14.1]: https://github.com/AssetSync/asset_sync/compare/v2.14.0...v2.14.1
|
1055
|
+
[2.14.0]: https://github.com/AssetSync/asset_sync/compare/v2.13.1...v2.14.0
|
1056
|
+
[2.13.1]: https://github.com/AssetSync/asset_sync/compare/v2.13.0...v2.13.1
|
1057
|
+
[2.13.0]: https://github.com/AssetSync/asset_sync/compare/v2.12.1...v2.13.0
|
1058
|
+
[2.12.1]: https://github.com/AssetSync/asset_sync/compare/v2.12.0...v2.12.1
|
1059
|
+
[2.12.0]: https://github.com/AssetSync/asset_sync/compare/v2.11.0...v2.12.0
|
1060
|
+
[2.11.0]: https://github.com/AssetSync/asset_sync/compare/v2.10.0...v2.11.0
|
1061
|
+
[2.10.0]: https://github.com/AssetSync/asset_sync/compare/v2.9.1...v2.10.0
|
1062
|
+
[2.9.1]: https://github.com/AssetSync/asset_sync/compare/v2.9.0...v2.9.1
|
1063
|
+
[2.9.0]: https://github.com/AssetSync/asset_sync/compare/v2.8.2...v2.9.0
|
1064
|
+
[2.8.2]: https://github.com/AssetSync/asset_sync/compare/v2.8.1...v2.8.2
|
926
1065
|
[2.8.1]: https://github.com/AssetSync/asset_sync/compare/v2.8.0...v2.8.1
|
927
1066
|
[2.8.0]: https://github.com/AssetSync/asset_sync/compare/v2.7.0...v2.8.0
|
928
1067
|
[2.7.0]: https://github.com/AssetSync/asset_sync/compare/v2.6.0...v2.7.0
|
data/README.md
CHANGED
@@ -35,7 +35,17 @@ Or, to use Azure Blob storage, configure as this.
|
|
35
35
|
|
36
36
|
``` ruby
|
37
37
|
gem "asset_sync"
|
38
|
-
gem "fog-azure-rm"
|
38
|
+
gem "gitlab-fog-azure-rm"
|
39
|
+
|
40
|
+
# This gem seems unmaintianed
|
41
|
+
# gem "fog-azure-rm"
|
42
|
+
```
|
43
|
+
|
44
|
+
To use Backblaze B2, insert these.
|
45
|
+
|
46
|
+
``` ruby
|
47
|
+
gem "asset_sync"
|
48
|
+
gem "fog-backblaze"
|
39
49
|
```
|
40
50
|
|
41
51
|
|
@@ -77,6 +87,13 @@ Or, to use Azure Blob storage, configure as this.
|
|
77
87
|
config.action_controller.asset_host = "//#{ENV['AZURE_STORAGE_ACCOUNT_NAME']}.blob.core.windows.net/#{ENV['FOG_DIRECTORY']}"
|
78
88
|
```
|
79
89
|
|
90
|
+
Or, to use Backblaze B2, configure as this.
|
91
|
+
|
92
|
+
``` ruby
|
93
|
+
#config/environments/production.rb
|
94
|
+
config.action_controller.asset_host = "//f000.backblazeb2.com/file/#{ENV['FOG_DIRECTORY']}"
|
95
|
+
```
|
96
|
+
|
80
97
|
|
81
98
|
On **HTTPS**: the exclusion of any protocol in the asset host declaration above will allow browsers to choose the transport mechanism on the fly. So if your application is available under both HTTP and HTTPS the assets will be served to match.
|
82
99
|
|
@@ -141,7 +158,7 @@ The Built-in Initializer will configure **AssetSync** based on the contents of y
|
|
141
158
|
|
142
159
|
Add your configuration details to **heroku**
|
143
160
|
|
144
|
-
|
161
|
+
``` bash
|
145
162
|
heroku config:add AWS_ACCESS_KEY_ID=xxxx
|
146
163
|
heroku config:add AWS_SECRET_ACCESS_KEY=xxxx
|
147
164
|
heroku config:add FOG_DIRECTORY=xxxx
|
@@ -170,7 +187,7 @@ heroku config:add FOG_DIRECTORY=xxxx
|
|
170
187
|
heroku config:add FOG_PROVIDER=Rackspace
|
171
188
|
```
|
172
189
|
|
173
|
-
Google Storage Cloud configuration is supported as well. The preferred option is using the [GCS JSON API](https://github.com/fog/fog-google#storage) which requires that you create an appropriate service account, generate the signatures and make them accessible to asset sync at the prescribed location
|
190
|
+
Google Storage Cloud configuration is supported as well. The preferred option is using the [GCS JSON API](https://github.com/fog/fog-google#storage) which requires that you create an appropriate service account, generate the signatures and make them accessible to asset sync at the prescribed location
|
174
191
|
|
175
192
|
```bash
|
176
193
|
heroku config:add FOG_PROVIDER=Google
|
@@ -199,6 +216,7 @@ Run the included Rake task to generate a starting point.
|
|
199
216
|
rails g asset_sync:install --provider=Rackspace
|
200
217
|
rails g asset_sync:install --provider=AWS
|
201
218
|
rails g asset_sync:install --provider=AzureRM
|
219
|
+
rails g asset_sync:install --provider=Backblaze
|
202
220
|
|
203
221
|
The generator will create a Rails initializer at `config/initializers/asset_sync.rb`.
|
204
222
|
|
@@ -208,6 +226,7 @@ AssetSync.configure do |config|
|
|
208
226
|
config.fog_directory = ENV['FOG_DIRECTORY']
|
209
227
|
config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
210
228
|
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
229
|
+
config.aws_session_token = ENV['AWS_SESSION_TOKEN'] if ENV.key?('AWS_SESSION_TOKEN')
|
211
230
|
|
212
231
|
# Don't delete files from the store
|
213
232
|
# config.existing_remote_files = 'keep'
|
@@ -223,6 +242,11 @@ AssetSync.configure do |config|
|
|
223
242
|
# Change AWS signature version. Default is 4
|
224
243
|
# config.aws_signature_version = 4
|
225
244
|
#
|
245
|
+
# Change canned ACL of uploaded object. Default is unset. Will override fog_public if set.
|
246
|
+
# Choose from: private | public-read | public-read-write | aws-exec-read |
|
247
|
+
# authenticated-read | bucket-owner-read | bucket-owner-full-control
|
248
|
+
# config.aws_acl = nil
|
249
|
+
#
|
226
250
|
# Change host option in fog (only if you need to)
|
227
251
|
# config.fog_host = 's3.amazonaws.com'
|
228
252
|
#
|
@@ -242,6 +266,15 @@ AssetSync.configure do |config|
|
|
242
266
|
# Upload the manifest file also.
|
243
267
|
# config.include_manifest = false
|
244
268
|
#
|
269
|
+
# Upload files concurrently
|
270
|
+
# config.concurrent_uploads = false
|
271
|
+
#
|
272
|
+
# Number of threads when concurrent_uploads is enabled
|
273
|
+
# config.concurrent_uploads_max_threads = 10
|
274
|
+
#
|
275
|
+
# Path to cache file to skip scanning remote
|
276
|
+
# config.remote_file_list_cache_file_path = './.asset_sync_remote_file_list_cache.json'
|
277
|
+
#
|
245
278
|
# Fail silently. Useful for environments such as Heroku
|
246
279
|
# config.fail_silently = true
|
247
280
|
#
|
@@ -264,6 +297,7 @@ Run the included Rake task to generate a starting point.
|
|
264
297
|
rails g asset_sync:install --use-yml --provider=Rackspace
|
265
298
|
rails g asset_sync:install --use-yml --provider=AWS
|
266
299
|
rails g asset_sync:install --use-yml --provider=AzureRM
|
300
|
+
rails g asset_sync:install --use-yml --provider=Backblaze
|
267
301
|
|
268
302
|
The generator will create a YAML file at `config/asset_sync.yml`.
|
269
303
|
|
@@ -283,6 +317,11 @@ defaults: &defaults
|
|
283
317
|
# Change AWS signature version. Default is 4
|
284
318
|
# aws_signature_version: 4
|
285
319
|
#
|
320
|
+
# Change canned ACL of uploaded object. Default is unset. Will override fog_public if set.
|
321
|
+
# Choose from: private | public-read | public-read-write | aws-exec-read |
|
322
|
+
# authenticated-read | bucket-owner-read | bucket-owner-full-control
|
323
|
+
# aws_acl: null
|
324
|
+
#
|
286
325
|
# Change host option in fog (only if you need to)
|
287
326
|
# fog_host: "s3.amazonaws.com"
|
288
327
|
#
|
@@ -338,6 +377,9 @@ AssetSync.config.gzip_compression == ENV['ASSET_SYNC_GZIP_COMPRESSION']
|
|
338
377
|
* **gzip\_compression**: (`true, false`) when enabled, will automatically replace files that have a gzip compressed equivalent with the compressed version. **default:** `'false'`
|
339
378
|
* **manifest**: (`true, false`) when enabled, will use the `manifest.yml` generated by Rails to get the list of local files to upload. **experimental**. **default:** `'false'`
|
340
379
|
* **include_manifest**: (`true, false`) when enabled, will upload the `manifest.yml` generated by Rails. **default:** `'false'`
|
380
|
+
* **concurrent_uploads**: (`true, false`) when enabled, will upload the files in different Threads, this greatly improves the upload speed. **default:** `'false'`
|
381
|
+
* **concurrent_uploads_max_threads**: when concurrent_uploads is enabled, this determines the number of threads that will be created. **default:** `10`
|
382
|
+
* **remote_file_list_cache_file_path**: if present, use this path to cache remote file list to skip scanning remote **default:** `nil`
|
341
383
|
* **enabled**: (`true, false`) when false, will disable asset sync. **default:** `'true'` (enabled)
|
342
384
|
* **ignored\_files**: an array of files to ignore e.g. `['ignore_me.js', %r(ignore_some/\d{32}\.css)]` Useful if there are some files that are created dynamically on the server and you don't want to upload on deploy **default**: `[]`
|
343
385
|
* **cache\_asset\_regexps**: an array of files to add cache headers e.g. `['cache_me.js', %r(cache_some\.\d{8}\.css)]` Useful if there are some files that are added to sprockets assets list and need to be set as 'Cacheable' on uploaded server. Only rails compiled regexp is matched internally **default**: `[]`
|
@@ -370,7 +412,7 @@ To customize the overrides:
|
|
370
412
|
AssetSync.configure do |config|
|
371
413
|
# Clear the default overrides
|
372
414
|
config.file_ext_to_mime_type_overrides.clear
|
373
|
-
|
415
|
+
|
374
416
|
# Add/Edit overrides
|
375
417
|
# Will call `#to_s` for inputs
|
376
418
|
config.file_ext_to_mime_type_overrides.add(:js, :"application/x-javascript")
|
@@ -379,7 +421,7 @@ end
|
|
379
421
|
The blocks are run when local files are being scanned and uploaded
|
380
422
|
|
381
423
|
#### Fog (Required)
|
382
|
-
* **fog\_provider**: your storage provider *AWS* (S3) or *Rackspace* (Cloud Files) or *Google* (Google Storage) or *AzureRM* (Azure Blob)
|
424
|
+
* **fog\_provider**: your storage provider *AWS* (S3) or *Rackspace* (Cloud Files) or *Google* (Google Storage) or *AzureRM* (Azure Blob) or *Backblaze* (Backblaze B2)
|
383
425
|
* **fog\_directory**: your bucket name
|
384
426
|
|
385
427
|
#### Fog (Optional)
|
@@ -391,6 +433,7 @@ The blocks are run when local files are being scanned and uploaded
|
|
391
433
|
|
392
434
|
* **aws\_access\_key\_id**: your Amazon S3 access key
|
393
435
|
* **aws\_secret\_access\_key**: your Amazon S3 access secret
|
436
|
+
* **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
|
394
437
|
|
395
438
|
#### Rackspace
|
396
439
|
|
@@ -413,6 +456,11 @@ When using the S3 API
|
|
413
456
|
* **azure\_storage\_account\_name**: your Azure Blob access key
|
414
457
|
* **azure\_storage\_access\_key**: your Azure Blob access secret
|
415
458
|
|
459
|
+
#### Backblaze B2
|
460
|
+
* **b2\_key\_id**: Your Backblaze B2 key ID
|
461
|
+
* **b2\_key\_token**: Your Backblaze B2 key token
|
462
|
+
* **b2\_bucket\_id**: Your Backblaze B2 bucket ID
|
463
|
+
|
416
464
|
#### Rackspace (Optional)
|
417
465
|
|
418
466
|
* **rackspace\_auth\_url**: Rackspace auth URL, for Rackspace London use: `https://lon.identity.api.rackspacecloud.com/v2.0`
|
@@ -536,6 +584,10 @@ AssetSync.configure do |config|
|
|
536
584
|
config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
537
585
|
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
538
586
|
config.prefix = 'assets'
|
587
|
+
# Can be a `Pathname` or `String`
|
588
|
+
# Will be converted into an `Pathname`
|
589
|
+
# If relative, will be converted into an absolute path
|
590
|
+
# via `::Rails.root` or `::Dir.pwd`
|
539
591
|
config.public_path = Pathname('./public')
|
540
592
|
end
|
541
593
|
```
|
@@ -605,7 +657,7 @@ Make sure you have a .env file with these details:-
|
|
605
657
|
AWS_SECRET_ACCESS_KEY=<yoursecretkey>
|
606
658
|
FOG_DIRECTORY=<yourbucket>
|
607
659
|
FOG_REGION=<youbucketregion>
|
608
|
-
|
660
|
+
|
609
661
|
# for AzureRM provider
|
610
662
|
AZURE_STORAGE_ACCOUNT_NAME=<youraccountname>
|
611
663
|
AZURE_STORAGE_ACCESS_KEY=<youraccesskey>
|
data/asset_sync.gemspec
CHANGED
@@ -27,11 +27,14 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_development_dependency('mime-types', ">= 3.0")
|
28
28
|
|
29
29
|
s.add_development_dependency "fog-aws"
|
30
|
-
s.add_development_dependency "fog-azure-rm"
|
30
|
+
s.add_development_dependency "gitlab-fog-azure-rm"
|
31
|
+
s.add_development_dependency "fog-backblaze"
|
31
32
|
|
32
33
|
s.add_development_dependency "uglifier"
|
33
34
|
s.add_development_dependency "appraisal"
|
34
35
|
|
36
|
+
s.add_development_dependency "gem-release"
|
37
|
+
|
35
38
|
s.files = `git ls-files`.split("\n")
|
36
39
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
37
40
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
data/gemfiles/rails_6_0.gemfile
CHANGED
@@ -5,6 +5,6 @@ source "https://rubygems.org"
|
|
5
5
|
gem "rcov", platforms: :mri_18, group: [:development, :test]
|
6
6
|
gem "simplecov", platforms: [:jruby, :mri_19, :ruby_19, :mri_20, :rbx], group: [:development, :test], require: false
|
7
7
|
gem "jruby-openssl", platform: :jruby
|
8
|
-
gem "rails", "~> 6.0.0
|
8
|
+
gem "rails", "~> 6.0.0"
|
9
9
|
|
10
10
|
gemspec path: "../"
|
@@ -5,6 +5,6 @@ source "https://rubygems.org"
|
|
5
5
|
gem "rcov", platforms: :mri_18, group: [:development, :test]
|
6
6
|
gem "simplecov", platforms: [:jruby, :mri_19, :ruby_19, :mri_20, :rbx], group: [:development, :test], require: false
|
7
7
|
gem "jruby-openssl", platform: :jruby
|
8
|
-
gem "rails", "~>
|
8
|
+
gem "rails", "~> 6.1.0"
|
9
9
|
|
10
10
|
gemspec path: "../"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "yaml"
|
2
|
+
|
1
3
|
module AssetSync
|
2
4
|
|
3
5
|
class << self
|
@@ -60,6 +62,14 @@ module AssetSync
|
|
60
62
|
stdout.puts msg unless config.log_silently?
|
61
63
|
end
|
62
64
|
|
65
|
+
def load_yaml(yaml)
|
66
|
+
if YAML.respond_to?(:unsafe_load)
|
67
|
+
YAML.unsafe_load(yaml)
|
68
|
+
else
|
69
|
+
YAML.load(yaml)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
63
73
|
def enabled?
|
64
74
|
config.enabled?
|
65
75
|
end
|