luci-app-sshtunnel: ssh_keys: list keys without a corresponding .pub
authorSergey Ponomarev <stokito@gmail.com>
Sun, 17 Dec 2023 12:34:32 +0000 (14:34 +0200)
committerPaul Donald <newtwen@gmail.com>
Wed, 27 Dec 2023 20:29:19 +0000 (20:29 +0000)
commit6e7c4527813b14e1a246c0acb67c9aef679288f4
tree681f24ce09ede906c9ca44036db0e64f0e375a55
parent043d243ac8b03f2a080f3c37adf8a3df1a06676a
luci-app-sshtunnel: ssh_keys: list keys without a corresponding .pub

The private keys doesn't have any extension so the only way to clearly say that this file is a key is a presence of the corresponding .pub file.
Most of time key files have a prefix id_ e.g. id_rsa etc.

The dropbearkey generates a key without a corresponding .pub file e.g. id_dropbearkey.

So we need to detect a key files by both .pub file or id_ prefix.
Key files without the id_ prefix won't be listed, sorry.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
(cherry picked from commit 949e7cbcb33cc457bfcdd27aaf4da487bab89f30)
applications/luci-app-sshtunnel/htdocs/luci-static/resources/view/sshtunnel/ssh_keys.js
applications/luci-app-sshtunnel/htdocs/luci-static/resources/view/sshtunnel/ssh_servers.js