Improve acme process and error log

This commit is contained in:
VirtuBox
2019-10-26 19:28:56 +02:00
parent f3f0573954
commit 179ea7d9cf
4 changed files with 17 additions and 14 deletions

View File

@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Initial creation of .gitconfig is displayed the first time you run the command `wo`
- Added `/var/lib/php/sessions/` to open_basedir to allow php sessions storage
- WordOps now check if a repository already exist before trying to adding it again.
- Improved SSL certificate error messages by displaying domain IP and server IP
#### Fixed

View File

@@ -136,8 +136,8 @@ if [ -z "$wo_branch" ]; then
wo_branch=master
fi
fi
readonly wo_log_dir=/var/log/wo/
readonly wo_backup_dir=/var/lib/wo-backup/
readonly wo_log_dir=/var/log/wo
readonly wo_backup_dir=/var/lib/wo-backup
readonly wo_tmp_dir=/var/lib/wo/tmp
readonly wo_install_log=/var/log/wo/install.log
readonly TIME_FORMAT='%d-%b-%Y-%H%M%S'

View File

@@ -199,12 +199,12 @@ class WOStackUpgradeController(CementBaseController):
Log.wait(self, "Upgrading APT Packages")
# additional pre_pref
if ["nginx-custom"] in apt_packages:
if "nginx-custom" in apt_packages:
pre_pref(self, WOVar.wo_nginx)
if ["php7.2-fpm"] in apt_packages:
if "php7.2-fpm" in apt_packages:
WOAptGet.remove(self, ['php7.2-fpm'],
auto=False, purge=True)
if ["php7.3-fpm"] in apt_packages:
if "php7.3-fpm" in apt_packages:
WOAptGet.remove(self, ['php7.3-fpm'],
auto=False, purge=True)
# check if nginx upgrade is blocked
@@ -216,6 +216,8 @@ class WOStackUpgradeController(CementBaseController):
Log.valide(self, "Upgrading APT Packages")
Log.wait(self, "Configuring APT Packages")
post_pref(self, apt_packages, [], True)
if "mariadb-server" in apt_packages:
WOShellExec(self, 'mysql_upgrade')
Log.valide(self, "Configuring APT Packages")
# Post Actions after package updates

View File

@@ -72,6 +72,7 @@ class WOAcme:
return True
def deploycert(self, wo_domain_name):
"""Deploy Let's Encrypt certificates with acme.sh"""
if not os.path.isfile('/etc/letsencrypt/renewal/{0}_ecc/fullchain.cer'
.format(wo_domain_name)):
Log.error(self, 'Certificate not found. Deployment canceled')
@@ -139,11 +140,13 @@ class WOAcme:
.format(domain)).text
if(not domain_ip == server_ip):
Log.warn(
self, "{0} is not pointing to your server IP"
.format(domain))
self, "{0}".format(domain) +
" point to the IP {0}".format(domain_ip) +
" but your server IP is {0}.".format(server_ip) +
"\nUse the flag --force to bypass this check.")
Log.error(
self, "You have to add the "
"proper DNS record", False)
self, "You have to set the "
"proper DNS record for your domain", False)
return False
else:
Log.debug(self, "DNS record are properly set")
@@ -162,9 +165,6 @@ class WOAcme:
if wo_domain_name in row[0]:
# check if cert expiration exist
if not row[3] == '':
cert_exist = True
break
else:
cert_exist = False
return True
certfile.close()
return cert_exist
return False