44 Commits

Author SHA1 Message Date
Remco Burema
4fc43c2b32
Compare version-objects, not strings.
This would've gone so wrong if we actually released 4.10 without this, since, as a string, 4.10 is 'smaller than' 4.6 (for example), because alphanumerical-order.

done as part of CURA-8269
2021-06-03 09:25:59 +02:00
Jaime van Kessel
2d572eef7f
No longer include plugins in the backup
Backups are synced with your account anyway. Backing up the plugins means that you
quickly reach the limit of the max size (250mb) that the backups allow.

CURA-8269
2021-06-01 13:34:07 +02:00
Kostas Karmas
7e98fb7fb0 Fix crashing while restoring a backup file with the wrong encoding
Fixes sentry issue CURA-24R
2021-04-19 14:24:42 +02:00
Jelle Spijker
3fd3fd7c7d
Obfuscate sensitive preference data from the back-up
CURA-7180 keyring storage
2021-03-17 08:54:16 +01:00
Ghostkeeper
c7b960edfa
Don't send -1 as profile count
The server gives an error about this and we got complaints about it. As far as we know this can only happen when users mess with their profile folders. Still, it's good to not send -1. The original implementation of this is indeed very naive, but we don't have the resources to refactor that now.
2020-07-21 10:42:24 +02:00
Ghostkeeper
79cc6ec897
Also report failure if the file system can't handle the archive contents
For instance if the file name is too long for this file system, if the computer is running out of disk space or if there is a general failure to write here.

Fixes Sentry issue CURA-YQ.
2020-06-25 09:47:59 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +02:00
Jelle Spijker
d69bf84424
Updated comments in Backup
Converted doxygen style comments to reStructuredText style in the files
 found in Cura/cura/Backup directory recursively  using the script
dox_2_rst.py (provided in the Uranium repo). Comments were manually
 checked and changed if needed.
2020-05-08 15:39:16 +02:00
Remco Burema
a03a2885b6
Check if main config file is in backup zip.
Prevent unpacking of possibly spoofed backups (as a last line of defence if other security has failed).
Zips with partially known content are a lot harder to spoof.
Thanks WhiteHats :-)
2020-01-31 16:26:30 +01:00
Jaime van Kessel
1c9eab6b2b Prevent crashes when backup fails to be restored
Also add a bit of logging so that we know what / how it went wrong
2019-05-16 15:48:09 +02:00
Jaime van Kessel
8acafe09f6 No longer prevent old versions from being restored in backup
CURA-5983
2019-04-04 14:28:29 +02:00
Ghostkeeper
5469613c17
Don't fail the samefile check if second file didn't exist
If the backup file didn't exist but the original did, then apparently they are not the same file so the copy should be allowed.
2018-11-26 09:40:14 +01:00
Ghostkeeper
c9eb57cead
Don't copy preference file to the same location
This crashes Cura on start-up for some people.
2018-11-26 09:32:59 +01:00
ChrisTerBeke
acb7df710c Fix getting cura application instance 2018-10-01 15:37:28 +02:00
Lipu Fei
c04c7654c1 Make Backup._application private 2018-09-28 14:31:36 +02:00
Lipu Fei
6e46772170 Fix imports in Backup 2018-09-28 12:25:03 +02:00
Ghostkeeper
c9480f2f2b
Add types for backup metadata 2018-07-04 17:30:01 +02:00
Diego Prado Gesto
554a3fd908 Merge branch 'master' into mypy_fixes
Conflicts:
cura/Backups/Backup.py
cura/Settings/ExtruderManager.py
cura/Settings/MachineManager.py
2018-06-13 11:53:02 +02:00
Ghostkeeper
2eedc96f36
Convert to Doxygen documentation
Like the rest of Cura and Uranium.
2018-06-11 15:06:48 +02:00
Diego Prado Gesto
a6815e7c61 CURA-5330 Add typing to Backup 2018-06-08 16:31:43 +02:00
ChrisTerBeke
809cab4ea5
Cleanup for cfd1b7b813ccdac76c623243a03633b2059d9a0e 2018-05-23 19:18:11 +02:00
ChrisTerBeke
2bbcb2dd7d Save settings before moving config file on Linux 2018-05-22 17:45:30 +02:00
ChrisTerBeke
a20de3581a Add info message when failed because of version mismatch 2018-05-18 10:08:00 +02:00
ChrisTerBeke
a0d3dae920 Do not allow restore different version 2018-05-18 10:07:20 +02:00
ChrisTerBeke
7b3f334678 Fix ignored files for Windows 2018-05-17 15:07:28 +02:00
Diego Prado Gesto
aa07de45ed Start fixing restore on Windows 2018-05-17 12:13:01 +02:00
ChrisTerBeke
9410f93dbf Remove unused import 2018-05-17 10:16:13 +02:00
ChrisTerBeke
8b0346e11b For now just ignore locked files on windows 2018-05-17 10:15:11 +02:00
ChrisTerBeke
f00459e4cc revert 2018-05-17 09:32:18 +02:00
ChrisTerBeke
fb40ea13cc Try onerror 2018-05-17 09:25:03 +02:00
ChrisTerBeke
eb436a8b0e Ignore permission error on Windows when trying to remove log file 2018-05-17 09:13:55 +02:00
ChrisTerBeke
2ed4b1b014 Fixes for restoring preferences on Linux 2018-05-14 10:16:14 +02:00
ChrisTerBeke
30d66fb8de Copy preferences under Linux to add them to backup, notification messages 2018-05-14 09:47:44 +02:00
ChrisTerBeke
2742d61f9b
Add TODO for later 2018-05-13 01:20:42 +02:00
ChrisTerBeke
4429b5b5c1
Count backup items for meta data, small fixes 2018-05-12 23:35:01 +02:00
ChrisTerBeke
a7342f4619 Do not safe data after restoring backup 2018-05-11 17:13:40 +02:00
ChrisTerBeke
79cebca9f0 Rudimentary restore functionality 2018-05-11 16:45:32 +02:00
ChrisTerBeke
703e52c0c7 Ignore cura.cfg in the backups as it might contain secret data from plugins 2018-05-09 11:25:19 +02:00
ChrisTerBeke
c827703417 Fix ignoring files 2018-05-08 13:47:02 +02:00
ChrisTerBeke
1b1d99c4bc Ignore cura.log in backups 2018-05-08 13:22:17 +02:00
ChrisTerBeke
a4882d8f83 Fixes for archiving paths in backup, fake meta data 2018-05-08 11:46:09 +02:00
ChrisTerBeke
936de402ec use bytes to pass backup file around, generate in memory, small fixes 2018-05-07 15:40:47 +02:00
ChrisTerBeke
64819d517e Start implementing backups functionality 2018-05-07 15:09:08 +02:00
ChrisTerBeke
32e2723c26 Start class layouts for backups and plugins API 2018-05-07 10:55:24 +02:00