OpenSlides/caddy/entrypoint

17 lines
302 B
Bash
Executable File

#!/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 "$@"