PromucFlow_constructor/deploy/docker/scripts/renew-certificate.sh
Shrikant Sharat Kandula f0a61285a6
docs: Fat container documentation fixes (#7207)
Added additional details about how to use the fat container, and how to manage / maintain it.

Also includes some refactorings that shouldn't affect the functionality significantly.
2021-09-14 19:01:06 +05:30

27 lines
683 B
Bash

#!/usr/bin/env bash
set -e
if [[ -f /appsmith-stacks/configuration/docker.env ]]; then
echo 'Load environment configuration'
set -o allexport
. /appsmith-stacks/configuration/docker.env
set +o allexport
fi
if [[ -n $CUSTOM_DOMAIN ]]; then
#then run script
local data_path="/appsmith-stacks/data/certificate"
domain="$CUSTOM_DOMAIN"
local rsa_key_size=4096
certbot certonly --webroot --webroot-path="$data_path/certbot" \
--register-unsafely-without-email \
--domains $domain \
--rsa-key-size $rsa_key_size \
--agree-tos \
--force-renewal
supervisorctl restart editor
else
echo 'Custom domain not configured. Cannot enable SSL without a custom domain.' >&2
fi