Commit graph

231 commits

Author SHA1 Message Date
tofbouf
f0ae164afe
Apply realpath to find mounted points to unmount
Bindings created by some backup methods appears with their 'real' path in /etc/mtab, that may differ from the original /home/yunohost.backup/tmp/auto_xxx that is passed to _recursive_umount().
This fix applies realpath to the 'directory' parameter passed to _recursive_umount().

Tested OK on my own instance, where backups with Borg were failing (except the first one after a reboot) because of this issue (it was unable to clean temporary dir).
2021-05-27 14:28:48 +02:00
Alexandre Aubin
4aaf015428
Also catch tarfile.ReadError as possible archive corruption error 2021-05-09 18:38:17 +02:00
yunohost-bot
2443b2ee1d [CI] Format code 2021-04-26 15:10:07 +00:00
yunohost-bot
66f2613518 [CI] Format code 2021-04-17 00:31:06 +00:00
Alexandre Aubin
931ed64e1b
Merge pull request #1214 from YunoHost/more-uniform-tmp-workdir-for-apps
More uniform tmp dir for apps, remove some weird 'admin' ownership
2021-04-17 01:56:28 +02:00
Alexandre Aubin
3f892c7f02
Merge pull request #1205 from YunoHost/backup-create-dry-run
Add a --dry-run option to backup_create to fetch an estimate of the backup size
2021-04-17 01:56:20 +02:00
Alexandre Aubin
a373047756 More uniform tmp dir for apps, remove some weird 'admin' ownership 2021-04-15 22:27:05 +02:00
Kay0u
6745fce647
fix tests 2021-04-13 16:28:32 +02:00
Kay0u
f6687e69f8
user_permission_list: use the new apps arg when we can 2021-04-13 13:22:07 +02:00
Alexandre Aubin
23ceedf5d1
Merge pull request #1191 from YunoHost/improve-restore-error-management
Improve error management for app restore, similar to what's done in app install
2021-04-05 20:57:34 +02:00
Alexandre Aubin
e5b4d2aa73 Trick to add all the apps/ folder such that they are correctly attributed to the corresponding app when we compute the size_details later 2021-04-05 20:46:33 +02:00
Alexandre Aubin
93166741ee Simplify indentation 2021-04-05 20:45:51 +02:00
Alexandre Aubin
28268c58eb Add a --dry-run option to backup_create that returns the size of items that will be backed up 2021-04-05 20:45:28 +02:00
Alexandre Aubin
fe9f0731e8 Add logging to backup_create 2021-04-05 18:39:26 +02:00
Alexandre Aubin
6d3fcd6cc3 Improve error management for app restore, similar to what's done in app install 2021-04-05 16:31:09 +02:00
Alexandre Aubin
80e2e0da71 Misc test fixes for corrupted archive test though not sure what doing .. 2021-04-03 01:28:52 +02:00
Alexandre Aubin
dc10e88b1e Unused imports 2021-04-02 22:36:34 +02:00
Alexandre Aubin
c552b4f006 Be able to define directly in migrations hooks that are called when restoring system/apps prior to the introduction of the migration 2021-04-02 04:28:52 +02:00
Alexandre Aubin
df49cc83d5 Drop legacy stuff for backups from before the 3.7 era 2021-04-02 03:55:20 +02:00
Alexandre Aubin
8b8a8fb3c7 Drop support for restoring backup archives from prior to 3.8 2021-04-02 03:13:53 +02:00
Alexandre Aubin
00ec7b2fc4 Support having .tar / .tar.gz in the archive name arg of backup_info/restore 2021-04-01 22:58:04 +02:00
Alexandre Aubin
e63ca06d37 Missing import 2021-03-22 21:58:15 +01:00
Alexandre Aubin
01ccab5252 Add semantic of YunohostValidationError for all exceptions which are related to validating stuff 2021-03-11 01:39:52 +01:00
Alexandre Aubin
acfea3d76d Define YNH_APP_BASEDIR to be able to properly point to conf folder depending on the app script we're running 2021-02-23 02:17:04 +01:00
Laurent Peuch
97f26015c6 [fix] kill all bare exceptions 2021-02-02 14:40:29 +01:00
yunohost-bot
c4439110e1 [CI] Format code 2021-02-02 03:37:40 +00:00
Alexandre Aubin
10ba00affe logger.exception -> logger.error because logger.exception displays a stacktrace and it ain't relevant in any of these cases 2021-02-02 03:57:33 +01:00
Alexandre Aubin
c659216e23 Make sure tmp_script exists .. 2021-01-22 03:32:27 +01:00
Alexandre Aubin
09acc2a466
Merge branch 'dev' into less-madness-for-hook-exec 2021-01-19 23:25:43 +01:00
Alexandre Aubin
c43a51ba30
Merge branch 'dev' into enh-python3 2021-01-10 18:31:19 +01:00
Alexandre Aubin
46a902a263 Merge branch 'dev' into less-madness-for-hook-exec 2021-01-03 23:05:44 +01:00
Alexandre Aubin
c272d20a31 Zblerg, forgot an unused 'e' 2021-01-03 04:00:51 +01:00
Alexandre Aubin
de126fcdce Don't allow failure for invalid python3 code + fix unsued variables 2021-01-02 20:43:39 +01:00
Alexandre Aubin
2b12b67847 python3: Add some list() where that sounds relevant 2021-01-02 19:48:44 +01:00
Alexandre Aubin
1ac59f9877 More encode/decode fixes 2021-01-01 05:04:54 +01:00
Alexandre Aubin
cce020daac Uniformize check_output calls to use moulinette helpers which shall now automatically decode() automatically + also strip() etc 2021-01-01 05:03:55 +01:00
Alexandre Aubin
8e30768598 2to3-2.7 ./src/yunohost/{,data_migrations/,utils/,tests/}*.py data/hooks/diagnosis/*.py -w -x dict -x print --nobackups --no-diffs 2020-12-30 21:53:43 +01:00
Kayou
9e2e5ce55e
not protected by default 2020-12-29 23:59:13 +01:00
Kayou
2b80bac769
Fix restore permission 2020-12-29 23:12:14 +01:00
Alexandre Aubin
2428f01521 Do not pass app args to the command line, they're already provided in the env... 2020-12-05 20:35:53 +01:00
Alexandre Aubin
74272de52c
We need to have YNH_MANIFEST_VERSION also defined during backup/restore (#1088)
* We need to have YNH_MANIFEST_VERSION also defined during backup/restore

Co-authored-by: Kayou <pierre@kayou.io>
2020-11-30 23:20:13 +01:00
Alexandre Aubin
0aaaeef807 Backup restore: Only ask that question about 'system already installed' if some system parts are actually going to be restored... 2020-11-16 18:42:04 +01:00
Alexandre Aubin
05b1a8f96e autopep8 --in-place -a -a -a --ignore E402,E501,E722 -r src/yunohost/*.py 2020-10-30 15:22:40 +01:00
Alexandre Aubin
00a10c9a5d Fix some possible label inconsistencies when restoring apps permissions 2020-10-29 23:35:03 +01:00
Alexandre Aubin
e047b67b1d Move legacy permission setting migration to legacy.py 2020-10-29 23:16:27 +01:00
Alexandre Aubin
4279c108ba Don't forget to handle _regex legacy permission settings 2020-10-29 19:58:07 +01:00
Alexandre Aubin
fb44bd1c66 Try to uh simplify the whole full_path=True / False thing, most of the time internally we want it set to False 2020-10-01 23:47:56 +02:00
Alexandre Aubin
a7d105ace6 Merge branch 'dev' into permission_protection 2020-09-30 18:48:26 +02:00
Alexandre Aubin
950dbc6b46
Merge pull request #935 from YunoHost/remove_legacy_settings
Remove legacy settings
2020-09-30 17:06:08 +02:00
Alexandre Aubin
2864c07266
Merge pull request #1046 from YunoHost/backup_download
Add possibility to download backups
2020-09-16 17:41:08 +02:00