Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
aea5284279
|
|||
a1bc755181 | |||
9fae7124be
|
|||
0e6ed176b3
|
@@ -6,6 +6,12 @@
|
||||
- ℹ️ - Information
|
||||
- ♻️ - 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]
|
||||
- ♻️ - Password outdated date change to 3 month
|
||||
- ➕ - 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**
|
||||
|
||||
|
@@ -2,5 +2,5 @@ version: 2.0
|
||||
shards:
|
||||
ameba:
|
||||
git: https://github.com/crystal-ameba/ameba.git
|
||||
version: 0.14.3
|
||||
version: 1.0.0
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name: pmng
|
||||
version: 0.2.3
|
||||
version: 0.2.4
|
||||
|
||||
authors:
|
||||
- Alexander Popov <iiiypuk@iiiypuk.me>
|
||||
@@ -11,8 +11,8 @@ targets:
|
||||
development_dependencies:
|
||||
ameba:
|
||||
github: crystal-ameba/ameba
|
||||
version: ~> 0.14.0
|
||||
version: ~> 1.0.0
|
||||
|
||||
crystal: 1.3.2
|
||||
crystal: 1.5.0
|
||||
|
||||
license: MIT
|
||||
|
41
src/pmng.cr
41
src/pmng.cr
@@ -22,8 +22,8 @@ class Password
|
||||
property update : Int32
|
||||
end
|
||||
|
||||
VERSION = "0.2.3"
|
||||
|
||||
VERSION = "0.2.4"
|
||||
PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml"
|
||||
ASCII_LOGO = "
|
||||
██████╗ ███╗ ███╗███╗ ██╗ ██████╗
|
||||
██╔══██╗████╗ ████║████╗ ██║██╔════╝
|
||||
@@ -70,15 +70,26 @@ rescue ex
|
||||
puts ex.message, ""
|
||||
end
|
||||
|
||||
PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml"
|
||||
|
||||
# check password file exists
|
||||
if File.exists?(PASSWORD_FILE_PATH)
|
||||
yaml = File.open(PASSWORD_FILE_PATH) do |file|
|
||||
YAML.parse(file)
|
||||
end
|
||||
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)
|
||||
end
|
||||
@@ -91,15 +102,6 @@ while count < yaml.size
|
||||
count += 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)
|
||||
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# pmng title
|
||||
system "clear"
|
||||
puts ASCII_LOGO.colorize(:yellow)
|
||||
@@ -121,10 +123,7 @@ while loop
|
||||
|
||||
if password_string.to_s == ":q"
|
||||
# if ':q' to close program
|
||||
system "clear"
|
||||
puts "Bye! 👋"
|
||||
|
||||
exit(0)
|
||||
loop = false
|
||||
elsif password_string.to_s.size == 0
|
||||
# if puts empty, retry prompt
|
||||
puts
|
||||
@@ -197,12 +196,16 @@ while loop
|
||||
passwords_finded_array += 1
|
||||
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
|
||||
|
||||
puts
|
||||
end
|
||||
|
||||
system "clear"
|
||||
puts "Bye! 👋"
|
||||
|
Reference in New Issue
Block a user