From 50b756e2bf52c0b3f7e61e9b49ccef8cdb57753f Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 02:30:14 +0200 Subject: [PATCH 01/14] Fix `wo maintenance` message --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index f34f842..c46eb42 100755 --- a/install +++ b/install @@ -960,7 +960,7 @@ else wo_lib_echo_info "wo stack upgrade --nginx" echo wo_lib_echo "To update other packages use the command:" - wo_lib_echo_info "wo stack maintenance" + wo_lib_echo_info "wo maintenance" else wo_lib_echo "WordOps (wo) installed successfully" echo From 4026255513901c12354931637d12e5615a1c16a1 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 02:42:46 +0200 Subject: [PATCH 02/14] Fix installer version check --- CHANGELOG.md | 9 +++++++++ install | 10 +++++----- wo/cli/plugins/site_functions.py | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12876bf..2134222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.x - [Unreleased] +#### Changed + +- WordPress default permalinks structure from `/%year%/%monthnum%/%day%/%postname%/` -> `/%postname%/` + +#### Fixed + +- Error with `wo stack upgrade --nginx` +- Install/update script version check + ### v3.9.8.6 - 2019-08-30 #### Added diff --git a/install b/install index c46eb42..438411d 100755 --- a/install +++ b/install @@ -811,11 +811,11 @@ if [ "$wo_purge" = "y" ]; then else # 1 - WO already installed if [ -x /usr/local/bin/wo ]; then - if { - wo -v 2>&1 | grep -q "$wo_version_new" - } && [ -z "$wo_force_install" ]; then - wo_lib_error "You already have WordOps $wo_version_new" - exit 1 + if [ -z "$wo_force_install" ]; then + if { wo -v 2>&1 | grep -q "$wo_version_new"; }; then + wo_lib_error "You already have WordOps $wo_version_new" + exit 1 + fi fi wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log wo_install_dep | tee -ai $wo_install_log diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 1ecec76..201d37e 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -519,7 +519,7 @@ def setupwordpress(self, data, vhostonly=False): WOShellExec.cmd_exec(self, " {0} --allow-root " .format(WOVariables.wo_wpcli_path) + "rewrite structure " - "/%year%/%monthnum%/%day%/%postname%/") + "/%postname%/") except CommandExecutionError as e: Log.debug(self, str(e)) raise SiteError("Update wordpress permalinks failed") From 57039904039a32c925700886041fe62aca7c9615 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 03:08:23 +0200 Subject: [PATCH 03/14] Update testing script --- tests/travis.sh | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/tests/travis.sh b/tests/travis.sh index 4e77573..b5cd618 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -3,9 +3,11 @@ # WordOps travis testing script # # +# Colors CSI='\033[' -CEND="${CSI}0m" +CRED="${CSI}1;31m" CGREEN="${CSI}1;32m" +CEND="${CSI}0m" exit_script() { tar -I pigz -cf wordops.tar.gz /var/log/wo @@ -21,25 +23,44 @@ if ! { }; then exit_script fi -if ! { + echo -e "${CGREEN}#############################################${CEND}" echo -e ' Simple site create ' echo -e "${CGREEN}#############################################${CEND}" - wo site create html.net --html && wo site create php.com --php && wo site create mysql.com --mysql && wo site create proxy.com --proxy=127.0.0.1:3000 - wo site create wp1.com --wp && wo site create wpsc1.net --wpsc && wo site create wpfc1.com --wpfc - wo site create wpsc-php73.net --wpsc --php73 && wo site create wpfc-php73.net --wpfc --php73 - wo site create wprocket.net --wprocket && wo site create wprocket-php73.net --wprocket --php73 - wo site create wpce.net --wpce && wo site create wpce-php73.net --wpce --php73 - wo site create wpredis.net --wpredis && wo site create wpredis-php73.net --wpredis --php73 + site_types='html php mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' + for site in $site_types; do + echo -ne " Installing $site [..]\r" + if { + wo site create ${site}.net --${site} + } >> /var/log/wo/test.log; then + echo -ne " Installing $site [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Installing $site [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi + done + for site in $site_types; do + echo -ne " Installing $site php73 [..]\r" + if { + wo site create ${site}.com --${site} --php73 + } >> /var/log/wo/test.log; then + echo -ne " Installing $site php73 [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Installing $site php73 [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi + done -}; then - exit_script -fi if ! { echo -e "${CGREEN}#############################################${CEND}" echo -e ' Multi-site create ' echo -e "${CGREEN}#############################################${CEND}" - wo site create wpsubdir1.com --wpsubdir && wo site create wpsubdir-php73.com --wpsubdir --php73 wo site create wpsubdirwpsc1.com --wpsubdir --wpsc && wo site create wpsubdirwpsc2.com --wpsubdir --wpfc && wo site create wpsubdirwpsc1-php73.com --wpsubdir --wpsc --php73 && wo site create wpsubdirwpsc2-php73.com --wpsubdir --wpfc --php73 wo site create wpsubdomain1.com --wpsubdomain && wo site create wpsubdomain1-php73.com --wpsubdomain --php73 && wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc && wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc && wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain echo -e "${CGREEN}#############################################${CEND}" @@ -56,6 +77,7 @@ if ! { echo -e ' wo stack upgrade ' echo -e "${CGREEN}#############################################${CEND}" wo stack upgrade --force + wo stack upgrade --nginx --force wo stack upgrade --php --force wo stack upgrade --netdata --force wo stack upgrade --phpmyadmin --force From f2c94acc4bac4c628585d2a2a21140355ec12141 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 03:22:35 +0200 Subject: [PATCH 04/14] Fix test script --- tests/travis.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/travis.sh b/tests/travis.sh index b5cd618..63ba226 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -42,6 +42,7 @@ fi fi done + other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' for site in $site_types; do echo -ne " Installing $site php73 [..]\r" if { From a3c5f453112be32ae803324166fb1b48608dc0ab Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 04:22:04 +0200 Subject: [PATCH 05/14] Fix script --- tests/travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/travis.sh b/tests/travis.sh index 63ba226..484dc4d 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -43,7 +43,7 @@ fi fi done other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' - for site in $site_types; do + for site in $other_site_types; do echo -ne " Installing $site php73 [..]\r" if { wo site create ${site}.com --${site} --php73 From 1d9c736fa636dadb28d86ed7b7c27cd9b0e021a6 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 04:24:49 +0200 Subject: [PATCH 06/14] Update travis --- tests/travis.sh | 75 ++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/tests/travis.sh b/tests/travis.sh index 484dc4d..427e4a1 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -19,44 +19,55 @@ if ! { echo -e "${CGREEN}#############################################${CEND}" echo -e ' stack install ' echo -e "${CGREEN}#############################################${CEND}" - wo --help && wo stack install && wo stack install --proftpd + echo -ne " Installing stacks [..]\r" + if { + wo stack install --all + }; then + echo -ne " Installing stacks [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Installing stacks [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi }; then exit_script fi - echo -e "${CGREEN}#############################################${CEND}" - echo -e ' Simple site create ' - echo -e "${CGREEN}#############################################${CEND}" - site_types='html php mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' - for site in $site_types; do - echo -ne " Installing $site [..]\r" - if { - wo site create ${site}.net --${site} - } >> /var/log/wo/test.log; then - echo -ne " Installing $site [${CGREEN}OK${CEND}]\\r" - echo -ne '\n' - else - echo -e " Installing $site [${CRED}FAIL${CEND}]" - echo -ne '\n' - exit_script +echo -e "${CGREEN}#############################################${CEND}" +echo -e ' Simple site create ' +echo -e "${CGREEN}#############################################${CEND}" +site_types='html php mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' +for site in $site_types; do + echo -ne " Installing $site [..]\r" + if { + wo site create ${site}.net --${site} + } >> /var/log/wo/test.log; then + echo -ne " Installing $site [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Installing $site [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script - fi - done - other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' - for site in $other_site_types; do - echo -ne " Installing $site php73 [..]\r" - if { - wo site create ${site}.com --${site} --php73 - } >> /var/log/wo/test.log; then - echo -ne " Installing $site php73 [${CGREEN}OK${CEND}]\\r" - echo -ne '\n' - else - echo -e " Installing $site php73 [${CRED}FAIL${CEND}]" - echo -ne '\n' - exit_script + fi +done +other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' +for site in $other_site_types; do + echo -ne " Installing $site php73 [..]\r" + if { + wo site create ${site}.com --${site} --php73 + } >> /var/log/wo/test.log; then + echo -ne " Installing $site php73 [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Installing $site php73 [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script - fi - done + fi +done if ! { echo -e "${CGREEN}#############################################${CEND}" From 956a5e0a6bd9384fc29ee9b8e1924a209c7dfd2e Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 12:04:35 +0200 Subject: [PATCH 07/14] Update travis --- tests/travis.sh | 125 +++++++++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 48 deletions(-) diff --git a/tests/travis.sh b/tests/travis.sh index 427e4a1..74806d1 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -11,58 +11,100 @@ CEND="${CSI}0m" exit_script() { tar -I pigz -cf wordops.tar.gz /var/log/wo - curl --progress-bar --upload-file wordops.tar.gz https://transfer.vtbox.net/$(basename "wordops.tar.gz") && echo "" | sudo tee -a $HOME/.transfer.log && echo "" + curl --progress-bar --upload-file wordops.tar.gz https://transfer.vtbox.net/"$(basename wordops.tar.gz)" && echo "" | sudo tee -a $HOME/.transfer.log && echo "" exit 1 } -if ! { - echo -e "${CGREEN}#############################################${CEND}" - echo -e ' stack install ' - echo -e "${CGREEN}#############################################${CEND}" - echo -ne " Installing stacks [..]\r" - if { - wo stack install --all - }; then - echo -ne " Installing stacks [${CGREEN}OK${CEND}]\\r" - echo -ne '\n' - else - echo -e " Installing stacks [${CRED}FAIL${CEND}]" - echo -ne '\n' - exit_script - - fi -}; then - exit_script -fi - echo -e "${CGREEN}#############################################${CEND}" -echo -e ' Simple site create ' +echo -e ' stack install ' echo -e "${CGREEN}#############################################${CEND}" -site_types='html php mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' -for site in $site_types; do - echo -ne " Installing $site [..]\r" +stack_list='nginx php php73 mysql redis fail2ban clamav proftpd admin' +for stack in $stack_list; do + echo -ne " Installing $stack [..]\r" if { - wo site create ${site}.net --${site} + wo stack install --${stack} } >> /var/log/wo/test.log; then - echo -ne " Installing $site [${CGREEN}OK${CEND}]\\r" + echo -ne " Installing $stack [${CGREEN}OK${CEND}]\\r" echo -ne '\n' else - echo -e " Installing $site [${CRED}FAIL${CEND}]" + echo -e " Installing $stack [${CRED}FAIL${CEND}]" echo -ne '\n' exit_script fi done -other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' -for site in $other_site_types; do - echo -ne " Installing $site php73 [..]\r" + +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' +for site in $site_types; do + echo -ne " Creating $site [..]\r" if { - wo site create ${site}.com --${site} --php73 + wo site create ${site}.net --${site} } >> /var/log/wo/test.log; then - echo -ne " Installing $site php73 [${CGREEN}OK${CEND}]\\r" + echo -ne " Creating $site [${CGREEN}OK${CEND}]\\r" echo -ne '\n' else - echo -e " Installing $site php73 [${CRED}FAIL${CEND}]" + echo -e " Creating $site [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi +done +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' +for site in $other_site_types; do + echo -ne " Updating site to $site php73 [..]\r" + if { + wo site update ${site}.net --php73 + } >> /var/log/wo/test.log; then + echo -ne " Updating site to $site php73 [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Updating site to $site php73 [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi +done + +echo -e "${CGREEN}#############################################${CEND}" +echo -e ' wo site update WP ' +echo -e "${CGREEN}#############################################${CEND}" + +wp_site_types='wpfc wpsc wpce wprocket wpredis' +wo site create wp.io --wp >> /dev/null 2>&1 +for site in $wp_site_types; do + echo -ne " Updating WP to $site [..]\r" + if { + wo site update wp.io --${site} + } >> /var/log/wo/test.log; then + echo -ne " Updating WP to $site [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Updating WP to $site [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi +done + +echo -e "${CGREEN}#############################################${CEND}" +echo -e ' wo stack upgrade ' +echo -e "${CGREEN}#############################################${CEND}" +stack_upgrade='nginx php mysql redis netdata dashboard phpmyadmin' +for stack in $stack_upgrade; do + echo -ne " Upgrading $stack [..]\r" + if { + wo stack upgrade --${stack} --force + } >> /var/log/wo/test.log; then + echo -ne " Upgrading $stack [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Upgrading $stack [${CRED}FAIL${CEND}]" echo -ne '\n' exit_script @@ -84,20 +126,7 @@ if ! { }; then exit_script fi -if ! { - echo -e "${CGREEN}#############################################${CEND}" - echo -e ' wo stack upgrade ' - echo -e "${CGREEN}#############################################${CEND}" - wo stack upgrade --force - wo stack upgrade --nginx --force - wo stack upgrade --php --force - wo stack upgrade --netdata --force - wo stack upgrade --phpmyadmin --force - wo stack upgrade --composer --force - wo stack upgrade --dashboard --force -}; then - exit_script -fi + echo -e "${CGREEN}#############################################${CEND}" echo -e ' various informations ' echo -e "${CGREEN}#############################################${CEND}" From 5fa39709ef06cd64eb603d88c0dbf39bb9b8b9db Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 12:18:16 +0200 Subject: [PATCH 08/14] Fix clamav install --- wo/cli/plugins/stack.py | 6 +- wo/cli/plugins/stack_pref.py | 174 +++++++++++++++++------------------ wo/core/variables.py | 1 + 3 files changed, 91 insertions(+), 90 deletions(-) diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index c829708..d9feefc 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -265,7 +265,7 @@ class WOStackController(CementBaseController): if pargs.clamav: Log.debug(self, "Setting apt_packages variable for ClamAV") if not WOAptGet.is_installed(self, 'clamav'): - apt_packages = apt_packages + ["clamav"] + apt_packages = apt_packages + WOVariables.wo_clamav else: Log.debug(self, "ClamAV already installed") Log.info(self, "ClamAV already installed") @@ -587,7 +587,7 @@ class WOStackController(CementBaseController): if pargs.clamav: Log.debug(self, "Setting apt_packages variable for ClamAV") if WOAptGet.is_installed(self, 'clamav'): - apt_packages = apt_packages + ["clamav"] + apt_packages = apt_packages + WOVariables.wo_clamav # proftpd if pargs.proftpd: @@ -793,7 +793,7 @@ class WOStackController(CementBaseController): if pargs.clamav: Log.debug(self, "Setting apt_packages variable for ClamAV") if WOAptGet.is_installed(self, 'clamav'): - apt_packages = apt_packages + ["clamav"] + apt_packages = apt_packages + WOVariables.wo_clamav # proftpd if pargs.proftpd: diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 9f5bc26..1f88bde 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -1079,100 +1079,100 @@ def post_pref(self, apt_packages, packages, upgrade=False): msg="Adding ProFTPd into Git") WOService.reload_service(self, 'proftpd') - # Redis configuration - if set(WOVariables.wo_redis).issubset(set(apt_packages)): - if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): - if not WOFileUtils.grep(self, "/etc/nginx/conf.d/" - "upstream.conf", - "redis"): - with open("/etc/nginx/conf.d/upstream.conf", - "a") as redis_file: - redis_file.write("upstream redis {\n" - " server 127.0.0.1:6379;\n" - " keepalive 10;\n}\n") + # Redis configuration + if set(WOVariables.wo_redis).issubset(set(apt_packages)): + if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): + if not WOFileUtils.grep(self, "/etc/nginx/conf.d/" + "upstream.conf", + "redis"): + with open("/etc/nginx/conf.d/upstream.conf", + "a") as redis_file: + redis_file.write("upstream redis {\n" + " server 127.0.0.1:6379;\n" + " keepalive 10;\n}\n") - if os.path.isfile("/etc/nginx/nginx.conf"): - if not os.path.isfile("/etc/nginx/conf.d/redis.conf"): - with open("/etc/nginx/conf.d/redis.conf", + if os.path.isfile("/etc/nginx/nginx.conf"): + if not os.path.isfile("/etc/nginx/conf.d/redis.conf"): + with open("/etc/nginx/conf.d/redis.conf", + "a") as redis_file: + redis_file.write("# Log format Settings\n" + "log_format rt_cache_redis " + "'$remote_addr " + "$upstream_response_time " + "$srcache_fetch_status " + "[$time_local]" + " '\n '$http_host" + " \"$request\" " + "$status $body_bytes_sent '\n" + "'\"$http_referer\" " + "\"$http_user_agent\"';\n") + # set redis.conf parameter + # set maxmemory 10% for ram below 512MB and 20% for others + # set maxmemory-policy allkeys-lru + # enable systemd service + Log.debug(self, "Enabling redis systemd service") + WOShellExec.cmd_exec(self, "systemctl enable redis-server") + if (os.path.isfile("/etc/redis/redis.conf") and + not WOFileUtils.grep(self, "/etc/redis/redis.conf", + "WordOps")): + Log.info(self, "Tuning Redis configuration") + with open("/etc/redis/redis.conf", "a") as redis_file: - redis_file.write("# Log format Settings\n" - "log_format rt_cache_redis " - "'$remote_addr " - "$upstream_response_time " - "$srcache_fetch_status " - "[$time_local]" - " '\n '$http_host" - " \"$request\" " - "$status $body_bytes_sent '\n" - "'\"$http_referer\" " - "\"$http_user_agent\"';\n") - # set redis.conf parameter - # set maxmemory 10% for ram below 512MB and 20% for others - # set maxmemory-policy allkeys-lru - # enable systemd service - Log.debug(self, "Enabling redis systemd service") - WOShellExec.cmd_exec(self, "systemctl enable redis-server") - if (os.path.isfile("/etc/redis/redis.conf") and - not WOFileUtils.grep(self, "/etc/redis/redis.conf", - "WordOps")): - Log.info(self, "Tuning Redis configuration") - with open("/etc/redis/redis.conf", - "a") as redis_file: - redis_file.write("\n# WordOps v3.9.8\n") - wo_ram = psutil.virtual_memory().total / (1024 * 1024) - if wo_ram < 1024: - Log.debug(self, "Setting maxmemory variable to " - "{0} in redis.conf" - .format(int(wo_ram*1024*1024*0.1))) + redis_file.write("\n# WordOps v3.9.8\n") + wo_ram = psutil.virtual_memory().total / (1024 * 1024) + if wo_ram < 1024: + Log.debug(self, "Setting maxmemory variable to " + "{0} in redis.conf" + .format(int(wo_ram*1024*1024*0.1))) + WOFileUtils.searchreplace(self, + "/etc/redis/redis.conf", + "# maxmemory ", + "maxmemory {0}" + .format + (int(wo_ram*1024*1024*0.1))) + + else: + Log.debug(self, "Setting maxmemory variable to {0} " + "in redis.conf" + .format(int(wo_ram*1024*1024*0.2))) + WOFileUtils.searchreplace(self, + "/etc/redis/redis.conf", + "# maxmemory ", + "maxmemory {0}" + .format + (int(wo_ram*1024*1024*0.2))) + + Log.debug( + self, "Setting maxmemory-policy variable to " + "allkeys-lru in redis.conf") WOFileUtils.searchreplace(self, "/etc/redis/redis.conf", - "# maxmemory ", - "maxmemory {0}" - .format - (int(wo_ram*1024*1024*0.1))) - - else: - Log.debug(self, "Setting maxmemory variable to {0} " - "in redis.conf" - .format(int(wo_ram*1024*1024*0.2))) + "# maxmemory-policy " + "noeviction", + "maxmemory-policy " + "allkeys-lru") + Log.debug( + self, "Setting tcp-backlog variable to " + "in redis.conf") WOFileUtils.searchreplace(self, "/etc/redis/redis.conf", - "# maxmemory ", - "maxmemory {0}" - .format - (int(wo_ram*1024*1024*0.2))) + "tcp-backlog 511", + "tcp-backlog 32768") + WOFileUtils.chown(self, '/etc/redis/redis.conf', + 'redis', 'redis', recursive=False) + WOService.restart_service(self, 'redis-server') - Log.debug( - self, "Setting maxmemory-policy variable to " - "allkeys-lru in redis.conf") - WOFileUtils.searchreplace(self, - "/etc/redis/redis.conf", - "# maxmemory-policy " - "noeviction", - "maxmemory-policy " - "allkeys-lru") - Log.debug( - self, "Setting tcp-backlog variable to " - "in redis.conf") - WOFileUtils.searchreplace(self, - "/etc/redis/redis.conf", - "tcp-backlog 511", - "tcp-backlog 32768") - WOFileUtils.chown(self, '/etc/redis/redis.conf', - 'redis', 'redis', recursive=False) - WOService.restart_service(self, 'redis-server') - - # Redis configuration - if set(["clamav"]).issubset(set(apt_packages)): - Log.debug("Setting up freshclam cronjob") - WOTemplate.render(self, '/opt/freshclam.sh', - 'freshclam.mustache', - data, overwrite=False) - WOFileUtils.chmod(self, "/opt/freshclam.sh", 0o775) - WOCron.setcron_weekly(self, '/opt/freshclam.sh ' - '> /dev/null 2>&1', - comment='ClamAV freshclam cronjob ' - 'added by WordOps') + # Redis configuration + if set(["clamav"]).issubset(set(apt_packages)): + Log.debug("Setting up freshclam cronjob") + WOTemplate.render(self, '/opt/freshclam.sh', + 'freshclam.mustache', + data, overwrite=False) + WOFileUtils.chmod(self, "/opt/freshclam.sh", 0o775) + WOCron.setcron_weekly(self, '/opt/freshclam.sh ' + '> /dev/null 2>&1', + comment='ClamAV freshclam cronjob ' + 'added by WordOps') if (packages): # WP-CLI diff --git a/wo/core/variables.py b/wo/core/variables.py index fa97644..deb0652 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -160,6 +160,7 @@ class WOVariables(): wo_mysql_client = ["mariadb-client", "python3-mysql.connector"] wo_fail2ban = ["fail2ban"] + wo_clamav = ["clamav", "clamav-freshclam"] # Redis repo details if wo_distro == 'ubuntu': From 972c6a5da06c0090c7be1278ce05335f7a22a713 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 12:35:23 +0200 Subject: [PATCH 09/14] Fix self.msg --- wo/cli/plugins/stack.py | 2 +- wo/cli/plugins/stack_pref.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index d9feefc..17bd285 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -473,7 +473,7 @@ class WOStackController(CementBaseController): WOAptGet.install(self, apt_packages) post_pref(self, apt_packages, empty_packages) if (packages): - Log.debug(self, "Downloading following: {0}".format(packages)) + Log.info(self, "Downloading following: {0}".format(packages)) WODownload.download(self, packages) Log.debug(self, "Calling post_pref") post_pref(self, empty_packages, packages) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 1f88bde..ee92e34 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -151,6 +151,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): ngxcnf = '/etc/nginx/conf.d' ngxcom = '/etc/nginx/common' ngxroot = '/var/www/' + self.msg = [] if upgrade: if os.path.isdir('/etc/nginx'): WOGit.add(self, @@ -1512,3 +1513,9 @@ def post_pref(self, apt_packages, packages, upgrade=False): 'www-data', 'www-data', recursive=True) + + if (self.msg): + for msg in self.msg: + Log.info(self, Log.ENDC + msg) + else: + return self.msg From 91fe49fd81c9e777d444ecf351040f17925b87ff Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 12:47:35 +0200 Subject: [PATCH 10/14] Another fix for clamav --- wo/cli/plugins/stack_pref.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index ee92e34..5933d1b 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -1163,17 +1163,18 @@ def post_pref(self, apt_packages, packages, upgrade=False): 'redis', 'redis', recursive=False) WOService.restart_service(self, 'redis-server') - # Redis configuration - if set(["clamav"]).issubset(set(apt_packages)): + # ClamAV configuration + if set(WOVariables.wo_clamav).issubset(set(apt_packages)): Log.debug("Setting up freshclam cronjob") - WOTemplate.render(self, '/opt/freshclam.sh', - 'freshclam.mustache', - data, overwrite=False) - WOFileUtils.chmod(self, "/opt/freshclam.sh", 0o775) - WOCron.setcron_weekly(self, '/opt/freshclam.sh ' - '> /dev/null 2>&1', - comment='ClamAV freshclam cronjob ' - 'added by WordOps') + if not os.path.isfile("/opt/freshclam.sh"): + WOTemplate.render(self, '/opt/freshclam.sh', + 'freshclam.mustache', + data, overwrite=False) + WOFileUtils.chmod(self, "/opt/freshclam.sh", 0o775) + WOCron.setcron_weekly(self, '/opt/freshclam.sh ' + '> /dev/null 2>&1', + comment='ClamAV freshclam cronjob ' + 'added by WordOps') if (packages): # WP-CLI From 4684265d3d061c49439e6619dfe28a4609ca70bb Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 14:18:38 +0200 Subject: [PATCH 11/14] Several improvements --- wo/cli/plugins/stack_pref.py | 317 +++++++++++++++++------------------ 1 file changed, 155 insertions(+), 162 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 5933d1b..5f94f17 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -331,16 +331,17 @@ def post_pref(self, apt_packages, packages, upgrade=False): "/redis.conf")): with open("/etc/nginx/conf.d/" "redis.conf", "a") as redis_file: - redis_file.write("# Log format Settings\n" - "log_format rt_cache_redis " - "'$remote_addr " - "$upstream_response_time " - "$srcache_fetch_status " - "[$time_local] '\n" - "'$http_host \"$request\" $status" - " $body_bytes_sent '\n" - "'\"$http_referer\" " - "\"$http_user_agent\"';\n") + redis_file.write( + "# Log format Settings\n" + "log_format rt_cache_redis " + "'$remote_addr " + "$upstream_response_time " + "$srcache_fetch_status " + "[$time_local] '\n" + "'$http_host \"$request\" $status" + " $body_bytes_sent '\n" + "'\"$http_referer\" " + "\"$http_user_agent\"';\n") # Nginx-Plus does not have nginx # package structure like this @@ -357,30 +358,33 @@ def post_pref(self, apt_packages, packages, upgrade=False): # 22222 port settings if not os.path.isfile('/etc/nginx/sites-available/22222'): - WOTemplate.render(self, - '/etc/nginx/sites-available/22222', - '22222.mustache', data, overwrite=False) + WOTemplate.render( + self, + '/etc/nginx/sites-available/22222', + '22222.mustache', data, overwrite=False) passwd = ''.join([random.choice (string.ascii_letters + string.digits) for n in range(24)]) try: - WOShellExec.cmd_exec(self, "printf \"WordOps:" - "$(openssl passwd -crypt " - "{password} 2> /dev/null)\n\"" - "> /etc/nginx/htpasswd-wo " - "2>/dev/null" - .format(password=passwd)) + WOShellExec.cmd_exec( + self, "printf \"WordOps:" + "$(openssl passwd -crypt " + "{password} 2> /dev/null)\n\"" + "> /etc/nginx/htpasswd-wo " + "2>/dev/null" + .format(password=passwd)) except CommandExecutionError as e: Log.debug(self, "{0}".format(e)) Log.error(self, "Failed to save HTTP Auth") # Create Symbolic link for 22222 - WOFileUtils.create_symlink(self, ['/etc/nginx/' - 'sites-available/' - '22222', - '/etc/nginx/' - 'sites-enabled/' - '22222']) + WOFileUtils.create_symlink( + self, ['/etc/nginx/' + 'sites-available/' + '22222', + '/etc/nginx/' + 'sites-enabled/' + '22222']) # Create log and cert folder and softlinks if not os.path.exists('{0}22222/logs' .format(ngxroot)): @@ -406,51 +410,58 @@ def post_pref(self, apt_packages, packages, upgrade=False): os.makedirs('{0}22222/conf/nginx' .format(ngxroot)) - WOFileUtils.create_symlink(self, - ['/var/log/nginx/' - '22222.access.log', - '{0}22222/' - 'logs/access.log' - .format(ngxroot)] - ) + WOFileUtils.create_symlink( + self, + ['/var/log/nginx/' + '22222.access.log', + '{0}22222/' + 'logs/access.log' + .format(ngxroot)] + ) - WOFileUtils.create_symlink(self, - ['/var/log/nginx/' - '22222.error.log', - '{0}22222/' - 'logs/error.log' - .format(ngxroot)] - ) + WOFileUtils.create_symlink( + self, + ['/var/log/nginx/' + '22222.error.log', + '{0}22222/' + 'logs/error.log' + .format(ngxroot)] + ) try: - WOShellExec.cmd_exec(self, "openssl genrsa -out " - "{0}22222/cert/22222.key 2048" - .format(ngxroot)) - WOShellExec.cmd_exec(self, "openssl req -new -batch " - "-subj /commonName=localhost/ " - "-key {0}22222/cert/22222.key " - "-out {0}22222/cert/" - "22222.csr" - .format(ngxroot)) + WOShellExec.cmd_exec( + self, "openssl genrsa -out " + "{0}22222/cert/22222.key 2048" + .format(ngxroot)) + WOShellExec.cmd_exec( + self, "openssl req -new -batch " + "-subj /commonName=localhost/ " + "-key {0}22222/cert/22222.key " + "-out {0}22222/cert/" + "22222.csr" + .format(ngxroot)) - WOFileUtils.mvfile(self, "{0}22222/cert/22222.key" - .format(ngxroot), - "{0}22222/cert/" - "22222.key.org" - .format(ngxroot)) + WOFileUtils.mvfile( + self, "{0}22222/cert/22222.key" + .format(ngxroot), + "{0}22222/cert/" + "22222.key.org" + .format(ngxroot)) - WOShellExec.cmd_exec(self, "openssl rsa -in " - "{0}22222/cert/" - "22222.key.org -out " - "{0}22222/cert/22222.key" - .format(ngxroot)) + WOShellExec.cmd_exec( + self, "openssl rsa -in " + "{0}22222/cert/" + "22222.key.org -out " + "{0}22222/cert/22222.key" + .format(ngxroot)) - WOShellExec.cmd_exec(self, "openssl x509 -req -days " - "3652 -in {0}22222/cert/" - "22222.csr -signkey {0}" - "22222/cert/22222.key -out " - "{0}22222/cert/22222.crt" - .format(ngxroot)) + WOShellExec.cmd_exec( + self, "openssl x509 -req -days " + "3652 -in {0}22222/cert/" + "22222.csr -signkey {0}" + "22222/cert/22222.key -out " + "{0}22222/cert/22222.crt" + .format(ngxroot)) except CommandExecutionError as e: Log.debug(self, "{0}".format(e)) @@ -1114,8 +1125,8 @@ def post_pref(self, apt_packages, packages, upgrade=False): Log.debug(self, "Enabling redis systemd service") WOShellExec.cmd_exec(self, "systemctl enable redis-server") if (os.path.isfile("/etc/redis/redis.conf") and - not WOFileUtils.grep(self, "/etc/redis/redis.conf", - "WordOps")): + (not WOFileUtils.grep(self, "/etc/redis/redis.conf", + "WordOps"))): Log.info(self, "Tuning Redis configuration") with open("/etc/redis/redis.conf", "a") as redis_file: @@ -1171,10 +1182,10 @@ def post_pref(self, apt_packages, packages, upgrade=False): 'freshclam.mustache', data, overwrite=False) WOFileUtils.chmod(self, "/opt/freshclam.sh", 0o775) - WOCron.setcron_weekly(self, '/opt/freshclam.sh ' - '> /dev/null 2>&1', - comment='ClamAV freshclam cronjob ' - 'added by WordOps') + # WOCron.setcron_weekly(self, '/opt/freshclam.sh ' + # '> /dev/null 2>&1', + # comment='ClamAV freshclam cronjob ' + # 'added by WordOps') if (packages): # WP-CLI @@ -1255,16 +1266,33 @@ def post_pref(self, apt_packages, packages, upgrade=False): shutil.copyfile('/var/lib/wo/tmp/composer.phar', '/usr/local/bin/composer') WOFileUtils.chmod(self, "/usr/local/bin/composer", 0o775) - Log.info(self, "Updating phpMyAdmin, please wait...") - WOShellExec.cmd_exec(self, "/usr/local/bin/composer update " - "--no-plugins --no-scripts " - "-n --no-dev -d " - "/var/www/22222/htdocs/db/pma/") - WOFileUtils.chown(self, '{0}22222/htdocs/db/pma' - .format(WOVariables.wo_webroot), - 'www-data', - 'www-data', - recursive=True) + if os.path.isdir("/var/www/22222/htdocs/db/pma"): + Log.info(self, "Updating phpMyAdmin, please wait...") + WOShellExec.cmd_exec( + self, "/usr/local/bin/composer update " + "--no-plugins --no-scripts " + "-n --no-dev -d " + "/var/www/22222/htdocs/db/pma/") + WOFileUtils.chown( + self, '{0}22222/htdocs/db/pma' + .format(WOVariables.wo_webroot), + 'www-data', + 'www-data', + recursive=True) + if not os.path.exists('{0}22222/htdocs/cache/' + 'redis/phpRedisAdmin' + .format(WOVariables.wo_webroot)): + Log.debug(self, "Creating new directory " + "{0}22222/htdocs/cache/redis" + .format(WOVariables.wo_webroot)) + os.makedirs('{0}22222/htdocs/cache/redis/phpRedisAdmin' + .format(WOVariables.wo_webroot)) + WOFileUtils.chown(self, '{0}22222/htdocs' + .format(WOVariables.wo_webroot), + 'www-data', + 'www-data', + recursive=True) + # MySQLtuner if any('/usr/bin/mysqltuner' == x[1] for x in packages): @@ -1285,34 +1313,33 @@ def post_pref(self, apt_packages, packages, upgrade=False): else: wo_netdata = "/opt/netdata/" # disable mail notifications - WOFileUtils.searchreplace(self, "{0}usr/" - "lib/netdata/conf.d/" - "health_alarm_notify.conf" - .format(wo_netdata), - 'SEND_EMAIL="YES"', - 'SEND_EMAIL="NO"') + WOFileUtils.searchreplace( + self, "{0}usr/" + "lib/netdata/conf.d/health_alarm_notify.conf" + .format(wo_netdata), + 'SEND_EMAIL="YES"', + 'SEND_EMAIL="NO"') # make changes persistant - WOFileUtils.copyfile(self, "{0}usr/" - "lib/netdata/conf.d/" - "health_alarm_notify.conf" - .format(wo_netdata), - "{0}etc/netdata/" - "health_alarm_notify.conf" - .format(wo_netdata)) + WOFileUtils.copyfile( + self, "{0}usr/lib/netdata/conf.d/" + "health_alarm_notify.conf" + .format(wo_netdata), + "{0}etc/netdata/health_alarm_notify.conf" + .format(wo_netdata)) # check if mysql credentials are available if os.path.isfile('/etc/mysql/conf.d/my.cnf'): try: - WOMysql.execute(self, - "create user " - "'netdata'@'localhost';", - log=False) - WOMysql.execute(self, - "grant usage on *.* to " - "'netdata'@'localhost';", - log=False) - WOMysql.execute(self, - "flush privileges;", - log=False) + WOMysql.execute( + self, + "create user 'netdata'@'localhost';", + log=False) + WOMysql.execute( + self, + "grant usage on *.* to 'netdata'@'localhost';", + log=False) + WOMysql.execute( + self, "flush privileges;", + log=False) except CommandExecutionError as e: Log.debug(self, "{0}".format(e)) Log.info( @@ -1398,20 +1425,23 @@ def post_pref(self, apt_packages, packages, upgrade=False): '{0}22222/htdocs/php/webgrind' .format(WOVariables.wo_webroot)) - WOFileUtils.searchreplace(self, "{0}22222/htdocs/php/webgrind/" - "config.php" - .format(WOVariables.wo_webroot), - "/usr/local/bin/dot", "/usr/bin/dot") - WOFileUtils.searchreplace(self, "{0}22222/htdocs/php/webgrind/" - "config.php" - .format(WOVariables.wo_webroot), - "Europe/Copenhagen", - WOVariables.wo_timezone) + WOFileUtils.searchreplace( + self, "{0}22222/htdocs/php/webgrind/" + "config.php" + .format(WOVariables.wo_webroot), + "/usr/local/bin/dot", "/usr/bin/dot") + WOFileUtils.searchreplace( + self, "{0}22222/htdocs/php/webgrind/" + "config.php" + .format(WOVariables.wo_webroot), + "Europe/Copenhagen", + WOVariables.wo_timezone) - WOFileUtils.searchreplace(self, "{0}22222/htdocs/php/webgrind/" - "config.php" - .format(WOVariables.wo_webroot), - "90", "100") + WOFileUtils.searchreplace( + self, "{0}22222/htdocs/php/webgrind/" + "config.php" + .format(WOVariables.wo_webroot), + "90", "100") Log.debug(self, "Setting Privileges of webroot permission to " "{0}22222/htdocs/php/webgrind/ file " @@ -1458,13 +1488,14 @@ def post_pref(self, apt_packages, packages, upgrade=False): Log.debug(self, "grant all on slow-query-log.*" " to anemometer@root_user" " IDENTIFIED BY password ") - WOMysql.execute(self, 'grant all on slow_query_log.* to' - '\'anemometer\'@\'{0}\' IDENTIFIED' - ' BY \'{1}\''.format(self.app.config.get( - 'mysql', 'grant-host'), - chars), - errormsg="cannot grant priviledges", - log=False) + WOMysql.execute( + self, 'grant all on slow_query_log.* to' + '\'anemometer\'@\'{0}\' IDENTIFIED' + ' BY \'{1}\''.format(self.app.config.get( + 'mysql', 'grant-host'), + chars), + errormsg="cannot grant priviledges", + log=False) # Custom Anemometer configuration Log.debug(self, "configration Anemometer") @@ -1482,41 +1513,3 @@ def post_pref(self, apt_packages, packages, upgrade=False): if any('/usr/bin/pt-query-advisor' == x[1] for x in packages): WOFileUtils.chmod(self, "/usr/bin/pt-query-advisor", 0o775) - - # phpredisadmin - if any('/var/lib/wo/tmp/pra.tar.gz' == x[1] - for x in packages): - if not os.path.exists('{0}22222/htdocs/cache/' - 'redis/phpRedisAdmin' - .format(WOVariables.wo_webroot)): - Log.debug(self, "Creating new directory " - "{0}22222/htdocs/cache/redis" - .format(WOVariables.wo_webroot)) - os.makedirs('{0}22222/htdocs/cache/redis/phpRedisAdmin' - .format(WOVariables.wo_webroot)) - WOFileUtils.chown(self, '{0}22222/htdocs' - .format(WOVariables.wo_webroot), - 'www-data', - 'www-data', - recursive=True) - if os.path.isfile("/usr/local/bin/composer"): - WOShellExec.cmd_exec(self, "/usr/local/bin/composer" - "create-project --no-plugins " - "--no-scripts -n -s dev " - "erik-dubbelboer/php-redis-admin " - "/var/www/22222/htdocs/cache" - "/redis/phpRedisAdmin ") - Log.debug(self, 'Setting Privileges of webroot permission to ' - '{0}22222/htdocs/cache/redis' - .format(WOVariables.wo_webroot)) - WOFileUtils.chown(self, '{0}22222/htdocs' - .format(WOVariables.wo_webroot), - 'www-data', - 'www-data', - recursive=True) - - if (self.msg): - for msg in self.msg: - Log.info(self, Log.ENDC + msg) - else: - return self.msg From 5af7a42d2e62ef31f91ace349b3e43d8454dcf74 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 14:23:29 +0200 Subject: [PATCH 12/14] Fix log clamav install --- wo/cli/plugins/stack_pref.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 5f94f17..bda963c 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -151,7 +151,6 @@ def post_pref(self, apt_packages, packages, upgrade=False): ngxcnf = '/etc/nginx/conf.d' ngxcom = '/etc/nginx/common' ngxroot = '/var/www/' - self.msg = [] if upgrade: if os.path.isdir('/etc/nginx'): WOGit.add(self, @@ -1176,7 +1175,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): # ClamAV configuration if set(WOVariables.wo_clamav).issubset(set(apt_packages)): - Log.debug("Setting up freshclam cronjob") + Log.debug(self, "Setting up freshclam cronjob") if not os.path.isfile("/opt/freshclam.sh"): WOTemplate.render(self, '/opt/freshclam.sh', 'freshclam.mustache', From d4e1ce71bbb6f925eaadb31e4a0554c6885008cf Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 14:27:47 +0200 Subject: [PATCH 13/14] Missing data --- wo/cli/plugins/stack_pref.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index bda963c..375c44d 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -357,6 +357,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): # 22222 port settings if not os.path.isfile('/etc/nginx/sites-available/22222'): + data = dict(webroot=ngxroot) WOTemplate.render( self, '/etc/nginx/sites-available/22222', @@ -497,6 +498,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOVariables.wo_fqdn)]) if not os.path.isfile("/opt/cf-update.sh"): + data = dict() WOTemplate.render(self, '/opt/cf-update.sh', 'cf-update.mustache', data, overwrite=False) @@ -1177,14 +1179,15 @@ def post_pref(self, apt_packages, packages, upgrade=False): if set(WOVariables.wo_clamav).issubset(set(apt_packages)): Log.debug(self, "Setting up freshclam cronjob") if not os.path.isfile("/opt/freshclam.sh"): + data = dict() WOTemplate.render(self, '/opt/freshclam.sh', 'freshclam.mustache', data, overwrite=False) WOFileUtils.chmod(self, "/opt/freshclam.sh", 0o775) - # WOCron.setcron_weekly(self, '/opt/freshclam.sh ' - # '> /dev/null 2>&1', - # comment='ClamAV freshclam cronjob ' - # 'added by WordOps') + WOCron.setcron_weekly(self, '/opt/freshclam.sh ' + '> /dev/null 2>&1', + comment='ClamAV freshclam cronjob ' + 'added by WordOps') if (packages): # WP-CLI From f1f20af49d276a7a11e124c7b5cf9fb87f1f3b14 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 14:48:04 +0200 Subject: [PATCH 14/14] Bump release to v3.9.8.7 --- CHANGELOG.md | 3 +++ setup.py | 2 +- wo/core/variables.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2134222..99250b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.x - [Unreleased] +### v3.9.8.7 - 2019-08-31 + #### Changed - WordPress default permalinks structure from `/%year%/%monthnum%/%day%/%postname%/` -> `/%postname%/` @@ -16,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Error with `wo stack upgrade --nginx` - Install/update script version check +- clamAV stack install ### v3.9.8.6 - 2019-08-30 diff --git a/setup.py b/setup.py index 5f3cbd1..30aeadf 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ if not os.path.isfile('/root/.gitconfig'): shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig') setup(name='wo', - version='3.9.8.6', + version='3.9.8.7', description=long_description, long_description=long_description, classifiers=[], diff --git a/wo/core/variables.py b/wo/core/variables.py index deb0652..11547bb 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -10,7 +10,7 @@ class WOVariables(): """Intialization of core variables""" # WordOps version - wo_version = "3.9.8.6" + wo_version = "3.9.8.7" # WordOps packages versions wo_wp_cli = "2.2.0" wo_adminer = "4.7.2"