rubeepass 3.4.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rpass +40 -75
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36a76dde7f5f12b9e591c3ec0147a1e5dcbe6a4316ceb1d006f06a4b8131c728
|
4
|
+
data.tar.gz: b2471a888adf6ef93a9f95e0580c7808720a166ef6b065a7cfb40dd9bf914358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bed9a37a826ee088f51d113ebfc153f70a6afe28e44c7dfd1116f075538e30302a5551c3bfcdfae4a0c766be22d70fcb2c1bfb679b4942931b9a5660438191c
|
7
|
+
data.tar.gz: a2d315b67eeabf46f9d024dd34c12238e1af4d0ad2079255c217b36505f74588598dbaff116c052a70b30a06d8ca30da4b83954f3e4433ba2e557b0d637f64e6
|
data/bin/rpass
CHANGED
@@ -19,37 +19,20 @@ class RubeePassExit
|
|
19
19
|
end
|
20
20
|
|
21
21
|
class RubeePassConfig < JSONConfig
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
def
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
file = nil
|
37
|
-
file = Pathname.new(kf).expand_path if (kf && !kf.empty?)
|
38
|
-
set("last_keyfile", file) if (kf)
|
39
|
-
kf = get("last_keyfile").to_s
|
40
|
-
return nil if (kf.nil? || kf.empty?)
|
41
|
-
return kf
|
42
|
-
end
|
43
|
-
|
44
|
-
def timeout(t = nil)
|
45
|
-
set("timeout", t) if (t)
|
46
|
-
t = get("timeout")
|
47
|
-
case t.to_s
|
48
|
-
when /[0-9]+/
|
49
|
-
return t.to_i
|
50
|
-
else
|
51
|
-
return nil
|
52
|
-
end
|
22
|
+
extend JSONConfig::Keys
|
23
|
+
|
24
|
+
add_key("kdbx")
|
25
|
+
add_key("keyfile")
|
26
|
+
add_key("timeout")
|
27
|
+
|
28
|
+
def initialize(file = nil)
|
29
|
+
file ||= "~/.config/rubeepass/rc"
|
30
|
+
@defaults = {
|
31
|
+
"kdbx" => nil,
|
32
|
+
"keyfile" => nil,
|
33
|
+
"timeout" => 10
|
34
|
+
}
|
35
|
+
super(file)
|
53
36
|
end
|
54
37
|
end
|
55
38
|
|
@@ -63,11 +46,10 @@ end
|
|
63
46
|
def parse(args)
|
64
47
|
options = Hash.new
|
65
48
|
options["command"] = nil
|
49
|
+
options["config"] = RubeePassConfig.new
|
66
50
|
options["export_file"] = nil
|
67
51
|
options["export_format"] = "xml"
|
68
52
|
options["password"] = nil
|
69
|
-
options["keyfile"] = nil
|
70
|
-
options["timeout"] = nil
|
71
53
|
options["verbose"] = false
|
72
54
|
|
73
55
|
info = "KeePass 2.x read-only client."
|
@@ -121,7 +103,8 @@ def parse(args)
|
|
121
103
|
"--keyfile=KEYFILE",
|
122
104
|
"Use specified keyfile"
|
123
105
|
) do |keyfile|
|
124
|
-
|
106
|
+
k = Pathname.new(keyfile).expand_path
|
107
|
+
options["config"].set_keyfile(k)
|
125
108
|
end
|
126
109
|
|
127
110
|
opts.on("--nocolor", "Disable colorized output") do
|
@@ -136,8 +119,13 @@ def parse(args)
|
|
136
119
|
options["password"] = password
|
137
120
|
end
|
138
121
|
|
139
|
-
opts.on(
|
140
|
-
|
122
|
+
opts.on(
|
123
|
+
"-t",
|
124
|
+
"--timeout=TIMEOUT",
|
125
|
+
Integer,
|
126
|
+
"Clipboard timeout"
|
127
|
+
) do |t|
|
128
|
+
options["config"].set_timeout(t)
|
141
129
|
end
|
142
130
|
|
143
131
|
opts.on(
|
@@ -183,59 +171,36 @@ def parse(args)
|
|
183
171
|
exit RubeePassExit::AMBIGUOUS_ARGUMENT
|
184
172
|
end
|
185
173
|
|
186
|
-
if (args.length > 1)
|
187
|
-
puts parser
|
188
|
-
exit RubeePassExit::EXTRA_ARGUMENTS
|
189
|
-
end
|
190
|
-
|
191
|
-
# Read config
|
192
|
-
rc = RubeePassConfig.new("~/.rpassrc")
|
193
|
-
|
194
|
-
# Determine kdbx and keyfile
|
195
174
|
if (args.length == 1)
|
196
|
-
|
197
|
-
options["
|
198
|
-
options["keyfile"] ||= ""
|
199
|
-
else
|
200
|
-
# Use kdbx from config if stored
|
201
|
-
if (rc.last_kdbx)
|
202
|
-
options["kdbx"] = rc.last_kdbx
|
203
|
-
end
|
175
|
+
k = Pathname.new(args[0]).expand_path
|
176
|
+
options["config"].set_kdbx(k)
|
204
177
|
|
205
|
-
#
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
end
|
211
|
-
end
|
212
|
-
|
213
|
-
# Determine timeout
|
214
|
-
if (options["timeout"].nil?)
|
215
|
-
options["timeout"] = 10
|
216
|
-
options["timeout"] = rc.timeout if (rc.timeout)
|
178
|
+
# Save keyfile even if not specified
|
179
|
+
options["config"].savediff
|
180
|
+
elsif (args.length > 1)
|
181
|
+
puts parser
|
182
|
+
exit RubeePassExit::EXTRA_ARGUMENTS
|
217
183
|
end
|
218
184
|
|
219
185
|
# Throw error if kdbx not specified or in config
|
220
|
-
if (options["
|
186
|
+
if (!options["config"].kdbx?)
|
221
187
|
puts parser
|
222
188
|
exit RubeePassExit::MISSING_ARGUMENT
|
223
189
|
end
|
224
190
|
|
225
|
-
# Store data in config
|
226
|
-
options["kdbx"] = rc.last_kdbx(options["kdbx"])
|
227
|
-
options["keyfile"] = rc.last_keyfile(options["keyfile"])
|
228
|
-
options["timeout"] = rc.timeout(options["timeout"])
|
229
|
-
|
230
191
|
return options
|
231
192
|
end
|
232
193
|
|
233
194
|
options = parse(ARGV)
|
234
195
|
|
235
196
|
begin
|
236
|
-
|
197
|
+
rc = options["config"]
|
198
|
+
kdbx = Pathname.new(rc.get_kdbx).expand_path
|
237
199
|
password = options["password"] || get_password
|
238
|
-
keyfile =
|
200
|
+
keyfile = nil
|
201
|
+
if (rc.keyfile?)
|
202
|
+
keyfile = Pathname.new(rc.get_keyfile).expand_path
|
203
|
+
end
|
239
204
|
|
240
205
|
# Read password from file if filename was provided
|
241
206
|
pfile = Pathname.new(password).expand_path
|
@@ -283,7 +248,7 @@ begin
|
|
283
248
|
{
|
284
249
|
"keepass" => keepass,
|
285
250
|
"cwd" => keepass.db,
|
286
|
-
"clipboard_timeout" => options["
|
251
|
+
"clipboard_timeout" => options["config"].get_timeout
|
287
252
|
}
|
288
253
|
)
|
289
254
|
keepass.wait_to_exit
|
@@ -292,7 +257,7 @@ begin
|
|
292
257
|
{
|
293
258
|
"keepass" => keepass,
|
294
259
|
"cwd" => keepass.db,
|
295
|
-
"clipboard_timeout" => options["
|
260
|
+
"clipboard_timeout" => options["config"].get_timeout,
|
296
261
|
"prompt_color" => "light_white"
|
297
262
|
},
|
298
263
|
"rpass:/> ".light_white
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubeepass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -94,22 +94,22 @@ dependencies:
|
|
94
94
|
name: json_config
|
95
95
|
requirement: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
|
-
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 0.2.0
|
100
97
|
- - "~>"
|
101
98
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0.
|
99
|
+
version: '0.3'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.3.1
|
103
103
|
type: :runtime
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - ">="
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: 0.2.0
|
110
107
|
- - "~>"
|
111
108
|
- !ruby/object:Gem::Version
|
112
|
-
version: '0.
|
109
|
+
version: '0.3'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 0.3.1
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: os
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|