diff --git a/CEO/backup_directories/59c712d9-e6dd-438f-aec9-31ca2ae750e6/backup_dir/fisiere/New Microsoft Excel Worksheet.xlsx b/CEO/backup_directories/59c712d9-e6dd-438f-aec9-31ca2ae750e6/backup_dir/fisiere/New Microsoft Excel Worksheet.xlsx deleted file mode 100644 index d8b87bb..0000000 Binary files a/CEO/backup_directories/59c712d9-e6dd-438f-aec9-31ca2ae750e6/backup_dir/fisiere/New Microsoft Excel Worksheet.xlsx and /dev/null differ diff --git a/CEO/backup_directories/59c712d9-e6dd-438f-aec9-31ca2ae750e6/backup_dir/fisiere/New Microsoft Word Document.docx b/CEO/backup_directories/59c712d9-e6dd-438f-aec9-31ca2ae750e6/backup_dir/fisiere/New Microsoft Word Document.docx deleted file mode 100644 index ff94689..0000000 Binary files a/CEO/backup_directories/59c712d9-e6dd-438f-aec9-31ca2ae750e6/backup_dir/fisiere/New Microsoft Word Document.docx and /dev/null differ diff --git a/CEO/ipConfig.json b/CEO/ipConfig.json index a02bae5..adbb4e0 100644 --- a/CEO/ipConfig.json +++ b/CEO/ipConfig.json @@ -1 +1 @@ -b=xgiT cQ,|{u \ No newline at end of file +/ =9 uDH[ \ No newline at end of file diff --git a/CEO/src/renderer/js/main_menu.js b/CEO/src/renderer/js/main_menu.js index 737a480..75a3ee5 100644 --- a/CEO/src/renderer/js/main_menu.js +++ b/CEO/src/renderer/js/main_menu.js @@ -182,7 +182,7 @@ document.addEventListener('DOMContentLoaded', async function () { .then(() => console.log('Alert window opened')) .catch(error => console.error('Error showing alert:', error))); - const button = document.getElementById('share_alert'); + const button = document.getElementById('share_file_alert'); button.remove(); } diff --git a/UC/backend/src/db/backup_schemes.json b/UC/backend/src/db/backup_schemes.json index b9cbe93..43e145d 100644 --- a/UC/backend/src/db/backup_schemes.json +++ b/UC/backend/src/db/backup_schemes.json @@ -1,11 +1,11 @@ { "7c0ef9d5-23ed-47a6-bfb4-fdcfce436904": { - "ip": "192.168.169.19", + "ip": "192.168.169.127", "directoryStructure": "{\"backup_dir\":{\"files\":[],\"fisiere\":{\"files\":[\"New Microsoft Excel Worksheet.xlsx\",\"New Microsoft Word Document.docx\"]}}}", "totalSize": 19363 }, "59c712d9-e6dd-438f-aec9-31ca2ae750e6": { - "ip": "192.168.169.53", + "ip": "192.168.169.19", "directoryStructure": "{\"backup_dir\":{\"files\":[],\"fisiere\":{\"files\":[\"New Microsoft Excel Worksheet.xlsx\",\"New Microsoft Word Document.docx\"]}}}", "totalSize": 19363 } diff --git a/User/backupSchemes.json b/User/backupSchemes.json new file mode 100644 index 0000000..43e145d --- /dev/null +++ b/User/backupSchemes.json @@ -0,0 +1,12 @@ +{ + "7c0ef9d5-23ed-47a6-bfb4-fdcfce436904": { + "ip": "192.168.169.127", + "directoryStructure": "{\"backup_dir\":{\"files\":[],\"fisiere\":{\"files\":[\"New Microsoft Excel Worksheet.xlsx\",\"New Microsoft Word Document.docx\"]}}}", + "totalSize": 19363 + }, + "59c712d9-e6dd-438f-aec9-31ca2ae750e6": { + "ip": "192.168.169.19", + "directoryStructure": "{\"backup_dir\":{\"files\":[],\"fisiere\":{\"files\":[\"New Microsoft Excel Worksheet.xlsx\",\"New Microsoft Word Document.docx\"]}}}", + "totalSize": 19363 + } +} \ No newline at end of file diff --git a/User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/New Microsoft Excel Worksheet.xlsx b/User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/New Microsoft Excel Worksheet.xlsx deleted file mode 100644 index a12bb7f..0000000 Binary files a/User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/New Microsoft Excel Worksheet.xlsx and /dev/null differ diff --git a/User/backup_directories/7c0ef9d5-23ed-47a6-bfb4-fdcfce436904/backup_dir/fisiere/New Microsoft Excel Worksheet.xlsx b/User/backup_directories/7c0ef9d5-23ed-47a6-bfb4-fdcfce436904/backup_dir/fisiere/New Microsoft Excel Worksheet.xlsx deleted file mode 100644 index 8f3963d..0000000 Binary files a/User/backup_directories/7c0ef9d5-23ed-47a6-bfb4-fdcfce436904/backup_dir/fisiere/New Microsoft Excel Worksheet.xlsx and /dev/null differ diff --git a/User/backup_directories/7c0ef9d5-23ed-47a6-bfb4-fdcfce436904/backup_dir/fisiere/New Microsoft Word Document.docx b/User/backup_directories/7c0ef9d5-23ed-47a6-bfb4-fdcfce436904/backup_dir/fisiere/New Microsoft Word Document.docx deleted file mode 100644 index ebcad29..0000000 Binary files a/User/backup_directories/7c0ef9d5-23ed-47a6-bfb4-fdcfce436904/backup_dir/fisiere/New Microsoft Word Document.docx and /dev/null differ diff --git a/User/dirBackup.json b/User/dirBackup.json new file mode 100644 index 0000000..3b51572 --- /dev/null +++ b/User/dirBackup.json @@ -0,0 +1,15 @@ +{ + "path": "/home/andrei/Desktop/proiect-licenta/dirs/user/backup_dir", + "structure": { + "backup_dir": { + "files": [], + "fisiere": { + "files": [ + "New Microsoft Excel Worksheet.xlsx", + "New Microsoft Word Document.docx" + ] + } + } + }, + "size": 19363 +} \ No newline at end of file diff --git a/User/dirDepartment.json b/User/dirDepartment.json new file mode 100644 index 0000000..bb4392f --- /dev/null +++ b/User/dirDepartment.json @@ -0,0 +1,3 @@ +{ + "path": "/home/andrei/Desktop/proiect-licenta/dirs/user/department_dir" +} \ No newline at end of file diff --git a/User/dirShare.json b/User/dirShare.json new file mode 100644 index 0000000..df67c5e --- /dev/null +++ b/User/dirShare.json @@ -0,0 +1,3 @@ +{ + "path": "/home/andrei/Desktop/proiect-licenta/dirs/user/share_dir" +} \ No newline at end of file diff --git a/User/ipConfig.json b/User/ipConfig.json new file mode 100644 index 0000000..51f378a --- /dev/null +++ b/User/ipConfig.json @@ -0,0 +1 @@ +);'F w-`e/dK \ No newline at end of file diff --git a/User/jobs/backup.js b/User/jobs/backup.js index 3a0c8ae..f206d9e 100644 --- a/User/jobs/backup.js +++ b/User/jobs/backup.js @@ -265,6 +265,7 @@ async function decryptDepartmentFilesToDirectory() { await lockFile(loginDataPath); await lockFile(usersConfigPath); + await lockFile(dirDepartmentPath); await decryptFileInPlace(loginDataPath); await decryptFileInPlace(usersConfigPath); @@ -286,8 +287,7 @@ async function decryptDepartmentFilesToDirectory() { await unlockFile(loginDataPath); await unlockFile(usersConfigPath); - - await removeDirectory(destinationDir); + await unlockFile(dirDepartmentPath); for (const userId of users) { const userDir = path.join(sourceDir, userId); @@ -331,7 +331,7 @@ decryptAndGetServerIP(path.join(__dirname, '..', 'ipConfig.json')).then(ip => { serverIp = ip; }); -const timeoutInterval = 7 * 60 * 1000 //minutes * seconds * miliseconds +const timeoutInterval = 1 * 10 * 1000 //minutes * seconds * miliseconds setInterval(async () => { await decryptDepartmentFilesToDirectory(); diff --git a/User/loginData.json b/User/loginData.json new file mode 100644 index 0000000..d0a73b5 --- /dev/null +++ b/User/loginData.json @@ -0,0 +1 @@ +5oʾ8cA=6ZėhѫE YFYQ>t݃xFFٝzEoaE CEzȽA\$D*}>}K/ev(ݸE`g.Gܽlç`]SXwwˆUL \ No newline at end of file diff --git a/User/usersInSystem.json b/User/usersInSystem.json new file mode 100644 index 0000000..0ca3084 Binary files /dev/null and b/User/usersInSystem.json differ diff --git a/dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/New Microsoft Excel Worksheet.xlsx b/dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/New Microsoft Excel Worksheet.xlsx new file mode 100644 index 0000000..f760a7b Binary files /dev/null and b/dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/New Microsoft Excel Worksheet.xlsx differ diff --git a/User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/alt fisier.txt b/dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/alt fisier.txt similarity index 100% rename from User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/alt fisier.txt rename to dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/alt fisier.txt diff --git a/User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/fisier now.txt b/dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/fisier now.txt similarity index 100% rename from User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/alte fis/fisier now.txt rename to dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/alte fis/fisier now.txt diff --git a/User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/fisier_random.txt b/dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/fisier_random.txt similarity index 100% rename from User/backup_directories/4659e71f-9bb4-4902-97d8-097efa138333/to_backup/fisier_random.txt rename to dirs/user/department_dir/59c712d9-e6dd-438f-aec9-31ca2ae750e6/to_backup/fisier_random.txt