bug fix with backups v2

This commit is contained in:
usmannasir 2024-04-19 00:10:30 +04:00
parent 5505f5a0f7
commit 77425d9e76
5 changed files with 25 additions and 38 deletions

View File

@ -1864,7 +1864,7 @@ app.controller('ConfigureV2Backup', function ($scope, $http, $timeout) {
$scope.setupAccount = function () {
window.open("https://platform.cyberpersons.com/gDrive?name=" + $scope.accountName + '&server=' + window.location.href + 'Setup&domain=' + $scope.selwebsite);
window.open("https://platform.cyberpersons.com/gDrive?name=" + $scope.accountName + '&client_id=' + $scope.client_id + '&client_secret=' + $scope.client_secret + '&server=' + window.location.href + 'Setup&domain=' + $scope.selwebsite);
};
$scope.ConfigerSFTP = function () {

View File

@ -69,6 +69,23 @@
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<p class="text-center"><a href="https://rclone.org/drive/#making-your-own-client-id">Learn how to create this.</a>. These field can be left empty but backups may not work then. </p>
<label class="col-sm-3 control-label">{% trans "client_id" %}</label>
<div class="col-sm-6">
<input name="client_id" type="text" class="form-control"
ng-model="client_id">
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "client_secret" %}</label>
<div class="col-sm-6">
<input name="client_secret" type="text" class="form-control"
ng-model="client_secret">
</div>
</div>
</form>
</div>

View File

@ -747,6 +747,8 @@ def ConfigureV2BackupSetup(request):
req_data['token_uri'] = request.GET.get('to')
req_data['scopes'] = request.GET.get('s')
req_data['accountname'] = request.GET.get('n')
req_data['client_id'] = request.GET.get('client_id')
req_data['client_secret'] = request.GET.get('client_secret')
website = request.GET.get('d')
# logging.writeToFile('domainname is ====%s'%(request.GET.get))
@ -770,7 +772,9 @@ def ConfigureV2BackupSetup(request):
except BaseException as msg:
logging.writeToFile("Error configure"+str(msg))
return redirect(loadLoginPage)
data_ret = {'status': 0, 'error_message': str(msg) + request.get_raw_uri() }
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def CreateV2Backup(request):
try:

View File

@ -203,6 +203,8 @@ port = {config["sshPort"]}
[{config["accountname"]}]
type = drive
scope = drive
client_id={config["client_id"]}
client_secret={config["client_secret"]}
token = {token}
team_drive =
'''

View File

@ -1,36 +0,0 @@
import sys
sys.path.append('/usr/local/CyberCP')
from plogical.processUtilities import ProcessUtilities
def findPHPVersions():
# distro = ProcessUtilities.decideDistro()
# if distro == ProcessUtilities.centos:
# return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
# elif distro == ProcessUtilities.cent8:
# return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
# elif distro == ProcessUtilities.ubuntu20:
# return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
# else:
# return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
try:
# Run the shell command and capture the output
result = ProcessUtilities.outputExecutioner('ls -la /usr/local/lsws')
# Get the lines containing 'lsphp' in the output
lsphp_lines = [line for line in result.split('\n') if 'lsphp' in line]
print(lsphp_lines)
# Extract the version from the lines and format it as 'PHP x.y'
php_versions = ['PHP ' + line.split()[8][5] + '.' + line.split()[8][6:] for line in lsphp_lines]
print(php_versions)
# Now php_versions contains the formatted PHP versions
return php_versions
except BaseException as msg:
print(str(msg))
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
findPHPVersions()