diff options
author | mrsdizzie <info@mrsdizzie.com> | 2019-12-18 16:49:56 -0500 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-12-18 16:49:56 -0500 |
commit | d64493495623280d324fb5908f7fb20952f18a3d (patch) | |
tree | 25e501d8b1ca88bee38b9fd660a62d0c9ce07cca /modules/migrations | |
parent | 21f84a6315a838fdfc05b09ed595976d71f12865 (diff) | |
download | gitea-d64493495623280d324fb5908f7fb20952f18a3d.tar.gz gitea-d64493495623280d324fb5908f7fb20952f18a3d.zip |
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.
Diffstat (limited to 'modules/migrations')
-rw-r--r-- | modules/migrations/migrate.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/migrations/migrate.go b/modules/migrations/migrate.go index ece871a857..fb143f7e29 100644 --- a/modules/migrations/migrate.go +++ b/modules/migrations/migrate.go @@ -59,7 +59,7 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string, 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() } @@ -77,7 +77,7 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string, 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 |