mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 09:46:11 +01:00
centralized execution ph2
This commit is contained in:
@@ -236,14 +236,14 @@ class sslUtilities:
|
||||
|
||||
if not os.path.exists(acmePath):
|
||||
command = 'wget -O - https://get.acme.sh | sh'
|
||||
ProcessUtilities.executioner(command, shell=True)
|
||||
subprocess.call(command, shell=True)
|
||||
|
||||
if aliasDomain == None:
|
||||
|
||||
existingCertPath = '/etc/letsencrypt/live/' + virtualHostName
|
||||
if not os.path.exists(existingCertPath):
|
||||
command = 'mkdir -p ' + existingCertPath
|
||||
ProcessUtilities.executioner(shlex.split(command))
|
||||
subprocess.call(shlex.split(command))
|
||||
|
||||
try:
|
||||
logging.CyberCPLogFileWriter.writeToFile("Trying to obtain SSL for: " + virtualHostName + " and: www." + virtualHostName)
|
||||
@@ -252,7 +252,7 @@ class sslUtilities:
|
||||
+ ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + ' -w ' + sslpath + ' --force'
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
output = subprocess.check_output(shlex.split(command))
|
||||
logging.CyberCPLogFileWriter.writeToFile("Successfully obtained SSL for: " + virtualHostName + " and: www." + virtualHostName)
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ class sslUtilities:
|
||||
command = acmePath + " --issue -d " + virtualHostName + ' --cert-file ' + existingCertPath \
|
||||
+ '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + ' -w ' + sslpath + ' --force'
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
output = subprocess.check_output(shlex.split(command))
|
||||
logging.CyberCPLogFileWriter.writeToFile("Successfully obtained SSL for: " + virtualHostName)
|
||||
except subprocess.CalledProcessError:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Failed to obtain SSL, issuing self-signed SSL for: ' + virtualHostName)
|
||||
@@ -275,7 +275,7 @@ class sslUtilities:
|
||||
existingCertPath = '/etc/letsencrypt/live/' + virtualHostName
|
||||
if not os.path.exists(existingCertPath):
|
||||
command = 'mkdir -p ' + existingCertPath
|
||||
ProcessUtilities.executioner(shlex.split(command))
|
||||
subprocess.call(shlex.split(command))
|
||||
|
||||
try:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
@@ -286,7 +286,7 @@ class sslUtilities:
|
||||
+ ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + ' -w ' + sslpath + ' --force'
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
output = subprocess.check_output(shlex.split(command))
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
"Successfully obtained SSL for: " + virtualHostName + ", www." + virtualHostName + ", " + aliasDomain + "and www." + aliasDomain + ",")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user