Fix vhostonly, improve git rollback

* prevent issues with wildcard certs
This commit is contained in:
VirtuBox
2019-10-02 17:23:07 +02:00
parent abff3e14f8
commit 204469ae4c
4 changed files with 14 additions and 23 deletions

View File

@@ -1483,25 +1483,14 @@ class WOSiteUpdateController(CementBaseController):
Log.info(self, "Congratulations! Successfully " Log.info(self, "Congratulations! Successfully "
"Configured SSL for Site " "Configured SSL for Site "
" https://{0}".format(wo_domain)) " https://{0}".format(wo_domain))
if acme_subdomain and iswildcard: if (SSL.getexpirationdays(self, wo_domain) > 0):
if (SSL.getexpirationdays(self, wo_root_domain) > 0): Log.info(self, "Your cert will expire within " +
Log.info( str(SSL.getexpirationdays(self, wo_domain)) +
self, "Your cert will expire within " + " days.")
str(SSL.getexpirationdays(self, wo_root_domain)) +
" days.")
else:
Log.warn(
self, "Your cert already EXPIRED ! "
".PLEASE renew soon . ")
else: else:
if (SSL.getexpirationdays(self, wo_domain) > 0): Log.warn(
Log.info(self, "Your cert will expire within " + self, "Your cert already EXPIRED ! "
str(SSL.getexpirationdays(self, wo_domain)) + ".PLEASE renew soon . ")
" days.")
else:
Log.warn(
self, "Your cert already EXPIRED ! "
".PLEASE renew soon . ")
elif data['letsencrypt'] is False: elif data['letsencrypt'] is False:
if pargs.letsencrypt == "off": if pargs.letsencrypt == "off":

View File

@@ -610,6 +610,7 @@ def setupwordpress(self, data, vhostonly=False):
WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root " WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root "
.format(WOVar.wo_wpcli_path) + .format(WOVar.wo_wpcli_path) +
"db clean --yes\"") "db clean --yes\"")
WOFileUtils.chdir(self, '{0}'.format(wo_site_webroot))
WOFileUtils.rm(self, "{0}/htdocs".format(wo_site_webroot)) WOFileUtils.rm(self, "{0}/htdocs".format(wo_site_webroot))
WOFileUtils.mkdir(self, "{0}/htdocs".format(wo_site_webroot)) WOFileUtils.mkdir(self, "{0}/htdocs".format(wo_site_webroot))
WOFileUtils.chown(self, "{0}/htdocs".format(wo_site_webroot), WOFileUtils.chown(self, "{0}/htdocs".format(wo_site_webroot),

View File

@@ -2,7 +2,6 @@
import os import os
from sh import ErrorReturnCode, git from sh import ErrorReturnCode, git
from wo.core.logging import Log from wo.core.logging import Log
@@ -72,9 +71,10 @@ class WOGit:
Log.error(self, "Unable to find a git repository at {0}" Log.error(self, "Unable to find a git repository at {0}"
.format(path)) .format(path))
try: try:
Log.debug(self, "WOGit: git reset HEAD~ at {0}" Log.debug(self, "WOGit: git stash --include-untracked at {0}"
.format(path)) .format(path))
git.reset("HEAD~", "--hard") git.stash("push", "--include-untracked", "-m {0}"
.format(msg))
except ErrorReturnCode as e: except ErrorReturnCode as e:
Log.debug(self, "{0}".format(e)) Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to git reset at {0} " Log.error(self, "Unable to git reset at {0} "

View File

@@ -111,8 +111,9 @@ class SSL:
wo_wildcard_domain = ("*.{0}".format(wo_domain_name)) wo_wildcard_domain = ("*.{0}".format(wo_domain_name))
for row in reader: for row in reader:
if wo_wildcard_domain in row[2]: if wo_wildcard_domain in row[2]:
iswildcard = True if not row[2] == "":
break iswildcard = True
break
else: else:
iswildcard = False iswildcard = False
certfile.close() certfile.close()