30 Zeilen
862 B
Bash
30 Zeilen
862 B
Bash
#!/bin/sh
|
|
|
|
# Nginx im Hintergrund starten
|
|
nginx
|
|
|
|
# Warte bis Nginx läuft
|
|
sleep 5
|
|
|
|
# Versuche Let's Encrypt Zertifikate zu holen (nur in Produktion)
|
|
if [ "$LETSENCRYPT_ENABLED" = "true" ]; then
|
|
echo "Requesting Let's Encrypt certificates..."
|
|
|
|
# Admin Panel Zertifikat
|
|
certbot --nginx -d admin-panel-undso.z5m7q9dk3ah2v1plx6ju.com \
|
|
--non-interactive --agree-tos --email ${LETSENCRYPT_EMAIL} \
|
|
--redirect --expand --no-eff-email
|
|
|
|
# API Server Zertifikat
|
|
certbot --nginx -d api-software-undso.z5m7q9dk3ah2v1plx6ju.com \
|
|
--non-interactive --agree-tos --email ${LETSENCRYPT_EMAIL} \
|
|
--redirect --expand --no-eff-email
|
|
|
|
# Auto-renewal einrichten
|
|
echo "0 0,12 * * * root certbot renew --quiet" >> /etc/crontabs/root
|
|
crond
|
|
fi
|
|
|
|
# Nginx im Vordergrund halten
|
|
nginx -s stop
|
|
nginx -g "daemon off;" |