Expose the authorized keys tmate feature (#18)
* Expose the authorized keys tmate feature Described here: https://tmate.io/ in "Access Control" The variable accepts the file content in raw format (with \n) and dumps it into a file which tmate reads * Use echo instead of printf * Add missing quote * Only setup tmate settings if debug is activated
This commit is contained in:
@@ -63,14 +63,18 @@ remote_debug() {
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -z "${DRONE_TMATE_HOST}" ]; then
|
||||
echo "set -g tmate-server-host $DRONE_TMATE_HOST" >> $HOME/.tmate.conf
|
||||
echo "set -g tmate-server-port $DRONE_TMATE_PORT" >> $HOME/.tmate.conf
|
||||
echo "set -g tmate-server-rsa-fingerprint $DRONE_TMATE_FINGERPRINT_RSA" >> $HOME/.tmate.conf
|
||||
echo "set -g tmate-server-ed25519-fingerprint $DRONE_TMATE_FINGERPRINT_ED25519" >> $HOME/.tmate.conf
|
||||
fi
|
||||
|
||||
if [ "${DRONE_BUILD_DEBUG}" = "true" ]; then
|
||||
if [ ! -z "${DRONE_TMATE_HOST}" ]; then
|
||||
echo "set -g tmate-server-host $DRONE_TMATE_HOST" >> $HOME/.tmate.conf
|
||||
echo "set -g tmate-server-port $DRONE_TMATE_PORT" >> $HOME/.tmate.conf
|
||||
echo "set -g tmate-server-rsa-fingerprint $DRONE_TMATE_FINGERPRINT_RSA" >> $HOME/.tmate.conf
|
||||
echo "set -g tmate-server-ed25519-fingerprint $DRONE_TMATE_FINGERPRINT_ED25519" >> $HOME/.tmate.conf
|
||||
|
||||
if [ ! -z "${DRONE_TMATE_AUTHORIZED_KEYS}" ]; then
|
||||
echo "$DRONE_TMATE_AUTHORIZED_KEYS" > $HOME/.tmate.authorized_keys
|
||||
echo "set -g tmate-authorized-keys \"$HOME/.tmate.authorized_keys\"" >> $HOME/.tmate.conf
|
||||
fi
|
||||
fi
|
||||
trap remote_debug EXIT
|
||||
fi
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user