summaryrefslogtreecommitdiff
path: root/selfpublish.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2021-09-30 12:22:14 -0400
committerAndrew Cady <d@jerkface.net>2021-09-30 12:22:14 -0400
commit07c5d1bd135ecee48f61334c25ac357234e9ced8 (patch)
treefdd5a3b18ff974cd9059c02dc90bb399a29e2f60 /selfpublish.sh
parent8a6d22a96cfa36f2198f53be8270c29140aa09c7 (diff)
only show one key
Diffstat (limited to 'selfpublish.sh')
-rw-r--r--selfpublish.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/selfpublish.sh b/selfpublish.sh
index aa13fce..c24c9b7 100644
--- a/selfpublish.sh
+++ b/selfpublish.sh
@@ -1,7 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2set -e 2set -e
3 3
4DEFAULT_AUTH_TYPE=ed25519
5DYNDNSHOST=cryptonomic.net 4DYNDNSHOST=cryptonomic.net
6DEFAULT_UPSTREAM=d@cryptonomic.net:public_git/selfpublish.sh 5DEFAULT_UPSTREAM=d@cryptonomic.net:public_git/selfpublish.sh
7 6
@@ -407,9 +406,11 @@ EOF
407set -e 406set -e
408 407
409DOMAIN=cryptonomic.net 408DOMAIN=cryptonomic.net
410DEFAULT_AUTH_TYPE=ed25519
411HASH_TYPE=2 409HASH_TYPE=2
412HOSTNAME=$(hostname --short) 410HOSTNAME=$(hostname --short)
411KEY_TYPE=ed25519
412KEY_FILE=/etc/ssh/ssh_host_${KEY_TYPE}_key
413HostKeyAlgorithm=ssh-ed25519
413 414
414die() { echo "$0: Error: $*" >&2; exit 1; } 415die() { echo "$0: Error: $*" >&2; exit 1; }
415 416
@@ -422,7 +423,7 @@ get_domain()
422{ 423{
423 get_sshfp "$1" 424 get_sshfp "$1"
424 425
425 domain=$(printf %s.%s.%s "$sshfp_b32" "$DEFAULT_AUTH_TYPE" "$DOMAIN" | tail -c64) 426 domain=$(printf %s.%s.%s "$sshfp_b32" "$KEY_TYPE" "$DOMAIN" | tail -c64)
426 domain=$(printf %s.%s "$HOSTNAME" "$domain") 427 domain=$(printf %s.%s "$HOSTNAME" "$domain")
427} 428}
428 429
@@ -445,21 +446,19 @@ withsetx()
445 "$@" | indent 446 "$@" | indent
446} 447}
447 448
448KEY_FILE=/etc/ssh/ssh_host_${DEFAULT_AUTH_TYPE}_key
449
450delegate_command=/usr/lib/cryptonomic/cryptonomic-$1 449delegate_command=/usr/lib/cryptonomic/cryptonomic-$1
451 450
452if [ $# = 0 ] 451if [ $# = 0 ]
453then 452then
454 hostname=$(cryptonomic hostname) 453 hostname=$(cryptonomic hostname)
455 uid=$(id -un)@${hostname} 454 uid=$(id -un)@${hostname}
456 2>/dev/null withsetx ssh-keyscan "$hostname" 455 2>/dev/null withsetx ssh-keyscan -t "${HostKeyAlgorithm}" "$hostname"
457 2>/dev/null withsetx dig +nocmd -taaaa "$hostname" +noall +answer 456 2>/dev/null withsetx dig +nocmd -taaaa "$hostname" +noall +answer
458 2>/dev/null withsetx dig +nocmd "$hostname" +noall +answer 457 2>/dev/null withsetx dig +nocmd "$hostname" +noall +answer
459 2>&1 withsetx gpg --locate-keys "$uid" 458 2>&1 withsetx gpg --locate-keys "$uid"
460 2>/dev/null withsetx delv @1.1.1.1 -t sshfp "$hostname" 459 2>/dev/null withsetx delv @1.1.1.1 -t sshfp "$hostname"
461 export hostname 460 export hostname HostKeyAlgorithm
462 2>&1 withsetx sh -c 'ssh -v -i /dev/null -o BatchMode=yes -o HostKeyAlgorithms=ssh-ed25519 -o VerifyHostKeyDNS=yes -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null "$hostname" -- true 2>&1 | tee cryptonomic.ssh.$$.log | egrep "DNS|Server host key|match:|Connecting to|Connection|Authenticating to"' 461 2>&1 withsetx sh -c 'ssh -v -i /dev/null -o BatchMode=yes -o HostKeyAlgorithms=${HostKeyAlgorithm} -o VerifyHostKeyDNS=yes -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null "$hostname" -- true 2>&1 | tee cryptonomic.ssh.$$.log | egrep "DNS|Server host key|match:|Connecting to|Connection|Authenticating to"'
463 462
464elif [ "$1" = hostname ] 463elif [ "$1" = hostname ]
465then 464then