summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-03-19 14:16:38 +0000
committerGitHub <noreply@github.com>2022-03-19 14:16:38 +0000
commit2d21d2af9ef907ed3407b07d6a0191c39a29ee54 (patch)
tree8beaec74bab15d8e74219120d966f9eec0bf2bf5 /services
parentfb08d2b3fd04dc8fc6cbd45fd341773b817c0857 (diff)
downloadgitea-2d21d2af9ef907ed3407b07d6a0191c39a29ee54.tar.gz
gitea-2d21d2af9ef907ed3407b07d6a0191c39a29ee54.zip
Make migrations SKIP_TLS_VERIFY apply to git too (#19132)
Make SKIP_TLS_VERIFY apply to git data migrations too through adding the `-c http.sslVerify=false` option to the git clone command. Fix #18998 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'services')
-rw-r--r--services/migrations/dump.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/services/migrations/dump.go b/services/migrations/dump.go
index 9a093ef298..594b78511a 100644
--- a/services/migrations/dump.go
+++ b/services/migrations/dump.go
@@ -22,6 +22,7 @@ import (
"code.gitea.io/gitea/modules/log"
base "code.gitea.io/gitea/modules/migration"
"code.gitea.io/gitea/modules/repository"
+ "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/structs"
"gopkg.in/yaml.v2"
@@ -149,9 +150,10 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
}
err = git.Clone(g.ctx, remoteAddr, repoPath, git.CloneRepoOptions{
- Mirror: true,
- Quiet: true,
- Timeout: migrateTimeout,
+ Mirror: true,
+ Quiet: true,
+ Timeout: migrateTimeout,
+ SkipTLSVerify: setting.Migrations.SkipTLSVerify,
})
if err != nil {
return fmt.Errorf("Clone: %v", err)
@@ -166,10 +168,11 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
}
if err := git.Clone(g.ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{
- Mirror: true,
- Quiet: true,
- Timeout: migrateTimeout,
- Branch: "master",
+ Mirror: true,
+ Quiet: true,
+ Timeout: migrateTimeout,
+ Branch: "master",
+ SkipTLSVerify: setting.Migrations.SkipTLSVerify,
}); err != nil {
log.Warn("Clone wiki: %v", err)
if err := os.RemoveAll(wikiPath); err != nil {