Skip to content
Permalink
Browse files

Fix Dates. Improve CSF integration. Fix Typos

  • Loading branch information...
whattheserver committed Oct 8, 2019
1 parent 99c0c5a commit 25848342f51542a009fa58ce58dd1059b8c13bec
Showing with 379 additions and 108 deletions.
  1. +3 −3 IncBackups/IncBackupsControl.py
  2. +1 −1 IncBackups/static/IncBackups/IncBackups.js
  3. 0 IncBackups/templates/IncBackups/createBackup.html
  4. +3 −3 backup/backupManager.py
  5. 0 baseTemplate/templates/baseTemplate/index.html
  6. +1 −1 cli/cliLogger.py
  7. 0 emailPremium/templates/emailPremium/emailPage.html
  8. +1 −1 emailPremium/templates/emailPremium/listDomains.html
  9. +1 −1 emailPremium/templates/emailPremium/policyServer.html
  10. +46 −0 firewall/templates/firewall/index.html
  11. +6 −6 install/install.py
  12. +1 −1 install/installLog.py
  13. +1 −1 locale/br/LC_MESSAGES/django.po
  14. +1 −1 locale/bs/LC_MESSAGES/django.po
  15. +1 −1 locale/cn/LC_MESSAGES/django.po
  16. +1 −1 locale/es/LC_MESSAGES/django.po
  17. +1 −1 locale/fr/LC_MESSAGES/django.po
  18. +1 −1 locale/gr/LC_MESSAGES/django.po
  19. +1 −1 locale/id/LC_MESSAGES/django.po
  20. +1 −1 locale/it/LC_MESSAGES/django.po
  21. +1 −1 locale/ja/LC_MESSAGES/django.po
  22. +1 −1 locale/pl/LC_MESSAGES/django.po
  23. +1 −1 locale/pt/LC_MESSAGES/django.po
  24. +1 −1 locale/ru/LC_MESSAGES/django.po
  25. +1 −1 locale/tr/LC_MESSAGES/django.po
  26. +1 −1 locale/vi/LC_MESSAGES/django.po
  27. +1 −1 loginSystem/templates/loginSystem/login.html
  28. +2 −2 plogical/CyberCPLogFileWriter.py
  29. +4 −4 plogical/backupSchedule.py
  30. +2 −2 plogical/backupScheduleLocal.py
  31. +9 −9 plogical/backupUtilities.py
  32. +232 −7 plogical/csf.py
  33. 0 plogical/mailUtilities.py
  34. 0 plogical/mysqlUtilities.py
  35. 0 plogical/processUtilities.py
  36. +24 −24 plogical/remoteBackup.py
  37. +18 −18 plogical/remoteTransferUtilities.py
  38. +3 −3 plogical/upgrade.py
  39. +3 −3 pluginInstaller/pluginInstaller.py
  40. +2 −2 postfixSenderPolicy/accept_traffic.py
  41. +2 −2 s3Backups/s3Backups.py
@@ -12,7 +12,7 @@
pass
import threading as multi
from plogical.processUtilities import ProcessUtilities
from IncBackups.models import IncJob, JobSnapshots
from models import IncJob, JobSnapshots
from websiteFunctions.models import Websites
import plogical.randomPassword as randomPassword
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
@@ -316,7 +316,7 @@ def prettify(elem):
reparsed = minidom.parseString(rough_string)
return reparsed.toprettyxml(indent=" ")

## /home/example.com/backup/backup-example-06-50-03-Thu-Feb-2018/meta.xml -- metaPath
## /home/example.com/backup/backup-example.com-02.13.2018_10-24-52/meta.xml -- metaPath

metaPath = '/home/cyberpanel/%s' % (str(randint(1000, 9999)))

@@ -538,4 +538,4 @@ def createBackup(self):
except:
pass

