16 lines
301 B
Plaintext
16 lines
301 B
Plaintext
|
#!/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 "$@"
|