Fix subdomains detection for acme

This commit is contained in:
VirtuBox
2019-10-12 11:07:25 +02:00
parent 8c8a092510
commit 3c0498c4ad
4 changed files with 21 additions and 21 deletions

View File

@@ -37,16 +37,17 @@ class WODomain():
if os.path.isfile("/var/lib/wo/public_suffix_list.dat"): if os.path.isfile("/var/lib/wo/public_suffix_list.dat"):
# Read mode opens a file for reading only. # Read mode opens a file for reading only.
suffix_file = open( suffix_file = open(
"/var/lib/wo/public_suffix_list.dat", encoding='utf-8', ) "/var/lib/wo/public_suffix_list.dat", encoding='utf-8')
# Read all the lines into a list. # Read all the lines into a list.
for domain_suffix in suffix_file: for domain_suffix in suffix_file:
if (str(domain_suffix).strip()) == ('.'.join(domain_name[1:])): if (str(domain_suffix).strip()) == ('.'.join(domain_name[1:])):
domain_type = 'domain' domain_type = 'domain'
root_domain = ('.'.join(domain_name[0:]))
break break
else: else:
domain_type = 'subdomain' domain_type = 'subdomain'
root_domain = ('.'.join(domain_name[1:]))
suffix_file.close() suffix_file.close()
if domain_type == 'domain':
root_domain = ('.'.join(domain_name[0:]))
else:
root_domain = ('.'.join(domain_name[1:]))
return (domain_type, root_domain) return (domain_type, root_domain)
return ('other', domain)

View File

@@ -8,7 +8,7 @@ Render Templates
""" """
class WOTemplate(): class WOTemplate:
"""WordOps template utilities""" """WordOps template utilities"""
def deploy(self, fileconf, template, data, overwrite=True): def deploy(self, fileconf, template, data, overwrite=True):

View File

@@ -140,21 +140,20 @@ class WOVar():
wo_php_extra = ["php-memcached", "php-imagick", wo_php_extra = ["php-memcached", "php-imagick",
"graphviz", "php-xdebug", "php-msgpack", "php-redis"] "graphviz", "php-xdebug", "php-msgpack", "php-redis"]
if not wo_distro == 'raspbian': wo_mysql = ["mariadb-server", "percona-toolkit"]
if (not wo_platform_codename == 'jessie'): if wo_distro == 'raspbian':
wo_mysql = ["mariadb-server", "percona-toolkit", wo_mysql = wo_mysql + ["python3-mysqldb"]
"python3-mysqldb", "mariadb-backup"]
else: else:
wo_mysql = ["mariadb-server", "percona-toolkit",
"python3-mysql.connector"]
else:
wo_mysql = ["mariadb-server", "percona-toolkit",
"python3-mysqldb"]
if wo_platform_codename == 'jessie': if wo_platform_codename == 'jessie':
wo_mysql_client = ["mariadb-client", "python3-mysqldb"] wo_mysql = wo_mysql + ["python3-mysql.connector"]
else: else:
wo_mysql_client = ["mariadb-client", "python3-mysql.connector"] wo_mysql = wo_mysql + ["python3-mysqldb", "mariadb-backup"]
wo_mysql_client = ["mariadb-client"]
if wo_platform_codename == 'jessie':
wo_mysql_client = wo_mysql_client + ["python3-mysqldb"]
else:
wo_mysql_client = wo_mysql_client + ["python3-mysql.connector"]
wo_fail2ban = ["fail2ban"] wo_fail2ban = ["fail2ban"]
wo_clamav = ["clamav", "clamav-freshclam"] wo_clamav = ["clamav", "clamav-freshclam"]