diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-08-18 21:10:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 21:10:39 +0800 |
commit | f9acad82ca231b2a094879e53134b0d91815ddf0 (patch) | |
tree | 31207c11f9d2c7135bfb31cbf1388d94724f1ddc /services/mirror | |
parent | 422c30d3157d9f06af43901a1c7978dd25ca12a5 (diff) | |
download | gitea-f9acad82ca231b2a094879e53134b0d91815ddf0.tar.gz gitea-f9acad82ca231b2a094879e53134b0d91815ddf0.zip |
Add proxy settings and support for migration and webhook (#16704)
* Add proxy settings and support for migration and webhook
* Fix default value
* Add newline for example ini
* Add lfs proxy support
* Fix lint
* Follow @zeripath's review
* Fix git clone
* Fix test
* missgin http requests for proxy
* use empty
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'services/mirror')
-rw-r--r-- | services/mirror/mirror_pull.go | 2 | ||||
-rw-r--r-- | services/mirror/mirror_push.go | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go index 89b5df4638..5bd08fa9bf 100644 --- a/services/mirror/mirror_pull.go +++ b/services/mirror/mirror_pull.go @@ -196,7 +196,7 @@ func runSync(ctx context.Context, m *models.Mirror) ([]*mirrorSyncResult, bool) if m.LFS && setting.LFS.StartServer { log.Trace("SyncMirrors [repo: %-v]: syncing LFS objects...", m.Repo) ep := lfs.DetermineEndpoint(remoteAddr.String(), m.LFSEndpoint) - if err = repo_module.StoreMissingLfsObjectsInRepository(ctx, m.Repo, gitRepo, ep); err != nil { + if err = repo_module.StoreMissingLfsObjectsInRepository(ctx, m.Repo, gitRepo, ep, false); err != nil { log.Error("Failed to synchronize LFS objects for repository: %v", err) } } diff --git a/services/mirror/mirror_push.go b/services/mirror/mirror_push.go index de81303689..c1f53196e3 100644 --- a/services/mirror/mirror_push.go +++ b/services/mirror/mirror_push.go @@ -134,7 +134,7 @@ func runPushSync(ctx context.Context, m *models.PushMirror) error { defer gitRepo.Close() ep := lfs.DetermineEndpoint(remoteAddr.String(), "") - if err := pushAllLFSObjects(ctx, gitRepo, ep); err != nil { + if err := pushAllLFSObjects(ctx, gitRepo, ep, false); err != nil { return util.NewURLSanitizedError(err, remoteAddr, true) } } @@ -176,8 +176,8 @@ func runPushSync(ctx context.Context, m *models.PushMirror) error { return nil } -func pushAllLFSObjects(ctx context.Context, gitRepo *git.Repository, endpoint *url.URL) error { - client := lfs.NewClient(endpoint) +func pushAllLFSObjects(ctx context.Context, gitRepo *git.Repository, endpoint *url.URL, skipTLSVerify bool) error { + client := lfs.NewClient(endpoint, skipTLSVerify) contentStore := lfs.NewContentStore() pointerChan := make(chan lfs.PointerBlob) |