Website App

This commit is contained in:
Zarak Khan
2024-01-20 12:50:12 +05:00
parent 912746a999
commit 102a9a1c36
13 changed files with 2408 additions and 75 deletions

View File

@@ -0,0 +1,167 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
<head>
<title>{% trans "File Manager - CyberPanel" %}</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% load static %}
<link rel="icon" type="image/png" href="{% static 'baseTemplate/assets/finalBase/favicon.png' %}">
<!-- Angular JS -->
<script src="https://code.angularjs.org/1.6.5/angular.min.js"></script>
<script src="{% static 'filemanager/js/fileManager.js' %}"></script>
<!-- Fix for old browsers -->
<script src="{% static 'filemanager/js/es5-shim.min.js' %}"></script>
<script src="{% static 'filemanager/js/es5-sham.min.js' %}"></script>
<script src="{% static 'filemanager/js/jquery-1.8.3.min.js' %}"></script>
<script src="{% static 'filemanager/js/console-sham.js' %}"></script>
<!--<script src="../bower_components/angular/angular.js"></script>-->
<script src="{% static 'filemanager/js/angular-file-upload.min.js' %}"></script>
<!-- HTML Editor Include -->
</head>
<div ng-app="fileManager" ng-controller="fileManagerCtrl" class="p-8">
<div class="flex py-2 px-6 items-center gap-4">
<div>
<p class="font-bold w-32">Current Path</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" id="currentRPath" ng-model="currentRPath"
readonly>
</div>
<div>
<ul class="list-group list-group-flush">
<li class="flex text-orange-500">
<a href="#" onclick="return false;" ng-click="fetchChilds($event,currentRPath,'primary')">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>
</svg>
</a>
<a onclick="return false;"
ng-click="fetchForTableSecondary($event,'fromTree',completeStartingPath)" href="#">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/>
</svg>
</a>
<a href="" class="ml-2">{$ startingPath $}</a>
</li>
</ul>
</div>
</div>
<div class="py-4">
<div>
<ul class="flex justify-between bg-blue-200 py-5 px-5 rounded-lg shadow-lg font-semibold">
<li>
<a onclick="return false;" ng-click="showUploadBox()" class="nav-link point-events" href="#"><i
class="fa fa-upload" aria-hidden="true"></i> {% trans "Upload" %}</a>
</li>
<li>
<a onclick="return false;" ng-click="showCreateFileModal()" class="nav-link point-events"
href="#"><i class="fa fa-plus-square" aria-hidden="true"></i> {% trans "New File" %}</a>
</li>
<li>
<a onclick="return false;" ng-click="showCreateFolderModal()" class="nav-link point-events"
href="#"><i class="fa fa-folder" aria-hidden="true"></i> {% trans "New Folder" %}</a>
</li>
<li id="deleteFile">
<a onclick="return false;" ng-click="showDeleteModal()" class="nav-link point-events"
href="#"><i
class="fa fa-trash-o" aria-hidden="true"></i> {% trans "Delete" %}</a>
</li>
<li id="copyFile">
<a onclick="return false;" ng-click="showCopyModal()" class="nav-link point-events" href="#"><i
class="fa fa-files-o" aria-hidden="true"></i> {% trans "Copy" %}</a>
</li>
<li id="moveFile">
<a onclick="return false;" ng-click="showMoveModal()" class="nav-link point-events" href="#"><i
class="fa fa-arrows-alt" aria-hidden="true"></i> {% trans "Move" %}</a>
</li>
<li id="renameFile">
<a onclick="return false;" ng-click="showRenameModal()" class="nav-link point-events"
href="#"><i
class="fa fa-file-text-o" aria-hidden="true"></i> {% trans "Rename" %}</a>
</li>
<li id="editFile">
<a onclick="return false;" ng-click="showHTMLEditorModal()" class="nav-link point-events"
href="#"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {% trans "Edit" %}</a>
</li>
<li id="compressFile">
<a onclick="return false;" ng-click="showCompressionModal()" class="nav-link point-events"
href="#"><i
class="fa fa-compress" aria-hidden="true"></i> {% trans "Compress" %}</a>
</li>
<li id="extractFile">
<a onclick="return false;" ng-click="showExtractionModal()" class="nav-link point-events"
href="#"><i class="fa fa-expand" aria-hidden="true"></i> {% trans "Extract" %}</a>
</li>
</ul>
</div>
<div class="mt-2">
<ul class="flex py-5 px-5 gap-10 font-semibold">
<li>
<a onclick="return false;" ng-click="fetchForTableSecondary($event,'homeFetch')"
href="#"><i class="fa fa-home fa-lg" aria-hidden="true"></i> {% trans "Home" %}</a>
</li>
<li>
<a onclick="return false;" ng-click="fetchForTableSecondary($event,'goBackOnPath')"
href="#"><i class="fa fa-arrow-left fa-lg"
aria-hidden="true"></i> {% trans "Back" %}</a>
</li>
<li>
<a onclick="return false;" ng-click="fetchForTableSecondary($event,'refresh')"
href="#"><i class="fa fa-refresh fa-lg" aria-hidden="true"></i> {% trans "Refresh" %}</a>
</li>
<li>
<a onclick="return false;" ng-click="selectAll()" href="#"><i
class="fa fa-check-square-o fa-lg" aria-hidden="true"></i> {% trans "Select All" %}</a>
</li>
<li>
<a onclick="return false;" ng-click="unSelectAll()" href="#"><i
class="fa fa-square-o fa-lg" aria-hidden="true"></i> {% trans "UnSelect All" %}</a>
</li>
</ul>
</div>
<div>
<div class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead id="tableHead">
<tr>
<th scope="col" class="px-6 py-3">
File Name
</th>
<th scope="col" class="px-6 py-3">
Size (KB)
</th>
<th scope="col" class="px-6 py-3">
Last Modified
</th>
<th scope="col" class="px-6 py-3">
Permissions
</th>
</tr>
</thead>
<tbody id="tableBodyFiles">
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -9,6 +9,7 @@ urlpatterns = [
url(r'^RootDownloadFile$',views.RootDownloadFile, name='RootDownloadFile'),
url(r'^editFile$', views.editFile, name='editFile'),
url('^Filemanager', views.FileManagerRoot, name='Filemanager'),
url('^V2/FilemanagerV2', views.FileManagerRootV2, name='FilemanagerV2'),
url(r'^(?P<domain>(.*))$', views.loadFileManagerHome, name='loadFileManagerHome'),
]

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from django.shortcuts import render,redirect
from django.shortcuts import render, redirect
from loginSystem.models import Administrator
from loginSystem.views import loadLoginPage
import plogical.CyberCPLogFileWriter as logging
@@ -8,9 +8,11 @@ import json
from websiteFunctions.models import Websites
from plogical.acl import ACLManager
from .filemanager import FileManager as FM
# Create your views here.
def loadFileManagerHome(request,domain):
def loadFileManagerHome(request, domain):
try:
userID = request.session['userID']
if Websites.objects.filter(domain=domain).exists():
@@ -27,6 +29,7 @@ def loadFileManagerHome(request,domain):
except KeyError:
return redirect(loadLoginPage)
def changePermissions(request):
try:
userID = request.session['userID']
@@ -58,6 +61,7 @@ def changePermissions(request):
except KeyError:
return redirect(loadLoginPage)
def controller(request):
try:
data = json.loads(request.body)
@@ -128,6 +132,7 @@ def controller(request):
fm = FM(request, None)
return fm.ajaxPre(0, str(msg))
def upload(request):
try:
@@ -152,6 +157,7 @@ def upload(request):
except KeyError:
return redirect(loadLoginPage)
def editFile(request):
try:
userID = request.session['userID']
@@ -184,13 +190,15 @@ def editFile(request):
if ACLManager.checkOwnership(domainName, admin, currentACL) == 1:
return render(request, 'filemanager/editFile.html', {'domainName': domainName, 'fileName': fileName,
'mode': mode, 'modeFiles': modeFiles, 'theme': theme,
'themeFile': themeFile, 'additionalOptions': additionalOptions})
'themeFile': themeFile,
'additionalOptions': additionalOptions})
else:
return ACLManager.loadError()
except KeyError:
return redirect(loadLoginPage)
def FileManagerRoot(request):
### Load Custom CSS
try:
@@ -216,17 +224,17 @@ def FileManagerRoot(request):
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
data = {
"name": "Filemanager",
"IP": ipAddressLocal
"IP": ipAddressLocal
}
import requests
response = requests.post(url, data=json.dumps(data))
Status = response.json()['status']
if(Status == 1):
if (Status == 1):
template = 'baseTemplate/FileManager.html'
else:
return redirect("https://cyberpanel.net/cyberpanel-addons")
return redirect("https://cyberpanel.net/cyberpanel-addons")
else:
template = 'baseTemplate/FileManager.html'
except BaseException as msg:
@@ -241,6 +249,58 @@ def FileManagerRoot(request):
proc = httpProc(request, template)
return proc.render()
def FileManagerRootV2(request):
### Load Custom CSS
try:
from baseTemplate.models import CyberPanelCosmetic
cosmetic = CyberPanelCosmetic.objects.get(pk=1)
except:
from baseTemplate.models import CyberPanelCosmetic
cosmetic = CyberPanelCosmetic()
cosmetic.save()
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
ipFile = "/etc/cyberpanel/machineIP"
f = open(ipFile)
ipData = f.read()
ipAddressLocal = ipData.split('\n', 1)[0]
try:
from plogical.processUtilities import ProcessUtilities
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
data = {
"name": "Filemanager",
"IP": ipAddressLocal
}
import requests
response = requests.post(url, data=json.dumps(data))
Status = response.json()['status']
if (Status == 1):
template = 'baseTemplate/FileManagerV2.html'
else:
return redirect("https://cyberpanel.net/cyberpanel-addons")
else:
template = 'baseTemplate/FileManagerV2.html'
except BaseException as msg:
template = 'baseTemplate/FileManagerV2.html'
if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)
from plogical.httpProc import httpProc
proc = httpProc(request, template)
return proc.render()
def downloadFile(request):
try:
userID = request.session['userID']
@@ -274,6 +334,7 @@ def downloadFile(request):
except KeyError:
return redirect(loadLoginPage)
def RootDownloadFile(request):
try:
userID = request.session['userID']
@@ -295,6 +356,6 @@ def RootDownloadFile(request):
response['X-LiteSpeed-Location'] = '%s' % (fileToDownload)
return response
#return HttpResponse(response['X-LiteSpeed-Location'])
# return HttpResponse(response['X-LiteSpeed-Location'])
except KeyError:
return redirect(loadLoginPage)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="installMauticCTRLV2" class="p-8">
<div>
<p class="text-4xl font-bold">Install Mautic</p>
<p class="text-xs text-gray-600 py-2 font-semibold">One-click Mautic Install!</p>
</div>
<div>
<div class="py-4">
<h3 class="title-hero">
<span id="domainNamePage">{{ domainName }}</span> - {% trans "Installation Details" %} <img
ng-hide="wpInstallLoading" src="{% static 'images/loading.gif' %}">
</h3>
</div>
<strong style="margin:2%; color: red">{% trans "Before installing Mautic, we will change the PHP version of the website to PHP 8.0, which is supported by Mautic." %}</strong>
<hr>
<div id="createPackages" ng-hide="installationDetailsForm">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Administrator Username</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="adminUserName" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Email</p>
</div>
<div>
<input type="email" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="email" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Password</p>
</div>
<div>
<input type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="password" required>
</div>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center">
<button ng-click="installMautic()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Install Now
</button>
</div>
<div ng-hide="installationProgress">
<div class="col-sm-7">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
<div ng-hide="installationFailed" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Installation failed. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="installationSuccessfull" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Installation successful. Visit:" %} {$ installationURL $}</p>
</div>
<div ng-hide="couldNotConnect" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">{% trans "Go Back" %}</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,108 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="installPrestaShopCTRLV2" class="p-8">
<div>
<p class="text-4xl font-bold">Install PrestaShop</p>
<p class="text-xs text-gray-600 py-2 font-semibold">One-click PrestaShop Install!</p>
</div>
<div>a
<div class="py-4">
<h3 class="title-hero">
<span id="domainNamePage">{{ domainName }}</span> - {% trans "Installation Details" %} <img
ng-hide="wpInstallLoading" src="{% static 'images/loading.gif' %}">
</h3>
</div>
<hr>
<div id="createPackages" ng-hide="installationDetailsForm">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Shop Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="shopName" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">First Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="firstName" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Last Name</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="lastName" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Email</p>
</div>
<div>
<input type="email" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="email" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Password</p>
</div>
<div>
<input type="password" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="password" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Database Prefix</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="databasePrefix"
required>
</div>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center">
<button ng-click="installPrestShop()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Install Now
</button>
</div>
<div ng-hide="installationProgress">
<div class="col-sm-7">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
<div ng-hide="installationFailed" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Installation failed. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="installationSuccessfull" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Installation successful. Visit:" %} {$ installationURL $}</p>
</div>
<div ng-hide="couldNotConnect" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">{% trans "Go Back" %}</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,103 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="installWordPressCTRLV2" class="p-8">
<div>
<p class="text-4xl font-bold">Install WordPress</p>
<p class="text-xs text-gray-600 py-2 font-semibold">Install WordPress with LSCache.</p>
</div>
<div>a
<div class="py-4">
<h3 class="title-hero">
<span id="domainNamePage">{{ domainName }}</span> - {% trans "Installation Details" %} - <a
href="https://go.cyberpanel.net/StessTest">Stress Test</a></strong> <img
ng-hide="wpInstallLoading" src="{% static 'images/loading.gif' %}">
</h3>
</div>
<hr>
<div id="createPackages" ng-hide="installationDetailsForm">
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Blog Title</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="blogTitle" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Login User</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="adminUser" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Login Password</p>
</div>
<div>
<input type="password" class=" w-80 bg-gray-100 rounded px-2 py-1" ng-model="adminPassword"
required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Email</p>
</div>
<div>
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="adminEmail" required>
</div>
</div>
<div class="flex py-2 px-6">
<div>
<p class="font-semibold w-48">Path</p>
</div>
<div>
<input placeholder="{% trans "Leave empty to install in website home directory. (Without preceding slash)" %}"
type="text" class="w-80 bg-gray-100 rounded px-2 py-1" ng-model="installPath">
</div>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="flex justify-center">
<button ng-click="installWordPress()"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Install Now
</button>
</div>
<div ng-hide="installationProgress">
<div class="col-sm-7">
<div class="flex justify-center font-bold text-xl">
<h2>{$ currentStatus $}</h2>
</div>
<div class="w-full bg-gray-100 rounded-full mt-3">
<div id="installProgress"
class="bg-green-600 text-xs font-medium text-white text-center p-2 leading-none rounded-full"
style="width:0%">
</div>
</div>
<div ng-hide="installationFailed" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Installation failed. Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="installationSuccessfull" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Installation successful. Visit:" %} {$ installationURL $} or perform <strong><a
href="https://go.cyberpanel.net/StessTest">stress test</a></strong>.</p>
</div>
<div ng-hide="couldNotConnect" class="flex justify-center font-bold text-xl mt-3">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="flex justify-center mt-3">
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
class="bg-blue-500 px-3 py-2 rounded-lg text-xl font-semibold text-white">{% trans "Go Back" %}</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -37,8 +37,7 @@
</div>
</div>
</form>
<p style="margin: 2%"
ng-hide="gitTracking">{% trans "This folder does not have Git tracking, click below to initiate a repository and start tracking files." %}</p>
<p ng-hide="gitTracking">{% trans "This folder does not have Git tracking, click below to initiate a repository and start tracking files." %}</p>
<button ng-hide="gitTracking" style="margin-left: 2%" type="button" class="btn btn-primary"
ng-click="initRepo()">
Init Repo

