Several improvements
* Run `mysql_upgrade` during MySQL upgrade with `wo stack upgrade` to perform migration if needed * WordOps now check if a repository already exist before trying to adding it again. * install script refactored
This commit is contained in:
@@ -22,6 +22,7 @@ class WOAcme:
|
||||
self, "{0} ".format(WOAcme.wo_acme_exec) +
|
||||
"--list --listraw > /var/lib/wo/cert.csv"):
|
||||
Log.error(self, "Unable to export certs list")
|
||||
WOFileUtils.chmod(self, '/var/lib/wo/cert.csv', 0o600)
|
||||
|
||||
def setupletsencrypt(self, acme_domains, acmedata):
|
||||
"""Issue SSL certificates with acme.sh"""
|
||||
@@ -38,6 +39,14 @@ class WOAcme:
|
||||
acme_mode = "-w /var/www/html"
|
||||
validation_mode = "Webroot challenge"
|
||||
Log.debug(self, "Validation : Webroot mode")
|
||||
if not os.path.isdir('/var/www/html/.well-known/acme-challenge'):
|
||||
WOFileUtils.mkdir(
|
||||
self, '/var/www/html/.well-known/acme-challenge')
|
||||
WOFileUtils.chown(
|
||||
self, '/var/www/html/.well-known', 'www-data', 'www-data',
|
||||
recursive=True)
|
||||
WOFileUtils.chmod(self, '/var/www/html/.well-known', 0o750,
|
||||
recursive=True)
|
||||
|
||||
Log.info(self, "Validation mode : {0}".format(validation_mode))
|
||||
Log.wait(self, "Issuing SSL cert with acme.sh")
|
||||
|
||||
@@ -25,7 +25,6 @@ class WODomain():
|
||||
return domain_name
|
||||
|
||||
|
||||
|
||||
def getlevel(self, domain):
|
||||
"""
|
||||
Returns the domain type : domain, subdomain and the root domain
|
||||
|
||||
@@ -280,17 +280,19 @@ class WOFileUtils():
|
||||
"""
|
||||
Searches for string in file and returns True or False.
|
||||
"""
|
||||
try:
|
||||
Log.debug(self, "Finding string {0} to file {1}"
|
||||
.format(sstr, fnm))
|
||||
if os.path.isfile(fnm):
|
||||
try:
|
||||
Log.debug(self, "Finding string {0} to file {1}"
|
||||
.format(sstr, fnm))
|
||||
for line in open(fnm, encoding='utf-8'):
|
||||
if sstr in line:
|
||||
return True
|
||||
return False
|
||||
except OSError as e:
|
||||
Log.debug(self, "{0}".format(e.strerror))
|
||||
Log.error(self, "Unable to Search string {0} in {1}"
|
||||
.format(sstr, fnm))
|
||||
Log.debug(self, "{0}".format(e.strerror))
|
||||
Log.error(self, "Unable to Search string {0} in {1}"
|
||||
.format(sstr, fnm))
|
||||
return False
|
||||
|
||||
def rm(self, path):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user