Commit graph

4436 commits

Author SHA1 Message Date
Laurent Peuch
d0666d86d6 [mod] we don't use those filter/offset/limit stuff 2017-08-14 00:47:16 +02:00
Laurent Peuch
968259239d [mod] call directly python code instead of using os.system 2017-08-13 23:40:44 +02:00
Laurent Peuch
1fe568a60d [mod] style, declare everything as once to make code more readable 2017-08-13 23:38:11 +02:00
Laurent Peuch
555caa9c73 [mod] only check once if the domain exist 2017-08-13 23:37:12 +02:00
Laurent Peuch
a8e57d9c6a [mod] don't request the server if a dyndns domain is already subscribed 2017-08-13 23:34:35 +02:00
Laurent Peuch
3f65543dc2 [mod] we need timeout everywhere to avoid blocking code 2017-08-13 23:33:41 +02:00
Laurent Peuch
4c069c5c3f [mod] fails when registering dynette domain and that dynette can't be reached 2017-08-13 23:32:50 +02:00
Laurent Peuch
286449386c [mod] clean code, this is what we indeed want to check 2017-08-13 23:25:11 +02:00
Laurent Peuch
56513bbdb1 [mod] we never used those filtering/offset things 2017-08-13 23:18:18 +02:00
Alexandre Aubin
951589ad07 Regen dnsmasq conf if it's not up to date :| 2017-08-13 17:16:07 -04:00
Laurent Peuch
f41c2dd763 [mod] remove unused import 2017-08-13 23:14:40 +02:00
Laurent Peuch
ee7fd825d4 [mod] remove unused variables 2017-08-13 23:14:17 +02:00
Alexandre Aubin
a050b40559 Removed unusted socket import 2017-08-13 17:07:20 -04:00
ljf (zamentur)
bb4af396d8 [fix] Make read-only mount bind actually read-only (#343)
* [fix] Mount bind readonly not really readonly
* Attempt to clarify and fix some issues with the readonly mount
* Fix some missing messages and exception handling
* Get rid of horrible bash command
* Use subproces.check_call to avoid security hazard
* Revert comment about hard link
* Add test that mount binds are readonly
2017-08-13 22:28:36 +02:00
ljf (zamentur)
3ede5fc39d [fix] Backup without info.json (#342)
* [fix] Backup without info.json
* Add test of archive restore with no info.json
* Fix exception handling in backup_delete when info.json is missng
2017-08-13 22:26:28 +02:00
Alexandre Aubin
1f7d56940e [fix] Tell user that domain dns-conf shows a recommendation only 2017-08-13 14:00:15 -04:00
Alexandre Aubin
b892284266 [fix] Remove check that domain is resolved locally 2017-08-13 12:59:39 -04:00
Laurent Peuch
02ea0c0656 [enh] Add reboot/shutdown actions in tools (#190)
* [enh] Implements shutdown/reboot helpers.
* [enh] Improve reboot/shutdown help.
2017-08-11 16:16:09 +02:00
Laurent Peuch
cd9444f647 Merge pull request #341 from YunoHost/timeout_dyndns
[fix] timeout on request to avoid blocking process
2017-08-11 08:49:51 +02:00
Alexandre Aubin
a5331063cc Put request url in an intermediate variable 2017-08-09 16:12:35 +02:00
Laurent Peuch
31105b8c86 [fix] timeout on request to avoid blocking process 2017-08-08 13:24:16 +02:00
Alexandre Aubin
d6d4717bb2 [fix] Tests were broken from recent changes about m18n 2017-08-07 12:16:31 -04:00
Laurent Peuch
a441f37454 Migration framework (#195)
* [enh] list migrations
* [enh] first version of the migrate command
* [mod] add todo comment
* [mod] migrate command shouldn't return anything
* [mod] rename yunohost_migrations to data_migrations
* [mod] better regex
* [enh] had base class for migration
* [fix] inverted condition
* [enh] save last runned migration
* [enh] add migrations state command
* [mod] add todo comments
* [mod] error handling
* [mod] DRY
* [doc] more comment
* [enh] handle exceptions on migration
* [mod] error handling
* [mod] DRY
* [enh] error handling
* [mod] this is done earlier
* [doc] docstring
* [enh] handle fail to load migration case
* [doc] add TODO Comment
* [fix] typos, thx ju
* [enh] add a migration to remove archivemount (as an example)
* [fix] check_call is boring
* [enh] support forward/backward migrations
* [mod] I don't need auth
* [fix] apt is expecting input...
* [mod] save it as int
* [mod] add some logging
* [doc] update todo
* [fix] I also need to run backward latest runed migration
* [enh] add target cli argument
* [enh] fake migration
* [enh] uniformly convert to int at the same place
* [fix] we need to filename now
* [enh] validate input
* [enh] handle 0 special case
* [mod] rename fake to skip
* [mod] s/runed/run/g
* [doc] anglich typo in comments
* [mod] more explicit error message
* [mod] more typo
* [doc] put comment in the right place
* [mod] typo
* [fix] forgot to cape migrations by target
* [fix] typo
* [mod] uses moulinette helpers
* [enh] launch migrations during package upgrade
* [mod] remove unused import
* [mod] sort translation keys
* [enh] i18n
* [fix] missing __init__.py in data_migrations
* [mod] move to a subcategory
* Typo / caps / consistency
* [fix] forgot that migrations is now in tools, in postinst
* Skip migrations during postinstall
* Remove archivemount example migration
It relied on apt-get, which can't be used during 'postinst' debian scripts because we're already inside a apt
* Add migration for cert group from 'metronome' to 'ssl-cert'
2017-08-07 15:55:18 +02:00
e-lie
36770b0eda [fix] No default backup method (redmine 968) (#339) 2017-08-07 15:30:25 +02:00
opi
535f36b1c1 [fix] Properly catch Invalid manifest json with ValueError. (#324)
* [fix] Properly catch Invalid manifest json with ValueError.
* [fix] display detailed error in every case for invalid manifest
2017-08-07 15:29:53 +02:00
Laurent Peuch
3235f5f3fe [mod] autopep8 2017-08-07 06:58:29 +02:00
Laurent Peuch
99292e32d1 Merge pull request #336 from YunoHost/unglobify_some_globals
[mod] explicitely import previously globals magic variables
2017-08-05 12:24:50 +02:00
Laurent Peuch
baf0d098f5 [mod] explicitely import previously globals magic variables 2017-07-25 21:32:20 +02:00
Alexandre Aubin
a513d0ecbe [enh] Check that url is available and normalize path before app install (#304) 2017-07-24 20:11:58 +02:00
Alexandre Aubin
3afbf0f7b9 [fix] Depreciation warning for --hooks was always shown (#333) 2017-07-23 01:56:05 +02:00
Alexandre Aubin
84153f6390 [mod] Microdecision to go with Moulinette#141 2017-07-21 13:23:32 -04:00
Alexandre Aubin
c96d5f90ec Don't verify SSL during changeurl tests :/ (#332) 2017-07-21 00:45:05 +02:00
Alexandre Aubin
89189ed52f [fix] Refactor DNS conf management for domains (#299)
* Add an helper that build a dict describing the dns conf
* Synchronize the dyndns dns conf with the one from domain.py
* [mod] try to make code more lisible
* [mod] try to make code a bit more lisible
* [mod/fix] try to simplify and clean the code (and remove what looks like a debug return)
* [fix] First delete records, then add the new records
2017-07-21 00:28:37 +02:00
JimboJoe
baf1d44c1f Run change_url scripts as root as a matter of homogeneity (#329) 2017-07-17 20:39:39 +02:00
ljf (zamentur)
20f4a39bf0 [fix] Errors in backup custom methods (#326) 2017-07-13 19:36:31 +02:00
Alexandre Aubin
f0c9e697fe [fix] Do not crash if archivemount is not there (#325) 2017-07-10 17:45:34 +02:00
Alexandre Aubin
6042e71003 [fix] Don't attempt to change hostname in LXC (#301)
* Don't attempt to change hostname in LXC
* Detect any kind of container, not just lxc
2017-06-12 16:58:22 +02:00
opi
5e4cce3f1f [fix] Do not break if disk is not a dict (fixes #redmine-919) (#315) 2017-06-07 11:53:45 +02: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
Alexandre Aubin
2de7e3301b [fix] Typo in applist migration (#317) 2017-06-01 18:14:39 +02:00
Jean-Baptiste
64ab4a82b3 [fix] Yypos in en.json (#314)
* serialzed => serialized
* typo close global_settings_key_doesnt_exists
* serialized/serialize & setings/settings
2017-05-31 17:06:40 +02:00
Alexandre Aubin
7102bf1b0e [fix] Missing change from metronome to ssl-cert (#316) 2017-05-31 16:09:39 +02:00
Alexandre Aubin
7af130d81b Allow regen-conf to manage new files already when they're already present on the system (#311) 2017-05-22 15:24:47 +02:00
Laurent Peuch
f9437bbd33 Global settings (#229)
* [enh] add base to run tests
* [enh] start global settings proto
* [mod] has -> exists
* [enh] configure actionmap for settings module
* [enh] add a default values mecanism
* [enh] nicer yaml dump
* [mod] DRY
* [fix] moulinette doesn't respect positionned arguments
* [fix] typo
* [mod] don't print when it's not needed
* [enh] raise a moulinette exception when the key doesn't exists
* [mod] add todo comments
* [mod] no more default value
* [enh] namespace all global settings commands
* [mod] unix way, be quiet except when needed
* [fix] forgot to add namespace argument to settings-list
* [fix] fail_silently wasn't considered as a cli flag
* [mod] refactoring
* [enh] remove empty namespace on remove
* [enh] print a warning if attempt to list an empty namespace settings
* [mod] refactoring
* [enh] handle case where I can't open settings file
* [enh] handle case where I can't write settings file
* [enh] handle case where I can't serialized settings data into yaml
* [mod] add error return codes
* [enh] start to move to new architecture for settings
* [enh] uses a dict instead of a tuple for settings
* [mod] no more namespace in settings list
* [mod] settings.exists isn't relevant anymore
* [mod] settings.remove isn't relevant anymore
* [enh] fix settings and switch to json
* [enh] adapt settings set
* [enh] don't set a key that doesn't exists
* [enh] check type of keys before settings them
* [enh] start implement default
* [enh] handle case where key doesnt exist for default
* [enh] i18n for bad key type on settings set
* [enh] i18n for bad key type on settings set for enum
* [mod] exception for weird situation
* [mod] this message isn't used anymore
* [enh] i18n for unknown setting key from local settings
* [mod] style
* [enh] start to work on a reset mecanism
* [enh] complain if settings_reset is called without yes
* [fix] --yes of reset is a boolean option
* [enh] backup old settings before resetting
* [fix] bad usage of logger
* [enh] backup unknown settings
* [enh] move settings description in translations
* [enh] add tests for settings
* [enh] migrate to pytest assert style
* [fix] typo
* [doc] add some comments for not explicite part of the code
* [mod] possibilities -> choices for uniformised vocabulary
* [mod] follow rest semantic
* [doc] made namespace usage more explicit
* [fix] we don't use namespace key anymore
* [enh] make settings_default available in cli
* [fix] *really* be Rest semantic
* [doc] add docstrings to settings module functions
* [enh] reset-all and --full option
* [fix] Remove unused global_settings_reset_not_yes
2017-05-16 17:18:07 +02:00
Alexandre Aubin
2d6abf4ffe Use ssl-cert group instead of metronome (#222) 2017-05-16 17:14:42 +02:00
Moul
00d9b9ee86 [fix] app_checkport was broken. 2017-05-10 22:53:40 +02:00
Alexandre Aubin
59aafebea7 [microdecision] Fix typo in checkport, fixes issue 912 on redmine 2017-05-04 18:46:20 +02:00
Alexandre Aubin
785790b930 [enh] Add a custom --yunodebug option for pytest (#303) 2017-05-04 16:23:35 +02:00
ljf (zamentur)
afe28470c0 [enh] Add execution dir in env on hook exec (#293)
* [enh] Add execution dir in env on hook exec
* [enh] YNH_EXECUTION_DIR become YNH_CWD
* [fix] Hook exec with no env fail
* [enh] Remove dead condition
2017-05-03 19:11:01 +02:00
Alexandre Aubin
c502b8c348 [fix] Add random delay to app fetchlist cron job (#297)
* Add random delay to app fetchlist cron job
* Split the sleep and yunohost command on two lines
2017-04-24 13:38:11 +02:00