View File

@@ -0,0 +1,57 @@
{% extends "baseTemplate/newBase.html" %}
{% load i18n %}
{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %}
{% block newContent %}
{% load static %}
<div ng-controller="manageGITV2" class="p-8">
<div>
<p class="text-4xl font-bold">Manage GIT - <a target="_blank"
href="https://go.cyberpanel.net/manageGit"
style="height: 23px;line-height: 21px;"
class="btn btn-border btn-alt border-red btn-link font-red"
title=""><span>{% trans "Git Docs" %}</span></a></p>
<p class="text-xs text-gray-600 py-2 font-semibold">Manage and track folders via Git
for {{ domainName }}.</p>
</div>
<div>a
<div class="py-4">
<h3 class="title-hero">
{% trans "Manage and track folders via Git for " %} <span id="domain">{{ domainName }}</span>. <img
ng-hide="cyberpanelLoading" src="{% static 'images/loading.gif' %}">
</h3>
</div>
<hr>
<div>
<div class="flex mt-4 py-2 px-6">
<div>
<p class="font-semibold w-48">Select Folder to Track</p>
</div>
<div>
<select ng-change="fetchFolderDetails()" ng-model="folder"
class="w-80 bg-gray-100 rounded px-2 py-1">
{% for item in folders %}
<option>{{ item }}</option>
{% endfor %}
</select>
</div>
</div>
<p ng-hide="gitTracking">{% trans "This folder does not have Git tracking, click below to initiate a repository and start tracking files." %}</p>
<button ng-hide="gitTracking" style="margin-left: 2%" type="button"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white"
ng-click="initRepo()">
Init Repo
</button>
<button data-toggle="modal" data-target="#attachExistingRepo" ng-disabled="home==0"
ng-hide="gitTracking" style="margin-left: 2%" type="button"
class="bg-orange-500 px-3 py-4 rounded-lg text-xl font-semibold text-white">
Attach Existing Repo <img
ng-hide="cyberpanelLoading" src="{% static 'images/loading.gif' %}">
</button>
</div>
</div>
</div>
{% endblock %}

