- PHP 7.4 support
- Improved Webp images support with Cloudflare (Issue [#95](https://github.com/WordOps/WordOps/issues/95)). Nginx will not serve webp images alternative with Cloudflare IP ranges.
- Stack upgrade for adminer
- Check acme.sh installation and setup acme.sh if needed before issuing certificate
- Add `--ufw` to `wo stack status`
- Add Nginx directive `gzip_static on;` to serve precompressed assets with Cache-Enabler or WP-Rocket. (Issue [#207](https://github.com/WordOps/WordOps/issues/207))
- Previous `--php73` & `--php73=off` flags are replaced by `--php72`, `--php73`, `--php74` to switch site's php version
- phpMyAdmin updated to v4.9.2
- Adminer updated to v4.7.5
- Replace dot and dashes by underscores in database names (Issue [#206](https://github.com/WordOps/WordOps/issues/206))
- Increased database name length to 32 characters from domain name + 8 random characters
- typo error in motd-news script (Issue [#204](https://github.com/WordOps/WordOps/issues/204))
- Install Nginx before ngxblocker
- WordOps install/update script text color
- Issue with MySQL stack on Raspbian 9/10
- Typo error  (PR [#205](https://github.com/WordOps/WordOps/pull/205))
- php version in `wo debug` (PR [#209](https://github.com/WordOps/WordOps/pull/209))
- SSL certificates expiration display with shared wildcard certificates
This commit is contained in:
VirtuBox
2019-12-03 19:48:18 +01:00
committed by GitHub
parent 63d2acf7ba
commit 01ee8c0a13
72 changed files with 3222 additions and 2521 deletions

View File

@@ -2,11 +2,7 @@ from wo.utils import test
from wo.cli.main import WOTestApp
class CliTestCaseStack(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
class CliTestCaseStackInstall(test.WOTestCase):
def test_wo_cli_stack_install_nginx(self):
with WOTestApp(argv=['stack', 'install', '--nginx']) as app:

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseStackStop(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_stack_services_stop_nginx(self):
with WOTestApp(argv=['stack', 'stop', '--nginx']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseStackStart(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_stack_services_start_nginx(self):
with WOTestApp(argv=['stack', 'start', '--nginx']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseStackRestart(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_stack_services_restart_nginx(self):
with WOTestApp(argv=['stack', 'restart', '--nginx']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseStackStatus(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_stack_services_status_nginx(self):
with WOTestApp(argv=['stack', 'status', '--nginx']) as app:
app.run()

View File

@@ -4,47 +4,53 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteCreate(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_create_html(self):
with WOTestApp(argv=['site', 'create', 'example1.com',
with WOTestApp(argv=['site', 'create', 'html.com',
'--html']) as app:
app.config.set('wo', '', True)
app.run()
def test_wo_cli_site_create_php(self):
with WOTestApp(argv=['site', 'create', 'example2.com',
with WOTestApp(argv=['site', 'create', 'php.com',
'--php']) as app:
app.run()
def test_wo_cli_site_create_mysql(self):
with WOTestApp(argv=['site', 'create', 'example3.com',
with WOTestApp(argv=['site', 'create', 'mysql.com',
'--mysql']) as app:
app.run()
def test_wo_cli_site_create_wp(self):
with WOTestApp(argv=['site', 'create', 'example4.com',
with WOTestApp(argv=['site', 'create', 'wp.com',
'--wp']) as app:
app.run()
def test_wo_cli_site_create_wpsubdir(self):
with WOTestApp(argv=['site', 'create', 'example5.com',
with WOTestApp(argv=['site', 'create', 'wpsubdir.com',
'--wpsubdir']) as app:
app.run()
def test_wo_cli_site_create_wpsubdomain(self):
with WOTestApp(argv=['site', 'create', 'example6.com',
with WOTestApp(argv=['site', 'create', 'wpsubdomain.com',
'--wpsubdomain']) as app:
app.run()
def test_wo_cli_site_create_wpfc(self):
with WOTestApp(argv=['site', 'create', 'example8.com',
with WOTestApp(argv=['site', 'create', 'wpfc.com',
'--wpfc']) as app:
app.run()
def test_wo_cli_site_create_wpsc(self):
with WOTestApp(argv=['site', 'create', 'example9.com',
with WOTestApp(argv=['site', 'create', 'wpsc.com',
'--wpsc']) as app:
app.run()
def test_wo_cli_site_create_wpce(self):
with WOTestApp(argv=['site', 'create', 'wpce.com',
'--wpce']) as app:
app.run()
def test_wo_cli_site_create_wprocket(self):
with WOTestApp(argv=['site', 'create', 'wprocket.com',
'--wprocket']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteDisable(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_disable(self):
with WOTestApp(argv=['site', 'disable', 'example2.com']) as app:
with WOTestApp(argv=['site', 'disable', 'html.com']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteEnable(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_enable(self):
with WOTestApp(argv=['site', 'enable', 'example2.com']) as app:
with WOTestApp(argv=['site', 'enable', 'html.com']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteInfo(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_info(self):
with WOTestApp(argv=['site', 'info', 'example1.com']) as app:
with WOTestApp(argv=['site', 'info', 'html.com']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteList(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_list_enable(self):
with WOTestApp(argv=['site', 'list', '--enabled']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteShow(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_show_edit(self):
with WOTestApp(argv=['site', 'show', 'example1.com']) as app:
with WOTestApp(argv=['site', 'show', 'html.com']) as app:
app.run()

View File

@@ -4,46 +4,42 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteUpdate(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_update_html(self):
with WOTestApp(argv=['site', 'update', 'example2.com',
with WOTestApp(argv=['site', 'update', 'php.com',
'--html']) as app:
app.run()
def test_wo_cli_site_update_php(self):
with WOTestApp(argv=['site', 'update', 'example1.com',
with WOTestApp(argv=['site', 'update', 'html.com',
'--php']) as app:
app.run()
def test_wo_cli_site_update_mysql(self):
with WOTestApp(argv=['site', 'update', 'example1.com',
with WOTestApp(argv=['site', 'update', 'mysql.com',
'--html']) as app:
app.run()
def test_wo_cli_site_update_wp(self):
with WOTestApp(argv=['site', 'update', 'example5.com',
with WOTestApp(argv=['site', 'update', 'mysql.com',
'--wp']) as app:
app.run()
def test_wo_cli_site_update_wpsubdir(self):
with WOTestApp(argv=['site', 'update', 'example4.com',
with WOTestApp(argv=['site', 'update', 'wp.com',
'--wpsubdir']) as app:
app.run()
def test_wo_cli_site_update_wpsubdomain(self):
with WOTestApp(argv=['site', 'update', 'example7.com',
with WOTestApp(argv=['site', 'update', 'wpsubdir.com',
'--wpsubdomain']) as app:
app.run()
def test_wo_cli_site_update_wpfc(self):
with WOTestApp(argv=['site', 'update', 'example9.com',
with WOTestApp(argv=['site', 'update', 'wpsc.com',
'--wpfc']) as app:
app.run()
def test_wo_cli_site_update_wpsc(self):
with WOTestApp(argv=['site', 'update', 'example6.com',
with WOTestApp(argv=['site', 'update', 'wpfc.com',
'--wpsc']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseClean(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_clean(self):
with WOTestApp(argv=['clean']) as app:
app.run()

View File

@@ -1,66 +0,0 @@
from wo.utils import test
from wo.cli.main import WOTestApp
class CliTestCaseDebug(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_debug_stop(self):
with WOTestApp(argv=['debug', '--stop']) as app:
app.run()
def test_wo_cli_debug_start(self):
with WOTestApp(argv=['debug', '--start']) as app:
app.run()
def test_wo_cli_debug_php(self):
with WOTestApp(argv=['debug', '--php']) as app:
app.run()
def test_wo_cli_debug_nginx(self):
with WOTestApp(argv=['debug', '--nginx']) as app:
app.run()
def test_wo_cli_debug_rewrite(self):
with WOTestApp(argv=['debug', '--rewrite']) as app:
app.run()
def test_wo_cli_debug_fpm(self):
with WOTestApp(argv=['debug', '--fpm']) as app:
app.run()
def test_wo_cli_debug_mysql(self):
with WOTestApp(argv=['debug', '--mysql']) as app:
app.run()
def test_wo_cli_debug_import_slow_log_interval(self):
with WOTestApp(argv=['debug', '--mysql',
'--import-slow-log-interval']) as app:
app.run()
def test_wo_cli_debug_site_name_mysql(self):
with WOTestApp(argv=['debug', 'example3.com', '--mysql']) as app:
app.run()
def test_wo_cli_debug_site_name_wp(self):
with WOTestApp(argv=['debug', 'example4.com', '--wp']) as app:
app.run()
def test_wo_cli_debug_site_name_nginx(self):
with WOTestApp(argv=['debug', 'example4.com', '--nginx']) as app:
app.run()
def test_wo_cli_debug_site_name_start(self):
with WOTestApp(argv=['debug', 'example1.com', '--start']) as app:
app.run()
def test_wo_cli_debug_site_name_stop(self):
with WOTestApp(argv=['debug', 'example1.com', '--stop']) as app:
app.run()
def test_wo_cli_debug_site_name_rewrite(self):
with WOTestApp(argv=['debug', 'example1.com', '--rewrite']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseInfo(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_info_mysql(self):
with WOTestApp(argv=['info', '--mysql']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseSecure(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_secure_auth(self):
with WOTestApp(argv=['secure', '--auth', 'abc', 'superpass']) as app:
app.run()

View File

@@ -4,26 +4,22 @@ from wo.cli.main import WOTestApp
class CliTestCaseSiteDelete(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_site_detele(self):
with WOTestApp(argv=['site', 'delete', 'example1.com',
'--no-prompt']) as app:
with WOTestApp(argv=['site', 'delete', 'html.com',
'--force']) as app:
app.run()
def test_wo_cli_site_detele_all(self):
with WOTestApp(argv=['site', 'delete', 'example2.com',
'--all', '--no-prompt']) as app:
with WOTestApp(argv=['site', 'delete', 'wp.com',
'--all', '--force']) as app:
app.run()
def test_wo_cli_site_detele_db(self):
with WOTestApp(argv=['site', 'delete', 'example3.com',
'--db', '--no-prompt']) as app:
with WOTestApp(argv=['site', 'delete', 'mysql.com',
'--db', '--force']) as app:
app.run()
def test_wo_cli_site_detele_files(self):
with WOTestApp(argv=['site', 'delete', 'example4.com',
'--files', '--no-prompt']) as app:
with WOTestApp(argv=['site', 'delete', 'php.com',
'--files', '--force']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseStackRemove(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_stack_remove_admin(self):
with WOTestApp(argv=['stack', 'remove', '--admin', '--force']) as app:
app.run()

View File

@@ -4,10 +4,6 @@ from wo.cli.main import WOTestApp
class CliTestCaseStackPurge(test.WOTestCase):
def test_wo_cli(self):
with WOTestApp as app:
app.run()
def test_wo_cli_stack_purge_web(self):
with WOTestApp(
argv=['stack', 'purge', '--web', '--force']) as app:

View File

@@ -16,7 +16,7 @@ export LC_ALL='C.UTF-8'
if [ -z "$1" ]; then
{
apt-get -qq purge mysql* graphviz* redis*
apt-get -qq purge mysql* graphviz* redis* php73-* php-*
apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree
sudo apt-get -qq autoremove --purge
} > /dev/null 2>&1
@@ -30,7 +30,7 @@ exit_script() {
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' stack install '
echo -e "${CGREEN}#############################################${CEND}"
stack_list='nginx php php73 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis phpredisadmin mysqltuner utils ufw ngxblocker cheat nanorc'
stack_list='nginx php php73 php74 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis phpredisadmin mysqltuner utils ufw ngxblocker cheat nanorc'
for stack in $stack_list; do
echo -ne " Installing $stack [..]\r"
if {
@@ -49,7 +49,7 @@ done
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' Simple site create '
echo -e "${CGREEN}#############################################${CEND}"
site_types='html php php73 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
site_types='html php php73 php74 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
for site in $site_types; do
echo -ne " Creating $site [..]\r"
if {
@@ -64,10 +64,16 @@ for site in $site_types; do
fi
done
echo
echo -e "${CGREEN}#############################################${CEND}"
echo
wo site info wp.net
echo
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site update --php73 '
echo -e "${CGREEN}#############################################${CEND}"
other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
other_site_types='html mysql php php74 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
for site in $other_site_types; do
echo -ne " Updating site to $site php73 [..]\r"
if {
@@ -82,7 +88,57 @@ for site in $other_site_types; do
fi
done
echo
echo -e "${CGREEN}#############################################${CEND}"
echo
wo site info wp.net
echo
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site update --php74 '
echo -e "${CGREEN}#############################################${CEND}"
other_site_types='html mysql wp php php73 wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
for site in $other_site_types; do
echo -ne " Updating site to $site php74 [..]\r"
if {
wo site update ${site}.net --php74
} >>/var/log/wo/test.log; then
echo -ne " Updating site to $site php74 [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
else
echo -e " Updating site to $site php74 [${CRED}FAIL${CEND}]"
echo -ne '\n'
exit_script
fi
done
echo
echo -e "${CGREEN}#############################################${CEND}"
echo
wo site info wp.net
echo
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site update --php72 '
echo -e "${CGREEN}#############################################${CEND}"
other_site_types='html mysql php php73 php74 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
for site in $other_site_types; do
echo -ne " Updating site to $site php72 [..]\r"
if {
wo site update ${site}.net --php72
} >>/var/log/wo/test.log; then
echo -ne " Updating site to $site php72 [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
else
echo -e " Updating site to $site php72 [${CRED}FAIL${CEND}]"
echo -ne '\n'
exit_script
fi
done
echo
echo -e "${CGREEN}#############################################${CEND}"
echo
wo site info wp.net
echo
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site update WP '
echo -e "${CGREEN}#############################################${CEND}"
@@ -147,7 +203,7 @@ if [ -z "$1" ]; then
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo stack upgrade '
echo -e "${CGREEN}#############################################${CEND}"
stack_upgrade='nginx php php73 mysql redis netdata dashboard phpmyadmin composer ngxblocker'
stack_upgrade='nginx php php72 php73 php74 mysql redis netdata dashboard phpmyadmin composer ngxblocker mysqltuner'
for stack in $stack_upgrade; do
echo -ne " Upgrading $stack [..]\r"
if {
@@ -232,7 +288,7 @@ echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site info '
echo -e "${CGREEN}#############################################${CEND}"
wo site info wp.net
wo site info wpfc.net
echo
echo -e "${CGREEN}#############################################${CEND}"
@@ -240,10 +296,29 @@ echo -e ' wo info '
echo -e "${CGREEN}#############################################${CEND}"
wo info
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo site delete '
echo -e "${CGREEN}#############################################${CEND}"
sites=$(wo site list 2>&1)
for site in $sites; do
echo -ne " deleting $site [..]\r"
if {
wo site delete $site --force
} >>/var/log/wo/test.log; then
echo -ne " deleting $site [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
else
echo -e " deleting $site [${CRED}FAIL${CEND}]"
echo -ne '\n'
exit_script
fi
done
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' wo stack purge '
echo -e "${CGREEN}#############################################${CEND}"
stack_purge='nginx php php73 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis ufw ngxblocker cheat nanorc'
stack_purge='nginx php php73 php74 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis ufw ngxblocker cheat nanorc'
for stack in $stack_purge; do
echo -ne " purging $stack [..]\r"
if {