usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.53k stars 591 forks source link

(Backup) .. RESTORE - needs a fix #454

Open Berndinox opened 3 years ago

Berndinox commented 3 years ago

I can create a backup, fine! Its getting saved in/home/DOMAIN/backup/MYBACKUP_DATE.tar.gz

But when trying to restore it, the page is saying: it will detect all Back ups under /home/backup.

Thats the wrong path and a "normal" (non-admin) user will never be able to place the files there (without messing around with ACLs) - So atm a user has to connect via ssh to manually unpack and replace the files from backup, if necessary.

The concept of backup/restore seems not thought through to be honest.

PS: Overall i love CP!

netbospl commented 3 years ago

I think that fix need to be done at "/cyberpanel/backup/backupManager.py" `Searching 21 files for ".tar.gz"

/home/netbos/cyberpanel/backup/backupManager.py: 366 else: 367 all_files = [] 368: ext = ".tar.gz" 369
370 command = 'sudo chown -R cyberpanel:cyberpanel ' + path ... 589 return ACLManager.loadErrorJson() 590
591: path = "/home/" + domainName + "/backup/" + backup.fileName + ".tar.gz" 592 command = 'sudo rm -f ' + path 593 ProcessUtilities.executioner(command) ... 634 def restoreStatus(self, data=None): 635 try: 636: backupFile = data['backupFile'].strip(".tar.gz") 637
638 path = os.path.join("/home", "backup", data['backupFile']) ... 641 path = os.path.join("/home", "backup", backupFile) 642 elif os.path.exists(data['backupFile']): 643: path = data['backupFile'].strip(".tar.gz") 644 else: 645 dir = data['dir']

4 matches in 1 file `

