diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index a0418f7d2..1417e28e6 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -491,4 +491,30 @@ class FileManager: return HttpResponse(json_data) except BaseException as msg: - return self.ajaxPre(0, str(msg)) \ No newline at end of file + return self.ajaxPre(0, str(msg)) + + def fixPermissions(self, domainName): + + website = Websites.objects.get(domain=domainName) + externalApp = website.externalApp + + command = 'chown -R %s:%s /home/%s/public_html/*' % (externalApp, externalApp, domainName) + ProcessUtilities.popenExecutioner(command) + + command = 'chown -R %s:%s /home/%s/public_html/.[^.]*' % (externalApp, externalApp, domainName) + ProcessUtilities.popenExecutioner(command) + + command = "chown root:nobody /home/" + domainName + "/logs" + ProcessUtilities.popenExecutioner(command) + + command = "find %s -type d -exec chmod 0755 {} \;" % ("/home/" + domainName + "/public_html") + ProcessUtilities.popenExecutioner(command) + + command = "find %s -type f -exec chmod 0644 {} \;" % ("/home/" + domainName + "/public_html") + ProcessUtilities.popenExecutioner(command) + + command = 'chown %s:nobody /home/%s/public_html' % (externalApp, domainName) + ProcessUtilities.executioner(command) + + command = 'chmod 750 /home/%s/public_html' % (domainName) + ProcessUtilities.executioner(command) \ No newline at end of file diff --git a/filemanager/views.py b/filemanager/views.py index 838759f91..cf91e7d42 100755 --- a/filemanager/views.py +++ b/filemanager/views.py @@ -44,35 +44,13 @@ def changePermissions(request): else: return ACLManager.loadErrorJson('permissionsChanged', 0) - website = Websites.objects.get(domain=domainName) - externalApp = website.externalApp - - command = 'chown -R %s:%s /home/%s/public_html/*' % (externalApp, externalApp, domainName) - ProcessUtilities.popenExecutioner(command) - - command = 'chown -R %s:%s /home/%s/public_html/.[^.]*' % (externalApp, externalApp, domainName) - ProcessUtilities.popenExecutioner(command) - - command = "chown root:nobody /home/" + domainName+"/logs" - ProcessUtilities.popenExecutioner(command) - - command = "find %s -type d -exec chmod 0755 {} \;" % ("/home/" + domainName + "/public_html") - ProcessUtilities.popenExecutioner(command) - - command = "find %s -type f -exec chmod 0644 {} \;" % ("/home/" + domainName + "/public_html") - ProcessUtilities.popenExecutioner(command) - - command = 'chown %s:nobody /home/%s/public_html' % (externalApp, domainName) - ProcessUtilities.executioner(command) - - command = 'chmod 750 /home/%s/public_html' % (domainName) - ProcessUtilities.executioner(command) + fm = FM(request, data) + fm.fixPermissions(domainName) data_ret = {'permissionsChanged': 1, 'error_message': "None"} json_data = json.dumps(data_ret) return HttpResponse(json_data) - except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg)) data_ret = {'permissionsChanged': 0, 'error_message': str(msg)} diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 98eb1f90c..8269cd594 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -19,8 +19,6 @@ import shutil from plogical.mailUtilities import mailUtilities from plogical.processUtilities import ProcessUtilities - - class ApplicationInstaller(multi.Thread): def __init__(self, installApp, extraArgs): @@ -142,13 +140,13 @@ class ApplicationInstaller(multi.Thread): def installWPCLI(self): try: - command = 'sudo wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar' + command = 'wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar' ProcessUtilities.executioner(command) - command = 'sudo chmod +x wp-cli.phar' + command = 'chmod +x wp-cli.phar' ProcessUtilities.executioner(command) - command = 'sudo mv wp-cli.phar /usr/bin/wp' + command = 'mv wp-cli.phar /usr/bin/wp' ProcessUtilities.executioner(command) except BaseException as msg: diff --git a/websiteFunctions/templates/websiteFunctions/manageGIT.html b/websiteFunctions/templates/websiteFunctions/manageGIT.html new file mode 100755 index 000000000..c0debbc16 --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/manageGIT.html @@ -0,0 +1,64 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Manage Git - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + + +
{% trans "Manage and track folders via Git for " %} {{ domainName }}.
+
+ | Folder | +Remote | +Branch | +Status | +Manage | +
|---|---|---|---|---|
| + | + | + | + | + |
+
+ {% trans "Manage Git" %}
+
{% trans "Clone/Staging" %}
@@ -33,7 +36,6 @@
href="/websites/{{ domain }}/sshAccess" title="">{% trans "Set up SSH Access" %}