From fa826224aff7ed549672bc8bb52d765b9fbb86f7 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 5 Aug 2019 21:48:14 +0200 Subject: [PATCH] Fix wprocket --- .travis.yml | 4 ---- wo/cli/plugins/site.py | 4 ++-- wo/cli/plugins/stack_pref.py | 14 ++++++++++++++ wo/cli/templates/map-wp.mustache | 10 +++++----- wo/cli/templates/nginx-core.mustache | 8 ++++---- wo/cli/templates/virtualconf-php7.mustache | 2 +- wo/cli/templates/virtualconf.mustache | 2 +- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0bdc7df..c4ba976 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,10 +32,6 @@ script: - sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig' - sudo echo "Travis Banch = $TRAVIS_BRANCH" - sudo bash install --travis - - python3 -m pip install coverage - - python3 -m pip install codacy-coverage - - coverage xml - - python-codacy-coverage -c $TRAVIS_COMMIT -d $TRAVIS_BUILD_DIR -r coverage.xml - sudo wo --help && sudo wo stack install && sudo wo stack install --proftpd - sudo wo site create html.net --html && sudo wo site create php.com --php && sudo wo site create mysql.com --mysql && sudo wo site create proxy.com --proxy=127.0.0.1:3000 - sudo wo site create wp1.com --wp && sudo wo site create wpsc1.net --wpsc && sudo wo site create wpfc1.com --wpfc diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 20948e4..ec63fd6 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -1502,7 +1502,7 @@ class WOSiteUpdateController(CementBaseController): "and please try again") return 1 - if ((oldcachetype in ['wpsc', 'basic', 'wpredis'] and + if ((oldcachetype in ['wpsc', 'basic', 'wpredis', 'wprocket'] and (data['wpfc'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpfc'])): try: @@ -1541,7 +1541,7 @@ class WOSiteUpdateController(CementBaseController): "and please try again") return 1 - elif ((oldcachetype in ['wpsc', 'basic', 'wpfc'] and + elif ((oldcachetype in ['wpsc', 'basic', 'wpfc', 'wprocket'] and (data['wpredis'])) or (oldsitetype == 'wp' and data['multisite'] and data['wpredis'])): diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index df9bf9c..b7c84fb 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -173,6 +173,20 @@ def post_pref(self, apt_packages, packages): # Nginx configuration if set(WOVariables.wo_nginx).issubset(set(apt_packages)): + # Nginx main configuration + if os.path.isfile('/etc/nginx/nginx.conf'): + if (WOVariables.wo_distro == 'ubuntu' or + WOVariables.wo_platform_codename == 'buster'): + data = dict(tls13=True) + else: + data = dict(tls13=False) + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/nginx.conf') + wo_nginx = open('/etc/nginx/nginx.conf', + encoding='utf-8', mode='w') + self.app.render( + (data), 'nginx-core.mustache', out=wo_nginx) + wo_nginx.close() # Fix for white screen death with NGINX PLUS if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params', diff --git a/wo/cli/templates/map-wp.mustache b/wo/cli/templates/map-wp.mustache index f764020..87be917 100644 --- a/wo/cli/templates/map-wp.mustache +++ b/wo/cli/templates/map-wp.mustache @@ -52,11 +52,6 @@ map $is_args $query_no_cache { "" 0; } -map $https $https_prefix { - default ""; - on "-https" -} - # if all previous check are passed, $skip_cache = 0 map $http_request_no_cache$cookie_no_cache$uri_no_cache$query_no_cache $skip_cache { default 1; @@ -68,3 +63,8 @@ map $skip_cache $cache_uri { 0 $request_uri; default 'null cache'; } + +map $https $https_prefix { + default ""; + on "-https" +} diff --git a/wo/cli/templates/nginx-core.mustache b/wo/cli/templates/nginx-core.mustache index dd4631e..4201f52 100644 --- a/wo/cli/templates/nginx-core.mustache +++ b/wo/cli/templates/nginx-core.mustache @@ -66,12 +66,12 @@ http { ssl_session_cache shared:SSL:50m; ssl_session_tickets off; ssl_prefer_server_ciphers on; - ssl_ciphers 'TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+AESGCM:EECDH+CHACHA20'; - ssl_protocols TLSv1.2 TLSv1.3; + {{#tls13}}ssl_ciphers 'TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+AESGCM:EECDH+CHACHA20'; + ssl_protocols TLSv1.2 TLSv1.3;{{/tls13}} ssl_ecdh_curve X25519:P-521:P-384:P-256; # Previous TLS v1.2 configuration - # ssl_protocols TLSv1.2; - # ssl_ciphers EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES; + {{^tls13}}ssl_protocols TLSv1.2; + ssl_ciphers EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES;{{/tls13}} # Common security headers more_set_headers "X-Frame-Options : SAMEORIGIN"; diff --git a/wo/cli/templates/virtualconf-php7.mustache b/wo/cli/templates/virtualconf-php7.mustache index 56c1e96..fa137cb 100644 --- a/wo/cli/templates/virtualconf-php7.mustache +++ b/wo/cli/templates/virtualconf-php7.mustache @@ -49,7 +49,7 @@ server { } {{/static}} - {{^static}}include {{#basic}}common/php73.conf;{{/basic}}{{#wpfc}}common/wpfc-php73.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php73.conf;{{/wpsc}}{{#wpredis}}common/redis-php73.conf;{{/wpredis}}{{#wprocket}}common/wprocket-php73.conf{{/wprocket}} + {{^static}}include {{#basic}}common/php73.conf;{{/basic}}{{#wpfc}}common/wpfc-php73.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php73.conf;{{/wpsc}}{{#wpredis}}common/redis-php73.conf;{{/wpredis}}{{#wprocket}}common/wprocket-php73.conf;{{/wprocket}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon-php73.conf;{{/wp}} include common/locations-wo.conf;{{/proxy}} diff --git a/wo/cli/templates/virtualconf.mustache b/wo/cli/templates/virtualconf.mustache index 87d1100..19a1afb 100644 --- a/wo/cli/templates/virtualconf.mustache +++ b/wo/cli/templates/virtualconf.mustache @@ -49,7 +49,7 @@ server { } {{/static}} - {{^static}}include {{#basic}}common/php72.conf;{{/basic}}{{#wpfc}}common/wpfc-php72.conf;{{/wpfc}}{{#wpsc}}common/wpsc-php72.conf;{{/wpsc}}{{#wpredis}}common/redis-php72.conf;{{/wpredis}}{{#wprocket}}common/wprocket-php72.conf{{/wprocket}} + {{^static}}include {{#basic}}common/php72.conf;{{/basic}}{{#wpfc}}common/wpfc-php72.conf;{{/wpfc}}{{#wpsc}}common/wpsc-php72.conf;{{/wpsc}}{{#wpredis}}common/redis-php72.conf;{{/wpredis}}{{#wprocket}}common/wprocket-php72.conf;{{/wprocket}} {{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}} {{#wp}}include common/wpcommon-php72.conf;{{/wp}} include common/locations-wo.conf;{{/proxy}}