Skip to content

Commit e03934f

Browse files
mrsdizzietechknowlogick
authored andcommitted
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.
1 parent 3a14a69 commit e03934f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/migrations/migrate.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOpt
5757
opts.PullRequests = false
5858
opts.GitServiceType = structs.PlainGitService
5959
downloader = NewPlainGitDownloader(ownerName, opts.RepoName, opts.CloneAddr)
60-
log.Trace("Will migrate from git: %s", opts.CloneAddr)
60+
log.Trace("Will migrate from git: %s", opts.OriginalURL)
6161
} else if opts.GitServiceType == structs.NotMigrated {
6262
opts.GitServiceType = theFactory.GitServiceType()
6363
}
@@ -68,7 +68,7 @@ func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOpt
6868
log.Error("rollback failed: %v", err1)
6969
}
7070

71-
if err2 := models.CreateRepositoryNotice(fmt.Sprintf("Migrate repository from %s failed: %v", opts.CloneAddr, err)); err2 != nil {
71+
if err2 := models.CreateRepositoryNotice(fmt.Sprintf("Migrate repository from %s failed: %v", opts.OriginalURL, err)); err2 != nil {
7272
log.Error("create respotiry notice failed: ", err2)
7373
}
7474
return nil, err

0 commit comments

Comments
 (0)