Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
#!/usr/bin/env bash
|
2023-04-15 16:14:30 -07:00
|
|
|
# @file Generate Missing Public SSH Keys
|
|
|
|
# @brief Attempts to create missing public SSH keys for all private keys that are missing a public key file
|
|
|
|
# @description
|
2023-06-14 18:14:17 -07:00
|
|
|
# **Currently disabled.** Using private SSH keys, you can generate the corresponding public key. This script ensures that any SSH private key
|
2023-04-15 16:14:30 -07:00
|
|
|
# that does not have a matching `.pub` public key file has one generated.
|
2023-06-14 18:14:17 -07:00
|
|
|
#
|
|
|
|
# This script is intended to automatically generate the public key from the decrypted private key but it does not seem to be working
|
|
|
|
# properly so the code is commented out. Pull requests are welcome.
|
Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
|
2022-11-24 21:05:02 -08:00
|
|
|
{{ $sshFiles := (output "find" (joinPath .chezmoi.homeDir ".ssh") "-type" "f") -}}
|
|
|
|
{{- range $sshFile := splitList "\n" $sshFiles -}}
|
|
|
|
{{- if ne $sshFile "" -}}
|
|
|
|
# {{ $sshFile }} hash: {{ $sshFile | sha256sum }}
|
|
|
|
{{ end -}}
|
|
|
|
{{- end }}
|
Update dotfiles/.local/share/chezmoi/home/dot_ssh/create_encrypted_private_readonly_private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-{{ .user.username }}.service.tmpl, dotfiles/.local/share/chezmoi/system-linux/usr/local/bin/executable_rclone-mount, dotfiles/.local/share/chezmoi/home/dot_cache/readonly_rclone/.gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/cache/readonly_rclone/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/etc/rcloneignore, dotfiles/.local/share/chezmoi/system-linux/etc/systemd/system/r2-docker.service, dotfiles/.local/share/chezmoi/system-linux/mnt/private_r2-docker/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/system-linux/var/log/user/run_onchange_after-symlink-user-logs, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/log/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
2022-11-24 19:04:16 -08:00
|
|
|
|
2022-12-25 01:09:00 -08:00
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
|
|
{{ includeTemplate "universal/logg" }}
|
Update dotfiles/.local/share/chezmoi/home/private_dot_config/shell/encrypted_private_dot_private, dotfiles/.local/share/chezmoi/home/.chezmoi.yaml.tmpl, dotfiles/.local/share/chezmoi/home/private_dot_config/tabby/config.yaml.tmpl, dotfiles/.local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/bin/executable_run, dotfiles/.local/share/chezmoi/home/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/home/dot_local/state/bash/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/dot_local/state/zsh/remove_dot_gitkeep, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/_universal/run_onchange_after_60-cleanup.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/.config/symlink_taskfiles, dotfiles/.local/share/chezmoi/home/dot_local/symlink_Taskfile-upstream.yml.tmpl, dotfiles/.local/share/chezmoi/home/dot_local/Taskfile-local.yml, dotfiles/.local/share/chezmoi/home/private_dot_config/rofi/config.rasi.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoidata.yml
Deleted dotfiles/.local/share/chezmoi/home/dot_local/state/bash/.gitkeep, dotfiles/.local/share/chezmoi/home/dot_local/state/zsh/.gitkeep
2022-11-27 08:17:07 -08:00
|
|
|
|
2023-06-14 18:14:17 -07:00
|
|
|
# logg info 'Ensuring public keys are present'
|
2022-11-24 21:05:02 -08:00
|
|
|
|
2023-06-14 18:14:17 -07:00
|
|
|
# find "$HOME/.ssh" -type f -maxdepth 1 ! -name "*.pub" ! -name "*authorized_keys*" ! -name "known_host*" ! -name "config" | while read FILE; do
|
|
|
|
# if [ ! -f "${FILE}.pub" ]; then
|
2023-11-04 18:46:18 -07:00
|
|
|
# logg info 'Generating missing public key for '"$FILE"''
|
2023-06-14 18:14:17 -07:00
|
|
|
# ssh-keygen -f "$FILE" -y > "${FILE}.pub"
|
|
|
|
# chmod 600 "${FILE}.pub"
|
|
|
|
# fi
|
|
|
|
# done
|