From e03934f03517c63954d7f23ca42cda74ff6389e9 Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Wed, 18 Dec 2019 21:02:47 -0500 Subject: [PATCH] Use OriginalURL insead of CloneAddr in migration logging (#9418) (#9420) CloneAddr will contain username and password credentials and they will get stored in system notices about failed migrations (and logs if trace is set). Replace with OriginalURL that doesn't have those. --- modules/migrations/migrate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/migrations/migrate.go b/modules/migrations/migrate.go index e2a2c8b7ec..2348defd19 100644 --- a/modules/migrations/migrate.go +++ b/modules/migrations/migrate.go @@ -57,7 +57,7 @@ func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOpt opts.PullRequests = false opts.GitServiceType = structs.PlainGitService downloader = NewPlainGitDownloader(ownerName, opts.RepoName, opts.CloneAddr) - log.Trace("Will migrate from git: %s", opts.CloneAddr) + log.Trace("Will migrate from git: %s", opts.OriginalURL) } else if opts.GitServiceType == structs.NotMigrated { opts.GitServiceType = theFactory.GitServiceType() } @@ -68,7 +68,7 @@ func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOpt log.Error("rollback failed: %v", err1) } - if err2 := models.CreateRepositoryNotice(fmt.Sprintf("Migrate repository from %s failed: %v", opts.CloneAddr, err)); err2 != nil { + if err2 := models.CreateRepositoryNotice(fmt.Sprintf("Migrate repository from %s failed: %v", opts.OriginalURL, err)); err2 != nil { log.Error("create respotiry notice failed: ", err2) } return nil, err