gtk2passwordapp 5.2.1 → 6.0.210202
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 +5 -5
- data/README.md +107 -0
- data/bin/gtk2passwordapp +19 -0
- data/lib/gtk2passwordapp.rb +50 -14
- data/lib/gtk2passwordapp/account.rb +5 -5
- data/lib/gtk2passwordapp/accounts.rb +6 -4
- data/lib/gtk2passwordapp/cli.rb +35 -0
- data/lib/gtk2passwordapp/config.rb +197 -135
- data/lib/gtk2passwordapp/gui.rb +314 -0
- metadata +33 -50
- data/README.rdoc +0 -64
- data/bin/gtk2pwdV +0 -68
- data/data/VERSION +0 -1
- data/lib/gtk2passwordapp/gtk2pwdv.rb +0 -449
- data/lib/gtk2passwordapp/such_parts.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 250ac66febc964f13b9cd7b94f04766dbd2563c49a9aad7d38cb08f62271c3bb
|
4
|
+
data.tar.gz: d378a500d92273d2d6ad2999b0a49970fe48ffdb3e13babc042a227ee5d14279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351ebd133e9a4ff9bc99abb560d2c7063c055ed7403480bedd9edc374ed328b1c9f6eed7ae8e44bfe4e9e7e4c9ba3882dc468abfb3251eec4e3eeab0aa477423
|
7
|
+
data.tar.gz: 8d6b45f39397f7ba20e54d04fa01d0839c4995956575541ccaf4001c706eeb34c253e4deb3e04d87beee8027919bdef89258f26c3d48d4bd41c1e7f2ab516cc4
|
data/README.md
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
# Gtk2PasswordApp
|
2
|
+
|
3
|
+
* [VERSION 6.0.210202](https://github.com/carlosjhr64/gtk2passwordapp/releases)
|
4
|
+
* [github](https://github.com/carlosjhr64/gtk2passwordapp)
|
5
|
+
* [rubygems](https://rubygems.org/gems/gtk2passwordapp)
|
6
|
+
|
7
|
+

|
8
|
+
|
9
|
+
## Description:
|
10
|
+
|
11
|
+
Ruby-Gnome Password Manager.
|
12
|
+
|
13
|
+
Uses Blowfish to encrypt the datafile.
|
14
|
+
Features random password generator, clipboard use, and TOTP.
|
15
|
+
|
16
|
+
## Install:
|
17
|
+
|
18
|
+
```shell
|
19
|
+
$ gem install gtk2passwordapp
|
20
|
+
```
|
21
|
+
|
22
|
+
## Help:
|
23
|
+
|
24
|
+
```shell
|
25
|
+
$ gtk2passwordapp --help
|
26
|
+
Usage:
|
27
|
+
gtk2passwordapp [:gui+]
|
28
|
+
gtk2passwordapp :cli [<pattern> [<file>]]
|
29
|
+
gtk2passwordapp :info
|
30
|
+
Gui:
|
31
|
+
--notoggle Minime wont toggle decorated and keep above
|
32
|
+
--notdercorated Dont decorate window
|
33
|
+
Cli:
|
34
|
+
--nogui
|
35
|
+
Info:
|
36
|
+
-v --version Show version and exit
|
37
|
+
-h --help Show help and exit
|
38
|
+
# Notes #
|
39
|
+
With the --nogui cli-option,
|
40
|
+
one can give a pattern to filter by account names.
|
41
|
+
Default passwords data file is:
|
42
|
+
~/.cache/gtk3app/gtk2passwordapp/dump.yzb
|
43
|
+
```
|
44
|
+
|
45
|
+
## Gui:
|
46
|
+
|
47
|
+
Mouse clicks on logo:
|
48
|
+
|
49
|
+
1. `Right` to get the passwords list and select.
|
50
|
+
2. `Center` to reset the master password.
|
51
|
+
3. `Left` to get the application menu.
|
52
|
+
|
53
|
+
When you select an account,
|
54
|
+
the username/password will be in clipboard/primary for a few seconds.
|
55
|
+
|
56
|
+
View Account page:
|
57
|
+
|
58
|
+
* click on password to toggle visibility.
|
59
|
+
* click on secret to toggle TOTP(secret is password).
|
60
|
+
* `Current` button will put username/password in clipboard/primary for a few seconds.
|
61
|
+
* `Previous` button will put password/previous in clipboard/primary for a few seconds.
|
62
|
+
|
63
|
+
## Configuration:
|
64
|
+
|
65
|
+
```shell
|
66
|
+
$ ls ~/.config/gtk3app/gtk2passwordapp/config-?.?.rbon
|
67
|
+
```
|
68
|
+
|
69
|
+
* Salt: If your master password length is under 14(LongPwd), it'll append this Salt.
|
70
|
+
* TooOld: I have this set for a year (in seconds).
|
71
|
+
* PwdFile: passwords file... you'll want include this file in your back-ups.
|
72
|
+
|
73
|
+
If you're upgrading from `gtk2pwdV`,
|
74
|
+
copy your passwords files to the new file name:
|
75
|
+
|
76
|
+
```shell
|
77
|
+
$ cp ~/.cache/gtk3app/gtk2passwordapp/gtk2pwdV.dat ~/.cache/gtk3app/gtk2passwordapp/dump.yzb
|
78
|
+
```
|
79
|
+
|
80
|
+
And remember to set your `Salt:` in the configuration file.
|
81
|
+
The configuration file is created upon the first run of `gtk2passwordapp`, so
|
82
|
+
you'll need to do that first.
|
83
|
+
|
84
|
+
## LICENSE:
|
85
|
+
|
86
|
+
(The MIT License)
|
87
|
+
|
88
|
+
Copyright (c) 2021 CarlosJHR64
|
89
|
+
|
90
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
91
|
+
a copy of this software and associated documentation files (the
|
92
|
+
'Software'), to deal in the Software without restriction, including
|
93
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
94
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
95
|
+
permit persons to whom the Software is furnished to do so, subject to
|
96
|
+
the following conditions:
|
97
|
+
|
98
|
+
The above copyright notice and this permission notice shall be
|
99
|
+
included in all copies or substantial portions of the Software.
|
100
|
+
|
101
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
102
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
103
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
104
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
105
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
106
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
107
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/bin/gtk2passwordapp
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'gtk2passwordapp'
|
3
|
+
class Gtk2PasswordApp
|
4
|
+
begin
|
5
|
+
case ARGV
|
6
|
+
in [/^(-v)|(--version)$/]
|
7
|
+
puts VERSION
|
8
|
+
in [/^(-h)|(--help)$/]
|
9
|
+
puts HELP
|
10
|
+
in ['--nogui', *args]
|
11
|
+
Gtk2PasswordApp.cli
|
12
|
+
Gtk2PasswordApp.run(*args)
|
13
|
+
else
|
14
|
+
Gtk2PasswordApp.gui
|
15
|
+
Gtk2PasswordApp.run
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
exit
|
data/lib/gtk2passwordapp.rb
CHANGED
@@ -1,19 +1,55 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
class Gtk2PasswordApp
|
2
|
+
VERSION = '6.0.210202'
|
3
|
+
HELP = <<~HELP
|
4
|
+
Usage:
|
5
|
+
gtk2passwordapp [:gui+]
|
6
|
+
gtk2passwordapp :cli [<pattern> [<file>]]
|
7
|
+
gtk2passwordapp :info
|
8
|
+
Gui:
|
9
|
+
--notoggle \tMinime wont toggle decorated and keep above
|
10
|
+
--notdercorated\tDont decorate window
|
11
|
+
Cli:
|
12
|
+
--nogui
|
13
|
+
Info:
|
14
|
+
-v --version \tShow version and exit
|
15
|
+
-h --help \tShow help and exit
|
16
|
+
# Notes #
|
17
|
+
With the --nogui cli-option,
|
18
|
+
one can give a pattern to filter by account names.
|
19
|
+
Default passwords data file is:
|
20
|
+
~/.cache/gtk3app/gtk2passwordapp/dump.yzb
|
21
|
+
HELP
|
3
22
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
require 'base_convert'
|
23
|
+
def self.cli
|
24
|
+
# User using cli may be experiencing system problems.
|
25
|
+
begin
|
26
|
+
require 'gtk2passwordapp/cli'
|
27
|
+
require 'yaml_zlib_blowfish'
|
28
|
+
require 'base_convert'
|
29
|
+
rescue LoadError
|
30
|
+
$stderr.puts 'Missing Gem:'
|
31
|
+
$stderr.puts $!.message
|
32
|
+
exit 72
|
33
|
+
end
|
34
|
+
end
|
10
35
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
require_relative 'gtk2passwordapp/account.rb'
|
15
|
-
require_relative 'gtk2passwordapp/accounts.rb'
|
16
|
-
require_relative 'gtk2passwordapp/gtk2pwdv.rb'
|
36
|
+
def self.gui
|
37
|
+
# This is a Gtk3App.
|
38
|
+
require 'gtk3app'
|
17
39
|
|
40
|
+
# Helper Gems.
|
41
|
+
require 'base32'
|
42
|
+
require 'totp'
|
43
|
+
require 'yaml_zlib_blowfish'
|
44
|
+
require 'super_random'
|
45
|
+
require 'base_convert'
|
46
|
+
|
47
|
+
# This Gem.
|
48
|
+
require_relative 'gtk2passwordapp/config.rb'
|
49
|
+
require_relative 'gtk2passwordapp/account.rb'
|
50
|
+
require_relative 'gtk2passwordapp/accounts.rb'
|
51
|
+
require_relative 'gtk2passwordapp/gui.rb'
|
52
|
+
end
|
53
|
+
end
|
18
54
|
# Requires:
|
19
55
|
#`ruby`
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
class Gtk2PasswordApp
|
2
2
|
class Account
|
3
3
|
|
4
4
|
PASSWORD = 0
|
@@ -10,7 +10,7 @@ class Account
|
|
10
10
|
|
11
11
|
def initialize(name, data)
|
12
12
|
unless data.has_key?(name)
|
13
|
-
raise
|
13
|
+
raise CONFIG[:BadName] unless name.class==String and name.length > 0
|
14
14
|
data[name] = [ '', '', '', '', '', 0 ]
|
15
15
|
end
|
16
16
|
@name, @data = name, data[name]
|
@@ -49,7 +49,7 @@ class Account
|
|
49
49
|
### WRITTERS ###
|
50
50
|
|
51
51
|
def password=(password)
|
52
|
-
raise
|
52
|
+
raise CONFIG[:BadPassword] unless password=~/^[[:graph:]]*$/
|
53
53
|
if @data[PASSWORD] != password
|
54
54
|
@data[UPDATED] = Time.now.to_i
|
55
55
|
@data[PREVIOUS] = @data[PASSWORD]
|
@@ -62,12 +62,12 @@ class Account
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def username=(username)
|
65
|
-
raise
|
65
|
+
raise CONFIG[:BadUsername] unless username=~/^[[:graph:]]*$/
|
66
66
|
@data[USERNAME]=username
|
67
67
|
end
|
68
68
|
|
69
69
|
def url=(url)
|
70
|
-
raise
|
70
|
+
raise CONFIG[:BadUrl] unless url=='' or url=~/^\w+:\/\/\S+$/
|
71
71
|
@data[URL]=url
|
72
72
|
end
|
73
73
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
class Gtk2PasswordApp
|
2
2
|
class Accounts
|
3
3
|
|
4
4
|
def reset(password)
|
@@ -20,7 +20,8 @@ class Accounts
|
|
20
20
|
def load(password=nil)
|
21
21
|
reset(password) if password
|
22
22
|
data = @yzb.load(@dumpfile)
|
23
|
-
raise
|
23
|
+
# Sanity check... load will raise CipherError on decription error.
|
24
|
+
raise CONFIG[:CipherError] unless data.class == Hash
|
24
25
|
@data = data
|
25
26
|
end
|
26
27
|
|
@@ -35,16 +36,17 @@ class Accounts
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def delete(account)
|
39
|
+
raise CONFIG[:AccountMiss] unless @data.has_key?(account)
|
38
40
|
@data.delete(account)
|
39
41
|
end
|
40
42
|
|
41
43
|
def get(account)
|
42
|
-
raise
|
44
|
+
raise CONFIG[:AccountMiss] unless @data.has_key?(account)
|
43
45
|
Account.new(account, @data)
|
44
46
|
end
|
45
47
|
|
46
48
|
def add(account)
|
47
|
-
raise
|
49
|
+
raise CONFIG[:AccountHit] if @data.has_key?(account)
|
48
50
|
Account.new(account, @data)
|
49
51
|
end
|
50
52
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class Gtk2PasswordApp
|
2
|
+
def self.run(pattern='.', dump=File.expand_path('~/.cache/gtk3app/gtk2passwordapp/dump.yzb'), *trash)
|
3
|
+
unless trash.empty?
|
4
|
+
$stderr.puts HELP
|
5
|
+
$stderr.puts "Please match usage."
|
6
|
+
exit 64
|
7
|
+
end
|
8
|
+
begin
|
9
|
+
pattern = Regexp.new pattern, Regexp::IGNORECASE
|
10
|
+
rescue RegexpError
|
11
|
+
$stderr.puts $!.message
|
12
|
+
exit 65
|
13
|
+
end
|
14
|
+
unless File.exist? dump
|
15
|
+
$stderr.puts "Passwords data file missing: #{dump}"
|
16
|
+
exit 66
|
17
|
+
end
|
18
|
+
system('clear; clear')
|
19
|
+
print "Enter password: "
|
20
|
+
pwd = $stdin.gets.strip
|
21
|
+
system('clear; clear')
|
22
|
+
print "Enter salt: "
|
23
|
+
pwd << $stdin.gets.strip
|
24
|
+
system('clear; clear')
|
25
|
+
h2q = BaseConvert::FromTo.new base: 16, digits: '0123456789ABCDEF', to_base: 91, to_digits: :qgraph
|
26
|
+
pwd = h2q.convert Digest::SHA256.hexdigest(pwd).upcase
|
27
|
+
begin
|
28
|
+
lst = YamlZlibBlowfish.new(pwd).load(dump)
|
29
|
+
rescue OpenSSL::Cipher::CipherError
|
30
|
+
$stderr.puts "Bad password+salt"
|
31
|
+
exit 65
|
32
|
+
end
|
33
|
+
pp lst.select{|k,v|pattern.match? k}
|
34
|
+
end
|
35
|
+
end
|
@@ -1,151 +1,213 @@
|
|
1
|
-
|
1
|
+
class Gtk2PasswordApp
|
2
2
|
using Rafini::String
|
3
|
+
extend Rafini::Empty
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
h0 = Rafini::Empty::HASH
|
8
|
-
a0 = Rafini::Empty::ARRAY
|
5
|
+
H2Q = BaseConvert::FromTo.new(base: 16, digits: '0123456789ABCDEF', to_base:91, to_digits: :qgraph)
|
6
|
+
RND = SuperRandom.new
|
7
|
+
TOTPx = /^[A-Z2-7]{16,}$/
|
9
8
|
|
10
9
|
CONFIG = {
|
11
|
-
Salt: s0, # Password Salt
|
12
|
-
MinPwdLen: 14,
|
13
|
-
TOTP: /^[A-Z2-7]{16,}$/,
|
14
10
|
|
15
|
-
#
|
16
|
-
PwdFile: "#{XDG['CACHE']}/gtk3app/gtk2passwordapp/gtk2pwdV.dat",
|
17
|
-
BackupFile: "#{ENV['HOME']}/Dropbox/gtk2pwdV.bak",
|
11
|
+
# Hashing
|
18
12
|
|
19
|
-
|
20
|
-
|
13
|
+
Salt: s0,
|
14
|
+
LongPwd: 14,
|
21
15
|
|
22
|
-
#
|
23
|
-
TooOld: 60*60*24*365, # Year
|
16
|
+
# Miscellaneous Strings
|
24
17
|
|
25
|
-
#
|
26
|
-
Random: 'Random',
|
27
|
-
AlphaNumeric: 'Alpha-Numeric',
|
28
|
-
Custom: 'Custom',
|
29
|
-
CustomDigits: '3479ACEFHJKLMNPRTUVWXYabcdefghijkmnopqrstuvwxyz',
|
30
|
-
|
31
|
-
# Button Labels
|
32
|
-
Go: 'Go',
|
33
|
-
Edit: 'Edit',
|
34
|
-
Add: 'Add',
|
35
|
-
Goto: 'Goto',
|
36
|
-
Current: 'Current',
|
37
|
-
Previous: 'Previous',
|
38
|
-
Show: 'Show',
|
39
|
-
Cancel: 'Cancel',
|
40
|
-
Delete: 'Delete',
|
41
|
-
Save: 'Save',
|
42
|
-
|
43
|
-
# Labels
|
44
|
-
ReTry: 'Try Again!',
|
18
|
+
Logo: "#{UserSpace::XDG['data']}/gtk3app/gtk2passwordapp/logo.png",
|
45
19
|
HiddenPwd: ' * * * ',
|
46
20
|
|
21
|
+
# Overriding Gtk3App's window, main:
|
22
|
+
|
23
|
+
main: { set_title: 'Password Manager' },
|
24
|
+
|
25
|
+
# Overriding Gtk3App's toolbar
|
26
|
+
toolbar: {
|
27
|
+
set_expanded: true,
|
28
|
+
into: [:pack_start, expand:true, fill:true, padding:4],
|
29
|
+
},
|
30
|
+
|
31
|
+
# Overriding Gtk3App's app_menu:
|
32
|
+
|
33
|
+
app_menu: {
|
34
|
+
add_menu_item: [:minime!,:about!,:quit!],
|
35
|
+
},
|
36
|
+
|
47
37
|
# Colors
|
48
|
-
Blue: '#00F',
|
49
|
-
Red: '#F00',
|
50
|
-
Black: '#000',
|
51
38
|
|
52
|
-
#
|
53
|
-
|
39
|
+
Red: '#900',
|
40
|
+
Green: '#090',
|
41
|
+
Blue: '#009',
|
42
|
+
TooOld: 60*60*24*365, # Year
|
43
|
+
|
44
|
+
# Buttons
|
45
|
+
|
46
|
+
tool_button: {
|
47
|
+
set_width_request: 1,
|
48
|
+
into: [:pack_start, expand:true, fill:true, padding:1],
|
49
|
+
},
|
50
|
+
|
51
|
+
# Spin Buttons
|
52
|
+
|
53
|
+
PWDLEN: [3,40,1],
|
54
|
+
pwdlen: {set_value: 13},
|
55
|
+
pwdlen!: [:PWDLEN,:pwdlen],
|
56
|
+
|
57
|
+
# Tools Labels
|
58
|
+
|
59
|
+
ADD: [label: 'Add'],
|
60
|
+
EDIT: [label: 'Edit'],
|
61
|
+
GO: [label: 'Go'],
|
62
|
+
CANCEL: [label: 'Cancel'],
|
63
|
+
DELETE: [label: 'Delete'],
|
64
|
+
SAVE: [label: 'Save'],
|
65
|
+
CURRENT: [label: 'Current'],
|
66
|
+
PREVIOUS: [label: 'Previous'],
|
67
|
+
RAND: [label: 'Random'],
|
68
|
+
|
69
|
+
# Initialize
|
70
|
+
# Stage and Toolbar
|
71
|
+
|
54
72
|
ClipboardTimeout: 15,
|
73
|
+
PwdFile: "#{UserSpace::XDG['cache']}/gtk3app/gtk2passwordapp/dump.yzb",
|
74
|
+
|
75
|
+
# Logo's Main Menu
|
76
|
+
|
77
|
+
MAIN_MENU: a0,
|
78
|
+
main_menu: h0,
|
79
|
+
main_menu!: [:MAIN_MENU,:main_menu],
|
80
|
+
|
81
|
+
main_menu_item: h0,
|
82
|
+
|
83
|
+
# Toolbar's Toolbox
|
84
|
+
|
85
|
+
TOOLBOX: [:horizontal],
|
86
|
+
toolbox: h0,
|
87
|
+
toolbox!: [:TOOLBOX,:toolbox],
|
88
|
+
|
89
|
+
# Stage's Pages
|
90
|
+
|
91
|
+
PAGES: [:vertical],
|
92
|
+
pages: h0,
|
93
|
+
pages!: [:PAGES,:pages],
|
94
|
+
|
95
|
+
# Page
|
96
|
+
|
97
|
+
PAGE: [:vertical],
|
98
|
+
page: h0,
|
99
|
+
page!: [:PAGE,:page],
|
100
|
+
|
101
|
+
# Page Label
|
102
|
+
|
103
|
+
page_label: h0,
|
104
|
+
|
105
|
+
# Field Row
|
106
|
+
|
107
|
+
FIELD_ROW: [:horizontal],
|
108
|
+
field_row: h0,
|
109
|
+
field_row!: [:FIELD_ROW,:field_row],
|
110
|
+
|
111
|
+
# Field Label
|
112
|
+
|
113
|
+
FIELD_LABEL: a0,
|
114
|
+
field_label: {
|
115
|
+
set_selectable: false,
|
116
|
+
set_width_request: 80,
|
117
|
+
set_alignment: [1.0,0.5],
|
118
|
+
set_padding: [4,4],
|
119
|
+
},
|
120
|
+
field_label!: [:FIELD_LABEL, :field_label],
|
121
|
+
|
122
|
+
# Field View
|
123
|
+
|
124
|
+
FIELD_VIEW: a0,
|
125
|
+
field_view: {
|
126
|
+
set_selectable: true,
|
127
|
+
set_width_request: 250,
|
128
|
+
set_alignment: [0.0,0.5],
|
129
|
+
set_padding: [4,4],
|
130
|
+
},
|
131
|
+
field_view!: [:FIELD_VIEW, :field_view],
|
132
|
+
|
133
|
+
# Field Entry
|
134
|
+
|
135
|
+
FIELD_ENTRY: a0,
|
136
|
+
field_entry: {
|
137
|
+
set_width_request: 250,
|
138
|
+
into: [:pack_start, expand:true, fill:true, padding:4],
|
139
|
+
},
|
140
|
+
field_entry!: [:FIELD_ENTRY,:field_entry],
|
141
|
+
|
142
|
+
# Password Entry
|
143
|
+
|
144
|
+
PASSWORD_ENTRY: a0,
|
145
|
+
password_entry: {
|
146
|
+
set_visibility: false,
|
147
|
+
set_width_request: 250,
|
148
|
+
into: [:pack_start, expand:true, fill:true, padding:4],
|
149
|
+
},
|
150
|
+
password_entry!: [:PASSWORD_ENTRY,:password_entry],
|
151
|
+
|
152
|
+
# Error Label
|
153
|
+
|
154
|
+
ERROR_LABEL: a0,
|
155
|
+
error_label: h0,
|
156
|
+
error_label!: [:ERROR_LABEL,:error_label],
|
157
|
+
|
158
|
+
# Password Page
|
159
|
+
|
160
|
+
MinPwdLen: 7,
|
161
|
+
Confirm: "Confirm password!",
|
162
|
+
|
163
|
+
# Page Labels
|
164
|
+
|
165
|
+
PASSWORD_PAGE_LABEL: ['Enter Master Password'],
|
166
|
+
ADD_PAGE_LABEL: ['Add Account'],
|
167
|
+
EDIT_PAGE_LABEL: ['Edit Account'],
|
168
|
+
MAIN_PAGE_LABEL: ['View Account'],
|
169
|
+
|
170
|
+
# Fields
|
171
|
+
|
172
|
+
NAME: ['Name:'],
|
173
|
+
URL: ['URL:'],
|
174
|
+
NOTE: ['Note:'],
|
175
|
+
USERNAME: ['Username:'],
|
176
|
+
PASSWORD: ['Password:'],
|
177
|
+
|
178
|
+
# About Dialog
|
179
|
+
|
180
|
+
about_dialog: {
|
181
|
+
set_program_name: 'Password Manager',
|
182
|
+
set_version: VERSION.semantic(0..1),
|
183
|
+
set_copyright: '(c) 2021 CarlosJHR64',
|
184
|
+
set_comments: 'A Gtk3App Password Manager',
|
185
|
+
set_website: 'https://github.com/carlosjhr64/gtk2passwordapp',
|
186
|
+
set_website_label: 'See it at GitHub!',
|
187
|
+
},
|
188
|
+
|
189
|
+
# Delete Dialog
|
190
|
+
|
191
|
+
DELETE_URSURE: a0,
|
192
|
+
delete_ursure: {add_label: 'Delete?'},
|
193
|
+
delete_ursure!: [:DELETE_URSURE,:delete_ursure],
|
194
|
+
|
195
|
+
# Reset Dialog
|
196
|
+
|
197
|
+
RESET_URSURE: a0,
|
198
|
+
reset_ursure: {add_label: 'Reset Master Password?'},
|
199
|
+
reset_ursure!: [:RESET_URSURE,:reset_ursure],
|
200
|
+
|
201
|
+
# Errors
|
202
|
+
|
203
|
+
BadUrl: 'URL must be like http://site.',
|
204
|
+
BadUsername: 'Username must be all graph.',
|
205
|
+
BadPassword: 'Password must be all graph.',
|
206
|
+
BadName: 'Account name must be a non-empty String.',
|
207
|
+
CipherError: 'Decryption error.',
|
208
|
+
AccountHit: 'Account exists.',
|
209
|
+
AccountMiss: 'Account does NOT exist.',
|
210
|
+
TooShort: "Password too short!",
|
55
211
|
|
56
|
-
# Fields' Labels
|
57
|
-
Name: 'Account:',
|
58
|
-
FIELDS: [
|
59
|
-
[:url, 'Url:' ],
|
60
|
-
[:note, 'Note:' ],
|
61
|
-
[:username, 'Username:'],
|
62
|
-
[:password, 'Password:'],
|
63
|
-
],
|
64
|
-
FIELD_ALIGNMENT: [0.0, 0.5],
|
65
|
-
|
66
|
-
# Such::Thing::PARAMETERS
|
67
|
-
thing: {
|
68
|
-
|
69
|
-
box: h0,
|
70
|
-
label: h0,
|
71
|
-
check_button: h0,
|
72
|
-
entry: h0,
|
73
|
-
|
74
|
-
button: {
|
75
|
-
set_width_request: 75,
|
76
|
-
into: [:pack_start, expand:true, fill:true, padding:0],
|
77
|
-
},
|
78
|
-
|
79
|
-
vbox!: [[:vertical], :box, s0],
|
80
|
-
hbox!: [[:horizontal], :box, s0],
|
81
|
-
|
82
|
-
prompt: {
|
83
|
-
set_width_request: 75,
|
84
|
-
set_alignment: [1.0, 0.5],
|
85
|
-
set_padding: [4,4],
|
86
|
-
},
|
87
|
-
prompt!: [a0, :prompt],
|
88
|
-
|
89
|
-
prompted: {
|
90
|
-
set_width_request: 325,
|
91
|
-
},
|
92
|
-
prompted!: [a0, :prompted],
|
93
|
-
|
94
|
-
a!: [a0, :button],
|
95
|
-
b!: [a0, :button],
|
96
|
-
c!: [a0, :button],
|
97
|
-
|
98
|
-
window: {
|
99
|
-
set_title: 'Password Manager',
|
100
|
-
set_window_position: :center,
|
101
|
-
},
|
102
|
-
|
103
|
-
password_label!: [['Password:'], :label],
|
104
|
-
password_entry!: [a0, :entry, {set_visibility: false}],
|
105
|
-
|
106
|
-
edit_label!: [['Edit Account'], :label],
|
107
|
-
add_label!: [['Add Account'], :label],
|
108
|
-
view_label!: [['View Account'], :label],
|
109
|
-
|
110
|
-
pwd_size_check!: [:check_button],
|
111
|
-
pwd_size_spin!: [
|
112
|
-
[4,64,1],
|
113
|
-
{
|
114
|
-
set_increments: [1,10],
|
115
|
-
set_digits: 0,
|
116
|
-
set_value: 14,
|
117
|
-
},
|
118
|
-
],
|
119
|
-
|
120
|
-
reset!: [[label: 'Reset Master Password'], 'activate'],
|
121
|
-
backup!: [[label: 'Backup Passwords'], 'activate'],
|
122
|
-
|
123
|
-
about_dialog: {
|
124
|
-
set_program_name: 'Password Manager',
|
125
|
-
set_version: VERSION.semantic(0..1),
|
126
|
-
set_copyright: '(c) 2017 CarlosJHR64',
|
127
|
-
set_comments: 'A Gtk3App Password Manager',
|
128
|
-
set_website: 'https://github.com/carlosjhr64/gtk2passwordapp',
|
129
|
-
set_website_label: 'See it at GitHub!',
|
130
|
-
},
|
131
|
-
HelpFile: 'https://github.com/carlosjhr64/gtk2passwordapp',
|
132
|
-
Logo: "#{XDG['DATA']}/gtk3app/gtk2passwordapp/logo.png",
|
133
|
-
|
134
|
-
backup_dialog: {
|
135
|
-
set_title: 'Backup Passwords',
|
136
|
-
set_window_position: :center_on_parent,
|
137
|
-
},
|
138
|
-
|
139
|
-
error_dialog: {
|
140
|
-
set_text: 'Backup Error',
|
141
|
-
set_window_position: :center_on_parent,
|
142
|
-
},
|
143
|
-
|
144
|
-
delete_dialog: {
|
145
|
-
set_window_position: :center_on_parent,
|
146
|
-
},
|
147
|
-
delete_label!: [['Delete?'], :label],
|
148
|
-
|
149
|
-
}
|
150
212
|
}
|
151
213
|
end
|