onlyoffice_s3_wrapper 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onlyoffice_s3_wrapper.rb +8 -20
- data/lib/onlyoffice_s3_wrapper/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82668768004470091bdf2f1cf2c4c242f8ec8a7a0f5d6fdb7b20d4155d305782
|
4
|
+
data.tar.gz: 289810f2dde148fe5971954fcfee400480322d0a853d01268eecd263ecd5ee04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24446cf6c22cfecdfd41c37b1347c821244d8a79cf6eff4ebcc29c758313a80627c590c4903ee8f5488a29fe8fb1e50443d7cad5f762994613d6d55d02972de9
|
7
|
+
data.tar.gz: de18daabfed6d3d3c7db6041570894c4c2b0e60a4dcf68c943a26d3c8669b282f2d2f3dae5700eecc9f026ef976fae56dd55f819cf6739c801eff57d782a04fd
|
@@ -136,27 +136,15 @@ module OnlyofficeS3Wrapper
|
|
136
136
|
end
|
137
137
|
|
138
138
|
# Get S3 key and S3 private key
|
139
|
-
# @param
|
140
|
-
# @return [
|
141
|
-
def read_keys(
|
142
|
-
|
143
|
-
|
144
|
-
@access_key_id = File.read("#{Dir.home}/.s3/key").strip &&
|
145
|
-
@secret_access_key = File.read("#{Dir.home}/.s3/private_key").strip
|
139
|
+
# @param key_location [String] Path to search for key files
|
140
|
+
# @return [nil]
|
141
|
+
def read_keys(key_location = "#{Dir.home}/.s3")
|
142
|
+
@access_key_id = File.read("#{key_location}/key").strip
|
143
|
+
@secret_access_key = File.read("#{key_location}/private_key").strip
|
146
144
|
rescue Errno::ENOENT
|
147
|
-
raise Errno::ENOENT, "No key or private key found in #{
|
148
|
-
"Please create files #{
|
149
|
-
"and #{
|
150
|
-
end
|
151
|
-
|
152
|
-
private
|
153
|
-
|
154
|
-
# Read keys from env variables
|
155
|
-
def read_env_keys
|
156
|
-
return false unless ENV['S3_KEY'] && ENV['S3_PRIVATE_KEY']
|
157
|
-
|
158
|
-
@access_key_id = ENV['S3_KEY']
|
159
|
-
@secret_access_key = ENV['S3_PRIVATE_KEY']
|
145
|
+
raise Errno::ENOENT, "No key or private key found in #{key_location} "\
|
146
|
+
"Please create files #{key_location}/key "\
|
147
|
+
"and #{key_location}/private_key"
|
160
148
|
end
|
161
149
|
end
|
162
150
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_s3_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-09-
|
13
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk-s3
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.80.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
28
|
+
version: 1.80.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: onlyoffice_file_helper
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|