In this guide, I briefly describe the use of Shortcuts on iphone to manage my pool, and I also call Siri to help me.
You should have:
- Customized pool and pool management scripts (In this example, I run a script for a process called rotating the KES keys);
- iphone with Shortcuts.
Some scripts to manage the pool require cold keys. For quick access to cold keys and other important information I use an encrypted folder. I use a solution called gocryptfs to encrypt the folder.
Work in gocryptfs is as follows:
sudo apt install gocryptfs
mkdir -pv ~/Encrypted
gocryptfs -init ~/Encrypted
Create Mount Point:
mkdir -pv ~/Unencrypted
Mount file system (After mounting, write down the master key that appears on the terminal):
gocryptfs ~/Encrypted ~/Unencrypted
Move important data to the Unencrypted folder (or create important data in this folder).
Unmount file system:
fusermount -u ~/Unencrypted
When everything is ready, go to iphone:
- Open the standard Shortcuts application, and click “Create Shortcut”.
- Click on the ellipsis and set the name of the script. Then Done.
- Click “Add Action” and in the search enter “ssh”. Select “Run Script Over SSH”.
- Click “Show More” and fill in the parameters. Get something like this:
P.S.: For greater security, use authentication using the ssh key. Do not forget to import the key into the file ~/.ssh/authorized_keys
The “Script” parameter is filled with the necessary commands (separator “;”), in this case:
gocryptfs -q /home/admin/Encrypted /home/admin/Unencrypted -o masterkey=e5737ebf-d7c148e0-38a652ee-883bf29e-770286fd-6d106b9c-938d5557-d4f7aa30; /home/admin/scripts/KESupdate.sh; fusermount -u /home/admin/Unencrypted
Thus, we mount the encrypted folder to the mount point (parameter “q” turns on silent mode), execute the necessary script on the server and unmount.
It remains to press Done and execution Shortcut.
You can execute the script in several ways: from Shortcuts application, using Shortcuts widget or ask Siri to do this (after activating Siri, tell her “Start KESupdate”).
Thanks for reading. I hope this little guide simplifies your work.