From d71eaacbf2ff9f97c3577ad9e3a9092f0fdab3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=99=BA=E8=B6=85?= <1012112796@qq.com> Date: Sat, 26 Sep 2020 01:37:33 +0800 Subject: [PATCH] [Docs] Add all chooseable cron config options to 'app.example.ini' (#12931) As title. ref: https://github.com/go-gitea/gitea/blob/master/modules/cron/tasks_basic.go https://github.com/go-gitea/gitea/blob/master/modules/cron/tasks_extended.go https://github.com/go-gitea/gitea/blob/ba20dd7a7b59157d9232de7dfa99a23b0fb0d2aa/modules/setting/cron.go#L7-L11 Signed-off-by: a1012112796 <1012112796@qq.com> --- custom/conf/app.example.ini | 107 +++++++++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 25c3d5a59c..b3b9fd96cc 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -889,13 +889,27 @@ ENABLED = true ; Run cron tasks when Gitea starts. RUN_AT_START = false +; Basic cron tasks + ; Update mirrors [cron.update_mirrors] SCHEDULE = @every 10m +; Enable running Update mirrors task periodically. +ENABLED = true +; Run Update mirrors task when Gitea starts. +RUN_AT_START = false +; Notice if not success +NO_SUCCESS_NOTICE = true ; Repository health check [cron.repo_health_check] SCHEDULE = @every 24h +; Enable running Repository health check task periodically. +ENABLED = true +; Run Repository health check task when Gitea starts. +RUN_AT_START = false +; Notice if not success +NO_SUCCESS_NOTICE = true TIMEOUT = 60s ; Arguments for command 'git fsck', e.g. "--unreachable --tags" ; see more on http://git-scm.com/docs/git-fsck @@ -903,7 +917,12 @@ ARGS = ; Check repository statistics [cron.check_repo_stats] +; Enable running check repository statistics task periodically. +ENABLED = true +; Run check repository statistics task when Gitea starts. RUN_AT_START = true +; Notice if not success +NO_SUCCESS_NOTICE = true SCHEDULE = @every 24h ; Clean up old repository archives @@ -912,6 +931,8 @@ SCHEDULE = @every 24h ENABLED = true ; Whether to always run at least once at start up time (if ENABLED) RUN_AT_START = true +; Notice if not success +NO_SUCCESS_NOTICE = true ; Time interval for job to run SCHEDULE = @every 24h ; Archives created more than OLDER_THAN ago are subject to deletion @@ -919,19 +940,103 @@ OLDER_THAN = 24h ; Synchronize external user data (only LDAP user synchronization is supported) [cron.sync_external_users] +ENABLED = true ; Synchronize external user data when starting server (default false) RUN_AT_START = false +; Notice if not success +NO_SUCCESS_NOTICE = true ; Interval as a duration between each synchronization (default every 24h) SCHEDULE = @every 24h ; Create new users, update existing user data and disable users that are not in external source anymore (default) ; or only create new users if UPDATE_EXISTING is set to false UPDATE_EXISTING = true -; Update migrated repositories' issues and comments' posterid, it will always attempt synchronization when the instance starts. +; Clean-up deleted branches +[cron.deleted_branches_cleanup] +ENABLED = true +; Clean-up deleted branches when starting server (default true) +RUN_AT_START = true +; Notice if not success +NO_SUCCESS_NOTICE = true +; Interval as a duration between each synchronization (default every 24h) +SCHEDULE = @every 24h +; deleted branches than OLDER_THAN ago are subject to deletion +OLDER_THAN = 24h + [cron.update_migration_poster_id] +; Update migrated repositories' issues and comments' posterid, it will always attempt synchronization when the instance starts. +ENABLED = true +; Update migrated repositories' issues and comments' posterid when starting server (default true) +RUN_AT_START = true +; Notice if not success +NO_SUCCESS_NOTICE = true ; Interval as a duration between each synchronization. (default every 24h) SCHEDULE = @every 24h +; Extened cron task +; they was not enabled as default + +; Delete all unactivated accounts +[cron.delete_inactive_accounts] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @annually +OLDER_THAN = 168h + +; Delete all repository archives +[cron.delete_repo_archives] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @annually + +; Garbage collect all repositories +[cron.git_gc_repos] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @every 72h +TIMEOUT = 60s +; Arguments for command 'git gc' +; The default value is same with [git] -> GC_ARGS +ARGS = + +; Update the '.ssh/authorized_keys' file with Gitea SSH keys +[cron.resync_all_sshkeys] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @every 72h + +; Resynchronize pre-receive, update and post-receive hooks of all repositories. +[cron.resync_all_hooks] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @every 72h + +; Reinitialize all missing Git repositories for which records exist +[cron.reinit_missing_repos] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @every 72h + +; Delete all repositories missing their Git files +[cron.delete_missing_repos] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @every 72h + +; Delete generated repository avatars +[cron.delete_generated_repository_avatars] +ENABLED = false +RUN_AT_START = false +NO_SUCCESS_NOTICE = true +SCHEDULE = @every 72h + [git] ; The path of git executable. If empty, Gitea searches through the PATH environment. PATH =