mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dev' into bug/bool-obj-no-desc
This commit is contained in:
commit
dc73768a83
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,5 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
## --- [4.0.6] - 2022/TBD
|
||||
### New features
|
||||
None
|
||||
### Bug fixes
|
||||
- Remove redundant path check on backup restore ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/390))
|
||||
### Tweaks
|
||||
None
|
||||
### Lang
|
||||
- Add string "cloneConfirm" to german translation ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/389))
|
||||
<br><br>
|
||||
|
||||
## --- [4.0.5] - 2022/06/24
|
||||
### New features
|
||||
None
|
||||
|
@ -783,26 +783,21 @@ class Controller:
|
||||
|
||||
def rename_backup_dir(self, old_server_id, new_server_id, new_uuid):
|
||||
server_data = self.servers.get_server_data_by_id(old_server_id)
|
||||
server_obj = self.servers.get_server_obj(new_server_id)
|
||||
old_bu_path = server_data["backup_path"]
|
||||
ServerPermsController.backup_role_swap(old_server_id, new_server_id)
|
||||
if not Helpers.is_os_windows():
|
||||
backup_path = Helpers.validate_traversal(
|
||||
self.helper.backup_path, old_bu_path
|
||||
)
|
||||
if Helpers.is_os_windows():
|
||||
backup_path = Helpers.validate_traversal(
|
||||
Helpers.wtol_path(self.helper.backup_path),
|
||||
Helpers.wtol_path(old_bu_path),
|
||||
)
|
||||
backup_path = Helpers.wtol_path(str(backup_path))
|
||||
backup_path.replace(" ", "^ ")
|
||||
backup_path = Path(backup_path)
|
||||
backup_path = old_bu_path
|
||||
backup_path = Path(backup_path)
|
||||
backup_path_components = list(backup_path.parts)
|
||||
backup_path_components[-1] = new_uuid
|
||||
new_bu_path = pathlib.PurePath(os.path.join(*backup_path_components))
|
||||
if os.path.isdir(new_bu_path):
|
||||
if Helpers.validate_traversal(self.helper.backup_path, new_bu_path):
|
||||
os.rmdir(new_bu_path)
|
||||
server_obj.backup_path = new_bu_path
|
||||
default_backup_dir = os.path.join(self.helper.backup_path, new_uuid)
|
||||
try:
|
||||
os.rmdir(default_backup_dir)
|
||||
except:
|
||||
logger.error("Could not delete default backup dir")
|
||||
self.servers.update_server(server_obj)
|
||||
backup_path.rename(new_bu_path)
|
||||
|
||||
def register_server(
|
||||
|
@ -66,6 +66,7 @@
|
||||
"cannotSeeOnMobile": "Sehen Sie nicht alles auf dem Handy?",
|
||||
"cannotSeeOnMobile2": "Versuchen Sie, die Tabelle seitlich zu verschieben.",
|
||||
"clone": "Klonen",
|
||||
"cloneConfirm": "Sind Sie sich sicher, dass Sie den Server klonen wollen? Diese Aufgabe kann eine Weile dauern.",
|
||||
"cpuCores": "CPU Kerne",
|
||||
"cpuCurFreq": "Momentaner CPU-Takt",
|
||||
"cpuMaxFreq": "Maximaler CPU-Takt",
|
||||
|
Loading…
Reference in New Issue
Block a user