modified: .travis/verify.sh

modified:   README.md
This commit is contained in:
Code-Egg
2024-11-08 14:31:06 +08:00
parent 88223ae123
commit 0a7d0ceed7
3 changed files with 62 additions and 4 deletions
+58
View File
@@ -1,6 +1,7 @@
#!/bin/bash
set -o errexit
EX_DM='example.com'
install_demo(){
./bin/demosite.sh
@@ -22,6 +23,7 @@ verify_page(){
echo '[O] http://localhost:80/'
else
echo '[X] http://localhost:80/'
curl -sIk http://localhost:80/
exit 1
fi
curl -sIk https://localhost:443/ | grep -i WordPress
@@ -29,6 +31,7 @@ verify_page(){
echo '[O] https://localhost:443/'
else
echo '[X] https://localhost:443/'
curl -sIk https://localhost:443/
exit 1
fi
}
@@ -50,10 +53,65 @@ verify_phpadmin(){
fi
}
verify_add_vh_wp(){
echo "Setup a WordPress site with ${EX_DM} domain"
bash bin/domain.sh --add "${EX_DM}"
bash bin/database.sh --domain "${EX_DM}"
bash bin/appinstall.sh --app wordpress --domain "${EX_DM}"
curl -sIk http://${EX_DM}:80/ --resolve ${EX_DM}:80:127.0.0.1 | grep -i WordPress
if [ ${?} = 0 ]; then
echo "[O] http://${EX_DM}:80/"
else
echo "[X] http://${EX_DM}:80/"
curl -sIk http://${EX_DM}:80/
exit 1
fi
}
verify_del_vh_wp(){
echo "Remove ${EX_DM} domain"
bash bin/domain.sh --del ${EX_DM}
if [ ${?} = 0 ]; then
echo "[O] ${EX_DM} VH is removed"
else
echo "[X] ${EX_DM} VH is not removed"
exit 1
fi
echo "Remove examplecom DataBase"
bash bin/database.sh --delete -DB examplecom
}
verify_owasp(){
echo 'Updating LSWS'
bash bin/webadmin.sh --upgrade 2>&1 /dev/null
echo 'Enabling OWASP'
bash bin/webadmin.sh --mod-secure enable
curl -sIk http://localhost:80/phpinfo.php | awk '/HTTP/ && /403/'
if [ ${?} = 0 ]; then
echo '[O] OWASP enable'
else
echo '[X] OWASP enable'
curl -sIk http://localhost:80/phpinfo.php | awk '/HTTP/ && /403/'
exit 1
fi
bash bin/webadmin.sh --mod-secure disable
curl -sIk http://localhost:80/phpinfo.php | grep -i WordPress
if [ ${?} = 0 ]; then
echo '[O] OWASP disable'
else
echo '[X] OWASP disable'
curl -sIk http://localhost:80/phpinfo.php
exit 1
fi
}
main(){
verify_lsws
verify_phpadmin
install_demo
verify_page
verify_owasp
verify_add_vh_wp
verify_del_vh_wp
}
main
+1 -1
View File
@@ -4,7 +4,7 @@
[<img src="https://img.shields.io/badge/slack-LiteSpeed-blue.svg?logo=slack">](litespeedtech.com/slack)
[<img src="https://img.shields.io/twitter/follow/litespeedtech.svg?label=Follow&style=social">](https://twitter.com/litespeedtech)
Install a lightweight WordPress container with OpenLiteSpeed Edge or Stable version based on Ubuntu 22.04 Linux.
Install a lightweight WordPress container with OpenLiteSpeed Edge or Stable version based on Ubuntu 24.04 Linux.
### Prerequisites
1. [Install Docker](https://www.docker.com/)
+2 -2
View File
@@ -129,15 +129,15 @@ del_domain(){
echo "# Domain non-exist! Check the ${LS_HTTPD_CONF} if you believe this is a mistake!"
exit 1
fi
del_ls_domain ${1}
elif [ "${LSV}" = 'openlitespeed' ]; then
check_duplicate "member.*${DOMAIN}" ${OLS_HTTPD_CONF}
if [ "${CK_RESULT}" = '' ]; then
echo "# Domain non-exist! Check the ${OLS_HTTPD_CONF} if you believe this is a mistake!"
exit 1
fi
del_ols_domain ${1}
fi
del_ls_domain ${1}
del_ols_domain ${1}
}
check_input ${1}