Merge branch 'dev' into bug/bool-obj-no-desc

This commit is contained in:
Zedifus 2022-07-05 23:26:01 +01:00
commit dc73768a83
3 changed files with 22 additions and 15 deletions

View File

@ -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

View File

@ -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(

View File

@ -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",