Updating configuration (#197)
#### Added - [ACME] Display warning about sudo usage when issuing certificate with DNS API validation (require `sudo -E`) #### Changed - [ACME] Resolve domain IP over HTTPS with Cloudflare DNS Resolver - [CORE] Cement Framework updated to v2.10.2 - [SITE] database name = 0 to 16 characters from the site name + 4 randomly generated character - [SITE] database user = 0 to 12 characters from the site name + 4 randomy generated character - [STACK] Improve sysctl tweak deployment #### Fixed - [SITE] https redirection missing on subdomains sites - Issues with digitalocean mariadb repository - Cement Framework output handler issues - [CLEAN] check if Nginx is installed before purging fastcgi or opcache
This commit is contained in:
@@ -58,7 +58,8 @@ class WOAcme:
|
||||
if acmedata['dns'] is True:
|
||||
Log.error(
|
||||
self, "Please make sure your properly "
|
||||
"set your DNS API credentials for acme.sh")
|
||||
"set your DNS API credentials for acme.sh\n"
|
||||
"If you are using sudo, use \"sudo -E wo\"")
|
||||
return False
|
||||
else:
|
||||
Log.error(
|
||||
@@ -145,10 +146,19 @@ class WOAcme:
|
||||
|
||||
def check_dns(self, acme_domains):
|
||||
"""Check if a list of domains point to the server IP"""
|
||||
server_ip = requests.get('http://v4.wordops.eu/').text
|
||||
server_ip = requests.get('https://v4.wordops.eu/').text
|
||||
for domain in acme_domains:
|
||||
domain_ip = requests.get('http://v4.wordops.eu/dns/{0}/'
|
||||
.format(domain)).text
|
||||
url = (
|
||||
"https://cloudflare-dns.com/dns-query?name={0}&type=A"
|
||||
.format(domain))
|
||||
headers = {
|
||||
'accept': 'application/dns-json'
|
||||
}
|
||||
try:
|
||||
response = requests.get(url, headers=headers).json()
|
||||
domain_ip = response["Answer"][0]['data']
|
||||
except requests.RequestException:
|
||||
Log.error(self, 'Resolving domain IP failed')
|
||||
if(not domain_ip == server_ip):
|
||||
Log.warn(
|
||||
self, "{0}".format(domain) +
|
||||
|
||||
@@ -38,10 +38,10 @@ class WOSwap():
|
||||
WOFileUtils.searchreplace(self, "/etc/dphys-swapfile",
|
||||
"#CONF_SWAPFILE=/var/swap",
|
||||
"CONF_SWAPFILE=/wo-swapfile")
|
||||
WOFileUtils.searchreplace(self, "/etc/dphys-swapfile",
|
||||
WOFileUtils.searchreplace(self, "/etc/dphys-swapfile",
|
||||
"#CONF_MAXSWAP=2048",
|
||||
"CONF_MAXSWAP=1024")
|
||||
WOFileUtils.searchreplace(self, "/etc/dphys-swapfile",
|
||||
WOFileUtils.searchreplace(self, "/etc/dphys-swapfile",
|
||||
"#CONF_SWAPSIZE=",
|
||||
"CONF_SWAPSIZE=1024")
|
||||
else:
|
||||
|
||||
@@ -87,11 +87,11 @@ class WOService():
|
||||
output, error_output = sub.communicate()
|
||||
if 'emerg' not in str(error_output):
|
||||
Log.valide(self, "Testing Nginx configuration ")
|
||||
Log.wait(self, "Restarting Nginx ")
|
||||
Log.wait(self, "Restarting Nginx")
|
||||
service_cmd = ('service {0} restart'.format(service_name))
|
||||
retcode = subprocess.getstatusoutput(service_cmd)
|
||||
if retcode[0] == 0:
|
||||
Log.valide(self, "Restarting Nginx ")
|
||||
Log.valide(self, "Restarting Nginx")
|
||||
return True
|
||||
else:
|
||||
Log.failed(self, "Testing Nginx configuration ")
|
||||
|
||||
@@ -14,7 +14,7 @@ class WOVar():
|
||||
"""Intialization of core variables"""
|
||||
|
||||
# WordOps version
|
||||
wo_version = "3.10.2"
|
||||
wo_version = "3.10.3"
|
||||
# WordOps packages versions
|
||||
wo_wp_cli = "2.3.0"
|
||||
wo_adminer = "4.7.3"
|
||||
@@ -170,15 +170,16 @@ class WOVar():
|
||||
wo_clamav = ["clamav", "clamav-freshclam"]
|
||||
wo_ubuntu_backports = 'ppa:jonathonf/backports'
|
||||
|
||||
# Redis repo details
|
||||
# APT repositories
|
||||
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
||||
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
||||
"10.3/{distro} {codename} main"
|
||||
.format(distro=wo_distro,
|
||||
codename=wo_platform_codename))
|
||||
if wo_distro == 'ubuntu':
|
||||
wo_php_repo = "ppa:ondrej/php"
|
||||
wo_redis_repo = ("ppa:chris-lea/redis-server")
|
||||
wo_goaccess_repo = ("ppa:alex-p/goaccess")
|
||||
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
||||
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
||||
"10.3/ubuntu {codename} main"
|
||||
.format(codename=wo_platform_codename))
|
||||
|
||||
else:
|
||||
wo_php_repo = (
|
||||
@@ -187,10 +188,6 @@ class WOVar():
|
||||
wo_php_key = 'AC0E47584A7A714D'
|
||||
wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
|
||||
.format(codename=wo_platform_codename))
|
||||
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
||||
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
||||
"10.3/debian {codename} main"
|
||||
.format(codename=wo_platform_codename))
|
||||
|
||||
wo_redis = ['redis-server']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user