web: add builtin Let's Encrypt support
This commit is contained in:
@@ -8,12 +8,26 @@ mkdir -p \
|
||||
/var/tmp/nginx
|
||||
|
||||
# generate keys (maybe)
|
||||
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then
|
||||
echo "using keys found in /config/keys"
|
||||
if [[ $ENABLE_LETSENCRYPT -eq 1 ]]; then
|
||||
if [[ ! -f /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem ]]; then
|
||||
certbot certonly \
|
||||
--noninteractive \
|
||||
--standalone \
|
||||
--preferred-challenges http \
|
||||
-d $LETSENCRYPT_DOMAIN \
|
||||
--agree-tos \
|
||||
--email $LETSENCRYPT_EMAIL
|
||||
cp /defaults/letsencrypt-renew /etc/cron.monthly/
|
||||
fi
|
||||
else
|
||||
echo "generating self-signed keys in /config/keys, you can replace these with your own keys if required"
|
||||
SUBJECT="/C=US/ST=TX/L=Austin/O=jitsi.org/OU=Jitsi Server/CN=*"
|
||||
openssl req -new -x509 -days 3650 -nodes -out /config/keys/cert.crt -keyout /config/keys/cert.key -subj "$SUBJECT"
|
||||
# use self-signed certs
|
||||
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then
|
||||
echo "using keys found in /config/keys"
|
||||
else
|
||||
echo "generating self-signed keys in /config/keys, you can replace these with your own keys if required"
|
||||
SUBJECT="/C=US/ST=TX/L=Austin/O=jitsi.org/OU=Jitsi Server/CN=*"
|
||||
openssl req -new -x509 -days 3650 -nodes -out /config/keys/cert.crt -keyout /config/keys/cert.key -subj "$SUBJECT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# copy config files
|
||||
@@ -22,7 +36,7 @@ if [[ ! -f /config/nginx/nginx.conf ]]; then
|
||||
fi
|
||||
|
||||
if [[ ! -f /config/nginx/ssl.conf ]]; then
|
||||
cp /defaults/ssl.conf /config/nginx/ssl.conf
|
||||
tpl /defaults/ssl.conf > /config/nginx/ssl.conf
|
||||
fi
|
||||
|
||||
if [ ! -f "/config/nginx/dhparams.pem" ]; then
|
||||
|
||||
3
web/rootfs/etc/services.d/cron/run
Executable file
3
web/rootfs/etc/services.d/cron/run
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
exec cron -f
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
nginx -c /config/nginx/nginx.conf
|
||||
|
||||
exec nginx -c /config/nginx/nginx.conf
|
||||
|
||||
Reference in New Issue
Block a user