Skip to content

Commit d3e0b3f

Browse files
committed
update proxy site to other sites
1 parent 4855302 commit d3e0b3f

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

ee/cli/plugins/site.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ def info(self):
144144
ee_db_host = siteinfo.db_host
145145
if sitetype != "html":
146146
hhvm = ("enabled" if siteinfo.is_hhvm else "disabled")
147+
if sitetype == "proxy":
148+
access_log = "/var/log/nginx/{0}.access.log".format(ee_domain)
149+
error_log = "/var/log/nginx/{0}.error.log".format(ee_domain)
150+
ee_site_webroot = ''
147151

148152
pagespeed = ("enabled" if siteinfo.is_pagespeed else "disabled")
149153

@@ -730,14 +734,21 @@ def doupdatesite(self, pargs):
730734
Log.info(self, "Password Unchanged.")
731735
return 0
732736

737+
if ((stype == "proxy" and stype == oldsitetype and self.app.pargs.hhvm)
738+
or (stype == "proxy" and
739+
stype == oldsitetype and self.app.pargs.pagespeed)):
740+
Log.info(self, Log.FAIL +
741+
"Can not update proxy site to HHVM or Pagespeed")
742+
return 1
733743
if stype == "html" and stype == oldsitetype and self.app.pargs.hhvm:
734744
Log.info(self, Log.FAIL + "Can not update HTML site to HHVM")
735745
return 1
736746

737-
if ((stype == 'php' and oldsitetype != 'html') or
738-
(stype == 'mysql' and oldsitetype not in ['html', 'php']) or
747+
if ((stype == 'php' and oldsitetype not in ['html', 'proxy']) or
748+
(stype == 'mysql' and oldsitetype not in ['html', 'php',
749+
'proxy']) or
739750
(stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql',
740-
'wp']) or
751+
'proxy', 'wp']) or
741752
(stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or
742753
(stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or
743754
(stype == oldsitetype and cache == oldcachetype) and
@@ -781,8 +792,7 @@ def doupdatesite(self, pargs):
781792

782793
stype = oldsitetype
783794
cache = oldcachetype
784-
785-
if oldsitetype == 'html':
795+
if oldsitetype == 'html' or oldsitetype == 'proxy':
786796
data['static'] = True
787797
data['wp'] = False
788798
data['multisite'] = False
@@ -962,7 +972,7 @@ def doupdatesite(self, pargs):
962972
return 1
963973

964974
# Setup WordPress if old sites are html/php/mysql sites
965-
if data['wp'] and oldsitetype in ['html', 'php', 'mysql']:
975+
if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'mysql']:
966976
try:
967977
ee_wp_creds = setupwordpress(self, data)
968978
except SiteError as e:

ee/cli/plugins/site_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ def site_package_check(self, stype):
555555
packages = []
556556
stack = EEStackController()
557557
stack.app = self.app
558-
if stype in ['html', 'php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
558+
if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir',
559+
'wpsubdomain']:
559560
Log.debug(self, "Setting apt_packages variable for Nginx")
560561

561562
if EEVariables.ee_platform_distro == 'debian':

ee/cli/templates/siteinfo.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Nginx configuration {{type}} {{enable}}
55
{{#hhvm}}HHVM {{hhvm}}{{/hhvm}}
66
access_log {{accesslog}}
77
error_log {{errorlog}}
8-
Webroot {{webroot}}
8+
{{#webroot}}Webroot {{webroot}}{{/webroot}}
99
{{#dbname}}DB_NAME {{dbname}}{{/dbname}}
1010
{{#dbname}}DB_USER {{dbuser}}{{/dbname}}
1111
{{#dbname}}DB_PASS {{dbpass}}{{/dbname}}

0 commit comments

Comments
 (0)