Skip to content

Commit d644934

Browse files
mrsdizzietechknowlogick
authored andcommitted
Use OriginalURL insead of CloneAddr in migration logging (#9418)
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 21f84a6 commit d644934

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/migrations/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string,
5959
opts.PullRequests = false
6060
opts.GitServiceType = structs.PlainGitService
6161
downloader = NewPlainGitDownloader(ownerName, opts.RepoName, opts.CloneAddr)
62-
log.Trace("Will migrate from git: %s", opts.CloneAddr)
62+
log.Trace("Will migrate from git: %s", opts.OriginalURL)
6363
} else if opts.GitServiceType == structs.NotMigrated {
6464
opts.GitServiceType = theFactory.GitServiceType()
6565
}
@@ -77,7 +77,7 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string,
7777
log.Error("rollback failed: %v", err1)
7878
}
7979

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

0 commit comments

Comments
 (0)