diff options
author | mrsdizzie <info@mrsdizzie.com> | 2019-12-19 04:49:48 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-19 17:49:48 +0800 |
commit | e57f7639379c8561a8109b35d171a1540d75577e (patch) | |
tree | b2cd63ec4a4d1625a1e5a485d3177a995c515437 /models/migrations/migrations.go | |
parent | 4147cc91ed07666613fa84cd8caffde9b1a8b916 (diff) | |
download | gitea-e57f7639379c8561a8109b35d171a1540d75577e.tar.gz gitea-e57f7639379c8561a8109b35d171a1540d75577e.zip |
Add migration to sanitize repository original_url (#9423)
* Add migration to sanitize repository original_url
During a large code move in #6200 the OriginalURL field was
accidentially changed to be populated with the CloneAddr field which
will contain the username and/or password provided during a migration.
This behavior was fixed in previous PR #9097 and this migration will
remove any authentication details that were stored in the database
between those two.
* use net/url to rebuild URL instead of strings.Replace
* Update models/migrations/migrations.go
* changes per lunny
* make fmt
Diffstat (limited to 'models/migrations/migrations.go')
-rw-r--r-- | models/migrations/migrations.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index cbea5a95dd..923b5f5759 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -282,6 +282,8 @@ var migrations = []Migration{ NewMigration("remove release attachments which repository deleted", removeAttachmentMissedRepo), // v113 -> v114 NewMigration("new feature: change target branch of pull requests", featureChangeTargetBranch), + // v114 -> v115 + NewMigration("Remove authentication credentials from stored URL", sanitizeOriginalURL), } // Migrate database to current version |