View File

@@ -8,7 +8,7 @@
<div ng-controller="websitePagesV2" class="p-8">
<div class="flex lg:flex-row justify-between items-center sm:flex-col">
<div>
<p id="domainNamePage" class="text-4xl font-bold">{{ domain }}</p>
<p id="domainNamePageV2" class="text-4xl font-bold">{{ domain }}</p>
<p class="text-xs text-gray-600 py-2 font-semibold">All functions related to a particular site.
</p>
</div>
@@ -167,14 +167,13 @@
class="bg-orange-500 text-white font-bold px-2 py-1">{% trans "Next" %}</button>
<button ng-click="fetchLogs(4)" type="button"
class="bg-orange-500 text-white font-bold px-2 py-1">{% trans "Previous" %}</button>
</div>
<div style="margin-bottom: 1%;" class=" col-sm-1">
<a ng-click="hidelogsbtn()" href="">
<!--img src="/static/images/close-32.png"-->
<h3 class="glyph-icon icon-close text-danger mt-5"></h3>
<h3 class="bg-red-500 px-2 py-1 rounded-lg text-white">
X</h3>
</a>
</div>
<div ng-hide="currentRecords" class="relative py-5 overflow-x-auto">
<table class="w-full text-sm text-left rtl:text-right">
<thead>
@@ -800,7 +799,7 @@
</div>
<div>
<ul class="flex w-full grid lg:grid-cols-4">
<li class="px-3 py-3">
<a href="{% url 'FilemanagerV2' %}" class="px-3 py-3">
<div class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
@@ -817,7 +816,7 @@
<p class="px-2 font-bold" style="font-size: 70%;">File Manager</p>
</div>
</div>
</li>
</a>
<li ng-click="openBaseDirView()" class="px-3 py-3 cursor-pointer">
<div class="flex items-center">
<div>
@@ -1062,7 +1061,7 @@
</div>
<div>
<ul class="flex w-full grid lg:grid-cols-4">
<li class="px-3 py-3">
<a href="{$ wordPressInstallURLV2 $}" class="px-3 py-3">
<div class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
@@ -1079,8 +1078,8 @@
<p class="px-2 font-bold" style="font-size: 70%;">WP + LSCache</p>
</div>
</div>
</li>
<li class="px-3 py-3">
</a>
<a href="/websites/{{ domain }}/manageGITV2" class="px-3 py-3">
<div class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
@@ -1097,8 +1096,8 @@
<p class="px-2 font-bold" style="font-size: 70%;">Git</p>
</div>
</div>
</li>
<li class="px-3 py-3">
</a>
<a href="{$ installPrestaURL $}" class="px-3 py-3">
<div class="flex items-center">
<div>
<svg width="20" height="20" viewBox="0 0 40 40" fill="none"
@@ -1119,8 +1118,8 @@
<p class="px-2 font-bold" style="font-size: 70%;">Prestashop</p>
</div>
</div>
</li>
<li class="px-3 py-3">
</a>
<a href="{$ installMauticURL $}" class="px-3 py-3">
<div class="flex items-center">
<div>
@@ -1140,7 +1139,7 @@
<p class="px-2 font-bold" style="font-size: 70%;">Mautic</p>
</div>
</div>
</li>
</a>
</ul>
</div>
</div>

