This commit is contained in:
Pim Kunis 2023-04-05 16:48:38 +02:00
commit d41794e65d
5 changed files with 182 additions and 0 deletions

12
files/get_cert.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
CAHOST=root@hermes.dmz
eval "$(jq -r '@sh "PUBKEY=\(.pubkey) HOST=\(.host)"')"
# TODO: Can this be done more eye-pleasingly?
CERT=$(ssh $CAHOST '/root/ca.sh host "'"$PUBKEY"'" "'"$HOST"'".dmz')
jq -n --arg cert "$CERT" '{"cert":$cert}'