OpenSlides/caddy/entrypoint

17 lines
302 B
Plaintext
Raw Normal View History

2021-02-15 11:19:05 +01:00
#!/bin/sh
set -e
if [[ -f "/certs/key.pem" ]] && [[ -f "/certs/cert.pem" ]]; then
cat <<EOF >> /etc/caddy/endpoint
https://:8000 {
tls /certs/cert.pem /certs/key.pem
EOF
echo "Configured https"
else
echo "http://:8000 {" > /etc/caddy/endpoint
echo "Configured http"
fi
exec "$@"