summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-10-29 23:25:39 -0400
committerJesse Luehrs <doy@tozt.net>2018-10-29 23:25:39 -0400
commit3cb67fd39f02049898c8cef72aab7b1d2a9f4de3 (patch)
treef4506238bfd43f630825bfe45cd226f735a66a5a
parentb4467b611d01903ab65be8ed78fc6eb0f5020706 (diff)
downloadconf-3cb67fd39f02049898c8cef72aab7b1d2a9f4de3.tar.gz
conf-3cb67fd39f02049898c8cef72aab7b1d2a9f4de3.zip
stop using keychain
-rw-r--r--Makefile1
-rwxr-xr-xbin/hush/gpg6
l---------bin/hush/gpg21
-rwxr-xr-xbin/hush/ssh12
-rwxr-xr-xbin/hush/ssh-add-helper14
-rwxr-xr-xbin/hush/ssh-askpass5
-rwxr-xr-xbin/hush/ssh-key-unlock7
-rw-r--r--ssh/config1
-rw-r--r--xprofile2
9 files changed, 14 insertions, 35 deletions
diff --git a/Makefile b/Makefile
index 871e0d6..ffb4086 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,7 @@ INSTALL := \
.replyrc \
.screenrc \
.ssh/cao_key \
+ .ssh/config \
.tigrc \
.tmux.conf \
.vimrc \
diff --git a/bin/hush/gpg b/bin/hush/gpg
deleted file mode 100755
index d418711..0000000
--- a/bin/hush/gpg
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-GPG=/usr/bin/$(basename $0)
-
-keychain -q --timeout 30
-$GPG $*
diff --git a/bin/hush/gpg2 b/bin/hush/gpg2
deleted file mode 120000
index a7506d6..0000000
--- a/bin/hush/gpg2
+++ /dev/null
@@ -1 +0,0 @@
-gpg \ No newline at end of file
diff --git a/bin/hush/ssh b/bin/hush/ssh
index 453bb11..65c2f53 100755
--- a/bin/hush/ssh
+++ b/bin/hush/ssh
@@ -1,8 +1,6 @@
-#!/bin/bash
+#!/bin/sh
+set -eu
+set -o pipefail
-SSH=/usr/bin/$(basename $0)
-
-if [[ $1 != '-V' ]]; then
- . ssh-key-unlock
-fi
-exec $SSH $*
+ssh-add -l | grep -q "${HOME}/.ssh/id_rsa" || env SSH_ASKPASS="ssh-askpass" ssh-add < /dev/null
+exec /usr/bin/"$(basename "$0")" "$@"
diff --git a/bin/hush/ssh-add-helper b/bin/hush/ssh-add-helper
deleted file mode 100755
index cae6f27..0000000
--- a/bin/hush/ssh-add-helper
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use IO::Pty::Easy;
-
-my $hostname = `hostname`;
-my $pass = `pass search ssh.$hostname`;
-my $pty = IO::Pty::Easy->new;
-$pty->spawn("ssh-add -t 1800 $ARGV[0]");
-$pty->read;
-$pty->write($pass . "\n");
-while (1) {
- last if $pty->read =~ 'Identity added';
-}
diff --git a/bin/hush/ssh-askpass b/bin/hush/ssh-askpass
new file mode 100755
index 0000000..8088c8f
--- /dev/null
+++ b/bin/hush/ssh-askpass
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+set -o pipefail
+
+exec pass "ssh/$(hostname)"
diff --git a/bin/hush/ssh-key-unlock b/bin/hush/ssh-key-unlock
deleted file mode 100755
index e2654f1..0000000
--- a/bin/hush/ssh-key-unlock
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-keychain -q --timeout 30
-. ~/.keychain/${HOSTNAME}-sh
-if ! ssh-add -l | grep -q '.ssh/id_rsa'; then
- ssh-add-helper ~/.ssh/id_rsa
-fi
diff --git a/ssh/config b/ssh/config
new file mode 100644
index 0000000..07ff3a5
--- /dev/null
+++ b/ssh/config
@@ -0,0 +1 @@
+AddKeysToAgent yes
diff --git a/xprofile b/xprofile
index 2666eed..6d491f5 100644
--- a/xprofile
+++ b/xprofile
@@ -2,6 +2,8 @@
start-pulseaudio-x11
+eval "$(ssh-agent)"
+
pidof svscan || (svscan $HOME/.services/enabled 2>&1 | readproctitle $USER ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................) &
setup-inputs