Improve acme process and error log
This commit is contained in:
@@ -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`
|
- 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
|
- 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.
|
- 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
|
#### Fixed
|
||||||
|
|
||||||
|
|||||||
4
install
4
install
@@ -136,8 +136,8 @@ if [ -z "$wo_branch" ]; then
|
|||||||
wo_branch=master
|
wo_branch=master
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
readonly wo_log_dir=/var/log/wo/
|
readonly wo_log_dir=/var/log/wo
|
||||||
readonly wo_backup_dir=/var/lib/wo-backup/
|
readonly wo_backup_dir=/var/lib/wo-backup
|
||||||
readonly wo_tmp_dir=/var/lib/wo/tmp
|
readonly wo_tmp_dir=/var/lib/wo/tmp
|
||||||
readonly wo_install_log=/var/log/wo/install.log
|
readonly wo_install_log=/var/log/wo/install.log
|
||||||
readonly TIME_FORMAT='%d-%b-%Y-%H%M%S'
|
readonly TIME_FORMAT='%d-%b-%Y-%H%M%S'
|
||||||
|
|||||||
@@ -199,12 +199,12 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
Log.wait(self, "Upgrading APT Packages")
|
Log.wait(self, "Upgrading APT Packages")
|
||||||
|
|
||||||
# additional pre_pref
|
# additional pre_pref
|
||||||
if ["nginx-custom"] in apt_packages:
|
if "nginx-custom" in apt_packages:
|
||||||
pre_pref(self, WOVar.wo_nginx)
|
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'],
|
WOAptGet.remove(self, ['php7.2-fpm'],
|
||||||
auto=False, purge=True)
|
auto=False, purge=True)
|
||||||
if ["php7.3-fpm"] in apt_packages:
|
if "php7.3-fpm" in apt_packages:
|
||||||
WOAptGet.remove(self, ['php7.3-fpm'],
|
WOAptGet.remove(self, ['php7.3-fpm'],
|
||||||
auto=False, purge=True)
|
auto=False, purge=True)
|
||||||
# check if nginx upgrade is blocked
|
# check if nginx upgrade is blocked
|
||||||
@@ -216,6 +216,8 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
Log.valide(self, "Upgrading APT Packages")
|
Log.valide(self, "Upgrading APT Packages")
|
||||||
Log.wait(self, "Configuring APT Packages")
|
Log.wait(self, "Configuring APT Packages")
|
||||||
post_pref(self, apt_packages, [], True)
|
post_pref(self, apt_packages, [], True)
|
||||||
|
if "mariadb-server" in apt_packages:
|
||||||
|
WOShellExec(self, 'mysql_upgrade')
|
||||||
Log.valide(self, "Configuring APT Packages")
|
Log.valide(self, "Configuring APT Packages")
|
||||||
# Post Actions after package updates
|
# Post Actions after package updates
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class WOAcme:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def deploycert(self, wo_domain_name):
|
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'
|
if not os.path.isfile('/etc/letsencrypt/renewal/{0}_ecc/fullchain.cer'
|
||||||
.format(wo_domain_name)):
|
.format(wo_domain_name)):
|
||||||
Log.error(self, 'Certificate not found. Deployment canceled')
|
Log.error(self, 'Certificate not found. Deployment canceled')
|
||||||
@@ -139,11 +140,13 @@ class WOAcme:
|
|||||||
.format(domain)).text
|
.format(domain)).text
|
||||||
if(not domain_ip == server_ip):
|
if(not domain_ip == server_ip):
|
||||||
Log.warn(
|
Log.warn(
|
||||||
self, "{0} is not pointing to your server IP"
|
self, "{0}".format(domain) +
|
||||||
.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(
|
Log.error(
|
||||||
self, "You have to add the "
|
self, "You have to set the "
|
||||||
"proper DNS record", False)
|
"proper DNS record for your domain", False)
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "DNS record are properly set")
|
Log.debug(self, "DNS record are properly set")
|
||||||
@@ -162,9 +165,6 @@ class WOAcme:
|
|||||||
if wo_domain_name in row[0]:
|
if wo_domain_name in row[0]:
|
||||||
# check if cert expiration exist
|
# check if cert expiration exist
|
||||||
if not row[3] == '':
|
if not row[3] == '':
|
||||||
cert_exist = True
|
return True
|
||||||
break
|
|
||||||
else:
|
|
||||||
cert_exist = False
|
|
||||||
certfile.close()
|
certfile.close()
|
||||||
return cert_exist
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user