mirror of
https://github.com/kevinveenbirkenbach/splitted-secret.git
synced 2026-07-22 18:04:15 +00:00
Finished full encryption implementation
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user