Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
aea5284279
|
|||
a1bc755181 | |||
9fae7124be
|
|||
0e6ed176b3
|
@@ -6,6 +6,12 @@
|
|||||||
- ℹ️ - Information
|
- ℹ️ - Information
|
||||||
- ♻️ - Edited
|
- ♻️ - Edited
|
||||||
|
|
||||||
|
## 0.2.4 - [26/07/2022]
|
||||||
|
- ➕ - Added hint for fix file permissions error.
|
||||||
|
- ℹ️ - Crystal version raise to 1.5.0 for NO_COLOR support
|
||||||
|
- ✔️ - Fixed output finding records for all queryes
|
||||||
|
- ✔️ - Fixed check password file name info
|
||||||
|
|
||||||
## 0.2.3 - [02/05/2022]
|
## 0.2.3 - [02/05/2022]
|
||||||
- ♻️ - Password outdated date change to 3 month
|
- ♻️ - Password outdated date change to 3 month
|
||||||
- ➕ - Added `pmng` logo
|
- ➕ - Added `pmng` logo
|
||||||
|
14
README.md
14
README.md
@@ -1,12 +1,16 @@
|
|||||||
# 🔑 The very simple password manager for humans
|
# The very simple password manager for humans
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# 📷 Screenshots
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||

|
# Screenshots
|
||||||
|
|
||||||
# 💾 Download
|

|
||||||
|
|
||||||
|
# Download
|
||||||
|
|
||||||
**Coming soon**
|
**Coming soon**
|
||||||
|
|
||||||
|
@@ -2,5 +2,5 @@ version: 2.0
|
|||||||
shards:
|
shards:
|
||||||
ameba:
|
ameba:
|
||||||
git: https://github.com/crystal-ameba/ameba.git
|
git: https://github.com/crystal-ameba/ameba.git
|
||||||
version: 0.14.3
|
version: 1.0.0
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name: pmng
|
name: pmng
|
||||||
version: 0.2.3
|
version: 0.2.4
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Alexander Popov <iiiypuk@iiiypuk.me>
|
- Alexander Popov <iiiypuk@iiiypuk.me>
|
||||||
@@ -11,8 +11,8 @@ targets:
|
|||||||
development_dependencies:
|
development_dependencies:
|
||||||
ameba:
|
ameba:
|
||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
version: ~> 0.14.0
|
version: ~> 1.0.0
|
||||||
|
|
||||||
crystal: 1.3.2
|
crystal: 1.5.0
|
||||||
|
|
||||||
license: MIT
|
license: MIT
|
||||||
|
51
src/pmng.cr
51
src/pmng.cr
@@ -22,9 +22,9 @@ class Password
|
|||||||
property update : Int32
|
property update : Int32
|
||||||
end
|
end
|
||||||
|
|
||||||
VERSION = "0.2.3"
|
VERSION = "0.2.4"
|
||||||
|
PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml"
|
||||||
ASCII_LOGO = "
|
ASCII_LOGO = "
|
||||||
██████╗ ███╗ ███╗███╗ ██╗ ██████╗
|
██████╗ ███╗ ███╗███╗ ██╗ ██████╗
|
||||||
██╔══██╗████╗ ████║████╗ ██║██╔════╝
|
██╔══██╗████╗ ████║████╗ ██║██╔════╝
|
||||||
██████╔╝██╔████╔██║██╔██╗ ██║██║ ███╗
|
██████╔╝██╔████╔██║██╔██╗ ██║██║ ███╗
|
||||||
@@ -70,15 +70,26 @@ rescue ex
|
|||||||
puts ex.message, ""
|
puts ex.message, ""
|
||||||
end
|
end
|
||||||
|
|
||||||
PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml"
|
|
||||||
|
|
||||||
# check password file exists
|
# check password file exists
|
||||||
if File.exists?(PASSWORD_FILE_PATH)
|
if File.exists?(PASSWORD_FILE_PATH)
|
||||||
yaml = File.open(PASSWORD_FILE_PATH) do |file|
|
yaml = File.open(PASSWORD_FILE_PATH) do |file|
|
||||||
YAML.parse(file)
|
YAML.parse(file)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "No password.yml file exists."
|
print "~/.pwd.yml".colorize(:red).mode(:bold)
|
||||||
|
puts ": No such file"
|
||||||
|
|
||||||
|
exit(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
# check file ppermissions
|
||||||
|
password_file_permissions = File.info(PASSWORD_FILE_PATH).permissions.to_s
|
||||||
|
|
||||||
|
if /\d{3}/.match(password_file_permissions).try &.[0] != "600"
|
||||||
|
puts "Password file permissions is not RW for you.".colorize(:red)
|
||||||
|
print "Execute: ".colorize(:yellow)
|
||||||
|
print "(chmod 600 ~/.pwd.yml) ".colorize(:green).mode(:bold)
|
||||||
|
puts "for fix.".colorize(:yellow)
|
||||||
|
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
@@ -91,15 +102,6 @@ while count < yaml.size
|
|||||||
count += 1
|
count += 1
|
||||||
end
|
end
|
||||||
|
|
||||||
# check file ppermissions
|
|
||||||
password_file_permissions = File.info(PASSWORD_FILE_PATH).permissions.to_s
|
|
||||||
|
|
||||||
if /\d{3}/.match(password_file_permissions).try &.[0] != "600"
|
|
||||||
puts "Password file permissions is not RW for you.".colorize(:red)
|
|
||||||
|
|
||||||
exit(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
# pmng title
|
# pmng title
|
||||||
system "clear"
|
system "clear"
|
||||||
puts ASCII_LOGO.colorize(:yellow)
|
puts ASCII_LOGO.colorize(:yellow)
|
||||||
@@ -121,10 +123,7 @@ while loop
|
|||||||
|
|
||||||
if password_string.to_s == ":q"
|
if password_string.to_s == ":q"
|
||||||
# if ':q' to close program
|
# if ':q' to close program
|
||||||
system "clear"
|
loop = false
|
||||||
puts "Bye! 👋"
|
|
||||||
|
|
||||||
exit(0)
|
|
||||||
elsif password_string.to_s.size == 0
|
elsif password_string.to_s.size == 0
|
||||||
# if puts empty, retry prompt
|
# if puts empty, retry prompt
|
||||||
puts
|
puts
|
||||||
@@ -197,12 +196,16 @@ while loop
|
|||||||
passwords_finded_array += 1
|
passwords_finded_array += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts
|
||||||
|
print "Finded ".colorize(:yellow).mode(:bold)
|
||||||
|
print passwords_finded_array.colorize(:red).mode(:bold)
|
||||||
|
puts " records".colorize(:yellow).mode(:bold)
|
||||||
|
puts "-----".colorize(:dark_gray).mode(:bold)
|
||||||
end
|
end
|
||||||
|
|
||||||
puts
|
puts
|
||||||
print "Finded ".colorize(:yellow).mode(:bold)
|
|
||||||
print passwords_finded_array.colorize(:red).mode(:bold)
|
|
||||||
puts " records".colorize(:yellow).mode(:bold)
|
|
||||||
puts "-----".colorize(:dark_gray).mode(:bold)
|
|
||||||
puts
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
system "clear"
|
||||||
|
puts "Bye! 👋"
|
||||||
|
Reference in New Issue
Block a user