summaryrefslogtreecommitdiffstats
path: root/modules/cron
diff options
context:
space:
mode:
authorPaweł Bogusławski <pawel.boguslawski@ib.pl>2020-12-21 15:39:41 +0100
committerGitHub <noreply@github.com>2020-12-21 15:39:41 +0100
commit839daa85aaba5172b3dd2b3f882aa9639a09f13a (patch)
treecc99ed17087fd3b3b44cdb650efe16e6f0394e55 /modules/cron
parent3a500cf8c4b7892e13cb506af6fe3ab5c1c2faff (diff)
downloadgitea-839daa85aaba5172b3dd2b3f882aa9639a09f13a.tar.gz
gitea-839daa85aaba5172b3dd2b3f882aa9639a09f13a.zip
Added option to disable migrations (#13114)
* Added option to disable migrations This patch introduces DISABLE_MIGRATIONS parameter in [repository] section of app.ini (by default set to false). If set to true it blocks access to repository migration feature. This mod hides also local repo import option in user editor if local repo importing or migrations is disabled. * Alter Example config DISABLE_MIGRATIONS set to false in example config to match its default value. * HTTP error 403 instead of 500 on denied access to migration * Parameter DISABLE_MIGRATIONS exposed via API Fixes: 04b04cf854bcb3ed7659442bcf79822bdebe29e9 Author-Change-Id: IB#1105130
Diffstat (limited to 'modules/cron')
-rw-r--r--modules/cron/tasks_basic.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/cron/tasks_basic.go b/modules/cron/tasks_basic.go
index 4da21fc7d9..a45704e889 100644
--- a/modules/cron/tasks_basic.go
+++ b/modules/cron/tasks_basic.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/migrations"
repository_service "code.gitea.io/gitea/modules/repository"
+ "code.gitea.io/gitea/modules/setting"
mirror_service "code.gitea.io/gitea/services/mirror"
)
@@ -115,5 +116,7 @@ func initBasicTasks() {
registerArchiveCleanup()
registerSyncExternalUsers()
registerDeletedBranchesCleanup()
- registerUpdateMigrationPosterID()
+ if !setting.Repository.DisableMigrations {
+ registerUpdateMigrationPosterID()
+ }
}