logging.statusWriter(self.statusPath, 'Completed', 1)
logging.statusWriter(self.statusPath, 'Completed', 1)
@@ -491,4 +491,4 @@ app.controller('incrementalDestinations', function ($scope, $http) {
};


});
});
No changes.
6 backup/backupManager.py 100755 → 100644
@@ -142,10 +142,10 @@ def submitBackupCreation(self, userID = None, data = None):

## /home/example.com/backup
backupPath = os.path.join("/home", backupDomain, "backup/")
domainUser = website.externalApp
backupName = 'backup-' + domainUser + "-" + time.strftime("%I-%M-%S-%a-%b-%Y")
backupDomainName = data['websiteToBeBacked']

This comment has been minimized.

Copy link
@whattheserver

whattheserver Oct 10, 2019

Author Collaborator

Original credit for this idea should be attributed to @minhazulOO7

#109

backupName = 'backup-' + backupDomainName + "-" + time.strftime("%m.%d.%Y_%H-%M-%S")

## /home/example.com/backup/backup-example-06-50-03-Thu-Feb-2018
## /home/example.com/backup/backup-example.com-02.13.2018_10-24-52
tempStoragePath = os.path.join(backupPath, backupName)


No changes.
2 cli/cliLogger.py 100755 → 100644
@@ -10,7 +10,7 @@ def writeforCLI(message, level, method):
try:
file = open(cliLogger.fileName, 'a')
file.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] [" + level + ":" + method + "] " + message + "\n")
"%m.%d.%Y_%H-%M-%S") + "] [" + level + ":" + method + "] " + message + "\n")
file.close()
file.close()
except IOError:
No changes.
@@ -11,7 +11,7 @@
<div class="container">

<div id="page-title">
<h2 id="domainNamePage">{% trans "List Domains" %} - <a target="_blank" href="http://go.cyberpanel.net/emailLimits" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Emai Limits Docs" %}</span></a></h2>
<h2 id="domainNamePage">{% trans "List Domains" %} - <a target="_blank" href="http://go.cyberpanel.net/emailLimits" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Email Limits Docs" %}</span></a></h2>
<p>{% trans "On this page you manage emails limits for Domains/Email Addresses" %}</p>
</div>

@@ -10,7 +10,7 @@

<div class="container">
<div id="page-title">
<h2>{% trans "Email Policy Server Configurations!" %} - <a target="_blank" href="http://go.cyberpanel.net/emailLimits" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Emai Limits Docs" %}</span></a> </h2>
<h2>{% trans "Email Policy Server Configurations!" %} - <a target="_blank" href="http://go.cyberpanel.net/emailLimits" style="height: 23px;line-height: 21px;" class="btn btn-border btn-alt border-red btn-link font-red" title=""><span>{% trans "Email Limits Docs" %}</span></a> </h2>
<p>{% trans "Turn ON Email Policy Server to use Email Limits Feature. " %}</p>
</div>

@@ -43,6 +43,52 @@ <h3 class="content-box-header">
</a>
</div>

<div class="col-lg-5 col-md-6 btn-min-width">
<a href="{% url 'csf' %}" title="{% trans 'ConfigServer Security & Firewall (CSF)' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "CSF" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-lock"></i>
</div>
</a>
</div>

<div class="col-lg-5 col-md-6 btn-min-width">
<a href="{% url 'modSecurity' %}" title="{% trans 'ModSecurity Configurations' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "ModSecurity Conf" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-lock"></i>
</div>
</a>
</div>

<div class="col-lg-5 col-md-6 btn-min-width">
<a href="{% url 'modSecRules' %}" title="{% trans 'ModSecurity Rules' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "ModSecurity Rules" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-lock"></i>
</div>
</a>
</div>

<div class="col-lg-5 col-md-6 btn-min-width">
<a href="{% url 'modSecRulesPacks' %}" title="{% trans 'ModSecurity Rules Packs' %}" class="tile-box tile-box-shortcut btn-primary">
<div class="tile-header">
{% trans "ModSecurity Rules Packs" %}
</div>
<div class="tile-content-wrapper">
<i class="fa fa-lock"></i>
</div>
</a>
</div>




