Skip to content

Commit

Permalink
Small fixes for using robot's manage key
Browse files Browse the repository at this point in the history
  • Loading branch information
parsley42 committed Aug 5, 2023
1 parent 51f3131 commit ce9dbbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions cbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,13 @@ EOF
--name $CONTAINERNAME $IMAGE_SPEC
else
RANDOM_TOKEN="$(openssl rand -hex 21)"
if [ "$SSH_KEY_PATH" ]
then
CONTAINER_COMMAND=ssh-agent
elif [ "$FORWARD_SSH" ]
if [ "$FORWARD_SSH" ]
then
EXTERNAL_UID=$(id -u)
EXTERNAL_GID=$(id -g)
SSH_FORWARDING="-u $EXTERNAL_UID:$EXTERNAL_GID -v $(readlink -f $SSH_AUTH_SOCK):/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent"
else
CONTAINER_COMMAND=ssh-agent
fi

docker run -d $SSH_FORWARDING \
Expand Down
2 changes: 1 addition & 1 deletion resources/containers/assets/dev-init
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ check-clone-robot(){
}
check-load-botkey(){
ssh-add -l > /dev/null && return
ENCRYPTED_KEY=$(grep -A3 '"manage_key"' custom/conf/robot.yaml | sed -n 's/.*decrypt "\(.*\)" }}.*/\1/p')
ENCRYPTED_KEY=$(grep -A3 '"manage_key"' ~/custom/conf/robot.yaml | sed -n 's/.*decrypt "\(.*\)" }}.*/\1/p')
echo "Loading robot's manage_key with encrypted passphrase ($ENCRYPTED_KEY)..."
NAMED_PIPE=$(mktemp -u)
mkfifo $NAMED_PIPE
Expand Down

0 comments on commit ce9dbbb

Please sign in to comment.