`Searching 21 files for "backup/*.tar.gz"

0 matches

Searching 21 files for ".tar.gz"

/home/netbos/cyberpanel/backup/backupManager.py: 366 else: 367 all_files = [] 368: ext = ".tar.gz" 369
370 command = 'sudo chown -R cyberpanel:cyberpanel ' + path ... 589 return ACLManager.loadErrorJson() 590
591: path = "/home/" + domainName + "/backup/" + backup.fileName + ".tar.gz" 592 command = 'sudo rm -f ' + path 593 ProcessUtilities.executioner(command) ... 634 def restoreStatus(self, data=None): 635 try: 636: backupFile = data['backupFile'].strip(".tar.gz") 637
638 path = os.path.join("/home", "backup", data['backupFile']) ... 641 path = os.path.join("/home", "backup", backupFile) 642 elif os.path.exists(data['backupFile']): 643: path = data['backupFile'].strip(".tar.gz") 644 else: 645 dir = data['dir']

4 matches in 1 file

Searching 3518 files for "it will detect all Back ups under /home/backup"

0 matches

Searching 3518 files for "it will detect all Back ups under"

/home/netbos/cyberpanel/backup/templates/backup/restore.html: 13

14

{% trans "Restore Website" %} - {% trans "Backup Docs" %}

15:

{% trans "This page can be used to restore your websites, Back up should be generated from CyberPanel Back up generation tool, it will detect all Back ups under /home/backup." %}

16
17

/home/netbos/cyberpanel/locale/bn/LC_MESSAGES/django.po: 1000 msgid "" 1001 "This page can be used to restore your websites, Back up should be generated " 1002: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1003 "/home/backup." 1004 msgstr ""

/home/netbos/cyberpanel/locale/br/LC_MESSAGES/django.mo:

/home/netbos/cyberpanel/locale/br/LC_MESSAGES/django.po: 1062 msgid "" 1063 "This page can be used to restore your websites, Back up should be generated " 1064: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1065 "/home/backup." 1066 msgstr "" /home/netbos/cyberpanel/locale/bs/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/bs/LC_MESSAGES/django.po: 1092 msgid "" 1093 "This page can be used to restore your websites, Back up should be generated " 1094: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1095 "/home/backup." 1096 msgstr "" /home/netbos/cyberpanel/locale/cn/LC_MESSAGES/cyberpanel.mo: /home/netbos/cyberpanel/locale/cn/LC_MESSAGES/cyberpanel.po: 350 msgid "" 351 "This page can be used to restore your websites, Back up should be generated " 352: "from CyberPanel Back up generation tool, it will detect all Back ups under " 353 "/home/backup." 354 msgstr "" /home/netbos/cyberpanel/locale/cn/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/cn/LC_MESSAGES/django.po: 1073 msgid "" 1074 "This page can be used to restore your websites, Back up should be generated " 1075: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1076 "/home/backup." 1077 msgstr "" /home/netbos/cyberpanel/locale/de/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/de/LC_MESSAGES/django.po: 1023 msgid "" 1024 "This page can be used to restore your websites, Back up should be generated " 1025: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1026 "/home/backup." 1027 msgstr "" /home/netbos/cyberpanel/locale/es/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/es/LC_MESSAGES/django.po: 1082 msgid "" 1083 "This page can be used to restore your websites, Back up should be generated " 1084: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1085 "/home/backup." 1086 msgstr "" /home/netbos/cyberpanel/locale/fr/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/fr/LC_MESSAGES/django.po: 1067 msgid "" 1068 "This page can be used to restore your websites, Back up should be generated " 1069: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1070 "/home/backup." 1071 msgstr "" /home/netbos/cyberpanel/locale/gr/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/gr/LC_MESSAGES/django.po: 1102 msgid "" 1103 "This page can be used to restore your websites, Back up should be generated " 1104: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1105 "/home/backup." 1106 msgstr "" /home/netbos/cyberpanel/locale/id/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/id/LC_MESSAGES/django.po: 1056 msgid "" 1057 "This page can be used to restore your websites, Back up should be generated " 1058: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1059 "/home/backup." 1060 msgstr "" /home/netbos/cyberpanel/locale/it/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/it/LC_MESSAGES/django.po: 1079 msgid "" 1080 "This page can be used to restore your websites, Back up should be generated " 1081: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1082 "/home/backup." 1083 msgstr "" /home/netbos/cyberpanel/locale/ja/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/ja/LC_MESSAGES/django.po: 1011 msgid "" 1012 "This page can be used to restore your websites, Back up should be generated " 1013: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1014 "/home/backup." 1015 msgstr "" /home/netbos/cyberpanel/locale/pl/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/pl/LC_MESSAGES/django.po: 1040 msgid "" 1041 "This page can be used to restore your websites, Back up should be generated " 1042: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1043 "/home/backup." 1044 msgstr "" /home/netbos/cyberpanel/locale/pt-BR/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/pt-BR/LC_MESSAGES/django.po: 781 msgid "" 782 "This page can be used to restore your websites, Back up should be generated from CyberPanel " 783: "Back up generation tool, it will detect all Back ups under /home/backup." 784 msgstr "" 785 "Esta página pode ser usada para restaurar os seus websites, o backup deve ser gerado " /home/netbos/cyberpanel/locale/pt/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/pt/LC_MESSAGES/django.po: 1038 msgid "" 1039 "This page can be used to restore your websites, Back up should be generated " 1040: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1041 "/home/backup." 1042 msgstr "" /home/netbos/cyberpanel/locale/ru/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/ru/LC_MESSAGES/django.po: 1081 msgid "" 1082 "This page can be used to restore your websites, Back up should be generated " 1083: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1084 "/home/backup." 1085 msgstr "" /home/netbos/cyberpanel/locale/tr/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/tr/LC_MESSAGES/django.po: 1070 msgid "" 1071 "This page can be used to restore your websites, Back up should be generated " 1072: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1073 "/home/backup." 1074 msgstr "" /home/netbos/cyberpanel/locale/ur-PK/LC_MESSAGES/django.po: 487 msgid "" 488 "This page can be used to restore your websites, Back up should be generated " 489: "from CyberPanel Back up generation tool, it will detect all Back ups under " 490 "/home/backup." 491 msgstr "" /home/netbos/cyberpanel/locale/vi/LC_MESSAGES/django.mo: /home/netbos/cyberpanel/locale/vi/LC_MESSAGES/django.po: 1058 msgid "" 1059 "This page can be used to restore your websites, Back up should be generated " 1060: "from CyberPanel Back up generation tool, it will detect all Back ups under " 1061 "/home/backup." 1062 msgstr "" 37 matches across 37 files '
myst3k commented 3 years ago

Looks like the backup system needs to be updated to a new version, backup/backupManager.py needs to be updated, as well as plogical/backupUtilities.py to properly restore, and the template needs to be updated to select from a list of sites. Updating backupManager.py to have the proper domain does allow the files to be select, however the restore still fails.

AwesomeKhan commented 3 years ago

facing same issue, can backup but unable to restore.