Finished full encryption implementation

This commit is contained in:
2022-12-10 21:20:26 +01:00
parent 2b3e4932c2
commit 7b33c5420d
7 changed files with 49 additions and 32 deletions

View File

@@ -4,17 +4,20 @@ class Cleanup(AbstractSplittedSecret):
super(Cleanup, self).__init__()
def getAllFilePaths(self,file_type):
return [
all_file_paths = [
self.getGroupFilesFolderPath(file_type),
self.getUserFilesFolderPath(file_type),
self.getAccumulatedFilePath(file_type)
]
if file_type == AbstractSplittedSecret.TYPE_DECRYPTED:
all_file_paths.append(self.getDecryptedMainDataStandartFolder())
return all_file_paths
def deleteAllFilesInFolder(self,folder_path):
try:
self.executeCommand('rm -v ' + folder_path + '*')
except:
pass
self.executeCommand('rm -r ' + folder_path + '*')
except Exception as error:
print(error)
def cleanupFiles(self,file_type):
for folder_path in self.getAllFilePaths(file_type):
@@ -22,9 +25,9 @@ class Cleanup(AbstractSplittedSecret):
def cleanupForUser(self,user):
try:
self.executeCommand('find "' + self.getFolderPath(AbstractSplittedSecret.TYPE_ENCRYPTED) + '" -not -name "*' + str(user) +'*" -type f -print | xargs rm -v')
except:
pass
self.executeCommand('find "' + self.getDataFolderPath(AbstractSplittedSecret.TYPE_ENCRYPTED) + '" -not -name "*' + str(user) +'*" -type f -print | xargs rm -v')
except Exception as error:
print(error)
self.cleanupFiles(AbstractSplittedSecret.TYPE_DECRYPTED)
def deleteAll(self):