Skip to content

Commit

Permalink
Remove symlink_secretive_ssh_public_keys
Browse files Browse the repository at this point in the history
- Originally added based on maxgoedjen/secretive#117
- This was addressed in maxgoedjen/secretive#288
- Per the FAQ (https://github.com/maxgoedjen/secretive/blob/52cc08424ecb03552b0939ab03a68b941c249fa7/FAQ.md#how-do-i-tell-ssh-to-use-a-specific-key) “Beginning with Secretive 2.2, every secret has an automatically generated public key file representation on disk, and the path to it is listed under "Public Key Path" in Secretive. ”
- There are 2 options
  - Add the Public Key path generated by Secretive (e.g. $HOME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/xxxxx.pub) to SSH config
  - Create a friendly name file in $HOME/.ssh/ (e.g. $HOME/.ssh/github.pub) and symlink that to the Public Key generated by Secretive
- We can use ssh-add -l and -L to see which keys Secretive has added to ssh-agent. However this doesn’t give us the path to the public key files which live in `/Users/mikey/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/PublicKeys/`.
  - The public keys are named MD5-fingerprint.pub
- I think, ideally, Secretive could give us a way to list the currently generated keys and the path to their public keys
  • Loading branch information
0xmachos committed Apr 23, 2024
1 parent c1861c6 commit 18f4841
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions bittersweet
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function usage {
echo " scripts - Symlink scripts in bin into /usr/local/bin"
echo " sudotouch - Enable TouchID to sudo"
echo " secretive - Install Secretive 🔑"
echo " pubkeyln - Symlink Secretive Public Key files"
echo " gpgtools - Install GPGTools"
echo " sublimetext - Install Sublime Text"
echo " tower - Install Tower"
Expand Down Expand Up @@ -614,29 +613,6 @@ function install_secretive {
download_application "${zip_download_path}" "${zip_download_url}"

install_application "Secretive" "${zip_download_path}"

symlink_secretive_ssh_public_keys
}


function symlink_secretive_ssh_public_keys {

# See: https://github.com/maxgoedjen/secretive/issues/117
# for why we need to symlink public key files for use
# as IdentityFile for SSH

while IFS=$'\n' read -r pub_key_file; do
pub_key_file_basename=$(basename "${pub_key_file:?}")

if ln -sfn "${dir}/.ssh/.extra_secretive_pub_keys/${pub_key_file_basename:?}" "${HOME:?}/.ssh"; then
echo "[✅] Successfully linked ${pub_key_file_basename} to ${HOME}/.ssh/${pub_key_file_basename}"
else
echo "[❌] Failed to link ${pub_key_file_basename} to ${HOME}/.ssh/${pub_key_file_basename}"
fi

done < <(find ".ssh/.extra_secretive_pub_keys" \
-not -name '.DS_Store' \
-type f)
}


Expand Down Expand Up @@ -1083,10 +1059,6 @@ function main {
;;
secretive)
install_secretive
symlink_secretive_ssh_public_keys
;;
pubkeyln)
symlink_secretive_ssh_public_keys
;;
gpgtools)
install_gpgtools
Expand Down Expand Up @@ -1136,7 +1108,6 @@ function main {
install_scripts
enable_touchid_sudo
install_secretive
symlink_secretive_ssh_public_keys
install_gpgtools
install_sublime_text
install_tower
Expand Down

0 comments on commit 18f4841

Please sign in to comment.