Skip to content

Commit

Permalink
fix init_letsencrypt.sh CONFIG_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
dddpt committed Apr 9, 2024
1 parent 2a88347 commit 442f130
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ DEBUG_DEBUGPY_WORKER_WRAPPER_PORT=5679

# Path to the nginx, letsencrypt, etc configuration files, used by script in `./scripts/`.
# DEFAULT: ./conf
CONFIG_PATH=./conf
CONFIG_PATH=./
12 changes: 6 additions & 6 deletions scripts/init_letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ set -o allexport
source .env
set +o allexport

CONFIG_PATH="${CONFIG_PATH:-'./conf'}"
CONFIG_PATH="${CONFIG_PATH:-'./'}"

if [ ! -e "docker-nginx/options-ssl-nginx.conf" ] || [ ! -e "docker-nginx/ssl-dhparams.pem" ]; then
if [ ! -e "${CONFIG_PATH}/docker-nginx/options-ssl-nginx.conf" ] || [ ! -e "${CONFIG_PATH}/docker-nginx/ssl-dhparams.pem" ]; then
echo "### Downloading recommended TLS parameters ..."
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf > "docker-nginx/options-ssl-nginx.conf"
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot/certbot/ssl-dhparams.pem > "docker-nginx/ssl-dhparams.pem"
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf > "${CONFIG_PATH}/docker-nginx/options-ssl-nginx.conf"
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot/certbot/ssl-dhparams.pem > "${CONFIG_PATH}/docker-nginx/ssl-dhparams.pem"
echo
fi

Expand All @@ -34,8 +34,8 @@ docker compose run --rm --entrypoint "\
echo

echo "### Copy the certificate and key to their final destination ..."
cp ${CONFIG_PATH}/certbot/conf/live/${QFIELDCLOUD_HOST}/fullchain.pem docker-nginx/certs/${QFIELDCLOUD_HOST}.pem
cp ${CONFIG_PATH}/certbot/conf/live/${QFIELDCLOUD_HOST}/privkey.pem docker-nginx/certs/${QFIELDCLOUD_HOST}-key.pem
cp ${CONFIG_PATH}/conf/certbot/conf/live/${QFIELDCLOUD_HOST}/fullchain.pem ${CONFIG_PATH}/docker-nginx/certs/${QFIELDCLOUD_HOST}.pem
cp ${CONFIG_PATH}/conf/certbot/conf/live/${QFIELDCLOUD_HOST}/privkey.pem ${CONFIG_PATH}/docker-nginx/certs/${QFIELDCLOUD_HOST}-key.pem
echo

echo "### Reloading nginx ..."
Expand Down

0 comments on commit 442f130

Please sign in to comment.