mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
Remove SECURITY_INSTALLATION.md and implement SSL reconciliation features in manageSSL module. Add new views and URLs for SSL reconciliation, enhance mobile responsiveness in templates, and update SSL utilities for improved functionality. Update upgrade script for scheduled SSL reconciliation tasks.
This commit is contained in:
@@ -997,4 +997,58 @@ def issueSSLForDomain(domain, adminEmail, sslpath, aliasDomain=None, isHostname=
|
||||
return [0, "210 Failed to install SSL for domain. [issueSSLForDomain]"]
|
||||
|
||||
except BaseException as msg:
|
||||
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
|
||||
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
|
||||
|
||||
@staticmethod
|
||||
def reconcile_ssl_all():
|
||||
"""Reconcile SSL configuration for all domains using the new reconciliation module"""
|
||||
try:
|
||||
from plogical.sslReconcile import SSLReconcile
|
||||
return SSLReconcile.reconcile_all()
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error in reconcile_ssl_all: {str(e)}")
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def reconcile_ssl_domain(domain):
|
||||
"""Reconcile SSL configuration for a specific domain using the new reconciliation module"""
|
||||
try:
|
||||
from plogical.sslReconcile import SSLReconcile
|
||||
return SSLReconcile.reconcile_domain(domain)
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error in reconcile_ssl_domain for {domain}: {str(e)}")
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def fix_acme_challenge_context(virtualHostName):
|
||||
"""Fix ACME challenge context for a specific domain"""
|
||||
try:
|
||||
from plogical.sslReconcile import SSLReconcile
|
||||
|
||||
vconf_path = f"{sslUtilities.Server_root}/conf/vhosts/{virtualHostName}/vhost.conf"
|
||||
|
||||
if not os.path.exists(vconf_path):
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"VHost configuration not found: {vconf_path}")
|
||||
return False
|
||||
|
||||
# Read docRoot from vhost configuration
|
||||
docroot = ""
|
||||
with open(vconf_path, 'r') as f:
|
||||
for line in f:
|
||||
if line.strip().startswith('docRoot'):
|
||||
docroot = line.split()[1]
|
||||
break
|
||||
|
||||
if not docroot:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"No docRoot found for {virtualHostName}")
|
||||
return False
|
||||
|
||||
# Resolve $VH_ROOT variable
|
||||
if docroot.startswith('$VH_ROOT/'):
|
||||
docroot = docroot.replace('$VH_ROOT', f"/home/{virtualHostName}")
|
||||
|
||||
return SSLReconcile.fix_context_location(vconf_path, docroot)
|
||||
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Error fixing ACME challenge context for {virtualHostName}: {str(e)}")
|
||||
return False
|
||||
Reference in New Issue
Block a user