View File

@@ -16,6 +16,7 @@ urlpatterns = [
url(r'^createWebsiteV2$', views.createWebsiteV2, name='createWebsiteV2'),
url(r'^listWebsitesV2$', views.listWebsitesV2, name='listWebsitesV2'),
url(r'^V2/(?P<domain>(.*))$', views.domainV2, name='domainv2'),
url(r'^V2/(?P<domain>(.*))/wordpressInstallV2$', views.wordpressInstallV2, name='wordpressInstallV2'),
url(r'^CreateNewDomain$', views.CreateNewDomain, name='CreateNewDomain'),
url(r'^CreateNewDomainV2$', views.CreateNewDomainV2, name='CreateNewDomainV2'),
@@ -139,6 +140,7 @@ urlpatterns = [
url(r'^(?P<domain>(.*))/wordpressInstall$', views.wordpressInstall, name='wordpressInstall'),
url(r'^installWordpressStatus$', views.installWordpressStatus, name="installWordpressStatus"),
url(r'^installWordpress$', views.installWordpress, name='installWordpress'),
url(r'^V2/installWordpressV2$', views.installWordpressV2, name='installWordpressV2'),
## Joomla Install
@@ -149,6 +151,7 @@ urlpatterns = [
url(r'^prestaShopInstall$', views.prestaShopInstall, name='prestaShopInstall'),
url(r'^(?P<domain>(.*))/installPrestaShop$', views.installPrestaShop, name='installPrestaShop'),
url(r'^V2/(?P<domain>(.*))/installPrestaShopV2$', views.installPrestaShopV2, name='installPrestaShopV2'),
## magento
@@ -158,6 +161,7 @@ urlpatterns = [
## mautic
url(r'^(?P<domain>(.*))/installMautic$', views.installMautic, name='installMautic'),
url(r'^V2/(?P<domain>(.*))/installMauticV2$', views.installMauticV2, name='installMauticV2'),
url(r'^mauticInstall$', views.mauticInstall, name='mauticInstall'),
## Git
@@ -182,6 +186,7 @@ urlpatterns = [
### Manage GIT
url(r'^(?P<domain>(.*))/manageGIT$', views.manageGIT, name='manageGIT'),
url(r'^V2/(?P<domain>(.*))/manageGITV2$', views.manageGITV2, name='manageGITV2'),
url(r'^(?P<domain>(.*))/webhook$', views.webhook, name='webhook'),
url(r'^fetchFolderDetails$', views.fetchFolderDetails, name='fetchFolderDetails'),
url(r'^initRepo$', views.initRepo, name='initRepo'),

View File

@@ -49,6 +49,7 @@ def WPCreate(request):
except KeyError:
return redirect(loadLoginPage)
def WPCreateV2(request):
try:
userID = request.session['userID']
@@ -57,6 +58,7 @@ def WPCreateV2(request):
except KeyError:
return redirect(loadLoginPage)
def ListWPSites(request):
try:
userID = request.session['userID']
@@ -65,6 +67,8 @@ def ListWPSites(request):
return wm.ListWPSites(request, userID, DeleteID)
except KeyError:
return redirect(loadLoginPage)
def ListWPSitesV2(request):
try:
userID = request.session['userID']
@@ -74,6 +78,7 @@ def ListWPSitesV2(request):
except KeyError:
return redirect(loadLoginPage)
def WPHome(request):
try:
userID = request.session['userID']
@@ -85,6 +90,7 @@ def WPHome(request):
except KeyError:
return redirect(loadLoginPage)
def WPHomeV2(request):
try:
userID = request.session['userID']
@@ -162,6 +168,7 @@ def RestoreBackups(request):
except KeyError:
return redirect(loadLoginPage)
def RestoreBackupsV2(request):
try:
userID = request.session['userID']
@@ -201,6 +208,7 @@ def ConfigurePlugins(request):
except KeyError:
return redirect(loadLoginPage)
def ConfigurePluginsV2(request):
try:
userID = request.session['userID']
@@ -228,6 +236,7 @@ def Addnewplugin(request):
except KeyError:
return redirect(loadLoginPage)
def AddnewpluginV2(request):
try:
userID = request.session['userID']
@@ -237,7 +246,6 @@ def AddnewpluginV2(request):
return redirect(loadLoginPage)
def SearchOnkeyupPlugin(request):
try:
userID = request.session['userID']
@@ -292,6 +300,7 @@ def EidtPlugin(request):
except KeyError:
return redirect(loadLoginPage)
def EidtPluginV2(request):
try:
userID = request.session['userID']
@@ -904,6 +913,7 @@ def modifyWebsite(request):
except KeyError:
return redirect(loadLoginPage)
def modifyWebsiteV2(request):
try:
userID = request.session['userID']
@@ -924,6 +934,7 @@ def deleteWebsite(request):
except KeyError:
return redirect(loadLoginPage)
def deleteWebsiteV2(request):
try:
userID = request.session['userID']
@@ -931,6 +942,8 @@ def deleteWebsiteV2(request):
return wm.deleteWebsiteV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def CreateNewDomain(request):
try:
userID = request.session['userID']
@@ -939,6 +952,7 @@ def CreateNewDomain(request):
except KeyError:
return redirect(loadLoginPage)
def CreateNewDomainV2(request):
try:
userID = request.session['userID']
@@ -947,6 +961,7 @@ def CreateNewDomainV2(request):
except KeyError:
return redirect(loadLoginPage)
def siteState(request):
try:
userID = request.session['userID']
@@ -955,6 +970,7 @@ def siteState(request):
except KeyError:
return redirect(loadLoginPage)
def siteStateV2(request):
try:
userID = request.session['userID']
@@ -990,6 +1006,7 @@ def listChildDomains(request):
except KeyError:
return redirect(loadLoginPage)
def listChildDomainsV2(request):
try:
userID = request.session['userID']
@@ -1227,6 +1244,7 @@ def domain(request, domain):
except KeyError:
return redirect(loadLoginPage)
def domainV2(request, domain):
try:
@@ -1550,6 +1568,15 @@ def wordpressInstall(request, domain):
return redirect(loadLoginPage)
def wordpressInstallV2(request, domain):
try:
userID = request.session['userID']
wm = WebsiteManager(domain)
return wm.wordpressInstallV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def installWordpress(request):
try:
userID = request.session['userID']
@@ -1559,6 +1586,15 @@ def installWordpress(request):
return redirect(loadLoginPage)
def installWordpressV2(request):
try:
userID = request.session['userID']
wm = WebsiteManager()
return wm.installWordpressV2(userID, json.loads(request.body))
except KeyError:
return redirect(loadLoginPage)
def installWordpressStatus(request):
try:
userID = request.session['userID']
@@ -1640,6 +1676,15 @@ def installPrestaShop(request, domain):
return redirect(loadLoginPage)
def installPrestaShopV2(request, domain):
try:
userID = request.session['userID']
wm = WebsiteManager(domain)
return wm.installPrestaShopV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def installMagento(request, domain):
try:
userID = request.session['userID']
@@ -1667,6 +1712,15 @@ def installMautic(request, domain):
return redirect(loadLoginPage)
def installMauticV2(request, domain):
try:
userID = request.session['userID']
wm = WebsiteManager(domain)
return wm.installMauticV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def mauticInstall(request):
try:
userID = request.session['userID']
@@ -1757,6 +1811,22 @@ def manageGIT(request, domain):
return redirect(loadLoginPage)
def manageGITV2(request, domain):
try:
if not request.GET._mutable:
request.GET._mutable = True
request.GET['domain'] = domain
userID = request.session['userID']
wm = WebsiteManager(domain)
return wm.manageGITV2(request, userID)
except KeyError:
return redirect(loadLoginPage)
def fetchFolderDetails(request):
try:
userID = request.session['userID']

View File

@@ -82,7 +82,6 @@ class WebsiteManager:
Data, 'createWebsite')
return proc.render()
def createWebsiteV2(self, request=None, userID=None, data=None):
url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
@@ -290,7 +289,6 @@ class WebsiteManager:
response = requests.post(url, data=json.dumps(data))
Status = response.json()['status']
rnpss = randomPassword.generate_pass(10)
Data['Randam_String'] = rnpss.lower()
@@ -343,7 +341,6 @@ class WebsiteManager:
response = requests.post(url, data=json.dumps(data))
Status = response.json()['status']
rnpss = randomPassword.generate_pass(10)
Data['Randam_String'] = rnpss.lower()
@@ -698,11 +695,11 @@ class WebsiteManager:
password = randomPassword.generate_pass(10)
command = f'sudo -u %s {FinalPHPPath} /usr/bin/wp user create autologin %s --role=administrator --user_pass="%s" --path=%s --skip-plugins --skip-themes' % (
WPobj.owner.externalApp, 'autologin@cloudpages.cloud', password, WPobj.path)
WPobj.owner.externalApp, 'autologin@cloudpages.cloud', password, WPobj.path)
ProcessUtilities.executioner(command)
command = f'sudo -u %s {FinalPHPPath} /usr/bin/wp user update autologin --user_pass="%s" --path=%s --skip-plugins --skip-themes' % (
WPobj.owner.externalApp, password, WPobj.path)
WPobj.owner.externalApp, password, WPobj.path)
ProcessUtilities.executioner(command)
data = {}
@@ -1011,7 +1008,8 @@ class WebsiteManager:
rnpss = randomPassword.generate_pass(10)
proc = httpProc(request, 'websiteFunctions/createDomain.html',
{'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss, 'test_domain_data':test_domain_status})
{'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss,
'test_domain_data': test_domain_status})
return proc.render()
def CreateNewDomainV2(self, request=None, userID=None, data=None):
@@ -1035,7 +1033,8 @@ class WebsiteManager:
rnpss = randomPassword.generate_pass(10)
proc = httpProc(request, 'websiteFunctions/createDomainV2.html',
{'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss, 'test_domain_data':test_domain_status})
{'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss,
'test_domain_data': test_domain_status})
return proc.render()
def siteState(self, request=None, userID=None, data=None):
@@ -1151,12 +1150,12 @@ class WebsiteManager:
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s 2>/dev/null' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
version = ProcessUtilities.outputExecutioner(command, None, True)
version = html.escape(version)
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin status litespeed-cache --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
lscachee = ProcessUtilities.outputExecutioner(command)
if lscachee.find('Status: Active') > -1:
@@ -1165,7 +1164,7 @@ class WebsiteManager:
lscache = 0
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config list --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdout = ProcessUtilities.outputExecutioner(command)
debugging = 0
for items in stdout.split('\n'):
@@ -1174,12 +1173,12 @@ class WebsiteManager:
break
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp option get blog_public --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
searchindex = int(stdoutput.splitlines()[-1])
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode status --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
maintenanceMod = ProcessUtilities.outputExecutioner(command)
result = maintenanceMod.splitlines()[-1]
@@ -1250,7 +1249,7 @@ class WebsiteManager:
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin list --skip-plugins --skip-themes --format=json --path=%s' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
json_data = stdoutput.splitlines()[-1]
@@ -1288,7 +1287,7 @@ class WebsiteManager:
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp theme list --skip-plugins --skip-themes --format=json --path=%s' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
json_data = stdoutput.splitlines()[-1]
@@ -1631,7 +1630,7 @@ class WebsiteManager:
Rconfig = json.loads(RemoteBackupConfigobj.config)
try:
#This code is only supposed to run if backups are s3, not for SFTP
# This code is only supposed to run if backups are s3, not for SFTP
provider = Rconfig['Provider']
if provider == "Backblaze":
EndURl = Rconfig['EndUrl']
@@ -1761,7 +1760,6 @@ class WebsiteManager:
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
allweb = Websites.objects.all()
childdomain = ChildDomains.objects.all()
@@ -1774,7 +1772,6 @@ class WebsiteManager:
if os.path.exists(ProcessUtilities.debugPath):
logging.CyberCPLogFileWriter.writeToFile(result)
if result.find('No such file or directory') == -1:
try:
WPSites.objects.get(path=webpath)
@@ -2110,19 +2107,19 @@ class WebsiteManager:
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin status %s --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, plugin, path)
Vhuser, FinalPHPPath, plugin, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
if stdoutput.find('Status: Active') > -1:
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin deactivate %s --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, plugin, path)
Vhuser, FinalPHPPath, plugin, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
time.sleep(3)
else:
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin activate %s --skip-plugins --skip-themes --path=%s' % (
Vhuser, FinalPHPPath, plugin, path)
Vhuser, FinalPHPPath, plugin, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
time.sleep(3)
@@ -2199,11 +2196,6 @@ class WebsiteManager:
else:
return ACLManager.loadError()
background = ApplicationInstaller('CreateStagingNow', extraArgs)
background.start()
@@ -2255,27 +2247,27 @@ class WebsiteManager:
if settingValue:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin install litespeed-cache --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin activate litespeed-cache --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
else:
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin deactivate litespeed-cache --path=%s --skip-plugins --skip-themes' % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
elif setting == 'debugging':
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
if settingValue:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp config set WP_DEBUG true --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
logging.CyberCPLogFileWriter.writeToFile("Debugging mk true 1 output:" + str(stdoutput))
@@ -2287,7 +2279,7 @@ class WebsiteManager:
else:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp config set WP_DEBUG false --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
logging.CyberCPLogFileWriter.writeToFile("Debugging mk false 0 output:" + str(stdoutput))
@@ -2298,35 +2290,35 @@ class WebsiteManager:
elif setting == 'searchIndex':
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
if settingValue:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp option update blog_public 1 --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
else:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp option update blog_public 0 --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
elif setting == 'maintenanceMode':
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
if settingValue:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode activate --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
else:
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode deactivate --path=%s --skip-plugins --skip-themes" % (
Vhuser, FinalPHPPath, path)
Vhuser, FinalPHPPath, path)
stdoutput = ProcessUtilities.outputExecutioner(command)
elif setting == 'PasswordProtection':
execPath = f"/usr/local/CyberCP/bin/python {virtualHostUtilities.cyberPanel}/plogical/virtualHostUtilities.py"
@@ -2392,8 +2384,6 @@ class WebsiteManager:
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
extraArgs = {}
extraArgs['currentACL'] = currentACL
extraArgs['adminID'] = admin.pk
@@ -3159,9 +3149,9 @@ class WebsiteManager:
## Fix https://github.com/usmannasir/cyberpanel/issues/998
#from plogical.IncScheduler import IncScheduler
#isPU = IncScheduler('CalculateAndUpdateDiskUsage', {})
#isPU.start()
# from plogical.IncScheduler import IncScheduler
# isPU = IncScheduler('CalculateAndUpdateDiskUsage', {})
# isPU.start()
command = '/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/IncScheduler.py UpdateDiskUsageForce'
ProcessUtilities.outputExecutioner(command)
@@ -4269,6 +4259,18 @@ class WebsiteManager:
proc = httpProc(request, 'websiteFunctions/installWordPress.html', {'domainName': self.domain})
return proc.render()
def wordpressInstallV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
proc = httpProc(request, 'websiteFunctions/installWordPressV2.html', {'domainName': self.domain})
return proc.render()
def installWordpress(self, userID=None, data=None):
try:
@@ -4312,6 +4314,49 @@ class WebsiteManager:
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def installWordpressV2(self, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
self.domain = data['domain']
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadErrorJson('installStatus', 0)
mailUtilities.checkHome()
extraArgs = {}
extraArgs['admin'] = admin
extraArgs['domainName'] = data['domain']
extraArgs['home'] = data['home']
extraArgs['blogTitle'] = data['blogTitle']
extraArgs['adminUser'] = data['adminUser']
extraArgs['adminPassword'] = data['passwordByPass']
extraArgs['adminEmail'] = data['adminEmail']
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
if data['home'] == '0':
extraArgs['path'] = data['path']
background = ApplicationInstaller('wordpress', extraArgs)
background.start()
time.sleep(2)
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',
'tempStatusPath': extraArgs['tempStatusPath']}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'installStatus': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def installWordpressStatus(self, userID=None, data=None):
try:
statusFile = data['statusFile']
@@ -4604,6 +4649,18 @@ StrictHostKeyChecking no
proc = httpProc(request, 'websiteFunctions/installPrestaShop.html', {'domainName': self.domain})
return proc.render()
def installPrestaShopV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
proc = httpProc(request, 'websiteFunctions/installPrestaShopV2.html', {'domainName': self.domain})
return proc.render()
def installMagento(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
@@ -4675,6 +4732,18 @@ StrictHostKeyChecking no
proc = httpProc(request, 'websiteFunctions/installMautic.html', {'domainName': self.domain})
return proc.render()
def installMauticV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
proc = httpProc(request, 'websiteFunctions/installMauticV2.html', {'domainName': self.domain})
return proc.render()
def mauticInstall(self, userID=None, data=None):
try:
@@ -4688,7 +4757,6 @@ StrictHostKeyChecking no
else:
return ACLManager.loadErrorJson('installStatus', 0)
#### Before installing mautic change php to 8.0
completePathToConfigFile = f'/usr/local/lsws/conf/vhosts/{self.domain}/vhost.conf'
@@ -5101,7 +5169,7 @@ StrictHostKeyChecking no
else:
phpVersion = f'PHP {phpPath[2]}'
#php = PHPManager.getPHPString(phpVersion)
# php = PHPManager.getPHPString(phpVersion)
if os.path.exists(ProcessUtilities.debugPath):
logging.CyberCPLogFileWriter.writeToFile(f'PHP Version in tune settings {phpVersion}')
@@ -5121,7 +5189,7 @@ StrictHostKeyChecking no
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'error_message': str(msg)}
data_ret = {'status': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
@@ -5366,6 +5434,40 @@ StrictHostKeyChecking no
{'domainName': self.domain, 'folders': folders})
return proc.render()
def manageGITV2(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
pass
else:
return ACLManager.loadError()
try:
website = Websites.objects.get(domain=self.domain)
folders = ['/home/%s/public_html' % (self.domain)]
databases = website.databases_set.all()
# for database in databases:
# basePath = '/var/lib/mysql/'
# folders.append('%s%s' % (basePath, database.dbName))
except:
self.childWebsite = ChildDomains.objects.get(domain=self.domain)
folders = [self.childWebsite.path]
databases = self.childWebsite.master.databases_set.all()
# for database in databases:
# basePath = '/var/lib/mysql/'
# folders.append('%s%s' % (basePath, database.dbName))
proc = httpProc(request, 'websiteFunctions/manageGITV2.html',
{'domainName': self.domain, 'folders': folders})
return proc.render()
def folderCheck(self):
try:
@@ -6881,7 +6983,6 @@ StrictHostKeyChecking no
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def ApacheManager(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
admin = Administrator.objects.get(pk=userID)
@@ -6898,7 +6999,8 @@ StrictHostKeyChecking no
else:
apachemanager = 0
proc = httpProc(request, 'websiteFunctions/ApacheManager.html', {'domainName': self.domain, 'phps': phps, 'apachemanager':apachemanager})
proc = httpProc(request, 'websiteFunctions/ApacheManager.html',
{'domainName': self.domain, 'phps': phps, 'apachemanager': apachemanager})
return proc.render()
def saveApacheConfigsToFile(self, userID=None, data=None):