Commit graph

23 commits

Author SHA1 Message Date
Maniack Crudelis
7f7fb80b38
Add ynh_delete_file_checksum 2018-08-28 16:49:20 +02:00
Josue-T
bdf923aafc Solve issue with ynh_restore_file (#384)
* Solve issue with ynh_restore_file

While we use the `ynh_restore_file` if the destination already exist the `mv` fonction don't work correctly. By this commit the old directory is renamed.

* Move to /home/yunohost.conf file if already exist in restoration

* Remove if the file is bigger than 500Mo

* Use a local variable

* Fix DEST_PATH

* Fix comment and typo

* More precise comment regarding the behavior if DEST_PATH exists
2018-03-15 18:58:11 +01:00
Maniack Crudelis
65dab2022c
Merge branch 'unstable' into backup_core_only 2018-03-15 17:27:40 +01:00
Alexandre Aubin
af22474a50 Add some [internal] flags in the comment to hide a few helpers from autodoc 2018-03-10 19:01:37 +01:00
Maniack Crudelis
5289889174
Be nice with set -eu 2018-01-10 00:44:25 +01:00
Maniack Crudelis
3dd6317ae6
Add info 2017-12-22 19:33:47 +01:00
Jimmy Monin
810eaec8c9 Don't backup big data items when BACKUP_CORE_ONLY is set 2017-12-22 19:27:02 +01:00
Maniack Crudelis
3a3ec7d9b5 [fix/enh] Use local variables 2017-12-17 20:26:52 +01:00
ljf (zamentur)
d3eeb4bbc7 [enh] Refactor backup management to pave the way to borg (#275)
* [enh] Use a csv to list file to backup
* [enh] Use csv python module
* [wip] Backup refactoring
* [wip] Backup class refactoring
* [enh] Add archivemount dependencies
* [wip] Restore refactoring
* [fix] Some error in this refactoring
* [fix] Missing backup key translation
* [fix] Bad YNH_CWD in hook backup
* [fix] App backup part was broken
* [fix] Restore operation was broken
* [fix] No compressed backup
* [fix] Don't commit backup path into csv if app backup fail
* [fix] Default backup collect_dir should be in tmp subdir
* [enh] Simplify a copy code
* [enh] Build backup info from properties
* [enh] Improve comments presentation
* Adding first tests for backup/restore
* Adding more backup/restore app test scenario
* [enh] Separate BackupMethods in distinct class
* Adding test of restoring a wordpress archive from 2.4
* [fix] Be able to delete backup link too
* [fix] Bad internationalization key
* [fix] Edge case with empty mysql pwd restore
* [fix] Unset var in restore
* [fix] Edge case with empty mysql pwd restore
* Adding test for backup crash handling
* Cleaning tests + checking tmp dir is empty
* [fix] Missing tmp in backup path
* [fix] Error on reading backup csv
* Adding test of failed restore
* Adding tests when not enough space available
* Simplifying tests using markers
* [fix] ynh backup/restore helpers with only one arg
* [fix] Unmount subdir with python
* [enh] Improve backup size management
* [fix] None object in backup
* [enh] Remove dead code
* [fix] Missing locales
* [enh] Adapat test about needed space
* [fix] Pass some test
* [enh] Remove dead code
* [enh] Pass all test
* [enh] Adding test that backups contains what's expected
* Fix typo in tests
* [fix] Bad documentation
* [enh] Add comment
* [enh] Use len in place of implicit {} == False
* [enh] Add comment
* [enh] Add comment
* [enh] Refactoring on _collect_app_files
* Adding skeleton for remaining tests to write
* [enh] Use a csv to list file to backup
* [enh] Use csv python module
* [wip] Backup refactoring
* [wip] Backup class refactoring
* [enh] Add archivemount dependencies
* [wip] Restore refactoring
* [fix] Some error in this refactoring
* [fix] Missing backup key translation
* [fix] Bad YNH_CWD in hook backup
* [fix] App backup part was broken
* [fix] Restore operation was broken
* [fix] No compressed backup
* [fix] Don't commit backup path into csv if app backup fail
* [fix] Default backup collect_dir should be in tmp subdir
* [enh] Simplify a copy code
* [enh] Build backup info from properties
* [enh] Improve comments presentation
* Adding first tests for backup/restore
* Adding more backup/restore app test scenario
* [enh] Separate BackupMethods in distinct class
* Adding test of restoring a wordpress archive from 2.4
* [fix] Be able to delete backup link too
* [fix] Bad internationalization key
* [fix] Edge case with empty mysql pwd restore
* [fix] Unset var in restore
* [fix] Edge case with empty mysql pwd restore
* Adding test for backup crash handling
* Cleaning tests + checking tmp dir is empty
* [fix] Missing tmp in backup path
* [fix] Error on reading backup csv
* Adding test of failed restore
* Adding tests when not enough space available
* Simplifying tests using markers
* [fix] ynh backup/restore helpers with only one arg
* [fix] Unmount subdir with python
* [enh] Improve backup size management
* [fix] None object in backup
* [enh] Remove dead code
* [fix] Missing locales
* [enh] Adapat test about needed space
* [fix] Pass some test
* [enh] Remove dead code
* [enh] Pass all test
* [enh] Adding test that backups contains what's expected
* Fix typo in tests
* [fix] Bad documentation
* Adding skeleton for remaining tests to write
* [enh] Add comment
* [enh] Use len in place of implicit {} == False
* [enh] Add comment
* [enh] Add comment
* [enh] Refactoring on _collect_app_files
* [fix] Replay e1a507 deleted by rebase
* [fix] ynh_restore helper
* Renaming 'hooks' terminology to 'system' where it makes sense
* Propagating new --system/--ignore-system to actionmap
* Adding more tests + clarifying some functions and messages
* Factorize out the definition and validation of backup/restore targets
* Add missing key
* Use list comprehension instead of dirty loops
* [enh] Add docstring in BackupManager
* [enh] Add docstring on BackupMethod(s)
* [fix] Remove deadcode
* [fix] Remove debug message
* [enh] Add comments on RestoreManager
* [enh] Add comments on backup constants
* Adding a proper report/result for each backup target
* Skipping tests not implemented yet
* Fixing little mistake from merging
* [fix] Support different fs or archivemount error
* [enh] Backup helpers readability
* [fix] Copy backup method
* [fix] Deprecated warning always displayed
* [enh] Retrieve info.json file inside tar.gz
* Trying to reorganize methods with sections for readability
* [enh] Support archivemount failure
* [fix] Missing env var for system part restore helpers
* Clarifying disk usage / free space computation
* [enh] Refactoring around backup set_targets()
* Clarifying structure of backup_create and backup_restore
* Move RestoreManager between BackupManager and BackupMethods
* [fix] Missing locales
* [fix] System part restore if archivemount failure
* [enh] Extract all conf instead of specific code
* [fix] Other output directory (compressed archive)
* [enh] Add test for uncompressed backup
* [fix] Compressed backup in an existing output directory
* [fix] Return size for retro-compatibility
* [fix] Mountpoint check aborting script when called with -eu
* [fix] Avoid failure test with set -eu
* [fix] locale strings missing/bad arguments
* Check free space before mount
* [fix] ynh_restore_helpers with existing archive path
* Adding skeletons for moar tests
* Fixing some weird bug in _get_archive_path
* Adding a regen-conf at the end of system restore
* Adding tests of system restore from 2.4
* Have a class dedicated to target management
* Cleaning tests
* Misc formatting
* More meaningful variable names inside app restore
* [fix] can't call source ../settings/scripts/_common.sh in app backup
* [fix] ynh_install_app_dependencies is not compatible with readonly mount
* [fix] Remove temporary file
2017-06-02 13:41:16 +02:00
Maniack Crudelis
c0a40dd2df New helpers ynh_store_file_checksum and ynh_backup_if_checksum_is_different (#286)
* New helpers ynh_store_checksum_config and ynh_compare_checksum_config

Helpers for avoid destruction of personalised config files.
If the config file was manually modified, make a backup of it.

The name of this backup is returned, so the packager can choose which of this both file will used by default.

* Implement @JimboJoe's comments.
* Setting local variables as local
* Adding warning about $app that should be defined
* Remove "globally" in comment to limit confusion
* Remove "globally" in comment to limit confusion
* Remove compress and use /home/yunohost.conf/backup
* Changing timestamp format to match regen-conf's
* Tested and fixed ;)
2017-05-22 15:24:16 +02:00
Maniack Crudelis
47ce6d9e33 New helper ynh_secure_remove (#281)
* New helper ynh_secure_remove
A secure way to remove a file or directory.
Prevent to knew issues.
Tested with this paths:
- / -> Not removed
- /var -> Not removed
- /var/www -> Not removed
- /var/www/file -> Removed
- /opt -> Not removed
- /opt/file -> Removed
- /home/yunohost.app -> Not removed
- /home -> Not removed
- /home/ -> Not removed
- // -> Not removed
- /etc/cron.d/ -> Not removed
- /etc -> Not removed
- /etc/ -> Not removed
- /etc/X11 -> Removed
- /etc/X11/$var -> Removed (if $var is not empty)

* JimboJoe's typo fix
2017-04-30 22:37:52 +02:00
ljf
cc77cd788d [fix] Permission issue on install of some apps 778 2017-02-09 22:26:31 +01:00
opi
8e811fd0ac [enh] Add warning about deprecated ynh_mkdir_tmp helper 2017-02-01 21:30:59 +01:00
Maniack Crudelis
65d412055d Update filesystem 2017-02-01 21:30:50 +01:00
Maniack Crudelis
28ec1dec8f Remove helper ynh_mkdir_tmp
Le helper `ynh_mkdir_tmp` est inutile. Il existe la commande `mktemp -d` pour créer des dossiers temporaires.
2017-02-01 21:30:45 +01:00
JimboJoe
4486b24388 ynh_backup: Fix error message when source path doesn't exist 2017-01-31 15:28:04 +01:00
Jérôme Lebleu
542a7a3b82 [fix] Use the classic way to create read-only bind mount in ynh_backup 2016-05-30 12:05:12 +02:00
Jérôme Lebleu
81c8ce1a54 [fix] Set default value for YNH_APP_BACKUP_DIR in ynh_backup helper 2016-05-29 23:34:08 +02:00
Jérôme Lebleu
403b1d71a3 [fix] Prepend backup dir to relative path only and allow absolute in ynh_backup 2016-05-08 00:26:07 +02:00
Jérôme Lebleu
36a8a2d278 [enh] Try to remount directory as read-only in ynh_backup (wip #298) 2016-05-07 03:17:46 +02:00
Jérôme Lebleu
be9d744f3c [enh] Create ynh_backup helper based on ynh_bind_or_cp 2016-05-06 20:26:14 +02:00
Jérôme Lebleu
fa89291504 [enh] Do not bind mounting if no backup archive is created (wip #298) 2016-04-30 17:19:12 +02:00
Julien Malik
5b7e16384e [enh] move /usr/share/yunohost/apps/helpers to /usr/share/yunohost/helpers since it became of more general use 2016-03-12 00:12:59 +01:00
Renamed from data/apps/helpers.d/filesystem (Browse further)