</div>
</div>
12 install/install.py 100755 → 100644
@@ -122,10 +122,10 @@ def __init__(self, rootPath, ip, path, cwd, cyberPanelPath, distro):
def stdOut(message, log=0, do_exit=0, code=os.EX_OK):
print("\n\n")
print ("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] #########################################################################\n")
print("[" + time.strftime("%I-%M-%S-%a-%b-%Y") + "] " + message + "\n")
"%m.%d.%Y_%H-%M-%S") + "] #########################################################################\n")
print("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] " + message + "\n")
print ("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] #########################################################################\n")
"%m.%d.%Y_%H-%M-%S") + "] #########################################################################\n")

if log:
logging.InstallLog.writeToFile(message)
@@ -575,7 +575,7 @@ def install_python_setup_tools(self):
if preFlightsChecks.resFailed(self.distro, res):
count = count + 1
print("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] " + "Unable to install Python setup tools, trying again, try number: " + str(
"%m.%d.%Y_%H-%M-%S") + "] " + "Unable to install Python setup tools, trying again, try number: " + str(
count) + "\n")
if count == 3:
logging.InstallLog.writeToFile(
@@ -584,7 +584,7 @@ def install_python_setup_tools(self):
os._exit(0)
else:
logging.InstallLog.writeToFile("Python setup tools Successfully installed!")
print("[" + time.strftime("%I-%M-%S-%a-%b-%Y") + "] " + "Python setup tools Successfully installed!")
print("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] " + "Python setup tools Successfully installed!")
break

def install_python_requests(self):
@@ -2349,7 +2349,7 @@ def downoad_and_install_raindloop(self):
else:
logging.InstallLog.writeToFile("Rainloop permissions changed!")
print(
"[" + time.strftime("%I-%M-%S-%a-%b-%Y") + "] " + "Rainloop permissions changed!")
"[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] " + "Rainloop permissions changed!")
break

#############
2 install/installLog.py 100755 → 100644
@@ -7,5 +7,5 @@ class InstallLog:
def writeToFile(message):
file = open(InstallLog.fileName,'a')
file.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] "+message + "\n")
"%m.%d.%Y_%H-%M-%S") + "] "+message + "\n")
file.close()
@@ -3692,7 +3692,7 @@ msgstr "SpamAssassin конфигурация е успешно променен
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Email лимити документация"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3835,7 +3835,7 @@ msgstr " uspješno je kreiran."
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Email logovi"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3773,7 +3773,7 @@ msgstr " 已成功创建."
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Email日志"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3780,7 +3780,7 @@ msgstr ""
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr ""

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3706,7 +3706,7 @@ msgstr "Les configurations de SpamAssassin ont été enregistrées avec succès.
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Limites de messagerie documentations"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3848,7 +3848,7 @@ msgstr "δημιουργήθηκε με επιτυχία."
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Αρχεία καταγραφής Email "

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3437,7 +3437,7 @@ msgstr ""
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr ""

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3803,7 +3803,7 @@ msgstr "Le configurazioni di SpamAssassin sono state salvate correttamente."
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Documentazione Limiti Email"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3682,7 +3682,7 @@ msgstr "SpamAssassin 設定が保存されました。"
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Eメールの制限ドキュメント"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3676,7 +3676,7 @@ msgstr "Pomyślnie zapisano konfigurację SpamAssassin."
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Limity poczty dokumentacja"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3845,7 +3845,7 @@ msgstr " foi criado com sucesso."
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Logs de E-Mail"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3801,7 +3801,7 @@ msgstr "Успешно запущен процесс резервного коп
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Лог-журнал Эл.почты"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3775,7 +3775,7 @@ msgstr "Yedekleme işlemi başarıyla başlatıldı."
#: emailPremium/templates/emailPremium/policyServer.html:13
#, fuzzy
#| msgid "Email Logs"
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Eposta günlükleri"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -3674,7 +3674,7 @@ msgstr "Đã lưu thành công cấu hình SpamAssassin."
#: emailPremium/templates/emailPremium/emailPage.html:13
#: emailPremium/templates/emailPremium/listDomains.html:14
#: emailPremium/templates/emailPremium/policyServer.html:13
msgid "Emai Limits Docs"
msgid "Email Limits Docs"
msgstr "Tài liệu giới hạn Emai"

