mpw 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +122 -0
- data/.travis.yml +2 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +7 -9
- data/README.md +1 -7
- data/VERSION +1 -1
- data/bin/mpw +25 -25
- data/bin/mpw-add +54 -25
- data/bin/mpw-config +74 -62
- data/bin/mpw-copy +25 -30
- data/bin/mpw-delete +24 -29
- data/bin/mpw-export +27 -32
- data/bin/mpw-genpwd +22 -22
- data/bin/mpw-import +20 -25
- data/bin/mpw-list +24 -29
- data/bin/mpw-update +61 -32
- data/bin/mpw-wallet +48 -73
- data/i18n/en.yml +15 -26
- data/i18n/fr.yml +15 -26
- data/lib/mpw/cli.rb +554 -546
- data/lib/mpw/config.rb +168 -139
- data/lib/mpw/item.rb +75 -82
- data/lib/mpw/mpw.rb +328 -465
- data/mpw.gemspec +11 -10
- data/templates/add_form.erb +8 -8
- data/templates/update_form.erb +7 -7
- data/test/test_config.rb +70 -55
- data/test/test_item.rb +167 -167
- data/test/test_mpw.rb +132 -132
- data/test/test_translate.rb +23 -23
- data/test/tests.rb +1 -1
- metadata +4 -45
- data/lib/mpw/sync/ftp.rb +0 -68
- data/lib/mpw/sync/ssh.rb +0 -67
data/bin/mpw-copy
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# MPW is a software to crypt and manage your passwords
|
3
|
-
# Copyright (C)
|
4
|
-
#
|
3
|
+
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
4
|
+
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
7
7
|
# as published by the Free Software Foundation; either version 2
|
8
8
|
# of the License, or (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# This program is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with this program; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -25,45 +25,40 @@ require 'mpw/cli'
|
|
25
25
|
# --------------------------------------------------------- #
|
26
26
|
|
27
27
|
options = {}
|
28
|
-
options[:sync] = true
|
29
28
|
options[:clipboard] = true
|
30
29
|
values = {}
|
31
30
|
|
32
31
|
OptionParser.new do |opts|
|
33
|
-
|
32
|
+
opts.banner = "#{I18n.t('option.usage')}: mpw copy [options]"
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
|
35
|
+
options[:config] = config
|
36
|
+
end
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
opts.on('-d', '--disable-clipboard', I18n.t('option.clipboard')) do
|
39
|
+
options[:clipboard] = false
|
40
|
+
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
|
43
|
+
values[:group] = group
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
opts.on('-h', '--help', I18n.t('option.help')) do
|
47
|
+
puts opts
|
48
|
+
exit 0
|
49
|
+
end
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
|
52
|
+
values[:pattern] = pattern
|
53
|
+
end
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
61
|
-
options[:wallet] = wallet
|
62
|
-
end
|
55
|
+
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
56
|
+
options[:wallet] = wallet
|
57
|
+
end
|
63
58
|
end.parse!
|
64
59
|
|
65
60
|
config = MPW::Config.new(options[:config])
|
66
|
-
cli = MPW::Cli.new(config
|
61
|
+
cli = MPW::Cli.new(config)
|
67
62
|
|
68
63
|
cli.load_config
|
69
64
|
cli.get_wallet(options[:wallet])
|
data/bin/mpw-delete
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# MPW is a software to crypt and manage your passwords
|
3
|
-
# Copyright (C)
|
4
|
-
#
|
3
|
+
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
4
|
+
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
7
7
|
# as published by the Free Software Foundation; either version 2
|
8
8
|
# of the License, or (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# This program is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with this program; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -24,41 +24,36 @@ require 'mpw/cli'
|
|
24
24
|
# Options
|
25
25
|
# --------------------------------------------------------- #
|
26
26
|
|
27
|
-
options
|
28
|
-
|
29
|
-
values = {}
|
27
|
+
options = {}
|
28
|
+
values = {}
|
30
29
|
|
31
30
|
OptionParser.new do |opts|
|
32
|
-
|
31
|
+
opts.banner = "#{I18n.t('option.usage')}: mpw delete [options]"
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
|
34
|
+
options[:config] = config
|
35
|
+
end
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
|
38
|
+
values[:group] = group
|
39
|
+
end
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
opts.on('-h', '--help', I18n.t('option.help')) do
|
42
|
+
puts opts
|
43
|
+
exit 0
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
|
47
|
+
values[:pattern] = pattern
|
48
|
+
end
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
56
|
-
options[:wallet] = wallet
|
57
|
-
end
|
50
|
+
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
51
|
+
options[:wallet] = wallet
|
52
|
+
end
|
58
53
|
end.parse!
|
59
54
|
|
60
55
|
config = MPW::Config.new(options[:config])
|
61
|
-
cli = MPW::Cli.new(config
|
56
|
+
cli = MPW::Cli.new(config)
|
62
57
|
|
63
58
|
cli.load_config
|
64
59
|
cli.get_wallet(options[:wallet])
|
data/bin/mpw-export
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# MPW is a software to crypt and manage your passwords
|
3
|
-
# Copyright (C)
|
4
|
-
#
|
3
|
+
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
4
|
+
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
7
7
|
# as published by the Free Software Foundation; either version 2
|
8
8
|
# of the License, or (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# This program is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with this program; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -24,45 +24,40 @@ require 'mpw/cli'
|
|
24
24
|
# Options
|
25
25
|
# --------------------------------------------------------- #
|
26
26
|
|
27
|
-
options
|
28
|
-
|
29
|
-
values = {}
|
27
|
+
options = {}
|
28
|
+
values = {}
|
30
29
|
|
31
30
|
OptionParser.new do |opts|
|
32
|
-
|
31
|
+
opts.banner = "#{I18n.t('option.usage')}: mpw wallet [options]"
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
|
34
|
+
options[:config] = config
|
35
|
+
end
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
opts.on('-f', '--file PATH', I18n.t('option.file_export')) do |file|
|
38
|
+
options[:file] = file
|
39
|
+
end
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
opts.on('-g', '--group GROUP', I18n.t('option.group')) do |group|
|
42
|
+
values[:group] = group
|
43
|
+
end
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
opts.on('-h', '--help', I18n.t('option.help')) do
|
46
|
+
puts opts
|
47
|
+
exit 0
|
48
|
+
end
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
|
51
|
+
values[:pattern] = pattern
|
52
|
+
end
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
60
|
-
options[:wallet] = wallet
|
61
|
-
end
|
54
|
+
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
55
|
+
options[:wallet] = wallet
|
56
|
+
end
|
62
57
|
end.parse!
|
63
58
|
|
64
59
|
config = MPW::Config.new(options[:config])
|
65
|
-
cli = MPW::Cli.new(config
|
60
|
+
cli = MPW::Cli.new(config)
|
66
61
|
|
67
62
|
cli.load_config
|
68
63
|
cli.get_wallet(options[:wallet])
|
data/bin/mpw-genpwd
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# MPW is a software to crypt and manage your passwords
|
3
|
-
# Copyright (C)
|
4
|
-
#
|
3
|
+
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
4
|
+
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
7
7
|
# as published by the Free Software Foundation; either version 2
|
8
8
|
# of the License, or (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# This program is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with this program; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -22,29 +22,29 @@ require 'mpw/mpw'
|
|
22
22
|
options = {}
|
23
23
|
|
24
24
|
OptionParser.new do |opts|
|
25
|
-
|
25
|
+
opts.banner = "#{I18n.t('option.usage')}: mpw passwd [options]"
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
opts.on('-h', '--help', I18n.t('option.help')) do
|
28
|
+
puts opts
|
29
|
+
exit 0
|
30
|
+
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
opts.on('-l', '--length NUMBER', I18n.t('option.length')) do |length|
|
33
|
+
options[:length] = length.to_i
|
34
|
+
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
opts.on('-n', '--numeric', I18n.t('option.numeric')) do
|
37
|
+
options[:numeric] = true
|
38
|
+
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
opts.on('-s', '--special-chars', I18n.t('option.special_chars')) do
|
41
|
+
options[:special] = true
|
42
|
+
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
opts.on('-a', '--alpha', I18n.t('option.alpha')) do
|
45
|
+
options[:alpha] = true
|
46
|
+
end
|
47
47
|
end.parse!
|
48
48
|
|
49
|
-
puts MPW::MPW
|
49
|
+
puts MPW::MPW.password(options)
|
50
50
|
exit 0
|
data/bin/mpw-import
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# MPW is a software to crypt and manage your passwords
|
3
|
-
# Copyright (C)
|
4
|
-
#
|
3
|
+
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
4
|
+
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
7
7
|
# as published by the Free Software Foundation; either version 2
|
8
8
|
# of the License, or (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# This program is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with this program; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -24,36 +24,31 @@ require 'mpw/cli'
|
|
24
24
|
# Options
|
25
25
|
# --------------------------------------------------------- #
|
26
26
|
|
27
|
-
options
|
28
|
-
options[:sync] = true
|
27
|
+
options = {}
|
29
28
|
|
30
29
|
OptionParser.new do |opts|
|
31
|
-
|
30
|
+
opts.banner = "#{I18n.t('option.usage')}: mpw import [options]"
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
|
33
|
+
options[:config] = config
|
34
|
+
end
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
opts.on('-f', '--file PATH', I18n.t('option.file_import')) do |file|
|
37
|
+
options[:file] = file
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
opts.on('-h', '--help', I18n.t('option.help')) do
|
41
|
+
puts opts
|
42
|
+
exit 0
|
43
|
+
end
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
51
|
-
options[:wallet] = wallet
|
52
|
-
end
|
45
|
+
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
46
|
+
options[:wallet] = wallet
|
47
|
+
end
|
53
48
|
end.parse!
|
54
49
|
|
55
50
|
config = MPW::Config.new(options[:config])
|
56
|
-
cli = MPW::Cli.new(config
|
51
|
+
cli = MPW::Cli.new(config)
|
57
52
|
|
58
53
|
cli.load_config
|
59
54
|
cli.get_wallet(options[:wallet])
|
data/bin/mpw-list
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# MPW is a software to crypt and manage your passwords
|
3
|
-
# Copyright (C)
|
4
|
-
#
|
3
|
+
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
4
|
+
#
|
5
5
|
# This program is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU General Public License
|
7
7
|
# as published by the Free Software Foundation; either version 2
|
8
8
|
# of the License, or (at your option) any later version.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# This program is distributed in the hope that it will be useful,
|
11
11
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
12
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
13
|
# GNU General Public License for more details.
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with this program; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -24,41 +24,36 @@ require 'mpw/cli'
|
|
24
24
|
# Options
|
25
25
|
# --------------------------------------------------------- #
|
26
26
|
|
27
|
-
options
|
28
|
-
|
29
|
-
values = {}
|
27
|
+
options = {}
|
28
|
+
values = {}
|
30
29
|
|
31
30
|
OptionParser.new do |opts|
|
32
|
-
|
31
|
+
opts.banner = "#{I18n.t('option.usage')}: mpw list [options]"
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
|
34
|
+
options[:config] = config
|
35
|
+
end
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
|
38
|
+
values[:group] = group
|
39
|
+
end
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
opts.on('-h', '--help', I18n.t('option.help')) do
|
42
|
+
puts opts
|
43
|
+
exit 0
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
|
47
|
+
values[:pattern] = pattern
|
48
|
+
end
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
56
|
-
options[:wallet] = wallet
|
57
|
-
end
|
50
|
+
opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
|
51
|
+
options[:wallet] = wallet
|
52
|
+
end
|
58
53
|
end.parse!
|
59
54
|
|
60
55
|
config = MPW::Config.new(options[:config])
|
61
|
-
cli = MPW::Cli.new(config
|
56
|
+
cli = MPW::Cli.new(config)
|
62
57
|
|
63
58
|
cli.load_config
|
64
59
|
cli.get_wallet(options[:wallet])
|