Cold-Egg 2 years ago
commit 82731d9abb

20
.gitattributes vendored

@ -0,0 +1,20 @@
#
# Configure line ending normalisation for this repository.
# See http://schacon.github.io/git/gitattributes.html for more information.
#
# Also each developer should configure the old style normalisation on her workstation
# (see http://timclem.wordpress.com/2012/03/01/mind-the-end-of-your-line/):
#
# Windows user should use: git config --global core.autocrlf = true
# Unix/Linux users should use: git config --global core.autocrlf = input
#
# Auto detect text files and perform LF normalization
* text=auto
*.txt text
*.xml text diff=xml
# Shell scripts require LF
*.sh text eol=lf
# Batch scripts require CRLF
*.bat text eol=crlf

@ -8,6 +8,11 @@ TYPE=0
CONT_NAME='litespeed' CONT_NAME='litespeed'
ACME_SRC='https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh' ACME_SRC='https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh'
EPACE=' ' EPACE=' '
RENEW=''
RENEW_ALL=''
FORCE=''
REVOKE=''
REMOVE=''
echow(){ echow(){
FLAG=${1} FLAG=${1}
@ -31,6 +36,16 @@ help_message(){
echo -e "\033[1m Only for the First time\033[0m" echo -e "\033[1m Only for the First time\033[0m"
echow '--install --email [EMAIL_ADDR]' echow '--install --email [EMAIL_ADDR]'
echo "${EPACE}${EPACE}Will install ACME with the Email provided" 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."
echow '-v, --revoke'
echo "${EPACE}${EPACE}Revoke a domain."
echow '-V, --remove'
echo "${EPACE}${EPACE}Remove a domain."
exit 0 exit 0
;; ;;
"3") "3")
@ -172,7 +187,57 @@ install_cert(){
echo '[End] Apply Lets Encrypt Certificate' 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
}
revoke(){
echo '[Start] Revoke a domain'
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --revoke --domain ${1}"
echo '[End] Revoke a domain'
lsws_restart
}
remove(){
echo '[Start] Remove a domain'
docker-compose exec ${CONT_NAME} su -c "~/.acme.sh/acme.sh --remove --domain ${1}"
echo '[End] Remove a domain'
lsws_restart
}
main(){ main(){
if [ "${RENEW_ALL}" = 'true' ]; then
renew_all_acme
exit 0
elif [ "${RENEW}" = 'true' ]; then
renew_acme ${DOMAIN}
exit 0
elif [ "${REVOKE}" = 'true' ]; then
revoke ${DOMAIN}
exit 0
elif [ "${REMOVE}" = 'true' ]; then
remove ${DOMAIN}
exit 0
fi
check_acme check_acme
domain_filter ${DOMAIN} domain_filter ${DOMAIN}
www_domain ${DOMAIN} www_domain ${DOMAIN}
@ -199,6 +264,21 @@ while [ ! -z "${1}" ]; do
UNINSTALL=true UNINSTALL=true
uninstall_acme uninstall_acme
;; ;;
-[fF] | --force )
FORCE=true
;;
-[r] | --renew )
RENEW=true
;;
-[R] | --renew-all )
RENEW_ALL=true
;;
-[v] | --revoke )
REVOKE=true
;;
-[V] | --remove )
REMOVE=true
;;
-[eE] | --email ) shift -[eE] | --email ) shift
check_input "${1}" check_input "${1}"
EMAIL="${1}" EMAIL="${1}"

@ -2,28 +2,32 @@ version: '3'
services: services:
mysql: mysql:
image: mariadb:10.5.9 image: mariadb:10.5.9
logging:
driver: none
command: --max_allowed_packet=256M command: --max_allowed_packet=256M
volumes: volumes:
- "./data/db:/var/lib/mysql:delegated" - "./data/db:/var/lib/mysql:delegated"
ports:
- "3306:3306"
environment: environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER} MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD} MYSQL_PASSWORD: ${MYSQL_PASSWORD}
restart: always restart: always
networks:
- default
litespeed: litespeed:
image: litespeedtech/openlitespeed:${OLS_VERSION}-${PHP_VERSION} image: litespeedtech/openlitespeed:${OLS_VERSION}-${PHP_VERSION}
logging:
driver: none
env_file: env_file:
- .env - .env
volumes: volumes:
- ./lsws/conf:/usr/local/lsws/conf - ./lsws/conf:/usr/local/lsws/conf
- ./lsws/admin-conf:/usr/local/lsws/admin/conf - ./lsws/admin-conf:/usr/local/lsws/admin/conf
- ./bin/container:/usr/local/bin - ./bin/container:/usr/local/bin
- ./sites:/var/www/vhosts/ - ./sites:/var/www/vhosts/
- ./acme:/root/.acme.sh/ - ./acme:/root/.acme.sh/
- ./logs:/usr/local/lsws/logs/ - ./logs:/usr/local/lsws/logs/
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
@ -32,11 +36,20 @@ services:
restart: always restart: always
environment: environment:
TZ: ${TimeZone} TZ: ${TimeZone}
networks:
- default
phpmyadmin: phpmyadmin:
image: bitnami/phpmyadmin:5.0.2-debian-10-r72 image: bitnami/phpmyadmin:5.0.2-debian-10-r72
logging:
driver: none
ports: ports:
- 8080:80 - 8080:80
- 8443:443 - 8443:443
environment: environment:
DATABASE_HOST: mysql DATABASE_HOST: mysql
restart: always restart: always
networks:
- default
networks:
default:
driver: bridge
Loading…
Cancel
Save