mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 03:58:28 +02:00
Mirror SSH Keys -> Managed SSH Keys
This commit is contained in:
1 parent
ab27bfc58e
commit
41f1f53b67
16 files changed
+75
-75
No files matched your search
@@ -118,7 +118,7 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*repo_module.SyncResu
|
||||
timeout := time.Duration(setting.Git.Timeout.Mirror) * time.Second
|
||||
|
||||
// Setup SSH authentication if needed
|
||||
sshAuthSock, cleanup, sshErr := SetupMirrorSSHAgent(ctx, m.Repo, remoteURL.String())
|
||||
sshAuthSock, cleanup, sshErr := SetupManagedSSHAgent(ctx, m.Repo, remoteURL.String())
|
||||
if sshErr != nil {
|
||||
log.Error("SyncMirrors [repo: %-v]: SSH setup error %v", m.Repo, sshErr)
|
||||
return nil, false
|
||||
|
||||
@@ -167,7 +167,7 @@ func runPushSync(ctx context.Context, m *repo_model.PushMirror) error {
|
||||
}
|
||||
|
||||
// Setup SSH authentication
|
||||
sshAuthSock, cleanup, err := SetupMirrorSSHAgent(ctx, repo, remoteURL.String())
|
||||
sshAuthSock, cleanup, err := SetupManagedSSHAgent(ctx, repo, remoteURL.String())
|
||||
if err != nil {
|
||||
log.Error("Failed to set up SSH agent for push mirror %s: %v", repo.FullName(), err)
|
||||
return util.SanitizeErrorCredentialURLs(err)
|
||||
|
||||
@@ -51,9 +51,9 @@ func GetSSHKeypairForURL(ctx context.Context, repo *repo_model.Repository, url s
|
||||
return ssh_module.GetSSHKeypairForURL(ctx, repo, url)
|
||||
}
|
||||
|
||||
// SetupMirrorSSHAgent prepares SSH key-based authentication for a mirror or
|
||||
// SetupManagedSSHAgent prepares SSH key-based authentication for a mirror or
|
||||
// migration git operation against url on behalf of repo. The returned cleanup
|
||||
// is never nil and must always be called by the caller (typically via defer).
|
||||
func SetupMirrorSSHAgent(ctx context.Context, repo *repo_model.Repository, url string) (string, func(), error) {
|
||||
return ssh_module.SetupMirrorSSHAgent(ctx, repo, url)
|
||||
func SetupManagedSSHAgent(ctx context.Context, repo *repo_model.Repository, url string) (string, func(), error) {
|
||||
return ssh_module.SetupManagedSSHAgent(ctx, repo, url)
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
)
|
||||
|
||||
func cloneExternalRepoWithSSHAuth(ctx context.Context, repo *repo_model.Repository, remoteURL string, storageRepo gitrepo.Repository, cloneOpts git.CloneRepoOptions) error {
|
||||
sshAuthSock, cleanup, err := ssh_module.SetupMirrorSSHAgent(ctx, repo, remoteURL)
|
||||
sshAuthSock, cleanup, err := ssh_module.SetupManagedSSHAgent(ctx, repo, remoteURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user