mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-30 01:36:30 +01:00
This commit is contained in:
9
.idea/workspace.xml
generated
9
.idea/workspace.xml
generated
@@ -6,6 +6,12 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="5251c5c9-f2a1-41f2-bc76-10b517091df1" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/loginSystem/views.py" beforeDir="false" afterPath="$PROJECT_DIR$/loginSystem/views.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/plogical/adminPass.py" beforeDir="false" afterPath="$PROJECT_DIR$/plogical/adminPass.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/plogical/customACME.py" beforeDir="false" afterPath="$PROJECT_DIR$/plogical/customACME.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/plogical/sslUtilities.py" beforeDir="false" afterPath="$PROJECT_DIR$/plogical/sslUtilities.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/plogical/sslv2.py" beforeDir="false" afterPath="$PROJECT_DIR$/plogical/sslv2.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/websiteFunctions/views.py" beforeDir="false" afterPath="$PROJECT_DIR$/websiteFunctions/views.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -48,7 +54,7 @@
|
||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"SHELLCHECK.PATH": "/Users/cyberpersons/Library/Application Support/JetBrains/PyCharm2025.1/plugins/Shell Script/shellcheck",
|
||||
"git-widget-placeholder": "stable",
|
||||
"git-widget-placeholder": "v2.4.3",
|
||||
"last_opened_file_path": "/Users/cyberpersons/cyberpanel",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
@@ -117,6 +123,7 @@
|
||||
<workItem from="1754429757112" duration="3503000" />
|
||||
<workItem from="1754433799097" duration="517000" />
|
||||
<workItem from="1754448353513" duration="2970000" />
|
||||
<workItem from="1754511414251" duration="12135000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
@@ -222,7 +222,7 @@ def loadLoginPage(request):
|
||||
|
||||
token = hashPassword.generateToken('admin', '1234567')
|
||||
|
||||
email = 'example@example.org'
|
||||
email = 'admin@cyberpanel.net'
|
||||
admin = Administrator(userName="admin", password=password, type=1, email=email,
|
||||
firstName="Cyber", lastName="Panel", acl=acl, token=token)
|
||||
admin.save()
|
||||
|
||||
@@ -47,7 +47,7 @@ def main():
|
||||
acl = ACL.objects.get(name='admin')
|
||||
token = hashPassword.generateToken('admin', adminPass)
|
||||
|
||||
email = 'example@example.org'
|
||||
email = 'admin@cyberpanel.net'
|
||||
admin = Administrator(userName="admin", password=hashPassword.hash_password(adminPass), type=1, email=email,
|
||||
firstName="Cyber", lastName="Panel", acl=acl, token=token)
|
||||
admin.save()
|
||||
|
||||
@@ -17,10 +17,12 @@ from plogical import CyberCPLogFileWriter as logging
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
import socket
|
||||
|
||||
|
||||
class CustomACME:
|
||||
def __init__(self, domain, admin_email, staging=False, provider='letsencrypt'):
|
||||
"""Initialize CustomACME"""
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Initializing CustomACME for domain: {domain}, email: {admin_email}, staging: {staging}, provider: {provider}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Initializing CustomACME for domain: {domain}, email: {admin_email}, staging: {staging}, provider: {provider}')
|
||||
self.domain = domain
|
||||
self.admin_email = admin_email
|
||||
self.staging = staging
|
||||
@@ -55,7 +57,8 @@ class CustomACME:
|
||||
self.cert_path = f'/etc/letsencrypt/live/{domain}'
|
||||
self.challenge_path = '/usr/local/lsws/Example/html/.well-known/acme-challenge'
|
||||
self.account_key_path = f'/etc/letsencrypt/accounts/{domain}.key'
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Certificate path: {self.cert_path}, Challenge path: {self.challenge_path}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Certificate path: {self.cert_path}, Challenge path: {self.challenge_path}')
|
||||
|
||||
# Create accounts directory if it doesn't exist
|
||||
os.makedirs('/etc/letsencrypt/accounts', exist_ok=True)
|
||||
@@ -82,7 +85,8 @@ class CustomACME:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Fetching ACME directory from {self.acme_directory}')
|
||||
response = requests.get(self.acme_directory)
|
||||
self.directory = response.json()
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Successfully fetched ACME directory: {json.dumps(self.directory)}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Successfully fetched ACME directory: {json.dumps(self.directory)}')
|
||||
return True
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Error getting directory: {str(e)}')
|
||||
@@ -197,13 +201,10 @@ class CustomACME:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Creating final JWS...')
|
||||
jws = {
|
||||
"protected": protected_b64,
|
||||
"payload": payload_b64, # Always include payload field, even if empty
|
||||
"signature": signature_b64
|
||||
}
|
||||
|
||||
# Only add payload if it exists
|
||||
if payload is not None:
|
||||
jws["payload"] = payload_b64
|
||||
|
||||
# Ensure the JWS is properly formatted
|
||||
jws_str = json.dumps(jws, separators=(',', ':'))
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Final JWS: {jws_str}')
|
||||
@@ -259,14 +260,17 @@ class CustomACME:
|
||||
}
|
||||
|
||||
# Check if External Account Binding is required (for ZeroSSL)
|
||||
if self.provider == 'zerossl' and 'meta' in self.directory and 'externalAccountRequired' in self.directory['meta']:
|
||||
if self.provider == 'zerossl' and 'meta' in self.directory and 'externalAccountRequired' in self.directory[
|
||||
'meta']:
|
||||
if self.directory['meta']['externalAccountRequired']:
|
||||
logging.CyberCPLogFileWriter.writeToFile('ZeroSSL requires External Account Binding, getting EAB credentials...')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'ZeroSSL requires External Account Binding, getting EAB credentials...')
|
||||
|
||||
# Get EAB credentials from ZeroSSL
|
||||
eab_kid, eab_hmac_key = self._get_zerossl_eab_credentials()
|
||||
if not eab_kid or not eab_hmac_key:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Failed to get ZeroSSL EAB credentials, falling back to Let\'s Encrypt')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Failed to get ZeroSSL EAB credentials, falling back to Let\'s Encrypt')
|
||||
# Fallback to Let's Encrypt
|
||||
self.provider = 'letsencrypt'
|
||||
self.acme_directory = "https://acme-v02.api.letsencrypt.org/directory"
|
||||
@@ -294,12 +298,14 @@ class CustomACME:
|
||||
|
||||
if response.status_code == 201:
|
||||
self.account_url = response.headers['Location']
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Successfully created account. Account URL: {self.account_url}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Successfully created account. Account URL: {self.account_url}')
|
||||
# Save the account key for future use
|
||||
self._save_account_key()
|
||||
return True
|
||||
elif response.status_code == 429:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Rate limit hit for account creation. Using staging environment...')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Rate limit hit for account creation. Using staging environment...')
|
||||
self.staging = True
|
||||
self.acme_directory = "https://acme-staging-v02.api.letsencrypt.org/directory"
|
||||
# Get new directory and nonce for staging
|
||||
@@ -645,17 +651,20 @@ class CustomACME:
|
||||
order_status = response.json().get('status')
|
||||
if order_status == 'valid':
|
||||
self.certificate_url = response.json().get('certificate')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Successfully finalized order. Certificate URL: {self.certificate_url}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Successfully finalized order. Certificate URL: {self.certificate_url}')
|
||||
return True
|
||||
elif order_status == 'invalid':
|
||||
logging.CyberCPLogFileWriter.writeToFile('Order validation failed')
|
||||
return False
|
||||
elif order_status == 'processing':
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Order still processing, attempt {attempt + 1}/{max_attempts}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Order still processing, attempt {attempt + 1}/{max_attempts}')
|
||||
time.sleep(delay)
|
||||
continue
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Order status check failed, attempt {attempt + 1}/{max_attempts}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Order status check failed, attempt {attempt + 1}/{max_attempts}')
|
||||
time.sleep(delay)
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile('Order processing timed out')
|
||||
@@ -671,15 +680,30 @@ class CustomACME:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Downloading certificate...')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Certificate URL: {self.certificate_url}')
|
||||
|
||||
# For certificate downloads, we can use a simple GET request
|
||||
response = requests.get(self.certificate_url)
|
||||
# Get a fresh nonce for the request
|
||||
if not self._get_nonce():
|
||||
logging.CyberCPLogFileWriter.writeToFile('Failed to get nonce for certificate download')
|
||||
return None
|
||||
|
||||
# Use POST-as-GET for certificate download (ACME v2 requirement)
|
||||
jws = self._create_jws(None, self.certificate_url)
|
||||
if not jws:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Failed to create JWS for certificate download')
|
||||
return None
|
||||
|
||||
headers = {
|
||||
'Content-Type': 'application/jose+json'
|
||||
}
|
||||
response = requests.post(self.certificate_url, data=jws, headers=headers)
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Certificate download response status: {response.status_code}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Certificate download response headers: {response.headers}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Certificate download response content: {response.text}')
|
||||
|
||||
if response.status_code == 200:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Successfully downloaded certificate')
|
||||
return response.content
|
||||
# The response should be the PEM-encoded certificate chain
|
||||
return response.text.encode('utf-8') if isinstance(response.text, str) else response.content
|
||||
else:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Certificate download failed: {response.text}')
|
||||
return None
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Error downloading certificate: {str(e)}')
|
||||
@@ -715,7 +739,8 @@ class CustomACME:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Challenge validation failed')
|
||||
return False
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Challenge still pending, attempt {attempt + 1}/{max_attempts}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Challenge still pending, attempt {attempt + 1}/{max_attempts}')
|
||||
time.sleep(delay)
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile('Challenge validation timed out')
|
||||
@@ -876,11 +901,13 @@ class CustomACME:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Order validation failed')
|
||||
return False
|
||||
elif order_status == 'processing':
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Order still processing, attempt {attempt + 1}/{max_attempts}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Order still processing, attempt {attempt + 1}/{max_attempts}')
|
||||
time.sleep(delay)
|
||||
continue
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Order status check failed, attempt {attempt + 1}/{max_attempts}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Order status check failed, attempt {attempt + 1}/{max_attempts}')
|
||||
time.sleep(delay)
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile('Order processing timed out')
|
||||
@@ -892,7 +919,8 @@ class CustomACME:
|
||||
def issue_certificate(self, domains, use_dns=False):
|
||||
"""Main method to issue certificate"""
|
||||
try:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Starting certificate issuance for domains: {domains}, use_dns: {use_dns}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Starting certificate issuance for domains: {domains}, use_dns: {use_dns}')
|
||||
|
||||
# Try to load existing account key first
|
||||
if self._load_account_key():
|
||||
|
||||
@@ -6,6 +6,7 @@ import shlex
|
||||
import subprocess
|
||||
import socket
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
|
||||
try:
|
||||
from websiteFunctions.models import ChildDomains, Websites
|
||||
except:
|
||||
@@ -14,7 +15,6 @@ from plogical.acl import ACLManager
|
||||
|
||||
|
||||
class sslUtilities:
|
||||
|
||||
Server_root = "/usr/local/lsws"
|
||||
redisConf = '/usr/local/lsws/conf/dvhost_redis.conf'
|
||||
|
||||
@@ -108,7 +108,8 @@ class sslUtilities:
|
||||
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||
except TypeError:
|
||||
# Fallback for Python < 3.7
|
||||
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
|
||||
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
|
||||
# If there's any output, the domain has A records
|
||||
if result.stdout.strip():
|
||||
@@ -120,7 +121,8 @@ class sslUtilities:
|
||||
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
||||
except TypeError:
|
||||
# Fallback for Python < 3.7
|
||||
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
|
||||
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
|
||||
if result.stdout.strip():
|
||||
return True
|
||||
@@ -164,7 +166,6 @@ class sslUtilities:
|
||||
except BaseException as msg:
|
||||
return 0, str(msg)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def CheckIfSSLNeedsToBeIssued(virtualHostName):
|
||||
#### if website already have an SSL, better not issue again - need to check for wild-card
|
||||
@@ -177,7 +178,6 @@ class sslUtilities:
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'SSL provider for {virtualHostName} is {SSLProvider}.')
|
||||
|
||||
|
||||
#### totally seprate check to see if both non-www and www are covered
|
||||
|
||||
if SSLProvider == "(STAGING) Let's Encrypt":
|
||||
@@ -189,7 +189,8 @@ class sslUtilities:
|
||||
if len(domains) > 1:
|
||||
### need further checks here to see if ssl is valid for less then 15 days etc
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'[CheckIfSSLNeedsToBeIssued] SSL exists for %s and both versions are covered, just need to ensure if SSL is valid for less then 15 days.' % (virtualHostName), 0)
|
||||
'[CheckIfSSLNeedsToBeIssued] SSL exists for %s and both versions are covered, just need to ensure if SSL is valid for less then 15 days.' % (
|
||||
virtualHostName), 0)
|
||||
pass
|
||||
else:
|
||||
return sslUtilities.ISSUE_SSL
|
||||
@@ -202,7 +203,7 @@ class sslUtilities:
|
||||
now = datetime.now()
|
||||
diff = finalDate - now
|
||||
|
||||
if int(diff.days) >= 15 and SSLProvider!='Denial':
|
||||
if int(diff.days) >= 15 and SSLProvider != 'Denial':
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'[CheckIfSSLNeedsToBeIssued] SSL exists for %s and is not ready to fetch new SSL., skipping..' % (
|
||||
virtualHostName), 0)
|
||||
@@ -261,7 +262,6 @@ class sslUtilities:
|
||||
return str(msg)
|
||||
return 0
|
||||
|
||||
|
||||
@staticmethod
|
||||
def checkSSLIPv6Listener():
|
||||
try:
|
||||
@@ -271,7 +271,8 @@ class sslUtilities:
|
||||
return 1
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [IO Error with main config file [checkSSLIPv6Listener]]")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
str(msg) + " [IO Error with main config file [checkSSLIPv6Listener]]")
|
||||
return str(msg)
|
||||
return 0
|
||||
|
||||
@@ -350,7 +351,8 @@ class sslUtilities:
|
||||
# If conflicts found, log them and return
|
||||
if conflicts:
|
||||
conflict_message = 'Configuration conflicts found: ' + '; '.join(conflicts)
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Configuration conflicts for {virtualHostName}: {conflict_message}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Configuration conflicts for {virtualHostName}: {conflict_message}')
|
||||
return 0, conflict_message
|
||||
|
||||
# Create challenge directory if it doesn't exist
|
||||
@@ -397,7 +399,8 @@ context /.well-known/acme-challenge {
|
||||
for line in lines:
|
||||
f.write(line)
|
||||
if line.find('DocumentRoot /home/') > -1 and check == 0:
|
||||
f.write(' Alias /.well-known/acme-challenge /usr/local/lsws/Example/html/.well-known/acme-challenge\n')
|
||||
f.write(
|
||||
' Alias /.well-known/acme-challenge /usr/local/lsws/Example/html/.well-known/acme-challenge\n')
|
||||
check = 1
|
||||
except IOError as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Error writing Apache configuration: {str(e)}')
|
||||
@@ -407,7 +410,8 @@ context /.well-known/acme-challenge {
|
||||
try:
|
||||
from plogical import installUtilities
|
||||
installUtilities.installUtilities.reStartLiteSpeed()
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Successfully configured ACME challenge for {virtualHostName}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f'Successfully configured ACME challenge for {virtualHostName}')
|
||||
return 1, 'Successfully configured ACME challenge'
|
||||
except Exception as e:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Error restarting LiteSpeed: {str(e)}')
|
||||
@@ -418,7 +422,7 @@ context /.well-known/acme-challenge {
|
||||
return 0, f'Unexpected error: {str(e)}'
|
||||
|
||||
@staticmethod
|
||||
def installSSLForDomain(virtualHostName, adminEmail='example@example.org'):
|
||||
def installSSLForDomain(virtualHostName, adminEmail='domain@cyberpanel.net'):
|
||||
|
||||
try:
|
||||
website = Websites.objects.get(domain=virtualHostName)
|
||||
@@ -674,6 +678,14 @@ context /.well-known/acme-challenge {
|
||||
import json
|
||||
import socket
|
||||
|
||||
# Replace example.org emails with domain-specific email
|
||||
if adminEmail and ('example.org' in adminEmail or 'example.com' in adminEmail):
|
||||
import re
|
||||
# Remove special characters and create domain-based email
|
||||
clean_domain = re.sub(r'[^a-zA-Z0-9]', '', virtualHostName)
|
||||
adminEmail = f'{clean_domain}@cyberpanel.net'
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Replacing invalid email with {adminEmail}')
|
||||
|
||||
Status = 1
|
||||
|
||||
if sslUtilities.CheckIfSSLNeedsToBeIssued(virtualHostName) == sslUtilities.ISSUE_SSL:
|
||||
@@ -700,18 +712,22 @@ context /.well-known/acme-challenge {
|
||||
# Check if www subdomain has DNS records before adding it (skip for hostnames)
|
||||
if not isHostname and sslUtilities.checkDNSRecords(f'www.{virtualHostName}'):
|
||||
domains.append(f'www.{virtualHostName}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{virtualHostName} has DNS records, including in SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{virtualHostName} has DNS records, including in SSL request")
|
||||
elif not isHostname:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{virtualHostName} has no DNS records, excluding from SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{virtualHostName} has no DNS records, excluding from SSL request")
|
||||
|
||||
if aliasDomain:
|
||||
domains.append(aliasDomain)
|
||||
# Check if www.aliasDomain has DNS records
|
||||
if sslUtilities.checkDNSRecords(f'www.{aliasDomain}'):
|
||||
domains.append(f'www.{aliasDomain}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{aliasDomain} has DNS records, including in SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{aliasDomain} has DNS records, including in SSL request")
|
||||
else:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{aliasDomain} has no DNS records, excluding from SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{aliasDomain} has no DNS records, excluding from SSL request")
|
||||
|
||||
# Check if Cloudflare is used
|
||||
use_dns = False
|
||||
@@ -750,18 +766,22 @@ context /.well-known/acme-challenge {
|
||||
# Check if www subdomain has DNS records before adding it (skip for hostnames)
|
||||
if not isHostname and sslUtilities.checkDNSRecords(f'www.{virtualHostName}'):
|
||||
domains.append(f'www.{virtualHostName}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{virtualHostName} has DNS records, including in SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{virtualHostName} has DNS records, including in SSL request")
|
||||
elif not isHostname:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{virtualHostName} has no DNS records, excluding from SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{virtualHostName} has no DNS records, excluding from SSL request")
|
||||
|
||||
if aliasDomain:
|
||||
domains.append(aliasDomain)
|
||||
# Check if www.aliasDomain has DNS records
|
||||
if sslUtilities.checkDNSRecords(f'www.{aliasDomain}'):
|
||||
domains.append(f'www.{aliasDomain}')
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{aliasDomain} has DNS records, including in SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{aliasDomain} has DNS records, including in SSL request")
|
||||
else:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{aliasDomain} has no DNS records, excluding from SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{aliasDomain} has no DNS records, excluding from SSL request")
|
||||
|
||||
acme = CustomACME(virtualHostName, adminEmail, staging=False, provider='zerossl')
|
||||
if acme.issue_certificate(domains, use_dns=use_dns):
|
||||
@@ -794,9 +814,11 @@ context /.well-known/acme-challenge {
|
||||
# Check if www subdomain has DNS records (skip for hostnames)
|
||||
if not isHostname and sslUtilities.checkDNSRecords(f'www.{virtualHostName}'):
|
||||
domain_list += " -d www." + virtualHostName
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{virtualHostName} has DNS records, including in acme.sh SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{virtualHostName} has DNS records, including in acme.sh SSL request")
|
||||
elif not isHostname:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"www.{virtualHostName} has no DNS records, excluding from acme.sh SSL request")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"www.{virtualHostName} has no DNS records, excluding from acme.sh SSL request")
|
||||
|
||||
command = acmePath + " --issue" + domain_list \
|
||||
+ ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
@@ -807,7 +829,8 @@ context /.well-known/acme-challenge {
|
||||
result = subprocess.run(command, capture_output=True, universal_newlines=True, shell=True)
|
||||
except TypeError:
|
||||
# Fallback for Python < 3.7
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True)
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True, shell=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
command = acmePath + " --issue" + domain_list \
|
||||
@@ -819,7 +842,8 @@ context /.well-known/acme-challenge {
|
||||
result = subprocess.run(command, capture_output=True, universal_newlines=True, shell=True)
|
||||
except TypeError:
|
||||
# Fallback for Python < 3.7
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True)
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True, shell=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
@@ -860,7 +884,8 @@ context /.well-known/acme-challenge {
|
||||
result = subprocess.run(command, capture_output=True, universal_newlines=True, shell=True)
|
||||
except TypeError:
|
||||
# Fallback for Python < 3.7
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True)
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True, shell=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
return 1
|
||||
@@ -910,7 +935,8 @@ def issueSSLForDomain(domain, adminEmail, sslpath, aliasDomain=None, isHostname=
|
||||
|
||||
# For expired certificates, use --issue --force instead of --renew
|
||||
if is_expired:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Certificate is expired, using --issue --force for {domain}")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
f"Certificate is expired, using --issue --force for {domain}")
|
||||
command = f'{acmePath} --issue {renewal_domains} --webroot /usr/local/lsws/Example/html --force'
|
||||
else:
|
||||
# Try to renew with explicit webroot
|
||||
@@ -920,7 +946,8 @@ def issueSSLForDomain(domain, adminEmail, sslpath, aliasDomain=None, isHostname=
|
||||
result = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
except TypeError:
|
||||
# Fallback for Python < 3.7
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True)
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
universal_newlines=True, shell=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f"Successfully renewed SSL for {domain}")
|
||||
@@ -948,13 +975,16 @@ def issueSSLForDomain(domain, adminEmail, sslpath, aliasDomain=None, isHostname=
|
||||
|
||||
if os.path.exists(pathToStoreSSLFullChain):
|
||||
import OpenSSL
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, open(pathToStoreSSLFullChain, 'r').read())
|
||||
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
|
||||
open(pathToStoreSSLFullChain, 'r').read())
|
||||
SSLProvider = x509.get_issuer().get_components()[1][1].decode('utf-8')
|
||||
|
||||
if SSLProvider != 'Denial':
|
||||
if sslUtilities.installSSLForDomain(domain) == 1:
|
||||
logging.CyberCPLogFileWriter.writeToFile("We are not able to get new SSL for " + domain + ". But there is an existing SSL, it might only be for the main domain (excluding www).")
|
||||
return [1, "We are not able to get new SSL for " + domain + ". But there is an existing SSL, it might only be for the main domain (excluding www)." + " [issueSSLForDomain]"]
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
"We are not able to get new SSL for " + domain + ". But there is an existing SSL, it might only be for the main domain (excluding www).")
|
||||
return [1,
|
||||
"We are not able to get new SSL for " + domain + ". But there is an existing SSL, it might only be for the main domain (excluding www)." + " [issueSSLForDomain]"]
|
||||
|
||||
command = 'openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=' + domain + '" -keyout ' + pathToStoreSSLPrivKey + ' -out ' + pathToStoreSSLFullChain
|
||||
cmd = shlex.split(command)
|
||||
|
||||
@@ -10,6 +10,7 @@ import socket
|
||||
|
||||
from plogical.acl import ACLManager
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
|
||||
try:
|
||||
from websiteFunctions.models import ChildDomains, Websites
|
||||
except:
|
||||
@@ -17,7 +18,6 @@ except:
|
||||
|
||||
|
||||
class sslUtilities:
|
||||
|
||||
Server_root = "/usr/local/lsws"
|
||||
redisConf = '/usr/local/lsws/conf/dvhost_redis.conf'
|
||||
|
||||
@@ -57,7 +57,6 @@ class sslUtilities:
|
||||
return str(msg)
|
||||
return 0
|
||||
|
||||
|
||||
@staticmethod
|
||||
def checkSSLIPv6Listener():
|
||||
try:
|
||||
@@ -67,7 +66,8 @@ class sslUtilities:
|
||||
return 1
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [IO Error with main config file [checkSSLIPv6Listener]]")
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
str(msg) + " [IO Error with main config file [checkSSLIPv6Listener]]")
|
||||
return str(msg)
|
||||
return 0
|
||||
|
||||
@@ -84,7 +84,7 @@ class sslUtilities:
|
||||
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
|
||||
|
||||
@staticmethod
|
||||
def installSSLForDomain(virtualHostName, adminEmail='example@example.org'):
|
||||
def installSSLForDomain(virtualHostName, adminEmail='domain@cyberpanel.net'):
|
||||
|
||||
try:
|
||||
website = Websites.objects.get(domain=virtualHostName)
|
||||
@@ -332,7 +332,6 @@ class sslUtilities:
|
||||
ProcessUtilities.executioner(command)
|
||||
return 1
|
||||
|
||||
|
||||
@staticmethod
|
||||
def FindIfDomainInCloudflare(virtualHostName):
|
||||
try:
|
||||
@@ -403,6 +402,14 @@ class sslUtilities:
|
||||
|
||||
@staticmethod
|
||||
def obtainSSLForADomain(virtualHostName, adminEmail, sslpath, aliasDomain=None):
|
||||
# Replace example.org emails with domain-specific email
|
||||
if adminEmail and ('example.org' in adminEmail or 'example.com' in adminEmail):
|
||||
import re
|
||||
# Remove special characters and create domain-based email
|
||||
clean_domain = re.sub(r'[^a-zA-Z0-9]', '', virtualHostName)
|
||||
adminEmail = f'{clean_domain}@cyberpanel.net'
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Replacing invalid email with {adminEmail}')
|
||||
|
||||
sender_email = 'root@%s' % (socket.gethostname())
|
||||
|
||||
CF_Check = 0
|
||||
@@ -419,7 +426,6 @@ class sslUtilities:
|
||||
if SSLProvider != 'Denial':
|
||||
return 1, 'This domain already have a valid SSL.'
|
||||
|
||||
|
||||
CF_Check, message = sslUtilities.FindIfDomainInCloudflare(virtualHostName)
|
||||
|
||||
DNS_TO_USE = ''
|
||||
@@ -456,8 +462,8 @@ class sslUtilities:
|
||||
command = acmePath + f" --issue -d {virtualHostName} -d *.{virtualHostName}" \
|
||||
+ ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + f' --dns {DNS_TO_USE} -k ec-256 --force --server letsencrypt --dnssleep 20'
|
||||
#ResultText = open(logging.CyberCPLogFileWriter.fileName, 'r').read()
|
||||
#CurrentMessage = "Trying to obtain SSL for: " + virtualHostName + " and: www." + virtualHostName
|
||||
# ResultText = open(logging.CyberCPLogFileWriter.fileName, 'r').read()
|
||||
# CurrentMessage = "Trying to obtain SSL for: " + virtualHostName + " and: www." + virtualHostName
|
||||
# logging.CyberCPLogFileWriter.writeToFile(CurrentMessage, 0)
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(command, 0)
|
||||
@@ -480,7 +486,7 @@ class sslUtilities:
|
||||
+ '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + f' --dns {DNS_TO_USE} -k ec-256 --force --server letsencrypt --dnssleep 20'
|
||||
|
||||
#ResultText = open(logging.CyberCPLogFileWriter.fileName, 'r').read()
|
||||
# ResultText = open(logging.CyberCPLogFileWriter.fileName, 'r').read()
|
||||
CurrentMessage = '%s\nTrying to obtain SSL for: %s' % (finalText, virtualHostName)
|
||||
|
||||
finalText = '%s\nTrying to obtain SSL for: %s' % (finalText, virtualHostName)
|
||||
@@ -494,8 +500,10 @@ class sslUtilities:
|
||||
'SSL Notification for %s.' % (virtualHostName))
|
||||
|
||||
except subprocess.CalledProcessError:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Failed to obtain SSL, issuing self-signed SSL for: ' + virtualHostName, 0)
|
||||
logging.CyberCPLogFileWriter.SendEmail(sender_email, adminEmail, 'Failed to obtain SSL, issuing self-signed SSL for: ' + virtualHostName,
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Failed to obtain SSL, issuing self-signed SSL for: ' + virtualHostName, 0)
|
||||
logging.CyberCPLogFileWriter.SendEmail(sender_email, adminEmail,
|
||||
'Failed to obtain SSL, issuing self-signed SSL for: ' + virtualHostName,
|
||||
'SSL Notification for %s.' % (virtualHostName))
|
||||
return 0, output
|
||||
else:
|
||||
@@ -510,7 +518,7 @@ class sslUtilities:
|
||||
"Trying to obtain SSL for: " + virtualHostName + ", www." + virtualHostName + ", " + aliasDomain + " and www." + aliasDomain + ",")
|
||||
|
||||
command = acmePath + " --issue -d " + virtualHostName + " -d www." + virtualHostName \
|
||||
+ ' -d ' + aliasDomain + ' -d www.' + aliasDomain\
|
||||
+ ' -d ' + aliasDomain + ' -d www.' + aliasDomain \
|
||||
+ ' --cert-file ' + existingCertPath + '/cert.pem' + ' --key-file ' + existingCertPath + '/privkey.pem' \
|
||||
+ ' --fullchain-file ' + existingCertPath + '/fullchain.pem' + f' --dns {DNS_TO_USE} -k ec-256 --force --server letsencrypt --dnssleep 20'
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import json
|
||||
import plogical.CyberCPLogFileWriter as logging
|
||||
from plogical.acl import ACLManager
|
||||
|
||||
|
||||
from plogical.httpProc import httpProc
|
||||
from websiteFunctions.models import wpplugins
|
||||
from websiteFunctions.website import WebsiteManager
|
||||
@@ -26,6 +25,7 @@ from plogical.processUtilities import ProcessUtilities
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
def loadWebsitesHome(request):
|
||||
val = request.session['userID']
|
||||
admin = Administrator.objects.get(pk=val)
|
||||
@@ -33,6 +33,7 @@ def loadWebsitesHome(request):
|
||||
{"type": admin.type})
|
||||
return proc.render()
|
||||
|
||||
|
||||
def createWebsite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -40,14 +41,17 @@ def createWebsite(request):
|
||||
return wm.createWebsite(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def WPCreate(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
wm = WebsiteManager()
|
||||
return wm.WPCreate(request, userID,)
|
||||
return wm.WPCreate(request, userID, )
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def ListWPSites(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -57,6 +61,7 @@ def ListWPSites(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def WPHome(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -67,6 +72,8 @@ def WPHome(request):
|
||||
return wm.WPHome(request, userID, WPid, DeleteID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def RestoreHome(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -88,6 +95,7 @@ def RemoteBackupConfig(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def BackupfileConfig(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -99,6 +107,7 @@ def BackupfileConfig(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def AddRemoteBackupsite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -106,18 +115,20 @@ def AddRemoteBackupsite(request):
|
||||
ID = request.GET.get('ID')
|
||||
DeleteSiteID = request.GET.get('DeleteID')
|
||||
wm = WebsiteManager()
|
||||
return wm.AddRemoteBackupsite(request, userID, ID,DeleteSiteID )
|
||||
return wm.AddRemoteBackupsite(request, userID, ID, DeleteSiteID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def WordpressPricing(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
wm = WebsiteManager()
|
||||
return wm.WordpressPricing(request, userID,)
|
||||
return wm.WordpressPricing(request, userID, )
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def RestoreBackups(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -128,6 +139,7 @@ def RestoreBackups(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def AutoLogin(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -136,6 +148,8 @@ def AutoLogin(request):
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def ConfigurePlugins(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -147,13 +161,14 @@ def ConfigurePlugins(request):
|
||||
jobobj.delete()
|
||||
Deleted = 1
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile("DeleteFileID ....... %s....msg.....%s" % (DeleteFileID,msg))
|
||||
logging.CyberCPLogFileWriter.writeToFile("DeleteFileID ....... %s....msg.....%s" % (DeleteFileID, msg))
|
||||
Deleted = 0
|
||||
wm = WebsiteManager()
|
||||
return wm.ConfigurePlugins(request, userID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def Addnewplugin(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -163,8 +178,6 @@ def Addnewplugin(request):
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
|
||||
|
||||
def SearchOnkeyupPlugin(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -352,6 +365,7 @@ def fetchstaging(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchDatabase(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -373,6 +387,7 @@ def fetchDatabase(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def SaveUpdateConfig(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -394,27 +409,29 @@ def SaveUpdateConfig(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def DeploytoProduction(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
#result = pluginManager.preWebsiteCreation(request)
|
||||
# result = pluginManager.preWebsiteCreation(request)
|
||||
|
||||
#if result != 200:
|
||||
# if result != 200:
|
||||
# return result
|
||||
|
||||
wm = WebsiteManager()
|
||||
return wm.DeploytoProduction(userID, json.loads(request.body))
|
||||
|
||||
#result = pluginManager.postWebsiteCreation(request, coreResult)
|
||||
#if result != 200:
|
||||
# result = pluginManager.postWebsiteCreation(request, coreResult)
|
||||
# if result != 200:
|
||||
# return result
|
||||
|
||||
#return coreResult
|
||||
# return coreResult
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def WPCreateBackup(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -437,7 +454,6 @@ def WPCreateBackup(request):
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
|
||||
def RestoreWPbackupNow(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -480,6 +496,7 @@ def SaveBackupConfig(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def SaveBackupSchedule(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -500,6 +517,7 @@ def SaveBackupSchedule(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def AddWPsiteforRemoteBackup(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -607,7 +625,6 @@ def dataintegrity(request):
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
|
||||
def GetCurrentThemes(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -795,7 +812,6 @@ def CreateStagingNow(request):
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
|
||||
def modifyWebsite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -807,6 +823,7 @@ def modifyWebsite(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def deleteWebsite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -815,6 +832,7 @@ def deleteWebsite(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def CreateNewDomain(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -823,6 +841,7 @@ def CreateNewDomain(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def siteState(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -831,6 +850,7 @@ def siteState(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def listWebsites(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -839,6 +859,7 @@ def listWebsites(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def listChildDomains(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -847,6 +868,7 @@ def listChildDomains(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitWebsiteCreation(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -868,6 +890,7 @@ def submitWebsiteCreation(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitDomainCreation(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -887,6 +910,7 @@ def submitDomainCreation(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchDomains(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -895,6 +919,7 @@ def fetchDomains(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def searchWebsites(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -903,6 +928,7 @@ def searchWebsites(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def searchChilds(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -911,6 +937,7 @@ def searchChilds(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getFurtherAccounts(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -919,6 +946,7 @@ def getFurtherAccounts(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchWebsitesList(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -927,6 +955,7 @@ def fetchWebsitesList(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchChildDomainsMain(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -935,6 +964,7 @@ def fetchChildDomainsMain(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitWebsiteDeletion(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -954,6 +984,7 @@ def submitWebsiteDeletion(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitDomainDeletion(request):
|
||||
try:
|
||||
|
||||
@@ -975,6 +1006,7 @@ def submitDomainDeletion(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def convertDomainToSite(request):
|
||||
try:
|
||||
|
||||
@@ -985,6 +1017,7 @@ def convertDomainToSite(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitWebsiteStatus(request):
|
||||
try:
|
||||
|
||||
@@ -1006,6 +1039,7 @@ def submitWebsiteStatus(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitWebsiteModify(request):
|
||||
try:
|
||||
|
||||
@@ -1016,6 +1050,7 @@ def submitWebsiteModify(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveWebsiteChanges(request):
|
||||
try:
|
||||
|
||||
@@ -1037,6 +1072,7 @@ def saveWebsiteChanges(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def domain(request, domain):
|
||||
try:
|
||||
|
||||
@@ -1061,6 +1097,7 @@ def domain(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def launchChild(request, domain, childDomain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1069,6 +1106,7 @@ def launchChild(request, domain, childDomain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getDataFromLogFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1077,6 +1115,7 @@ def getDataFromLogFile(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchErrorLogs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1085,6 +1124,7 @@ def fetchErrorLogs(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getDataFromConfigFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1093,6 +1133,7 @@ def getDataFromConfigFile(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveConfigsToFile(request):
|
||||
try:
|
||||
|
||||
@@ -1114,6 +1155,7 @@ def saveConfigsToFile(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getRewriteRules(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1122,6 +1164,7 @@ def getRewriteRules(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveRewriteRules(request):
|
||||
try:
|
||||
|
||||
@@ -1143,6 +1186,7 @@ def saveRewriteRules(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveSSL(request):
|
||||
try:
|
||||
|
||||
@@ -1164,6 +1208,7 @@ def saveSSL(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def changePHP(request):
|
||||
try:
|
||||
|
||||
@@ -1185,6 +1230,7 @@ def changePHP(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def listCron(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1193,6 +1239,7 @@ def listCron(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getWebsiteCron(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1201,6 +1248,7 @@ def getWebsiteCron(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getCronbyLine(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1209,6 +1257,7 @@ def getCronbyLine(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveCronChanges(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1217,6 +1266,7 @@ def saveCronChanges(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def remCronbyLine(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1236,6 +1286,7 @@ def remCronbyLine(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def addNewCron(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1255,6 +1306,7 @@ def addNewCron(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def domainAlias(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1263,6 +1315,7 @@ def domainAlias(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitAliasCreation(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1282,6 +1335,7 @@ def submitAliasCreation(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def issueAliasSSL(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1290,6 +1344,7 @@ def issueAliasSSL(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def delateAlias(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1309,6 +1364,7 @@ def delateAlias(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def changeOpenBasedir(request):
|
||||
try:
|
||||
|
||||
@@ -1330,6 +1386,7 @@ def changeOpenBasedir(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def wordpressInstall(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1338,6 +1395,7 @@ def wordpressInstall(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installWordpress(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1346,6 +1404,7 @@ def installWordpress(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installWordpressStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1354,6 +1413,7 @@ def installWordpressStatus(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def joomlaInstall(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1362,6 +1422,7 @@ def joomlaInstall(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installJoomla(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1370,6 +1431,7 @@ def installJoomla(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def setupGit(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1378,6 +1440,7 @@ def setupGit(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def setupGitRepo(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1386,6 +1449,7 @@ def setupGitRepo(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def gitNotify(request, domain):
|
||||
try:
|
||||
@@ -1394,6 +1458,7 @@ def gitNotify(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def detachRepo(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1402,6 +1467,7 @@ def detachRepo(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def changeBranch(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1410,6 +1476,7 @@ def changeBranch(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installPrestaShop(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1418,6 +1485,7 @@ def installPrestaShop(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installMagento(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1426,6 +1494,7 @@ def installMagento(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def magentoInstall(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1434,6 +1503,7 @@ def magentoInstall(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installMautic(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1442,6 +1512,7 @@ def installMautic(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def mauticInstall(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1450,6 +1521,7 @@ def mauticInstall(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def prestaShopInstall(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1458,6 +1530,7 @@ def prestaShopInstall(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def sshAccess(request, domain):
|
||||
try:
|
||||
# from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter
|
||||
@@ -1517,6 +1590,7 @@ def sshAccess(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveSSHAccessChanges(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1552,6 +1626,7 @@ def syncToMaster(request, domain, childDomain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def startSync(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1578,6 +1653,7 @@ def manageGIT(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchFolderDetails(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1586,6 +1662,7 @@ def fetchFolderDetails(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def initRepo(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1594,6 +1671,7 @@ def initRepo(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def setupRemote(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1602,6 +1680,7 @@ def setupRemote(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def changeGitBranch(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1610,6 +1689,7 @@ def changeGitBranch(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def createNewBranch(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1618,6 +1698,7 @@ def createNewBranch(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def commitChanges(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1626,6 +1707,7 @@ def commitChanges(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def gitPull(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1634,6 +1716,7 @@ def gitPull(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def gitPush(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1642,6 +1725,7 @@ def gitPush(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def attachRepoGIT(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1650,6 +1734,7 @@ def attachRepoGIT(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def removeTracking(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1658,6 +1743,7 @@ def removeTracking(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchGitignore(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1666,6 +1752,7 @@ def fetchGitignore(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveGitIgnore(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1674,6 +1761,7 @@ def saveGitIgnore(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchCommits(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1682,6 +1770,7 @@ def fetchCommits(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchFiles(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1690,6 +1779,7 @@ def fetchFiles(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchChangesInFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1698,6 +1788,7 @@ def fetchChangesInFile(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveGitConfigurations(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1706,6 +1797,7 @@ def saveGitConfigurations(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchGitLogs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1714,6 +1806,7 @@ def fetchGitLogs(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def getSSHConfigs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1722,6 +1815,7 @@ def getSSHConfigs(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def deleteSSHKey(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1730,6 +1824,7 @@ def deleteSSHKey(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def addSSHKey(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1738,6 +1833,7 @@ def addSSHKey(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def webhook(request, domain):
|
||||
try:
|
||||
@@ -1764,6 +1860,7 @@ def getSwitchStatus(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def switchServer(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1772,6 +1869,7 @@ def switchServer(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def statusFunc(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1783,6 +1881,7 @@ def statusFunc(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def tuneSettings(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1792,6 +1891,7 @@ def tuneSettings(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def saveApacheConfigsToFile(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1812,6 +1912,7 @@ def CreateDockerPackage(request):
|
||||
except BaseException as msg:
|
||||
return HttpResponse(msg)
|
||||
|
||||
|
||||
def CreateDockerPackage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1820,6 +1921,8 @@ def CreateDockerPackage(request):
|
||||
return wm.CreateDockerPackage(request, userID, None, DeleteID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def AssignPackage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1828,6 +1931,8 @@ def AssignPackage(request):
|
||||
return wm.AssignPackage(request, userID, None, DeleteID)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def CreateDockersite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1836,6 +1941,7 @@ def CreateDockersite(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def AddDockerpackage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1844,6 +1950,8 @@ def AddDockerpackage(request):
|
||||
return wm.AddDockerpackage(userID, data)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def Getpackage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1852,6 +1960,8 @@ def Getpackage(request):
|
||||
return wm.Getpackage(userID, data)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def Updatepackage(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1860,6 +1970,8 @@ def Updatepackage(request):
|
||||
return wm.Updatepackage(userID, data)
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def AddAssignment(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1869,6 +1981,7 @@ def AddAssignment(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def submitDockerSiteCreation(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1878,6 +1991,7 @@ def submitDockerSiteCreation(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def ListDockerSites(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1887,6 +2001,7 @@ def ListDockerSites(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchDockersite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1896,6 +2011,7 @@ def fetchDockersite(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def Dockersitehome(request, dockerapp):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1904,6 +2020,7 @@ def Dockersitehome(request, dockerapp):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def fetchWPDetails(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
@@ -1915,6 +2032,7 @@ def fetchWPDetails(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def startContainer(request):
|
||||
try:
|
||||
@@ -1924,6 +2042,7 @@ def startContainer(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def stopContainer(request):
|
||||
try:
|
||||
@@ -1933,6 +2052,7 @@ def stopContainer(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def restartContainer(request):
|
||||
try:
|
||||
@@ -1942,6 +2062,7 @@ def restartContainer(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def get_website_resources(request):
|
||||
try:
|
||||
@@ -1980,6 +2101,7 @@ def get_website_resources(request):
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Error in get_website_resources: {str(msg)}')
|
||||
return JsonResponse({'status': 0, 'error_message': str(msg)})
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def get_terminal_jwt(request):
|
||||
import logging
|
||||
@@ -2046,6 +2168,7 @@ def get_terminal_jwt(request):
|
||||
logger.error(f"Exception in get_terminal_jwt: {str(e)}")
|
||||
return JsonResponse({'status': 0, 'error_message': str(e)})
|
||||
|
||||
|
||||
def fetchWPBackups(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
Reference in New Issue
Block a user