mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 05:30:45 +00:00
24 lines
694 B
Bash
Executable File
24 lines
694 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
# 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
|
|
fi
|
|
|
|
echo "Host key type '$t' for SSH authentication:"
|
|
cat /etc/ssh/keys/ssh_host_${t}_key.pub
|
|
done
|
|
|
|
# Create configuration file from collected templates.
|
|
envsubst < /etc/hugo/hooks.yaml.template > /etc/hugo/hooks.yaml
|
|
|
|
# Correct permissions where needed.
|
|
chown hugo:hugo /etc/ssh/keys/ssh_host_*
|
|
chown -R hugo:hugo /build
|
|
|
|
# Run webhook listener for configured hooks.
|
|
exec gosu hugo /usr/bin/webhook -verbose -port 8080 -hooks /etc/hugo/hooks.yaml
|