ssh-keys updates based on feedback
This commit is contained in:
@@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
verify_ssh_key_file() {
|
||||
declare desc="Test that public key is valid"
|
||||
[[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."
|
||||
ssh-keygen -l -f "${DOKKU_ROOT}/.ssh/authorized_keys" &> /dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys failed ssh-kegen check."
|
||||
ssh-keygen -l -f "${DOKKU_ROOT}/.ssh/authorized_keys" &> /dev/null || dokku_log_fail "${DOKKU_ROOT}/.ssh/authorized_keys failed ssh-keygen check."
|
||||
}
|
||||
|
||||
verify_ssh_key_exists() {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/ssh-keys/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
|
||||
|
||||
add_keys(){
|
||||
add_keys() {
|
||||
declare desc="add a new key via sshcommand"
|
||||
local cmd="ssh-keys:add"
|
||||
shift
|
||||
local name="$1" key_file="$2" key_contents key_from_pipe
|
||||
[[ -p /dev/stdin ]] && read -r key_from_pipe
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/ssh-keys/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
|
||||
|
||||
list_ssh_keys() {
|
||||
declare desc="List ssh key hashes"
|
||||
local cmd="ssh-keys:list"
|
||||
verify_ssh_key_file
|
||||
sshcommand list dokku
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/ssh-keys/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
|
||||
|
||||
remove_key() {
|
||||
declare desc="Removes key from authorized_keys"
|
||||
local cmd="ssh-keys:remove"
|
||||
shift
|
||||
local name="$1"
|
||||
verify_ssh_key_file
|
||||
|
||||
Reference in New Issue
Block a user