workarea-core 3.4.32 → 3.4.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/workarea/direct_upload.rb +12 -13
- data/app/workers/workarea/process_import.rb +3 -3
- data/lib/workarea/core/engine.rb +3 -4
- data/lib/workarea/version.rb +1 -1
- data/test/services/workarea/direct_upload_test.rb +0 -3
- data/test/workers/workarea/process_import_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9380a926427872b88a127eeca3d80b734d8679e297cd691a409b2125d181b210
|
4
|
+
data.tar.gz: 37b763327a0a0f7eec7d34b4f744eae59580a8717f1e0bac3b4fadc830c62f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6da8af3694f295513a48512a0fd51f2309c04f33b400461dfb90727c8d4b083a7e291e0e66edb69ae23ba9a55a4f8eb5351b34434da153ed915bada8ccdabe7d
|
7
|
+
data.tar.gz: f15b4a14d8e5a44f0acbc71c2c780731b0f9b3c3f07c8223e5aa15ba5d9ad48f8a779d81a10dd33b2561503fff5da37f7478ed3dedb7cfd6bfee5e6931b47a37
|
@@ -6,22 +6,21 @@ module Workarea
|
|
6
6
|
uri = URI.parse(request_url)
|
7
7
|
url = "#{uri.scheme}://#{uri.host}"
|
8
8
|
url += ":#{uri.port}" unless uri.port.in? [80, 443]
|
9
|
-
|
10
|
-
redis_key = "cors_#{url.optionize}"
|
11
|
-
return if Workarea.redis.get(redis_key) == 'true'
|
9
|
+
id = "direct_upload_#{url}"
|
12
10
|
|
13
11
|
response = Workarea.s3.get_bucket_cors(Configuration::S3.bucket)
|
14
12
|
cors = response.data[:body]
|
15
|
-
|
16
|
-
|
17
|
-
'
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
13
|
+
|
14
|
+
unless cors['CORSConfiguration'].pluck('ID').include?(id)
|
15
|
+
cors['CORSConfiguration'] << {
|
16
|
+
'ID' => id,
|
17
|
+
'AllowedMethod' => 'PUT',
|
18
|
+
'AllowedOrigin' => url,
|
19
|
+
'AllowedHeader' => '*'
|
20
|
+
}
|
21
|
+
|
22
|
+
Workarea.s3.put_bucket_cors(Configuration::S3.bucket, cors)
|
23
|
+
end
|
25
24
|
end
|
26
25
|
|
27
26
|
attr_reader :type, :filename
|
@@ -17,11 +17,11 @@ module Workarea
|
|
17
17
|
import.process!
|
18
18
|
|
19
19
|
ensure
|
20
|
-
if import
|
20
|
+
if import&.error?
|
21
21
|
Admin::DataFileMailer.import_error(id).deliver_now
|
22
|
-
elsif import
|
22
|
+
elsif import&.failure?
|
23
23
|
Admin::DataFileMailer.import_failure(id).deliver_now
|
24
|
-
|
24
|
+
elsif import.present?
|
25
25
|
Admin::DataFileMailer.import(id).deliver_now
|
26
26
|
end
|
27
27
|
end
|
data/lib/workarea/core/engine.rb
CHANGED
@@ -118,13 +118,12 @@ db.getSiblingDB("admin").runCommand( { setParameter: 1, notablescan: 0 } )
|
|
118
118
|
**************************************************
|
119
119
|
⛔️ WARNING: Dragonfly is configured to use the filesystem.
|
120
120
|
|
121
|
-
This means all
|
121
|
+
This means all Dragonfly assets (assets, product images, etc.) will be stored
|
122
122
|
locally and not accessible to all servers within your environment.
|
123
123
|
|
124
124
|
We recommend using S3 when running in a live environment by setting
|
125
|
-
WORKAREA_S3_REGION and WORKAREA_S3_BUCKET_NAME in your environment variables
|
126
|
-
|
127
|
-
are present.
|
125
|
+
WORKAREA_S3_REGION and WORKAREA_S3_BUCKET_NAME in your environment variables,
|
126
|
+
and setting `Workarea.config.asset_store = :s3` in an initializer.
|
128
127
|
**************************************************
|
129
128
|
eos
|
130
129
|
end
|
data/lib/workarea/version.rb
CHANGED
@@ -108,11 +108,8 @@ module Workarea
|
|
108
108
|
).returns(true)
|
109
109
|
|
110
110
|
assert(DirectUpload.ensure_cors!('http://test.host/admin/content_assets'))
|
111
|
-
assert_equal('true', Workarea.redis.get('cors_http_test_host'))
|
112
111
|
assert(DirectUpload.ensure_cors!('http://localhost:3000/admin/content_assets'))
|
113
|
-
assert_equal('true', Workarea.redis.get('cors_http_localhost_3000'))
|
114
112
|
assert(DirectUpload.ensure_cors!('https://example.com/admin/direct_uploads'))
|
115
|
-
assert_equal('true', Workarea.redis.get('cors_https_example_com'))
|
116
113
|
end
|
117
114
|
|
118
115
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|