-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added option to disable migrations #13114
Conversation
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. Author-Change-Id: IB#1105130
|
make fmt applied Fixes: 04b04cf Author-Change-Id: IB#1105130
make fmt done |
I think you have missed to add an import to some file |
Missing import added. Fixes: 04b04cf Author-Change-Id: IB#1105130
Missing import added. |
Codecov Report
@@ Coverage Diff @@
## master #13114 +/- ##
==========================================
- Coverage 42.84% 42.12% -0.72%
==========================================
Files 662 689 +27
Lines 73002 75830 +2828
==========================================
+ Hits 31279 31946 +667
- Misses 36652 38648 +1996
- Partials 5071 5236 +165
Continue to review full report at Codecov.
|
routers/repo/migrate.go
Outdated
@@ -25,6 +26,11 @@ const ( | |||
|
|||
// Migrate render migration of repository page | |||
func Migrate(ctx *context.Context) { | |||
if setting.Repository.DisableMigrations { | |||
ctx.ServerError("MigratePost", fmt.Errorf("cannot migrate; migrations disabled")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it's not server error, just return 403 is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed 500 to 403.
DISABLE_MIGRATIONS set to false in example config to match its default value. Fixes: 04b04cf Related: go-gitea#13114 (review) Author-Change-Id: IB#1105130
HTTP error 403 instead of 500 on denied access to migration. Fixes: 04b04cf Related: go-gitea#13114 (review) Author-Change-Id: IB#1105130
@pboguslawski some global settings are exposed via settings APIs, i think this should be exposed too :) After this I think I'm fine with it |
Parameter DISABLE_MIGRATIONS is now exposed via API. Fixes: 04b04cf Related: go-gitea#13114 (comment) Author-Change-Id: IB#1105130
Fixed. |
Done make generate-swagger. Fixes: 07760e7 Related: go-gitea#13114 (comment) Author-Change-Id: IB#1105130
Please update the branch |
Just merged current master to this PR. |
@pboguslawski can you do this again or give maintainers write permissions to this pull? |
Didn't find a way to allow rw access for maintainers to thist PR. Just pressed "Update branch" in gihtub - please check if its ok now. |
@pboguslawski I think this is because the pull is from a fork owned not by you but an org - a github issue ... |
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.
Author-Change-Id: IB#1105130