Compare commits

...

14 Commits

12 changed files with 80 additions and 15 deletions

View File

@ -13,3 +13,6 @@ indent_size = 2
[{*.ecr,*.json}]
indent_style = tab
indent_size = 4
[README.md]
trim_trailing_whitespace = false

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
/docs/
/dist/
/lib/
/bin/
/.shards/

View File

@ -6,6 +6,14 @@
- - Information
- ♻️ - Edited
## 0.2.7b - [14/04/2023]
- - Added environment variable for custom input timeout
- ✔️ - User input is converted to lowercase
## 0.2.6 - [03/08/2022]
- - Added environment variable for custom password file path
- - Added version in to ASCII logo
## 0.2.5 - [31/07/2022]
- - Added timeout user input
- ♻️ - Source file separated

View File

@ -1,5 +1,6 @@
# 🔑 The very simple password manager for humans
![Crystal](https://img.shields.io/badge/Crystal-000000?style=for-the-badge&color=000000&logo=crystal)
![License](https://img.shields.io/badge/license-public_domain-brightgreen?style=for-the-badge&color=ffcc68)
![NO_COLOR](https://img.shields.io/badge/no__color-support-brightgreen?style=for-the-badge&color=d44e52)
![Emoji](https://img.shields.io/badge/emoji-like-brightgreen?style=for-the-badge&color=ec8a4b)
@ -7,13 +8,8 @@
## 📷 Screenshots
![pmng](./.docs/logo.png)
![Passwords](./.docs/passwords.png)
See [SCREENSHOTS.md](SCREENSHOTS.md).
## 💾 Download
- [Linux x86_64](https://me.a2s.su/.../)
- [Linux x86](https://me.a2s.su/.../)
- [Linux x86_64 musl](https://me.a2s.su/.../)
- [OpenBSD x86_64](https://me.a2s.su/.../)
[![Linux x86_64](https://img.shields.io/badge/linux-x86--64-brightgreen?style=for-the-badge&color=55a894)](https://data.iiiypuk.me/pmng/alpha/pmng-0.2.6-linux-x86_64.tar.xz)

5
SCREENSHOTS.md Normal file
View File

@ -0,0 +1,5 @@
## 📷 Screenshots
![pmng](./.docs/logo.png)
![Passwords](./.docs/passwords.png)

25
build_release.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# Preparing
if [ -d "./dist/" ];
then
rm dist/* 2> /dev/null
else
mkdir dist/
fi
# Detect Musl C library
# thx @Unmanned Player https://stackoverflow.com/a/60471114
libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
if [ -z $libc ];
then
# build libc
OUTPUT=pmng-$(shards version)-linux-x86_64
crystal build ./src/pmng.cr --release --progress -o ./dist/$OUTPUT
tar -cJf ./dist/$OUTPUT.tar.xz ./dist/$OUTPUT
else
# Build musl
crystal build ./src/pmng.cr --release --progress -o ./dist/pmng-$(shards version)-linux-musl-x86_64
fi

View File

@ -2,5 +2,5 @@ version: 2.0
shards:
ameba:
git: https://github.com/crystal-ameba/ameba.git
version: 1.0.0
version: 1.4.3

View File

@ -1,5 +1,5 @@
name: pmng
version: 0.2.5
version: 0.2.7
authors:
- Alexander Popov <iiiypuk@iiiypuk.me>
@ -11,8 +11,8 @@ targets:
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.0.0
version: ~> 1.4.0
crystal: 1.5.0
crystal: 1.7.0
license: MIT

View File

@ -94,7 +94,7 @@ module Pmng
passwords_finded_array = 0
passwords_array.each do |item|
if item.url.includes?(password_string.to_s)
if item.url.includes?(password_string.to_s.downcase)
Functions.show_item(item)
puts "-----".colorize(:dark_gray).mode(:bold)

View File

@ -1,3 +1,28 @@
def password_file
# Return password file path
begin
file_path = "#{ENV["PMNG_PWD_FILE"]}"
file_path.to_s
rescue KeyError
file_path = "#{ENV["HOME"]}/.pwd.yml"
file_path.to_s
end
end
def input_timeout
# Return user input timeout
user_input_timeout = 60
begin
user_input_timeout = "#{ENV["PMNG_TIMEOUT"]}"
user_input_timeout.to_i
rescue KeyError
user_input_timeout.to_i # return default 60s
end
end
VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }}
PASSWORD_FILE_PATH = "#{ENV["HOME"]}/.pwd.yml"
USER_INPUT_TIMEOUT = 60
PASSWORD_FILE_PATH = password_file()
USER_INPUT_TIMEOUT = input_timeout()

View File

@ -4,5 +4,5 @@ ASCII_LOGO = "
#{VERSION}
"

View File

@ -1,4 +1,6 @@
module Pmng::Functions
extend self
class Statistics
getter passwords : Array(Password)
getter outdated : Int32