Merge pull request #42 from travistran1989/add-ssl-renewal

Add SSL renewal option, set none to log driver
master
E.L 3 years ago committed by GitHub
commit cfacb6947f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,6 +8,9 @@ TYPE=0
CONT_NAME='litespeed'
ACME_SRC='https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh'
EPACE=' '
RENEW=''
RENEW_ALL=''
FORCE=''
echow(){
FLAG=${1}
@ -31,6 +34,12 @@ help_message(){
echo -e "\033[1m Only for the First time\033[0m"
echow '--install --email [EMAIL_ADDR]'
echo "${EPACE}${EPACE}Will install ACME with the Email provided"
echow '-r, --renew'
echo "${EPACE}${EPACE}Renew a specific domain with -D or --domain parameter if posibile. To force renew, use -f parameter."
echow '-R, --renew-all'
echo "${EPACE}${EPACE}Renew all domains if possible. To force renew, use -f parameter."
echow '-f, -F, --force'
echo "${EPACE}${EPACE}Force renew for a specific domain or all domains."
exit 0
;;
"3")
@ -172,7 +181,37 @@ install_cert(){
echo '[End] Apply Lets Encrypt Certificate'
}
renew_acme(){
echo '[Start] Renew ACME'
if [ "${FORCE}" = 'true' ]; then
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew --domain ${1} --force"
else
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew --domain ${1}"
fi
echo '[End] Renew ACME'
lsws_restart
}
renew_all_acme(){
echo '[Start] Renew all ACME'
if [ "${FORCE}" = 'true' ]; then
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew-all --force"
else
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --renew-all"
fi
echo '[End] Renew all ACME'
lsws_restart
}
main(){
if [ "${RENEW_ALL}" = 'true' ]; then
renew_all_acme
exit 0
elif [ "${RENEW}" = 'true' ]; then
renew_acme ${DOMAIN}
exit 0
fi
check_acme
domain_filter ${DOMAIN}
www_domain ${DOMAIN}
@ -198,7 +237,16 @@ while [ ! -z "${1}" ]; do
-[uU] | --uninstall )
UNINSTALL=true
uninstall_acme
;;
;;
-[fF] | --force )
FORCE=true
;;
-[r] | --renew )
RENEW=true
;;
-[R] | --renew-all )
RENEW_ALL=true
;;
-[eE] | --email ) shift
check_input "${1}"
EMAIL="${1}"

@ -2,6 +2,8 @@ version: '3'
services:
mysql:
image: mariadb:10.5.9
logging:
driver: none
command: --max_allowed_packet=256M
volumes:
- "./data/db:/var/lib/mysql:delegated"
@ -15,6 +17,8 @@ services:
restart: always
litespeed:
image: litespeedtech/openlitespeed:${OLS_VERSION}-${PHP_VERSION}
logging:
driver: none
env_file:
- .env
volumes:
@ -34,6 +38,8 @@ services:
TZ: ${TimeZone}
phpmyadmin:
image: bitnami/phpmyadmin:5.0.2-debian-10-r72
logging:
driver: none
ports:
- 8080:80
- 8443:443

Loading…
Cancel
Save