summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-08-16 13:14:56 -0400
committerGalen Guyer <galen@galenguyer.com>2022-08-16 13:14:56 -0400
commit36fbe057d2235cbc12c3e7e85d88486d02be6c12 (patch)
tree3eb368cb6041a3793078b10915c19b82da425df2
parentfe808a0b8bc5acdd715ae3903c83a9d2d1e43aa2 (diff)
add ssh module
-rw-r--r--.gitattributes1
-rw-r--r--modules/10-ssh/install.sh34
-rw-r--r--modules/10-ssh/ssh/configbin0 -> 221 bytes
-rw-r--r--modules/10-ssh/ssh/id_ed25519bin0 -> 466 bytes
-rw-r--r--modules/10-ssh/ssh/id_ed25519.pubbin0 -> 115 bytes
-rw-r--r--modules/10-ssh/ssh/id_ed25519_legacybin0 -> 466 bytes
-rw-r--r--modules/10-ssh/ssh/id_ed25519_legacy.pubbin0 -> 115 bytes
-rw-r--r--modules/10-ssh/ssh/id_katybin0 -> 2624 bytes
-rw-r--r--modules/10-ssh/ssh/id_katy.pubbin0 -> 587 bytes
-rw-r--r--modules/10-ssh/ssh/id_rsabin0 -> 2657 bytes
-rw-r--r--modules/10-ssh/ssh/id_rsa.pubbin0 -> 587 bytes
-rw-r--r--modules/10-ssh/ssh/id_rsa_legacybin0 -> 2657 bytes
-rw-r--r--modules/10-ssh/ssh/id_rsa_legacy.pubbin0 -> 587 bytes
-rw-r--r--modules/10-ssh/ssh/id_rsyncbin0 -> 421 bytes
-rw-r--r--modules/10-ssh/ssh/id_rsync.pubbin0 -> 115 bytes
-rw-r--r--modules/10-ssh/ssh/known_hostsbin0 -> 8563 bytes
-rw-r--r--modules/10-ssh/ssh/known_hosts.oldbin0 -> 8391 bytes
17 files changed, 35 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..89e469b
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+modules/10-ssh/ssh/** filter=git-crypt diff=git-crypt
diff --git a/modules/10-ssh/install.sh b/modules/10-ssh/install.sh
new file mode 100644
index 0000000..8fb3145
--- /dev/null
+++ b/modules/10-ssh/install.sh
@@ -0,0 +1,34 @@
+_script="$(realpath ${BASH_SOURCE[0]})"
+_scriptname="$(basename $_script)"
+_scriptdir="$(dirname $_script)"
+_modulename="$(basename $_scriptdir)"
+DOT_MODULE_NAME="ssh"
+
+function preinstall() {
+ if ! [[ -x "$(command -v ssh)" ]]; then
+ PACKAGES+=("openssh")
+ fi
+ if ! [[ -x "$(command -v git-crypt)" ]]; then
+ PACKAGES+=("git-crypt")
+ fi
+}
+
+function install() {
+ git-crypt unlock
+
+ if [[ "$?" -ne "0" ]]; then
+ log error "error decrypting ssh files, bailing before we break anthing"
+ return
+ fi
+
+ # backup old file if it exists and we haven't backed it up before
+ if [[ -d "$HOME/.ssh" ]] && ! [[ -d "$HOME/.ssh.bak" ]] && ! [[ -f "$_scriptdir/.firstrun" ]]; then
+ log verbose "making backup"
+ cp -r "$HOME/.ssh" "$HOME/.ssh.bak"
+ touch "$_scriptdir/.firstrun"
+ fi
+
+ log info "linking ~/.ssh"
+ rm -rf "$HOME/.ssh"
+ ln -sf "$_scriptdir/ssh" "$HOME/.ssh"
+}
diff --git a/modules/10-ssh/ssh/config b/modules/10-ssh/ssh/config
new file mode 100644
index 0000000..fc90c1b
--- /dev/null
+++ b/modules/10-ssh/ssh/config
Binary files differ
diff --git a/modules/10-ssh/ssh/id_ed25519 b/modules/10-ssh/ssh/id_ed25519
new file mode 100644
index 0000000..fa5c8ee
--- /dev/null
+++ b/modules/10-ssh/ssh/id_ed25519
Binary files differ
diff --git a/modules/10-ssh/ssh/id_ed25519.pub b/modules/10-ssh/ssh/id_ed25519.pub
new file mode 100644
index 0000000..663d9c2
--- /dev/null
+++ b/modules/10-ssh/ssh/id_ed25519.pub
Binary files differ
diff --git a/modules/10-ssh/ssh/id_ed25519_legacy b/modules/10-ssh/ssh/id_ed25519_legacy
new file mode 100644
index 0000000..fa5c8ee
--- /dev/null
+++ b/modules/10-ssh/ssh/id_ed25519_legacy
Binary files differ
diff --git a/modules/10-ssh/ssh/id_ed25519_legacy.pub b/modules/10-ssh/ssh/id_ed25519_legacy.pub
new file mode 100644
index 0000000..663d9c2
--- /dev/null
+++ b/modules/10-ssh/ssh/id_ed25519_legacy.pub
Binary files differ
diff --git a/modules/10-ssh/ssh/id_katy b/modules/10-ssh/ssh/id_katy
new file mode 100644
index 0000000..9b99dc0
--- /dev/null
+++ b/modules/10-ssh/ssh/id_katy
Binary files differ
diff --git a/modules/10-ssh/ssh/id_katy.pub b/modules/10-ssh/ssh/id_katy.pub
new file mode 100644
index 0000000..b118bcf
--- /dev/null
+++ b/modules/10-ssh/ssh/id_katy.pub
Binary files differ
diff --git a/modules/10-ssh/ssh/id_rsa b/modules/10-ssh/ssh/id_rsa
new file mode 100644
index 0000000..219071e
--- /dev/null
+++ b/modules/10-ssh/ssh/id_rsa
Binary files differ
diff --git a/modules/10-ssh/ssh/id_rsa.pub b/modules/10-ssh/ssh/id_rsa.pub
new file mode 100644
index 0000000..cae0988
--- /dev/null
+++ b/modules/10-ssh/ssh/id_rsa.pub
Binary files differ
diff --git a/modules/10-ssh/ssh/id_rsa_legacy b/modules/10-ssh/ssh/id_rsa_legacy
new file mode 100644
index 0000000..219071e
--- /dev/null
+++ b/modules/10-ssh/ssh/id_rsa_legacy
Binary files differ
diff --git a/modules/10-ssh/ssh/id_rsa_legacy.pub b/modules/10-ssh/ssh/id_rsa_legacy.pub
new file mode 100644
index 0000000..cae0988
--- /dev/null
+++ b/modules/10-ssh/ssh/id_rsa_legacy.pub
Binary files differ
diff --git a/modules/10-ssh/ssh/id_rsync b/modules/10-ssh/ssh/id_rsync
new file mode 100644
index 0000000..3e6b73d
--- /dev/null
+++ b/modules/10-ssh/ssh/id_rsync
Binary files differ
diff --git a/modules/10-ssh/ssh/id_rsync.pub b/modules/10-ssh/ssh/id_rsync.pub
new file mode 100644
index 0000000..066d6b8
--- /dev/null
+++ b/modules/10-ssh/ssh/id_rsync.pub
Binary files differ
diff --git a/modules/10-ssh/ssh/known_hosts b/modules/10-ssh/ssh/known_hosts
new file mode 100644
index 0000000..be2db8a
--- /dev/null
+++ b/modules/10-ssh/ssh/known_hosts
Binary files differ
diff --git a/modules/10-ssh/ssh/known_hosts.old b/modules/10-ssh/ssh/known_hosts.old
new file mode 100644
index 0000000..b34f3ff
--- /dev/null
+++ b/modules/10-ssh/ssh/known_hosts.old
Binary files differ