mirror of
https://github.com/10h30/ols-docker-env.git
synced 2026-05-12 15:21:24 +09:00
help/param msg update
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ check_input(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
app_download(){
|
app_download(){
|
||||||
docker-compose exec litespeed su -c "appinstallctl.sh -app ${1} -domain ${2}"
|
docker-compose exec litespeed su -c "appinstallctl.sh --app ${1} --domain ${2}"
|
||||||
bash bin/webadmin.sh -r
|
bash bin/webadmin.sh -r
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,20 @@ PUB_IP=$(curl -s http://checkip.amazonaws.com)
|
|||||||
DB_HOST='mysql'
|
DB_HOST='mysql'
|
||||||
PLUGINLIST="litespeed-cache.zip"
|
PLUGINLIST="litespeed-cache.zip"
|
||||||
THEME='twentytwenty'
|
THEME='twentytwenty'
|
||||||
|
EPACE=' '
|
||||||
|
|
||||||
|
echow(){
|
||||||
|
FLAG=${1}
|
||||||
|
shift
|
||||||
|
echo -e "\033[1m${EPACE}${FLAG}\033[0m${@}"
|
||||||
|
}
|
||||||
|
|
||||||
help_message(){
|
help_message(){
|
||||||
echo 'Command [-app app_name] [-domain domain_name]'
|
echo -e "\033[1mOPTIONS\033[0m"
|
||||||
echo 'Example: appinstallctl.sh -app wordpress -d example.com'
|
echow '-A, -app [wordpress] -D, --domain [DOMAIN_NAME]'
|
||||||
|
echo "${EPACE}${EPACE}Example: appinstallctl.sh --app wordpress --domain example.com"
|
||||||
|
echow '-H, --help'
|
||||||
|
echo "${EPACE}${EPACE}Display help and exit."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,15 +286,15 @@ while [ ! -z "${1}" ]; do
|
|||||||
-[hH] | -help | --help)
|
-[hH] | -help | --help)
|
||||||
help_message
|
help_message
|
||||||
;;
|
;;
|
||||||
-app | -a | -A) shift
|
-[aA] | -app | --app) shift
|
||||||
check_input "${1}"
|
check_input "${1}"
|
||||||
APP_NAME="${1}"
|
APP_NAME="${1}"
|
||||||
;;
|
;;
|
||||||
-d | -D | -domain) shift
|
-[dD] | -domain | --domain) shift
|
||||||
check_input "${1}"
|
check_input "${1}"
|
||||||
DOMAIN="${1}"
|
DOMAIN="${1}"
|
||||||
;;
|
;;
|
||||||
-vhname) shift
|
-vhname | --vhname) shift
|
||||||
VHNAME="${1}"
|
VHNAME="${1}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -3,11 +3,22 @@ CK_RESULT=''
|
|||||||
LSDIR='/usr/local/lsws'
|
LSDIR='/usr/local/lsws'
|
||||||
LS_HTTPD_CONF="${LSDIR}/conf/httpd_config.xml"
|
LS_HTTPD_CONF="${LSDIR}/conf/httpd_config.xml"
|
||||||
OLS_HTTPD_CONF="${LSDIR}/conf/httpd_config.conf"
|
OLS_HTTPD_CONF="${LSDIR}/conf/httpd_config.conf"
|
||||||
|
EPACE=' '
|
||||||
|
|
||||||
|
echow(){
|
||||||
|
FLAG=${1}
|
||||||
|
shift
|
||||||
|
echo -e "\033[1m${EPACE}${FLAG}\033[0m${@}"
|
||||||
|
}
|
||||||
|
|
||||||
help_message(){
|
help_message(){
|
||||||
echo 'Command [-add|-del] [domain_name]'
|
echo -e "\033[1mOPTIONS\033[0m"
|
||||||
echo 'Example 1: domainctl.sh -add example.com'
|
echow '-A, --add [DOMAIN_NAME]'
|
||||||
echo 'Example 2: domainctl.sh -del example.com'
|
echo "${EPACE}${EPACE}Will add domain to listener and creat a virtual host from template"
|
||||||
|
echow '-D, --del [DOMAIN_NAME]'
|
||||||
|
echo "${EPACE}${EPACE}Will delete domain from listener"
|
||||||
|
echow '-H, --help'
|
||||||
|
echo "${EPACE}${EPACE}Display help."
|
||||||
}
|
}
|
||||||
|
|
||||||
check_lsv(){
|
check_lsv(){
|
||||||
@@ -135,10 +146,10 @@ while [ ! -z "${1}" ]; do
|
|||||||
-[hH] | -help | --help)
|
-[hH] | -help | --help)
|
||||||
help_message
|
help_message
|
||||||
;;
|
;;
|
||||||
-add | -a | -A) shift
|
-[aA] | -add | --add) shift
|
||||||
add_domain ${1}
|
add_domain ${1}
|
||||||
;;
|
;;
|
||||||
-del | -d | -D | -delete) shift
|
-[dD] | -del | --del | --delete) shift
|
||||||
del_domain ${1}
|
del_domain ${1}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -4,11 +4,22 @@ OWASP_DIR="${LSDIR}/conf/owasp"
|
|||||||
RULE_FILE='modsec_includes.conf'
|
RULE_FILE='modsec_includes.conf'
|
||||||
LS_HTTPD_CONF="${LSDIR}/conf/httpd_config.xml"
|
LS_HTTPD_CONF="${LSDIR}/conf/httpd_config.xml"
|
||||||
OLS_HTTPD_CONF="${LSDIR}/conf/httpd_config.conf"
|
OLS_HTTPD_CONF="${LSDIR}/conf/httpd_config.conf"
|
||||||
|
EPACE=' '
|
||||||
|
|
||||||
|
echow(){
|
||||||
|
FLAG=${1}
|
||||||
|
shift
|
||||||
|
echo -e "\033[1m${EPACE}${FLAG}\033[0m${@}"
|
||||||
|
}
|
||||||
|
|
||||||
help_message(){
|
help_message(){
|
||||||
echo 'Command [-enable|-disable]'
|
echo -e "\033[1mOPTIONS\033[0m"
|
||||||
echo 'Example: owaspctl.sh -enable'
|
echow '-E, --enable'
|
||||||
echo 'Enable mod_secure module with latest OWASP version of rules'
|
echo "${EPACE}${EPACE}Will Enable mod_secure module with latest OWASP version of rules"
|
||||||
|
echow '-D, --disable'
|
||||||
|
echo "${EPACE}${EPACE}Will Disable mod_secure module with latest OWASP version of rules"
|
||||||
|
echow '-H, --help'
|
||||||
|
echo "${EPACE}${EPACE}Display help and exit."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,6 +129,7 @@ disable_ls_modesec(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
disable_modsec(){
|
disable_modsec(){
|
||||||
|
check_lsv
|
||||||
if [ "${LSV}" = 'lsws' ]; then
|
if [ "${LSV}" = 'lsws' ]; then
|
||||||
disable_ls_modesec
|
disable_ls_modesec
|
||||||
elif [ "${LSV}" = 'openlitespeed' ]; then
|
elif [ "${LSV}" = 'openlitespeed' ]; then
|
||||||
@@ -195,6 +207,8 @@ main_owasp(){
|
|||||||
install_git
|
install_git
|
||||||
install_owasp
|
install_owasp
|
||||||
configure_owasp
|
configure_owasp
|
||||||
|
check_lsv
|
||||||
|
enable_modsec
|
||||||
}
|
}
|
||||||
|
|
||||||
check_input ${1}
|
check_input ${1}
|
||||||
@@ -203,13 +217,10 @@ while [ ! -z "${1}" ]; do
|
|||||||
-[hH] | -help | --help)
|
-[hH] | -help | --help)
|
||||||
help_message
|
help_message
|
||||||
;;
|
;;
|
||||||
-enable | -e | -E)
|
-[eE] | -enable | --enable)
|
||||||
main_owasp
|
main_owasp
|
||||||
check_lsv
|
|
||||||
enable_modsec
|
|
||||||
;;
|
;;
|
||||||
-disable | -d | -D)
|
-[dD] | -disable | --disable)
|
||||||
check_lsv
|
|
||||||
disable_modsec
|
disable_modsec
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
LSDIR='/usr/local/lsws'
|
LSDIR='/usr/local/lsws'
|
||||||
|
EPACE=' '
|
||||||
|
|
||||||
|
echow(){
|
||||||
|
FLAG=${1}
|
||||||
|
shift
|
||||||
|
echo -e "\033[1m${EPACE}${FLAG}\033[0m${@}"
|
||||||
|
}
|
||||||
|
|
||||||
help_message(){
|
help_message(){
|
||||||
echo 'Command [-serial|-S] SERIAL'
|
echo -e "\033[1mOPTIONS\033[0m"
|
||||||
echo 'Example: serialctl.sh -s SERIAL'
|
echow '-S, --serial [YOUR_SERIAL|TRIAL]'
|
||||||
echo 'Example: serialctl.sh -s TRIAL'
|
echo "${EPACE}${EPACE}Will apply and register the serial to LSWS."
|
||||||
|
echow '-H, --help'
|
||||||
|
echo "${EPACE}${EPACE}Display help and exit."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +73,7 @@ while [ ! -z "${1}" ]; do
|
|||||||
-[hH] | -help | --help)
|
-[hH] | -help | --help)
|
||||||
help_message
|
help_message
|
||||||
;;
|
;;
|
||||||
-[sS] | -serial) shift
|
-[sS] | -serial | --serial) shift
|
||||||
apply_serial "${1}"
|
apply_serial "${1}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ EOT
|
|||||||
}
|
}
|
||||||
|
|
||||||
app_download(){
|
app_download(){
|
||||||
docker-compose exec ${CONT_NAME} su -c "appinstallctl.sh -app ${1} -domain ${2}"
|
docker-compose exec ${CONT_NAME} su -c "appinstallctl.sh --app ${1} --domain ${2}"
|
||||||
}
|
}
|
||||||
|
|
||||||
lsws_restart(){
|
lsws_restart(){
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ check_input(){
|
|||||||
|
|
||||||
add_domain(){
|
add_domain(){
|
||||||
check_input ${1}
|
check_input ${1}
|
||||||
docker-compose exec ${CONT_NAME} su -s /bin/bash lsadm -c "cd /usr/local/lsws/conf && domainctl.sh -add ${1}"
|
docker-compose exec ${CONT_NAME} su -s /bin/bash lsadm -c "cd /usr/local/lsws/conf && domainctl.sh --add ${1}"
|
||||||
if [ ! -d "./sites/${1}" ]; then
|
if [ ! -d "./sites/${1}" ]; then
|
||||||
mkdir -p ./sites/${1}/{html,logs,certs}
|
mkdir -p ./sites/${1}/{html,logs,certs}
|
||||||
fi
|
fi
|
||||||
@@ -36,7 +36,7 @@ add_domain(){
|
|||||||
|
|
||||||
del_domain(){
|
del_domain(){
|
||||||
check_input ${1}
|
check_input ${1}
|
||||||
docker-compose exec ${CONT_NAME} su -s /bin/bash lsadm -c "cd /usr/local/lsws/conf && domainctl.sh -del ${1}"
|
docker-compose exec ${CONT_NAME} su -s /bin/bash lsadm -c "cd /usr/local/lsws/conf && domainctl.sh --del ${1}"
|
||||||
bash bin/webadmin.sh -r
|
bash bin/webadmin.sh -r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -37,16 +37,16 @@ lsws_restart(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
apply_serial(){
|
apply_serial(){
|
||||||
docker-compose exec ${CONT_NAME} su -c "serialctl.sh -s ${1}"
|
docker-compose exec ${CONT_NAME} su -c "serialctl.sh --serial ${1}"
|
||||||
lsws_restart
|
lsws_restart
|
||||||
}
|
}
|
||||||
|
|
||||||
mod_secure(){
|
mod_secure(){
|
||||||
if [ "${1}" = 'enable' ] || [ "${1}" = 'Enable' ]; then
|
if [ "${1}" = 'enable' ] || [ "${1}" = 'Enable' ]; then
|
||||||
docker-compose exec ${CONT_NAME} su -s /bin/bash root -c "owaspctl.sh -enable"
|
docker-compose exec ${CONT_NAME} su -s /bin/bash root -c "owaspctl.sh --enable"
|
||||||
lsws_restart
|
lsws_restart
|
||||||
elif [ "${1}" = 'disable' ] || [ "${1}" = 'Disable' ]; then
|
elif [ "${1}" = 'disable' ] || [ "${1}" = 'Disable' ]; then
|
||||||
docker-compose exec ${CONT_NAME} su -s /bin/bash root -c "owaspctl.sh -disable"
|
docker-compose exec ${CONT_NAME} su -s /bin/bash root -c "owaspctl.sh --disable"
|
||||||
lsws_restart
|
lsws_restart
|
||||||
else
|
else
|
||||||
help_message
|
help_message
|
||||||
|
|||||||
Reference in New Issue
Block a user