-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ns-api): removed
file
calls for SSH keys
- Loading branch information
Showing
3 changed files
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4623,16 +4623,61 @@ Read SSH keys | |
|
||
### list-keys | ||
|
||
Return the content of `/etc/dropbear/authorized_keys` file: | ||
``` | ||
Returns list of authorized keys: | ||
|
||
```bash | ||
api-cli ns.ssh list-keys | ||
``` | ||
|
||
Output example: | ||
|
||
```json | ||
{'keys': '\nssh-rsa AAAAB3N...6m5 [email protected]\n'} | ||
{ | ||
"keys": [ | ||
{ | ||
"type": "ssh-rsa", | ||
"key": "...", | ||
"comment": "very_cool_key" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### add-key | ||
|
||
Add a new key for SSH access: | ||
|
||
```bash | ||
api-cli ns.ssh add-key --data '{"key": "..."}' | ||
``` | ||
|
||
Example response: | ||
|
||
```json | ||
{ | ||
"message": "success" | ||
} | ||
``` | ||
|
||
### delete-key | ||
|
||
Delete a key from the list: | ||
|
||
```bash | ||
api-cli ns.ssh delete-key --data '{"key": "..."}' | ||
``` | ||
|
||
NOTE: API call only requires the key, not the full entry. Discard the comment and type of key. | ||
|
||
Example response: | ||
|
||
```json | ||
{ | ||
"message": "success" | ||
} | ||
``` | ||
|
||
|
||
## ns.reverseproxy | ||
|
||
Allows to configure a reverse proxy through the nginx web server. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters