Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update php versions - V2.3.5 dev #1203

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Web Hosting Control Panel that uses OpenLiteSpeed as the underlying Web Server.

# Supported PHP Versions

* PHP 8.2
* PHP 8.1
* PHP 8.0
* PHP 7.4
Expand Down
52 changes: 0 additions & 52 deletions README.md.bak

This file was deleted.

18 changes: 16 additions & 2 deletions baseTemplate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ def getLoadAverage(request):
def versionManagment(request):
## Get latest version

val = request.session['userID']
currentACL = ACLManager.loadedACL(val)
if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

getVersion = requests.get('https://cyberpanel.net/version.txt')
latest = getVersion.json()
latestVersion = latest['version']
Expand Down Expand Up @@ -224,6 +231,12 @@ def upgrade(request):
def upgradeStatus(request):
try:
val = request.session['userID']
currentACL = ACLManager.loadedACL(val)
if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

try:
if request.method == 'POST':
from plogical.upgrade import Upgrade
Expand Down Expand Up @@ -252,8 +265,6 @@ def upgradeStatus(request):
'error_message': "None",
'upgradeLog': upgradeLog})
return HttpResponse(final_json)


except BaseException as msg:
final_dic = {'upgradeStatus': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
Expand All @@ -266,6 +277,9 @@ def upgradeStatus(request):

def upgradeVersion(request):
try:



vers = version.objects.get(pk=1)
getVersion = requests.get('https://cyberpanel.net/version.txt')
latest = getVersion.json()
Expand Down
33 changes: 29 additions & 4 deletions databases/databaseManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os.path
import sys
import django
from django.shortcuts import redirect

sys.path.append('/usr/local/CyberCP')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
django.setup()
Expand Down Expand Up @@ -85,8 +87,33 @@ def deleteDatabase(self, request = None, userID = None):
return proc.render()

def MySQLManager(self, request = None, userID = None):

try:

from plogical.processUtilities import ProcessUtilities
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:

url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
data = {
"name": "Filemanager",
"IP": ACLManager.fetchIP()
}

import requests
response = requests.post(url, data=json.dumps(data))
Status = response.json()['status']

if (Status == 1):
template = 'baseTemplate/FileManager.html'
else:
return redirect("https://cyberpanel.net/cyberpanel-addons")
else:
template = 'databases/mysqlmanager.html'
except BaseException as msg:
template = 'databases/mysqlmanager.html'

template = 'databases/mysqlmanager.html'
proc = httpProc(request, template, None)
proc = httpProc(request, template, None, 'admin')
return proc.render()
def OptimizeMySQL(self, request = None, userID = None):
from cloudAPI.cloudManager import CloudManager
Expand All @@ -95,14 +122,12 @@ def OptimizeMySQL(self, request = None, userID = None):

data1 = json.loads(result.content)



data = {}
data['ramInGB'] = data1.get('ramInGB')
data['conf'] = data1.get('conf')

template = 'databases/OptimizeMySQL.html'
proc = httpProc(request, template, data)
proc = httpProc(request, template, data, 'admin')
return proc.render()

def fetchDatabases(self, userID = None, data = None):
Expand Down
30 changes: 29 additions & 1 deletion databases/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ def getMysqlstatus(request):
userID = request.session['userID']
finalData = mysqlUtilities.showStatus()

currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

finalData = json.dumps(finalData)
return HttpResponse(finalData)

Expand All @@ -386,6 +393,12 @@ def restartMySQL(request):
try:
userID = request.session['userID']
finalData = mysqlUtilities.restartMySQL()
currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

data = {}

Expand All @@ -402,6 +415,13 @@ def generateRecommendations(request):
try:
userID = request.session['userID']

currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

data = json.loads(request.body)
detectedRam = data['detectedRam']

Expand All @@ -418,9 +438,17 @@ def generateRecommendations(request):

def applyMySQLChanges(request):
try:

userID = request.session['userID']

currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

data = json.loads(request.body)
logging.writeToFile("=-------------------------------------------")
finalData = mysqlUtilities.applyMySQLChanges(data)

data = {}
Expand Down
2 changes: 1 addition & 1 deletion install/php-configs/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ slowlog = /var/log/php-fpm/www-slow.log
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5
;security.limit_extensions = .php .php3 .php4 .php5 .php7 .php8

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
Expand Down
6 changes: 3 additions & 3 deletions install/phpconfigs/php80.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
php74.confextprocessor php74 {
php74.confextprocessor php80 {
type lsapi
address uds://tmp/lshttpd/lsphp74.sock
address uds://tmp/lshttpd/lsphp80.sock
maxConns 50
initTimeout 60
retryTimeout 0
persistConn 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp74/bin/lsphp
path /usr/local/lsws/lsphp80/bin/lsphp
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 400
Expand Down
16 changes: 16 additions & 0 deletions install/phpconfigs/php81.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
php74.confextprocessor php81 {
type lsapi
address uds://tmp/lshttpd/lsphp81.sock
maxConns 50
initTimeout 60
retryTimeout 0
persistConn 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp81/bin/lsphp
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 400
procHardLimit 500
}

16 changes: 16 additions & 0 deletions install/phpconfigs/php82.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
php74.confextprocessor php82 {
type lsapi
address uds://tmp/lshttpd/lsphp82.sock
maxConns 50
initTimeout 60
retryTimeout 0
persistConn 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp82/bin/lsphp
memSoftLimit 2047M
memHardLimit 2047M
procSoftLimit 400
procHardLimit 500
}

Loading