ssh-keys updates based on feedback
This commit is contained in:
1 parent
283ed52520
commit
2d0374ec52
5 files changed
+9
-6
No files matched your search
@@ -26,7 +26,7 @@ Simplifies running a single command over SSH, and
|
|||||||
manages authorized keys (ACL) and users in order to do so.
|
manages authorized keys (ACL) and users in order to do so.
|
||||||
endef
|
endef
|
||||||
SSHCOMMAND_REPO_NAME ?= dokku/sshcommand
|
SSHCOMMAND_REPO_NAME ?= dokku/sshcommand
|
||||||
SSHCOMMAND_VERSION ?= 0.4.0
|
SSHCOMMAND_VERSION ?= 0.5.0
|
||||||
SSHCOMMAND_ARCHITECTURE = amd64
|
SSHCOMMAND_ARCHITECTURE = amd64
|
||||||
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
|
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
|
||||||
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v$(SSHCOMMAND_VERSION)/sshcommand
|
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v$(SSHCOMMAND_VERSION)/sshcommand
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
verify_ssh_key_file() {
|
verify_ssh_key_file() {
|
||||||
declare desc="Test that public key is valid"
|
declare desc="Test that public key is valid"
|
||||||
[[ -s ${DOKKU_ROOT}/.ssh/authorized_keys ]] || dokku_log_fail "No public keys found."
|
[[ -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() {
|
verify_ssh_key_exists() {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
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"
|
declare desc="add a new key via sshcommand"
|
||||||
|
local cmd="ssh-keys:add"
|
||||||
shift
|
shift
|
||||||
local name="$1" key_file="$2" key_contents key_from_pipe
|
local name="$1" key_file="$2" key_contents key_from_pipe
|
||||||
[[ -p /dev/stdin ]] && read -r key_from_pipe
|
[[ -p /dev/stdin ]] && read -r key_from_pipe
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
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() {
|
list_ssh_keys() {
|
||||||
declare desc="List ssh key hashes"
|
declare desc="List ssh key hashes"
|
||||||
|
local cmd="ssh-keys:list"
|
||||||
verify_ssh_key_file
|
verify_ssh_key_file
|
||||||
sshcommand list dokku
|
sshcommand list dokku
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/ssh-keys/functions"
|
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
|
||||||
|
|
||||||
remove_key() {
|
remove_key() {
|
||||||
declare desc="Removes key from authorized_keys"
|
declare desc="Removes key from authorized_keys"
|
||||||
|
local cmd="ssh-keys:remove"
|
||||||
shift
|
shift
|
||||||
local name="$1"
|
local name="$1"
|
||||||
verify_ssh_key_file
|
verify_ssh_key_file
|
||||||
|
|||||||
Reference in new issue
Block a user