#: emailPremium/templates/emailPremium/emailLimits.html:14
@@ -67,7 +67,7 @@
<div class="col-md-8 col-lg-6 clearfix center-margin">
<div class="row">
<div class="col-md-5">
<h3 class="text-transform-upr font-size-17">CyberPanel <span class="opacity-80">v 1.8</span></h3>
<h3 class="text-transform-upr font-size-17">CyberPanel <span class="opacity-80">v 1.9</span></h3>
<p class="font-gray">Web Hosting Control Panel</p>
<div class="divider"></div>
<ul class="reset-ul">
4 plogical/CyberCPLogFileWriter.py 100755 → 100644
@@ -10,7 +10,7 @@ def writeToFile(message):
try:
file = open(CyberCPLogFileWriter.fileName,'a')
file.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] "+ message + "\n")
"%m.%d.%Y_%H-%M-%S") + "] "+ message + "\n")
file.close()

except IOError,msg:
@@ -21,7 +21,7 @@ def writeforCLI(message, level, method):
try:
file = open(CyberCPLogFileWriter.fileName, 'a')
file.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "] [" + level + ":" + method + "] " + message + "\n")
"%m.%d.%Y_%H-%M-%S") + "] [" + level + ":" + method + "] " + message + "\n")
file.close()
file.close()
except IOError:
8 plogical/backupSchedule.py 100755 → 100644
@@ -24,8 +24,8 @@ class backupSchedule:
def remoteBackupLogging(fileName, message):
try:
file = open(fileName,'a')
file.writelines("[" + time.strftime("%I-%M-%S-%a-%b-%Y") + "] "+ message + "\n")
print ("[" + time.strftime("%I-%M-%S-%a-%b-%Y") + "] "+ message + "\n")
file.writelines("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message + "\n")
print ("[" + time.strftime("%m.%d.%Y_%H-%M-%S") + "] "+ message + "\n")
file.close()
except IOError,msg:
return "Can not write to error file."
@@ -192,10 +192,10 @@ def prepare():
try:
destinations = backupUtilities.destinationsPath

backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%I-%M-%S-%a-%b-%Y")
backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%m.%d.%Y_%H-%M-%S")

backupSchedule.remoteBackupLogging(backupLogPath,"#################################################")
backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%I-%M-%S-%a-%b-%Y"))
backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S"))
backupSchedule.remoteBackupLogging(backupLogPath,"#################################################\n")

backupSchedule.remoteBackupLogging(backupLogPath, "")
4 plogical/backupScheduleLocal.py 100755 → 100644
@@ -11,12 +11,12 @@ class backupScheduleLocal:
@staticmethod
def prepare():
try:
backupLogPath = "/usr/local/lscp/logs/local_backup_log." + time.strftime("%I-%M-%S-%a-%b-%Y")
backupLogPath = "/usr/local/lscp/logs/local_backup_log." + time.strftime("%m.%d.%Y_%H-%M-%S")

writeToFile = open(backupLogPath, "a")

backupSchedule.remoteBackupLogging(backupLogPath, "#################################################")
backupSchedule.remoteBackupLogging(backupLogPath," Local Backup log for: " + time.strftime("%I-%M-%S-%a-%b-%Y"))
backupSchedule.remoteBackupLogging(backupLogPath," Local Backup log for: " + time.strftime("%m.%d.%Y_%H-%M-%S"))
backupSchedule.remoteBackupLogging(backupLogPath, "#################################################\n")

backupSchedule.remoteBackupLogging(backupLogPath, "")

0 comments on commit 2584834

Please sign in to comment.
You can’t perform that action at this time.