@ -8,25 +8,30 @@ mkdir -p \
/var/tmp/nginx
/var/tmp/nginx
# generate keys (maybe)
# generate keys (maybe)
if [[ $ENABLE_LETSENCRYPT -eq 1 ]]; then
if [[ $DISABLE_HTTPS -ne 1 ]]; then
if [[ ! -f /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem ]]; then
if [[ $ENABLE_LETSENCRYPT -eq 1 ]]; then
certbot certonly \
if [[ ! -f /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem ]]; then
--noninteractive \
certbot certonly \
--standalone \
--noninteractive \
--preferred-challenges http \
--standalone \
-d $LETSENCRYPT_DOMAIN \
--preferred-challenges http \
--agree-tos \
-d $LETSENCRYPT_DOMAIN \
--email $LETSENCRYPT_EMAIL
--agree-tos \
cp /defaults/letsencrypt-renew /etc/cron.monthly/
--email $LETSENCRYPT_EMAIL
fi
cp /defaults/letsencrypt-renew /etc/cron.monthly/
else
fi
# use self-signed certs
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then
echo "using keys found in /config/keys"
else
else
echo "generating self-signed keys in /config/keys, you can replace these with your own keys if required"
# use self-signed certs
SUBJECT="/C=US/ST=TX/L=Austin/O=jitsi.org/OU=Jitsi Server/CN=*"
if [[ -f /config/keys/cert.key && -f /config/keys/cert.crt ]]; then
openssl req -new -x509 -days 3650 -nodes -out /config/keys/cert.crt -keyout /config/keys/cert.key -subj "$SUBJECT"
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
if [[ ! -f /config/nginx/dhparams.pem ]]; then
openssl dhparam -out /config/nginx/dhparams.pem 2048
fi
fi
fi
fi
@ -43,12 +48,8 @@ if [[ ! -f /config/nginx/ssl.conf ]]; then
tpl /defaults/ssl.conf > /config/nginx/ssl.conf
tpl /defaults/ssl.conf > /config/nginx/ssl.conf
fi
fi
if [ ! -f "/config/nginx/dhparams.pem" ]; then
openssl dhparam -out /config/nginx/dhparams.pem 2048
fi
if [[ ! -f /config/nginx/site-confs/default ]]; then
if [[ ! -f /config/nginx/site-confs/default ]]; then
cp /defaults/default /config/nginx/site-confs/default
tpl /defaults/default > /config/nginx/site-confs/default
fi
fi
if [[ ! -f /config/config.js ]]; then
if [[ ! -f /config/config.js ]]; then