There is a Mac app called 1Password
.
This app assists with strong encryption and automatic login of stored passwords.
Here, I think that many CLI users are using the OSS tool called Keepass
.
I also use Keepass
.
Therefore, I tried to make a tool to assist automatic login using the database file created by Keepass
.
airkeepass
git clone https://github.com/syui/airkeepass
cd !$:t
./airkeepass
There are some tools I need, but I've made sure they are automatically downloaded.
The following tools are automatically downloaded. The download location is ʻairkeepass / tool / `.
percol https://github.com/mooz/percol
kptool https://github.com/shirou/kptool
If you do not use the selection menu, check ʻairkeepass / text / theme.txt`.
command | Contents |
---|---|
./airkeepass login-a | Executing auto login |
./airkeepass login-k | Add database file |
./airkeepass login-l | View list |
./airkeepass login-t | Test login |
./airkeepass login-b | Browser specification |
./airkeepass login-d | Delete personal files |
./airkeepass login-e | End |
Let's try automatic login.
A database file for the test is available, so select it. text / keepass-test.kdb
The specified browser opened, successfully entered the ID and password, and pressed Enter.
The location of the database file is saved in text / keepass.txt
, so once you run ʻairkeepass`, it will select the same file again.
To change it, select login-k
or specify it as an argument.
If you are in a location that does not come up as a candidate, enter the path manually.
You can be sure to log in using Google Chrome
.
However, if you select Safari
and Firefox
, it may fail depending on your browser reload.
The cause is the following code.
script/browser_form_input.sh
Safari|Firefox)
echo "
tell application \"$brows\"
--Key operation(C-v,Tab,input,Enter)
--abridgement
"|osascript -
;;
Google Chrome|*)
echo "
tell application \"$brows\"
--Processing to wait for reload completion
repeat while loading of active tab of window 1
delay 0.1
end repeat
--Run paste
paste selection active tab of window 1
--Key operation(Tab,input,Enter)
--abridgement
"|osascript -
;;
Chrome writes reload completion and paste processing, but Safari and Firefox do not.
Recommended Posts