From fd270187b66935b354f12916ffe8dc055bbc56f1 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 19:55:41 +0200 Subject: [PATCH 01/10] Set variables for new release --- CHANGELOG.md | 2 ++ install | 6 +++--- setup.py | 2 +- wo/core/variables.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6d7734..ad94d06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.6 - [Unreleased] +### v3.9.5.2 - 2019-06-16 + #### Fixed - WP_CACHE_KEY_SALT set twice diff --git a/install b/install index a1eccd5..9b65546 100755 --- a/install +++ b/install @@ -10,7 +10,7 @@ # Version 3.9.5.1 - 2019-05-10 # ------------------------------------------------------------------------- readonly wo_version_old="2.2.3" -readonly wo_version_new="3.9.5.1" +readonly wo_version_new="3.9.5.2" # CONTENTS # --- # 1. VARIABLES AND DECLARATIONS @@ -380,7 +380,7 @@ wo_install_acme_sh() { --config-home /etc/letsencrypt/config \ --cert-home /etc/letsencrypt/renewal # enable auto-upgrade - /etc/letsencrypt/acme.sh --config-home /etc/letsencrypt/config --upgrade --auto-upgrade + /etc/letsencrypt/acme.sh --config-home '/etc/letsencrypt/config' --upgrade --auto-upgrade } >> "$wo_install_log" 2>&1 fi @@ -508,7 +508,7 @@ wo_upgrade_nginx() { else WO WO_STACK_INSTALL_ARGS="" fi - /usr/local/bin/wo stack install --nginx --php $WO_STACK_INSTALL_ARGS + /usr/local/bin/wo stack install --nginx --php "$WO_STACK_INSTALL_ARGS" echo "$wo_version_new" > /etc/nginx/common/release rm -f /etc/nginx/common/acl.conf /etc/nginx/conf.d/{map-wp-cache.conf,map-wp.conf} fi diff --git a/setup.py b/setup.py index c302674..ed36b82 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.5', + version='3.9.5.2', description=long_description, long_description=long_description, classifiers=[], diff --git a/wo/core/variables.py b/wo/core/variables.py index d3af7bd..9997193 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -11,7 +11,7 @@ class WOVariables(): """Intialization of core variables""" # WordOps version - wo_version = "3.9.5" + wo_version = "3.9.5.2" # WordOps packages versions wo_wp_cli = "2.2.0" wo_adminer = "4.7.1" From fef6ffc5821e496c38c92e4d7909ae827ff5b036 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 21:13:58 +0200 Subject: [PATCH 02/10] Add non interactive install and fix release number --- .travis.yml | 1 + CHANGELOG.md | 4 ++++ install | 40 ++++++++++++++++++++-------------------- wo/cli/plugins/update.py | 26 +++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28ce07f..b98179f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,3 +55,4 @@ script: - sudo wo info || sudo tail -n50 /var/log/wo/wordops.log - sudo tree -L 2 /etc/nginx - sudo cat /var/www/wpredis.net/wp-config.php + - sudo wo update --force || sudo tail -n50 /var/log/wo/wordops.log diff --git a/CHANGELOG.md b/CHANGELOG.md index ad94d06..940ba32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.5.2 - 2019-06-16 +#### Added + +- Non-interactive install/upgrade + #### Fixed - WP_CACHE_KEY_SALT set twice diff --git a/install b/install index 9b65546..4ef7cde 100755 --- a/install +++ b/install @@ -7,7 +7,7 @@ # Copyright (c) 2019 - WordOps # This script is licensed under M.I.T # ------------------------------------------------------------------------- -# Version 3.9.5.1 - 2019-05-10 +# Version 3.9.5.2 - 2019-06-16 # ------------------------------------------------------------------------- readonly wo_version_old="2.2.3" readonly wo_version_new="3.9.5.2" @@ -70,6 +70,9 @@ while [ "$#" -gt 0 ]; do --travis) wo_travis="y" ;; + -s | --silent) + wo_silent="y" + ;; *) # positional args ;; esac @@ -193,21 +196,7 @@ wo_install_dep() { locale-gen en } >> "$wo_install_log" 2>&1 - # Support PFS - # if [ -f /etc/nginx/nginx.conf ]; then - # # Replace previous ciphers - # new_ciphers="EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES" - # sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$new_ciphers\";/" /etc/nginx/nginx.conf - # # Change the TLS protocols - # sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2;/" /etc/nginx/nginx.conf - # fi - # # Let's Encrypt .well-known folder setup - # if [ ! -d /var/www/html/.well-known/acme-challenge ]; then - # mkdir -p /var/www/html/.well-known/acme-challenge - # chown -R www-data:www-data /var/www/html /var/www/html/.well-known - # chmod 750 /var/www/html /var/www/html/.well-known - # fi } ### @@ -427,6 +416,9 @@ wo_install() { fi cd /tmp/WordOps || exit 1 } >> "$wo_install_log" 2>&1 + if [ "$wo_silent" = "y" ] || [ "$wo_force_install" = "y" ]; then + [ ! -f $HOME/.gitconfig ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME" > $HOME/.gitconfig'; } + fi python3 setup.py install } @@ -435,7 +427,7 @@ wo_upgrade_nginx() { { if [ -d /var/lib/wo-backup/nginx ]; then - tar -I pigz "$NGINX_BACKUP_FILE" /var/lib/wo-backup/nginx + /bin/tar -I pigz "$NGINX_BACKUP_FILE" /var/lib/wo-backup/nginx rm -rf /var/lib/wo-backup/nginx fi # backup nginx conf @@ -464,7 +456,7 @@ wo_upgrade_nginx() { # import the respository key for updates apt-key add - < /tmp/nginx-wo.key rm -f /tmp/nginx-wo.key - sudo apt-get update + sudo apt-get update -qq if [ -f /etc/nginx/common/release ]; then CHECK_NGINX_UPSTREAM_VERSION=$(grep "$wo_version_new" /etc/nginx/common/release) @@ -681,8 +673,12 @@ wo_tweak_kernel() { if [ -x /usr/local/bin/wo ]; then if ! { wo -v 2>&1 | grep $wo_version_new - }; then - echo -e "Update WordOps to $wo_version_new (y/n): " && read -r WO_ANSWER + } || [ "$wo_force_install" = "y" ]; then + if [ -z "$wo_silent" ] && [ -z "$wo_force_install" ]; then + echo -e "Update WordOps to $wo_version_new (y/n): " && read -r WO_ANSWER + else + WO_ANSWER="y" + fi if [ "$WO_ANSWER" = "y" ] || [ "$WO_ANSWER" = "Y" ]; then wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log wo_install_dep | tee -ai $wo_install_log @@ -717,7 +713,11 @@ if [ -x /usr/local/bin/wo ]; then else # 2 - Migration from EEv3 if [ -x /usr/local/bin/ee ]; then - echo -e "Migrate from EasyEngine to WordOps (y/n): " && read -r WO_ANSWER + if [ -z "$wo_silent" ] && [ -z "$wo_force_install" ]; then + echo -e "Migrate from EasyEngine to WordOps (y/n): " && read -r WO_ANSWER + else + WO_ANSWER="y" + fi if [ "$WO_ANSWER" = "y" ] || [ "$WO_ANSWER" = "Y" ]; then 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/update.py b/wo/cli/plugins/update.py index fa955bc..65d47cb 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -19,15 +19,27 @@ class WOUpdateController(CementBaseController): aliases_only = True stacked_type = 'nested' description = ('update WordOps to latest version') - usage = "wo update" + arguments = [ + (['--force'], + dict(help='Force WordOps update', action='store_true')), + ] + usage = "wo update [options]" @expose(hide=True) def default(self): + if (not (self.app.pargs.force)): + self.update_wordops + if (self.app.pargs.force): + self.force_update_wordops + filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") WODownload.download(self, [["https://raw.githubusercontent.com/" "WordOps/WordOps/master/install", "/tmp/{0}".format(filename), "update script"]]) + + @expose(hide=True) + def update_wordops(self): try: Log.info(self, "updating WordOps, please wait...") os.system("bash /tmp/{0}".format(filename)) @@ -38,6 +50,18 @@ class WOUpdateController(CementBaseController): Log.debug(self, str(e)) Log.error(self, "WordOps update failed !") + @expose(hide=True) + def force_update_wordops(self): + try: + Log.info(self, "updating WordOps, please wait...") + os.system("bash /tmp/{0} --force".format(filename)) + except OSError as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") + except Exception as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") + def load(app): # register the plugin class.. this only happens if the plugin is enabled From 036f3b37107186e12adc0908496ef0193871d607 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 22:00:15 +0200 Subject: [PATCH 03/10] Fix wo update --- wo/cli/plugins/update.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 65d47cb..8dfc330 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -27,16 +27,15 @@ class WOUpdateController(CementBaseController): @expose(hide=True) def default(self): - if (not (self.app.pargs.force)): - self.update_wordops - if (self.app.pargs.force): - self.force_update_wordops - filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") WODownload.download(self, [["https://raw.githubusercontent.com/" "WordOps/WordOps/master/install", "/tmp/{0}".format(filename), "update script"]]) + if (not (self.app.pargs.force)): + self.update_wordops + if (self.app.pargs.force): + self.force_update_wordops @expose(hide=True) def update_wordops(self): From d0fee9a25390c6d25751deb12b6b48def4b89e58 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 22:27:23 +0200 Subject: [PATCH 04/10] Another fix for wo update --- wo/cli/plugins/update.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 8dfc330..05888dd 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -27,18 +27,18 @@ class WOUpdateController(CementBaseController): @expose(hide=True) def default(self): + if self.app.pargs.force: + self.force_update_wordops + else: + self.update_wordops + + @expose(hide=True) + def update_wordops(self): filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") WODownload.download(self, [["https://raw.githubusercontent.com/" "WordOps/WordOps/master/install", "/tmp/{0}".format(filename), "update script"]]) - if (not (self.app.pargs.force)): - self.update_wordops - if (self.app.pargs.force): - self.force_update_wordops - - @expose(hide=True) - def update_wordops(self): try: Log.info(self, "updating WordOps, please wait...") os.system("bash /tmp/{0}".format(filename)) @@ -51,6 +51,11 @@ class WOUpdateController(CementBaseController): @expose(hide=True) def force_update_wordops(self): + filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") + WODownload.download(self, [["https://raw.githubusercontent.com/" + "WordOps/WordOps/master/install", + "/tmp/{0}".format(filename), + "update script"]]) try: Log.info(self, "updating WordOps, please wait...") os.system("bash /tmp/{0} --force".format(filename)) From d2aefce659b4be9f58f8ba47c54a73ecdb1423d3 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 23:03:12 +0200 Subject: [PATCH 05/10] Simplify wo update --- wo/cli/plugins/update.py | 53 +++++++++++++--------------------------- 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 05888dd..b479544 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -27,44 +27,25 @@ class WOUpdateController(CementBaseController): @expose(hide=True) def default(self): + filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") + WODownload.download(self, [["https://raw.githubusercontent.com/" + "WordOps/WordOps/master/install", + "/tmp/{0}".format(filename), + "update script"]]) if self.app.pargs.force: - self.force_update_wordops + try: + Log.info(self, "updating WordOps, please wait...") + os.system("bash /tmp/{0} --force".format(filename)) + except OSError as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") else: - self.update_wordops - - @expose(hide=True) - def update_wordops(self): - filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") - WODownload.download(self, [["https://raw.githubusercontent.com/" - "WordOps/WordOps/master/install", - "/tmp/{0}".format(filename), - "update script"]]) - try: - Log.info(self, "updating WordOps, please wait...") - os.system("bash /tmp/{0}".format(filename)) - except OSError as e: - Log.debug(self, str(e)) - Log.error(self, "WordOps update failed !") - except Exception as e: - Log.debug(self, str(e)) - Log.error(self, "WordOps update failed !") - - @expose(hide=True) - def force_update_wordops(self): - filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") - WODownload.download(self, [["https://raw.githubusercontent.com/" - "WordOps/WordOps/master/install", - "/tmp/{0}".format(filename), - "update script"]]) - try: - Log.info(self, "updating WordOps, please wait...") - os.system("bash /tmp/{0} --force".format(filename)) - except OSError as e: - Log.debug(self, str(e)) - Log.error(self, "WordOps update failed !") - except Exception as e: - Log.debug(self, str(e)) - Log.error(self, "WordOps update failed !") + try: + Log.info(self, "updating WordOps, please wait...") + os.system("bash /tmp/{0}".format(filename)) + except OSError as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") def load(app): From 54f31c1c93b96f39c516c8f0b85982c887049430 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 23:20:16 +0200 Subject: [PATCH 06/10] Fix --force for wo update --- wo/cli/plugins/update.py | 1 - 1 file changed, 1 deletion(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index b479544..07214e7 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -16,7 +16,6 @@ class WOUpdateController(CementBaseController): label = 'wo_update' stacked_on = 'base' aliases = ['update'] - aliases_only = True stacked_type = 'nested' description = ('update WordOps to latest version') arguments = [ From 675f57d36b37c9572e33f142717471f72a4bb9e7 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 16 Jun 2019 23:21:34 +0200 Subject: [PATCH 07/10] Fix branch for wo download --- wo/cli/plugins/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 07214e7..f708f11 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -28,7 +28,7 @@ class WOUpdateController(CementBaseController): def default(self): filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") WODownload.download(self, [["https://raw.githubusercontent.com/" - "WordOps/WordOps/master/install", + "WordOps/WordOps/updating-configuration/install", "/tmp/{0}".format(filename), "update script"]]) if self.app.pargs.force: From c66b9f7b860416df5120b42bad7ba7a0f95ec41c Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 00:25:10 +0200 Subject: [PATCH 08/10] Rewrite site update with wpredis --- wo/cli/plugins/site.py | 56 +++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 6c27262..73944c5 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -4,6 +4,7 @@ from cement.core import handler, hook from wo.core.cron import WOCron from wo.core.sslutils import SSL from wo.core.variables import WOVariables +from wo.core.shellexec import WOShellExec from wo.core.domainvalidate import ValidateDomain from wo.core.fileutils import WOFileUtils from wo.cli.plugins.site_functions import * @@ -1610,42 +1611,25 @@ class WOSiteUpdateController(CementBaseController): if oldcachetype != 'wpredis' and data['wpredis']: try: if installwp_plugin(self, 'redis-cache', data): - # search for wp-config.php - if WOFileUtils.isexist(self, "{0}/wp-config.php" - .format(wo_site_webroot)): - config_path = '{0}/wp-config.php'.format( - wo_site_webroot) - elif WOFileUtils.isexist(self, "{0}/htdocs/wp-config.php" - .format(wo_site_webroot)): - config_path = '{0}/htdocs/wp-config.php'.format( - wo_site_webroot) - else: - Log.debug( - self, "Updating wp-config.php failed. " - "File could not be located.") - Log.error( - self, "wp-config.php could not be located !!") - raise SiteError - - if WOShellExec.cmd_exec(self, "grep -q " - "\"WP_CACHE_KEY_SALT\" {0}" - .format(config_path)): - pass - else: - try: - wpconfig = open("{0}".format(config_path), - encoding='utf-8', mode='a') - wpconfig.write("\n\ndefine( \'WP_CACHE_KEY_SALT\'," - " \'{0}:\' );".format(wo_domain)) - wpconfig.close() - except IOError as e: - Log.debug(self, str(e)) - Log.debug(self, "Updating wp-config.php failed.") - Log.warn(self, "Updating wp-config.php failed. " - "Could not append:" - "\ndefine( \'WP_CACHE_KEY_SALT\', " - "\'{0}:\' );".format(wo_domain) + - "\nPlease add manually") + # add WP_CACHE_KEY_SALT if not already set + try: + Log.debug(self, "Updating wp-config.php.") + WOShellExec.cmd_exec(self, + "bash -c \"php {0} --allow-root " + .format(WOVariables.wo_wpcli_path) + + "config set --add " + "WP_CACHE_KEY_SALT " + "\'{0}:\' --path={1}\"" + .format(wo_domain, + wo_site_webroot)) + except IOError as e: + Log.debug(self, str(e)) + Log.debug(self, "Updating wp-config.php failed.") + Log.warn(self, "Updating wp-config.php failed. " + "Could not append:" + "\ndefine( \'WP_CACHE_KEY_SALT\', " + "\'{0}:\' );".format(wo_domain) + + "\nPlease add manually") except SiteError as e: Log.debug(self, str(e)) Log.info(self, Log.FAIL + "Update site failed." From c8568bb9638a362a2772fa5f6eb11277bde0d489 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 00:45:12 +0200 Subject: [PATCH 09/10] Robots.txt fix and changelog update --- .travis.yml | 3 ++- CHANGELOG.md | 12 ++++++++++-- install | 2 +- wo/cli/plugins/update.py | 2 +- wo/cli/templates/locations.mustache | 11 ----------- wo/cli/templates/wpcommon-php7.mustache | 11 +++++++++++ wo/cli/templates/wpcommon.mustache | 11 +++++++++++ 7 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index b98179f..a0d2dbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,4 +55,5 @@ script: - sudo wo info || sudo tail -n50 /var/log/wo/wordops.log - sudo tree -L 2 /etc/nginx - sudo cat /var/www/wpredis.net/wp-config.php - - sudo wo update --force || sudo tail -n50 /var/log/wo/wordops.log + - echo "127.0.0.1 wpredis.net" | sudo tee -a /etc/hosts + - curl -sL http://wpredis.net/robots.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 940ba32..fba993c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,15 +10,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.6 - [Unreleased] -### v3.9.5.2 - 2019-06-16 +### v3.9.5.2 - 2019-06-17 #### Added - Non-interactive install/upgrade +- Argument `--force` with the command `wo update` +- Argument `-s|--silent` to perform non interactive installation + +#### Changed + +- robots.txt location block moved from locations-wo.conf to wpcommon.php #### Fixed -- WP_CACHE_KEY_SALT set twice +- WP_CACHE_KEY_SALT set twice with wpredis +- WordOps version check when using `wo update` +- robots.txt file download if not created ### v3.9.5.1 - 2019-05-10 diff --git a/install b/install index 4ef7cde..1c73fdc 100755 --- a/install +++ b/install @@ -7,7 +7,7 @@ # Copyright (c) 2019 - WordOps # This script is licensed under M.I.T # ------------------------------------------------------------------------- -# Version 3.9.5.2 - 2019-06-16 +# Version 3.9.5.2 - 2019-06-17 # ------------------------------------------------------------------------- readonly wo_version_old="2.2.3" readonly wo_version_new="3.9.5.2" diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index f708f11..07214e7 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -28,7 +28,7 @@ class WOUpdateController(CementBaseController): def default(self): filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") WODownload.download(self, [["https://raw.githubusercontent.com/" - "WordOps/WordOps/updating-configuration/install", + "WordOps/WordOps/master/install", "/tmp/{0}".format(filename), "update script"]]) if self.app.pargs.force: diff --git a/wo/cli/templates/locations.mustache b/wo/cli/templates/locations.mustache index 267891c..ba1d66f 100644 --- a/wo/cli/templates/locations.mustache +++ b/wo/cli/templates/locations.mustache @@ -6,17 +6,6 @@ location = /favicon.ico { log_not_found off; expires max; } -location = /robots.txt { -# Some WordPress plugin gererate robots.txt file -# Refer #340 issue - try_files $uri $uri/ /index.php$is_args$args @robots; - access_log off; - log_not_found off; -} -# fallback for robots.txt with default wordpress rules -location @robots { - return 200 "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n"; -} # Cache static files location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|ttf|m4a|mp4|ttf|rss|atom|jpe?g|gif|cur|heic|png|tiff|ico|webm|mp3|aac|tgz|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ { add_header "Access-Control-Allow-Origin" "*"; diff --git a/wo/cli/templates/wpcommon-php7.mustache b/wo/cli/templates/wpcommon-php7.mustache index 52054ad..d0ee50d 100644 --- a/wo/cli/templates/wpcommon-php7.mustache +++ b/wo/cli/templates/wpcommon-php7.mustache @@ -12,6 +12,17 @@ location = /wp-config.txt { access_log off; log_not_found off; } +location = /robots.txt { +# Some WordPress plugin gererate robots.txt file +# Refer #340 issue + try_files $uri $uri/ /index.php?$args @robots; + access_log off; + log_not_found off; +} +# fallback for robots.txt with default wordpress rules +location @robots { + return 200 "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n"; +} # webp rewrite rules for jpg and png images # try to load alternative image.png.webp before image.png location /wp-content/uploads { diff --git a/wo/cli/templates/wpcommon.mustache b/wo/cli/templates/wpcommon.mustache index 8ddc377..581710c 100644 --- a/wo/cli/templates/wpcommon.mustache +++ b/wo/cli/templates/wpcommon.mustache @@ -12,6 +12,17 @@ location = /wp-config.txt { access_log off; log_not_found off; } +location = /robots.txt { +# Some WordPress plugin gererate robots.txt file +# Refer #340 issue + try_files $uri $uri/ /index.php?$args @robots; + access_log off; + log_not_found off; +} +# fallback for robots.txt with default wordpress rules +location @robots { + return 200 "User-agent: *\nDisallow: /wp-admin/\nAllow: /wp-admin/admin-ajax.php\n"; +} # webp rewrite rules for jpg and png images # try to load alternative image.png.webp before image.png location /wp-content/uploads { From 7da9acbf7209922110821e39ec245bbd95bafdc0 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 00:53:22 +0200 Subject: [PATCH 10/10] [skip travis] update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fba993c..3cda1f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,13 +20,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), #### Changed -- robots.txt location block moved from locations-wo.conf to wpcommon.php +- robots.txt location block moved from locations-wo.conf to wpcommon(-php7).php #### Fixed - WP_CACHE_KEY_SALT set twice with wpredis - WordOps version check when using `wo update` - robots.txt file download if not created +- PHP-FPM socket path in stub_status.conf : PR [#82](https://github.com/WordOps/WordOps/pull/82) ### v3.9.5.1 - 2019-05-10