From 57d57e829d245a3f19a906766b7039023a1dc98a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 13 Jun 2019 17:28:23 +0200 Subject: [PATCH 1/6] WP_CACHE_KEY first fix --- wo/cli/plugins/site_functions.py | 52 ++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 39cb072..83887f7 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -317,12 +317,10 @@ def setupwordpress(self, data): ) + "--dbpass=\'{0}\' " "--extra-php< Date: Thu, 13 Jun 2019 17:47:58 +0200 Subject: [PATCH 2/6] update travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2ee76d3..28ce07f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,4 +54,4 @@ script: - sudo wp --allow-root --info - sudo wo info || sudo tail -n50 /var/log/wo/wordops.log - sudo tree -L 2 /etc/nginx - - sudo tree -L 3 /var/www/22222/htdocs/ + - sudo cat /var/www/wpredis.net/wp-config.php From f57856f41d2b018d7eeea5dde5dad7295e6573cb Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 15 Jun 2019 13:02:13 +0200 Subject: [PATCH 3/6] Another fix for WP_CACHE_KEY_SALT --- wo/cli/plugins/site_functions.py | 66 +++++++++----------------------- 1 file changed, 18 insertions(+), 48 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 83887f7..d17f3cf 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -317,10 +317,9 @@ def setupwordpress(self, data): ) + "--dbpass=\'{0}\' " "--extra-php< Date: Sat, 15 Jun 2019 13:14:08 +0200 Subject: [PATCH 4/6] Change method for WP_CACHE_KEY_SALT --- wo/cli/plugins/site_functions.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index d17f3cf..93c1ad5 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -328,6 +328,11 @@ def setupwordpress(self, data): except CommandExecutionError as e: raise SiteError("generate wp-config failed for wp single site") + WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " + .format(WOVariables.wo_wpcli_path) + + "config set WP_CACHE_KEY_SALT " + "\'{0}:\'".format(wo_domain_name)) + else: Log.debug(self, "Generating wp-config for WordPress multisite") Log.debug(self, "bash -c \"php {0} --allow-root " @@ -367,10 +372,10 @@ def setupwordpress(self, data): except CommandExecutionError as e: raise SiteError("generate wp-config failed for wp multi site") - WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " - .format(WOVariables.wo_wpcli_path) + - "config set WP_CACHE_KEY_SALT " - "\'{0}:\'".format(wo_domain_name)) + WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " + .format(WOVariables.wo_wpcli_path) + + "config set WP_CACHE_KEY_SALT " + "\'{0}:\'".format(wo_domain_name)) # WOFileUtils.mvfile(self, os.getcwd()+'/wp-config.php', # os.path.abspath(os.path.join(os.getcwd(), os.pardir))) From 3eaeff89a1d584984354a0943be52658f9b32d82 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 19:10:59 +0200 Subject: [PATCH 5/6] Last fix for WP_CACHE_KEY_SALT --- wo/cli/plugins/site_functions.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 93c1ad5..9d35048 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -296,7 +296,7 @@ def setupwordpress(self, data): Log.debug(self, "Generating wp-config for WordPress Single site") Log.debug(self, "bash -c \"php {0} --allow-root " .format(WOVariables.wo_wpcli_path) + - "core config " + + "config create " + "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbuser=\'{2}\' " "--dbhost=\'{3}\' " .format(data['wo_db_name'], wo_wp_prefix, @@ -308,7 +308,7 @@ def setupwordpress(self, data): try: if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" .format(WOVariables.wo_wpcli_path) + - " core config " + + " config create " + "--dbname=\'{0}\' --dbprefix=\'{1}\' " "--dbuser=\'{2}\' --dbhost=\'{3}\' " .format(data['wo_db_name'], wo_wp_prefix, @@ -331,13 +331,13 @@ def setupwordpress(self, data): WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " .format(WOVariables.wo_wpcli_path) + "config set WP_CACHE_KEY_SALT " - "\'{0}:\'".format(wo_domain_name)) + "\'{0}:\'\"".format(wo_domain_name)) else: Log.debug(self, "Generating wp-config for WordPress multisite") Log.debug(self, "bash -c \"php {0} --allow-root " .format(WOVariables.wo_wpcli_path) + - "core config " + + "config create " + "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' " .format(data['wo_db_name'], wo_wp_prefix, data['wo_db_host']) + "--dbuser=\'{0}\' --dbpass=\'{1}\' " @@ -351,7 +351,7 @@ def setupwordpress(self, data): try: if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" .format(WOVariables.wo_wpcli_path) + - " core config " + + " config create " + "--dbname=\'{0}\' --dbprefix=\'{1}\' " "--dbhost=\'{2}\' " .format(data['wo_db_name'], wo_wp_prefix, @@ -375,7 +375,7 @@ def setupwordpress(self, data): WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root " .format(WOVariables.wo_wpcli_path) + "config set WP_CACHE_KEY_SALT " - "\'{0}:\'".format(wo_domain_name)) + "\'{0}:\'\"".format(wo_domain_name)) # WOFileUtils.mvfile(self, os.getcwd()+'/wp-config.php', # os.path.abspath(os.path.join(os.getcwd(), os.pardir))) From 7eacd6c44d848053f8b7552ada3ad52f6809900a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 19:37:27 +0200 Subject: [PATCH 6/6] update changelog --- CHANGELOG.md | 4 ++++ wo/cli/plugins/debug.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbc0762..e6d7734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.6 - [Unreleased] +#### Fixed + +- WP_CACHE_KEY_SALT set twice + ### v3.9.5.1 - 2019-05-10 #### Fixed diff --git a/wo/cli/plugins/debug.py b/wo/cli/plugins/debug.py index 51178ae..1c29c68 100644 --- a/wo/cli/plugins/debug.py +++ b/wo/cli/plugins/debug.py @@ -100,7 +100,8 @@ class WODebugController(CementBaseController): for ip_addr in debug_address: if not ("debug_connection "+ip_addr in open('/etc/nginx/' - 'nginx.conf', encoding='utf-8').read()): + 'nginx.conf', + encoding='utf-8').read()): Log.info(self, "Setting up Nginx debug connection" " for "+ip_addr) WOShellExec.cmd_exec(self, "sed -i \"/events {{/a\\ \\ \\ "