2022-04-18 17:07:20 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2022-10-28 16:47:34 +00:00
|
|
|
# Generate host keys if none were found.
|
|
|
|
for t in rsa ecdsa ed25519; do
|
|
|
|
if test ! -f /etc/ssh/keys/ssh_host_${t}_key; then
|
|
|
|
ssh-keygen -q -t $t -f /etc/ssh/keys/ssh_host_${t}_key -C '' -N '' > /dev/null
|
|
|
|
chown hugo:hugo /etc/ssh/keys/ssh_host_${t}_key*
|
|
|
|
fi
|
2022-04-18 17:07:20 +00:00
|
|
|
|
2022-10-28 16:47:34 +00:00
|
|
|
echo "Host key type '$t' for SSH authentication:"
|
|
|
|
cat /etc/ssh/keys/ssh_host_${t}_key.pub
|
|
|
|
done
|
2022-04-18 17:07:20 +00:00
|
|
|
|
2022-10-28 16:47:34 +00:00
|
|
|
# Create configuration file from collected templates.
|
|
|
|
envsubst < /etc/hugo/hooks.yaml.template > /etc/hugo/hooks.yaml
|
2022-04-18 17:07:20 +00:00
|
|
|
|
2022-10-28 16:47:34 +00:00
|
|
|
# Run webhook listener for configured hooks.
|
|
|
|
gosu hugo /bin/webhook -verbose -port 8080 -hooks /etc/hugo/hooks.yaml
|