mpw 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +2 -1
- data/VERSION +1 -1
- data/bin/mpw +73 -61
- data/i18n/en.yml +9 -3
- data/i18n/fr.yml +7 -1
- data/lib/mpw/config.rb +5 -1
- data/lib/mpw/mpw.rb +13 -7
- data/lib/mpw/ui/cli.rb +58 -17
- data/mpw.gemspec +2 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef1f27beb1e85561895eeaec053e65339d404a18
|
4
|
+
data.tar.gz: b69ea026f373f5b3039a71776e4acc9ec4d44e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46c34128083ac6a70fcbb1ef3b9e0fb29b9bb58419a51d0b3623d0dbc34dd8b6371c8bed9c13b4dc61ffd7c9d0a2de06f37a61477e296b78934878edcf62959c
|
7
|
+
data.tar.gz: 0ff807e8c938d31abec7bce1f4a18b4f795eacf87065c8166430ffc9f86e3a9533f9098032db6ca94455345761099ea89c006072017868cac29aff6e1a381443
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# Manage your passwords!
|
2
2
|
|
3
3
|
MPW is a little software which stores your passwords in an GPG encrypted file.
|
4
|
-
MPW can synchronize your password with
|
4
|
+
MPW can synchronize your password with SSH or FTP.
|
5
5
|
|
6
6
|
# Installation
|
7
7
|
|
8
8
|
This program work with ruby >= 2.0
|
9
9
|
|
10
10
|
* install ruby and rubygems on your computer
|
11
|
+
* install xclip
|
11
12
|
* gem install mpw
|
12
13
|
|
13
14
|
# How to use
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1.0
|
data/bin/mpw
CHANGED
@@ -48,12 +48,13 @@ I18n.locale = lang.to_sym
|
|
48
48
|
# Options
|
49
49
|
# --------------------------------------------------------- #
|
50
50
|
|
51
|
-
options
|
52
|
-
options[:force]
|
53
|
-
options[:sync]
|
54
|
-
options[:
|
55
|
-
options[:
|
56
|
-
options[:
|
51
|
+
options = {}
|
52
|
+
options[:force] = false
|
53
|
+
options[:sync] = true
|
54
|
+
options[:clipboard] = true
|
55
|
+
options[:group] = nil
|
56
|
+
options[:config] = nil
|
57
|
+
options[:wallet] = nil
|
57
58
|
|
58
59
|
OptionParser.new do |opts|
|
59
60
|
opts.banner = "#{I18n.t('option.usage')}: mpw [options]"
|
@@ -71,6 +72,10 @@ OptionParser.new do |opts|
|
|
71
72
|
options[:config] = config
|
72
73
|
end
|
73
74
|
|
75
|
+
opts.on('-C', '--no-clipboard', I18n.t('option.clipboard')) do
|
76
|
+
options[:clipboard] = false
|
77
|
+
end
|
78
|
+
|
74
79
|
opts.on('-d', '--delete', I18n.t('option.remove')) do
|
75
80
|
options[:delete] = true
|
76
81
|
end
|
@@ -142,61 +147,68 @@ end.parse!
|
|
142
147
|
# Main
|
143
148
|
# --------------------------------------------------------- #
|
144
149
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
end
|
154
|
-
|
155
|
-
cli.get_wallet(options[:wallet])
|
156
|
-
cli.decrypt
|
157
|
-
|
158
|
-
# Display the item's informations
|
159
|
-
if not options[:show].nil?
|
160
|
-
opts = {search: options[:show],
|
161
|
-
group: options[:group],
|
162
|
-
}
|
163
|
-
|
164
|
-
cli.display(opts)
|
165
|
-
|
166
|
-
# Remove an item
|
167
|
-
elsif not options[:delete].nil? and not options[:id].nil?
|
168
|
-
cli.delete(options[:id], options[:force])
|
169
|
-
|
170
|
-
# Update an item
|
171
|
-
elsif not options[:update].nil? and not options[:id].nil?
|
172
|
-
cli.update(options[:id])
|
173
|
-
|
174
|
-
# Add a new item
|
175
|
-
elsif not options[:add].nil? and options[:key].nil?
|
176
|
-
cli.add
|
177
|
-
|
178
|
-
# Add a new public key in wallet
|
179
|
-
elsif not options[:add].nil? and not options[:key].nil?
|
180
|
-
cli.add_key(options[:key], options[:file])
|
181
|
-
|
182
|
-
# Delete a public key in wallet
|
183
|
-
elsif not options[:delete].nil? and not options[:key].nil?
|
184
|
-
cli.delete_key(options[:key])
|
185
|
-
|
186
|
-
# Export
|
187
|
-
elsif not options[:export].nil? and not options[:file].nil?
|
188
|
-
cli.export(options[:file])
|
189
|
-
|
190
|
-
# Add a new item
|
191
|
-
elsif not options[:import].nil? and not options[:file].nil?
|
192
|
-
cli.import(options[:file])
|
150
|
+
begin
|
151
|
+
config = MPW::Config.new(options[:config])
|
152
|
+
cli = MPW::Cli.new(config, options[:clipboard], options[:sync])
|
153
|
+
|
154
|
+
# Setup a new config
|
155
|
+
if not options[:setup].nil?
|
156
|
+
cli.setup(lang)
|
157
|
+
exit 0
|
158
|
+
end
|
193
159
|
|
194
|
-
|
195
|
-
|
196
|
-
|
160
|
+
cli.setup(lang) if not config.is_valid?
|
161
|
+
cli.setup_gpg_key if not config.check_gpg_key?
|
162
|
+
|
163
|
+
cli.get_wallet(options[:wallet])
|
164
|
+
cli.decrypt
|
165
|
+
|
166
|
+
# Display the item's informations
|
167
|
+
if not options[:show].nil?
|
168
|
+
opts = {search: options[:show],
|
169
|
+
group: options[:group],
|
170
|
+
}
|
171
|
+
|
172
|
+
cli.display(opts)
|
173
|
+
|
174
|
+
# Remove an item
|
175
|
+
elsif not options[:delete].nil? and not options[:id].nil?
|
176
|
+
cli.delete(options[:id], options[:force])
|
177
|
+
|
178
|
+
# Update an item
|
179
|
+
elsif not options[:update].nil? and not options[:id].nil?
|
180
|
+
cli.update(options[:id])
|
181
|
+
|
182
|
+
# Add a new item
|
183
|
+
elsif not options[:add].nil? and options[:key].nil?
|
184
|
+
cli.add
|
185
|
+
|
186
|
+
# Add a new public key in wallet
|
187
|
+
elsif not options[:add].nil? and not options[:key].nil?
|
188
|
+
cli.add_key(options[:key], options[:file])
|
189
|
+
|
190
|
+
# Delete a public key in wallet
|
191
|
+
elsif not options[:delete].nil? and not options[:key].nil?
|
192
|
+
cli.delete_key(options[:key])
|
193
|
+
|
194
|
+
# Export
|
195
|
+
elsif not options[:export].nil? and not options[:file].nil?
|
196
|
+
cli.export(options[:file])
|
197
|
+
|
198
|
+
# Add a new item
|
199
|
+
elsif not options[:import].nil? and not options[:file].nil?
|
200
|
+
cli.import(options[:file])
|
201
|
+
|
202
|
+
# Setup wallet config
|
203
|
+
elsif not options[:setup_wallet].nil?
|
204
|
+
cli.setup_wallet_config
|
205
|
+
|
206
|
+
end
|
207
|
+
|
208
|
+
cli = nil
|
209
|
+
|
210
|
+
exit 0
|
197
211
|
|
212
|
+
rescue SystemExit, Interrupt
|
213
|
+
exit 3
|
198
214
|
end
|
199
|
-
|
200
|
-
cli = nil
|
201
|
-
|
202
|
-
exit 0
|
data/i18n/en.yml
CHANGED
@@ -23,7 +23,7 @@ en:
|
|
23
23
|
update:
|
24
24
|
name_empty: "You must define a name!"
|
25
25
|
sync:
|
26
|
-
general: "An error
|
26
|
+
general: "An error has appeared during the sync"
|
27
27
|
connection: "Connection fail!"
|
28
28
|
communication: "A communication problem with the server is appeared!"
|
29
29
|
download: "Can't download the file!"
|
@@ -38,6 +38,7 @@ en:
|
|
38
38
|
option:
|
39
39
|
add: "Add an item or key"
|
40
40
|
config: "Specify the configuration file to use"
|
41
|
+
clipboard: "Disable the clipboard feature"
|
41
42
|
export: "Export a wallet in an yaml file"
|
42
43
|
file: "Specify a file, to use with the options [--import | --export | --add]"
|
43
44
|
force: "No ask to confirm when you delete an item"
|
@@ -51,7 +52,7 @@ en:
|
|
51
52
|
setup: "Create a new configuration file"
|
52
53
|
setup_wallet: "Create a new configuration file for a wallet"
|
53
54
|
show: "Search and show the items"
|
54
|
-
show_all: "
|
55
|
+
show_all: "List all items"
|
55
56
|
remove: "Delete an item"
|
56
57
|
update: "Update an item"
|
57
58
|
usage: "Usage"
|
@@ -72,6 +73,10 @@ en:
|
|
72
73
|
port: "Enter the connection port (optional): "
|
73
74
|
comment: "Enter a comment (optional): "
|
74
75
|
valid: "Item has been added!"
|
76
|
+
clipboard:
|
77
|
+
clean: "The clipboard has been cleaned."
|
78
|
+
login: "The login has been copied in clipboard, press any key to continue."
|
79
|
+
password: "The password has been copied in clipboard for 30s!"
|
75
80
|
delete_key:
|
76
81
|
valid: "Key has been deleted!"
|
77
82
|
delete_item:
|
@@ -86,11 +91,12 @@ en:
|
|
86
91
|
title: "Setup a new config file"
|
87
92
|
lang: "Choose your language (en, fr, ...) [default=%{lang}]: "
|
88
93
|
gpg_key: "Enter the GPG key [ex: test@host.local]: "
|
94
|
+
gpg_exe: "Enter the executable GPG path (optional): "
|
89
95
|
wallet_dir: "Enter the wallets's folder path [default=%{home}/wallets]: "
|
90
96
|
valid: "The config file has been created!"
|
91
97
|
setup_wallet:
|
92
98
|
title: "Wallet setup"
|
93
|
-
sync_type: "Synchronization type (ssh, ftp
|
99
|
+
sync_type: "Synchronization type (ssh, ftp): "
|
94
100
|
sync_host: "Synchronization server: "
|
95
101
|
sync_port: "Port of the synchronization server: "
|
96
102
|
sync_user: "Username for the synchronization: "
|
data/i18n/fr.yml
CHANGED
@@ -38,6 +38,7 @@ fr:
|
|
38
38
|
option:
|
39
39
|
add: "Ajoute un élément ou une clé"
|
40
40
|
config: "Spécifie le fichier de configuration à utiliser"
|
41
|
+
clipboard: "Désactive la fonction presse papier"
|
41
42
|
export: "Exporte un portefeuille dans un fichier yaml"
|
42
43
|
file: "Spécifie un fichier, à utiliser avec les options [--import | --export | --add]"
|
43
44
|
force: "Ne demande pas de confirmation pour la suppression d'un élément"
|
@@ -51,7 +52,7 @@ fr:
|
|
51
52
|
setup: "Création d'un nouveau fichier de configuration"
|
52
53
|
setup_wallet: "Création d'un nouveau fichier de configuration pour un portefeuille"
|
53
54
|
show: "Recherche et affiche les éléments"
|
54
|
-
show_all: "
|
55
|
+
show_all: "Liste tous les éléments"
|
55
56
|
remove: "Supprime un élément"
|
56
57
|
update: "Met à jour un élément"
|
57
58
|
usage: "Utilisation"
|
@@ -72,6 +73,10 @@ fr:
|
|
72
73
|
port: "Entrez le port de connexion (optionnel): "
|
73
74
|
comment: "Entrez un commentaire (optionnel): "
|
74
75
|
valid: "L'élément a bien été ajouté!"
|
76
|
+
clipboard:
|
77
|
+
clean: "Le presse papier a été nettoyé."
|
78
|
+
login: "L'identifiant a été copié dans le presse papier, pressez n'importe quelle touche pour continuer."
|
79
|
+
password: "Le mot de passe a été copié dans le presse papier pour 30s!"
|
75
80
|
delete_key:
|
76
81
|
valid: "La clé a bien été supprimée!"
|
77
82
|
delete_item:
|
@@ -86,6 +91,7 @@ fr:
|
|
86
91
|
title: "Création d'un nouveau fichier de configuration"
|
87
92
|
lang: "Choisissez votre langue (en, fr, ...) [défaut=%{lang}]: "
|
88
93
|
gpg_key: "Entrez la clé GPG [ex: test@host.local]: "
|
94
|
+
gpg_exe: "Entrez le chemin de l'exécutable GPG (optionnel): "
|
89
95
|
wallet_dir: "Entrez le chemin du répertoire qui contiendra les porte-feuilles de mot de passe [défaut=%{home}/wallets]: "
|
90
96
|
valid: "Le fichier de configuration a bien été créé!"
|
91
97
|
setup_wallet:
|
data/lib/mpw/config.rb
CHANGED
@@ -30,6 +30,7 @@ class Config
|
|
30
30
|
attr_accessor :lang
|
31
31
|
attr_accessor :config_dir
|
32
32
|
attr_accessor :wallet_dir
|
33
|
+
attr_accessor :gpg_exe
|
33
34
|
|
34
35
|
# Constructor
|
35
36
|
# @args: config_file -> the specify config file
|
@@ -53,8 +54,9 @@ class Config
|
|
53
54
|
# @args: key -> the gpg key to encrypt
|
54
55
|
# lang -> the software language
|
55
56
|
# wallet_dir -> the directory where are the wallets password
|
57
|
+
# gpg_exe -> the path of gpg executable
|
56
58
|
# @rtrn: true if le config file is create
|
57
|
-
def setup(key, lang, wallet_dir)
|
59
|
+
def setup(key, lang, wallet_dir, gpg_exe)
|
58
60
|
|
59
61
|
if not key =~ /[a-zA-Z0-9.-_]+\@[a-zA-Z0-9]+\.[a-zA-Z]+/
|
60
62
|
raise I18n.t('error.config.key_bad_format')
|
@@ -67,6 +69,7 @@ class Config
|
|
67
69
|
config = {'config' => {'key' => key,
|
68
70
|
'lang' => lang,
|
69
71
|
'wallet_dir' => wallet_dir,
|
72
|
+
'gpg_exe' => gpg_exe,
|
70
73
|
}
|
71
74
|
}
|
72
75
|
|
@@ -118,6 +121,7 @@ class Config
|
|
118
121
|
@key = config['config']['key']
|
119
122
|
@lang = config['config']['lang']
|
120
123
|
@wallet_dir = config['config']['wallet_dir']
|
124
|
+
@gpg_exe = config['config']['gpg_exe']
|
121
125
|
|
122
126
|
raise if @key.empty? or @wallet_dir.empty?
|
123
127
|
|
data/lib/mpw/mpw.rb
CHANGED
@@ -28,10 +28,15 @@ module MPW
|
|
28
28
|
class MPW
|
29
29
|
|
30
30
|
# Constructor
|
31
|
-
def initialize(key, wallet_file, gpg_pass=nil)
|
31
|
+
def initialize(key, wallet_file, gpg_pass=nil, gpg_exe=nil)
|
32
32
|
@key = key
|
33
33
|
@gpg_pass = gpg_pass
|
34
|
+
@gpg_exe = gpg_exe
|
34
35
|
@wallet_file = wallet_file
|
36
|
+
|
37
|
+
if @gpg_exe
|
38
|
+
GPGME::Engine.set_info(GPGME::PROTOCOL_OpenPGP, @gpg_exe, "#{Dir.home}/.gnupg")
|
39
|
+
end
|
35
40
|
end
|
36
41
|
|
37
42
|
# Read mpw file
|
@@ -311,12 +316,13 @@ class MPW
|
|
311
316
|
end
|
312
317
|
|
313
318
|
# Sync data with remote file
|
314
|
-
|
315
|
-
|
319
|
+
# @args: force -> force the sync
|
320
|
+
def sync(force=false)
|
321
|
+
return if @config.empty? or @config['sync']['type'].to_s.empty?
|
322
|
+
return if get_last_sync < Time.now.to_i + 300 and not force
|
316
323
|
|
317
324
|
tmp_file = "#{@wallet_file}.sync"
|
318
|
-
|
319
|
-
|
325
|
+
|
320
326
|
case @config['sync']['type']
|
321
327
|
when 'sftp', 'scp', 'ssh'
|
322
328
|
require "#{APP_ROOT}/../lib/mpw/sync/ssh.rb"
|
@@ -331,7 +337,7 @@ class MPW
|
|
331
337
|
sync.connect
|
332
338
|
sync.get(tmp_file)
|
333
339
|
|
334
|
-
remote = MPW.new(@key, tmp_file, @gpg_pass)
|
340
|
+
remote = MPW.new(@key, tmp_file, @gpg_pass, @gpg_exe)
|
335
341
|
remote.read_data
|
336
342
|
|
337
343
|
File.unlink(tmp_file) if File.exist?(tmp_file)
|
@@ -365,7 +371,7 @@ class MPW
|
|
365
371
|
end
|
366
372
|
|
367
373
|
# Remove an old item
|
368
|
-
if not update and item.last_sync.to_i <
|
374
|
+
if not update and item.last_sync.to_i < get_last_sync and item.last_edit < get_last_sync
|
369
375
|
item.delete
|
370
376
|
end
|
371
377
|
end
|
data/lib/mpw/ui/cli.rb
CHANGED
@@ -20,6 +20,7 @@ require 'readline'
|
|
20
20
|
require 'i18n'
|
21
21
|
require 'colorize'
|
22
22
|
require 'highline/import'
|
23
|
+
require 'clipboard'
|
23
24
|
|
24
25
|
#TODO
|
25
26
|
require "#{APP_ROOT}/../lib/mpw/item.rb"
|
@@ -31,9 +32,10 @@ class Cli
|
|
31
32
|
# Constructor
|
32
33
|
# @args: config -> the config
|
33
34
|
# sync -> boolean for sync or not
|
34
|
-
def initialize(config, sync=true)
|
35
|
-
@config
|
36
|
-
@
|
35
|
+
def initialize(config, clipboard=true, sync=true)
|
36
|
+
@config = config
|
37
|
+
@clipboard = clipboard
|
38
|
+
@sync = sync
|
37
39
|
end
|
38
40
|
|
39
41
|
# Create a new config file
|
@@ -44,13 +46,14 @@ class Cli
|
|
44
46
|
language = ask(I18n.t('form.setup_config.lang', lang: lang)).to_s
|
45
47
|
key = ask(I18n.t('form.setup_config.gpg_key')).to_s
|
46
48
|
wallet_dir = ask(I18n.t('form.setup_config.wallet_dir', home: "#{@config.config_dir}")).to_s
|
49
|
+
gpg_exe = ask(I18n.t('form.setup_config.gpg_exe')).to_s
|
47
50
|
|
48
51
|
if language.nil? or language.empty?
|
49
52
|
language = lang
|
50
53
|
end
|
51
54
|
I18n.locale = language.to_sym
|
52
55
|
|
53
|
-
@config.setup(key, lang, wallet_dir)
|
56
|
+
@config.setup(key, lang, wallet_dir, gpg_exe)
|
54
57
|
|
55
58
|
raise I18n.t('error.config.check') if not @config.is_valid?
|
56
59
|
|
@@ -103,11 +106,14 @@ class Cli
|
|
103
106
|
puts I18n.t('form.setup_wallet.title')
|
104
107
|
puts '--------------------'
|
105
108
|
config['sync']['type'] = ask(I18n.t('form.setup_wallet.sync_type')).to_s
|
106
|
-
|
107
|
-
config['sync']['
|
108
|
-
|
109
|
-
|
110
|
-
|
109
|
+
|
110
|
+
if ['ftp', 'ssh'].include?(config['sync']['type'].downcase)
|
111
|
+
config['sync']['host'] = ask(I18n.t('form.setup_wallet.sync_host')).to_s
|
112
|
+
config['sync']['port'] = ask(I18n.t('form.setup_wallet.sync_port')).to_s
|
113
|
+
config['sync']['user'] = ask(I18n.t('form.setup_wallet.sync_user')).to_s
|
114
|
+
config['sync']['password'] = ask(I18n.t('form.setup_wallet.sync_pwd')).to_s
|
115
|
+
config['sync']['path'] = ask(I18n.t('form.setup_wallet.sync_path')).to_s
|
116
|
+
end
|
111
117
|
|
112
118
|
@mpw.set_config(config)
|
113
119
|
@mpw.write_data
|
@@ -122,7 +128,7 @@ class Cli
|
|
122
128
|
def decrypt
|
123
129
|
if not defined?(@mpw)
|
124
130
|
@password = ask(I18n.t('display.gpg_password')) {|q| q.echo = false}
|
125
|
-
@mpw
|
131
|
+
@mpw = MPW.new(@config.key, @wallet_file, @password, @config.gpg_exe)
|
126
132
|
end
|
127
133
|
|
128
134
|
@mpw.read_data
|
@@ -141,11 +147,23 @@ class Cli
|
|
141
147
|
case result.length
|
142
148
|
when 0
|
143
149
|
puts I18n.t('display.nothing')
|
150
|
+
|
144
151
|
when 1
|
145
152
|
display_item(result.first)
|
153
|
+
|
146
154
|
else
|
147
|
-
|
155
|
+
group = nil
|
156
|
+
i = 1
|
157
|
+
|
158
|
+
result.sort! { |a,b| a.group.downcase <=> b.group.downcase }
|
159
|
+
|
148
160
|
result.each do |item|
|
161
|
+
if group != item.group
|
162
|
+
group = item.group
|
163
|
+
puts "#{I18n.t('display.group')}: #{group}".yellow
|
164
|
+
end
|
165
|
+
|
166
|
+
print " |_ ".yellow
|
149
167
|
print "#{i}: ".cyan
|
150
168
|
print item.name
|
151
169
|
print " -> #{item.comment}".magenta if not item.comment.to_s.empty?
|
@@ -180,11 +198,34 @@ class Cli
|
|
180
198
|
print "#{I18n.t('display.login')}: ".cyan
|
181
199
|
puts item.user
|
182
200
|
print "#{I18n.t('display.password')}: ".cyan
|
183
|
-
|
201
|
+
if @clipboard
|
202
|
+
puts '***********'
|
203
|
+
else
|
204
|
+
puts @mpw.get_password(item.id)
|
205
|
+
end
|
184
206
|
print "#{I18n.t('display.port')}: ".cyan
|
185
207
|
puts item.port
|
186
208
|
print "#{I18n.t('display.comment')}: ".cyan
|
187
209
|
puts item.comment
|
210
|
+
|
211
|
+
clipboard(item) if @clipboard
|
212
|
+
end
|
213
|
+
|
214
|
+
# Copy in clipboard the login and password
|
215
|
+
def clipboard(item)
|
216
|
+
Clipboard.copy(item.user)
|
217
|
+
print "\n#{I18n.t('form.clipboard.login')}".green
|
218
|
+
gets
|
219
|
+
|
220
|
+
Clipboard.copy(@mpw.get_password(item.id))
|
221
|
+
puts I18n.t('form.clipboard.password').yellow
|
222
|
+
|
223
|
+
sleep(30)
|
224
|
+
|
225
|
+
Clipboard.clear
|
226
|
+
puts I18n.t('form.clipboard.clean').green
|
227
|
+
rescue SystemExit, Interrupt
|
228
|
+
Clipboard.clear
|
188
229
|
end
|
189
230
|
|
190
231
|
# Display the wallet
|
@@ -226,7 +267,7 @@ class Cli
|
|
226
267
|
def add_key(key, file=nil)
|
227
268
|
@mpw.add_key(key, file)
|
228
269
|
@mpw.write_data
|
229
|
-
@mpw.sync if @sync
|
270
|
+
@mpw.sync(true) if @sync
|
230
271
|
|
231
272
|
puts "#{I18n.t('form.add_key.valid')}".green
|
232
273
|
rescue Exception => e
|
@@ -238,7 +279,7 @@ class Cli
|
|
238
279
|
def delete_key(key)
|
239
280
|
@mpw.delete_key(key)
|
240
281
|
@mpw.write_data
|
241
|
-
@mpw.sync if @sync
|
282
|
+
@mpw.sync(true) if @sync
|
242
283
|
|
243
284
|
puts "#{I18n.t('form.delete_key.valid')}".green
|
244
285
|
rescue Exception => e
|
@@ -265,7 +306,7 @@ class Cli
|
|
265
306
|
@mpw.add(item)
|
266
307
|
@mpw.set_password(item.id, password)
|
267
308
|
@mpw.write_data
|
268
|
-
@mpw.sync if @sync
|
309
|
+
@mpw.sync(true) if @sync
|
269
310
|
|
270
311
|
puts "#{I18n.t('form.add_item.valid')}".green
|
271
312
|
end
|
@@ -294,7 +335,7 @@ class Cli
|
|
294
335
|
item.update(options)
|
295
336
|
@mpw.set_password(item.id, password) if not password.empty?
|
296
337
|
@mpw.write_data
|
297
|
-
@mpw.sync if @sync
|
338
|
+
@mpw.sync(true) if @sync
|
298
339
|
|
299
340
|
puts "#{I18n.t('form.update_item.valid')}".green
|
300
341
|
else
|
@@ -326,7 +367,7 @@ class Cli
|
|
326
367
|
|
327
368
|
item.delete
|
328
369
|
@mpw.write_data
|
329
|
-
@mpw.sync if @sync
|
370
|
+
@mpw.sync(true) if @sync
|
330
371
|
|
331
372
|
puts "#{I18n.t('form.delete_item.valid', id: id)}".green
|
332
373
|
rescue Exception => e
|
data/mpw.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ['Adrien Waksberg']
|
9
9
|
spec.email = ['mpw@yae.im']
|
10
10
|
spec.summary = 'MPW is a software to crypt and manage your passwords'
|
11
|
-
spec.description = 'Manage your passwords in all security with MPW, we use GPG to
|
11
|
+
spec.description = 'Manage your passwords in all security with MPW, we use GPG to encrypt your passwords'
|
12
12
|
spec.homepage = 'https://github.com/nishiki/manage-password'
|
13
13
|
spec.license = 'GPL-2.0'
|
14
14
|
|
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "colorize"
|
25
25
|
spec.add_dependency "net-ssh"
|
26
26
|
spec.add_dependency "net-scp"
|
27
|
+
spec.add_dependency "clipboard"
|
27
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mpw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Waksberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -108,8 +108,22 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
|
112
|
-
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: clipboard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Manage your passwords in all security with MPW, we use GPG to encrypt
|
126
|
+
your passwords
|
113
127
|
email:
|
114
128
|
- mpw@yae.im
|
115
129
|
executables:
|