added proxy for git everywhere

This commit is contained in:
yashsinghcodes
2024-08-06 23:58:34 +05:30
parent 68db8aae14
commit 9b37eb34f9
2 changed files with 39 additions and 0 deletions
+13
View File
@@ -3940,6 +3940,19 @@ func LoadSpecificApps(resp http.ResponseWriter, request *http.Request) {
cloneOptions.ReferenceName = plumbing.ReferenceName(tmpBody.Branch)
}
if os.Getenv("HTTP_PROXY") != "" {
cloneOptions.ProxyOptions = gitProxy.ProxyOptions{
URL: os.Getenv("HTTP_PROXY"),
}
}
if os.Getenv("HTTPS_PROXY") != "" {
cloneOptions.ProxyOptions = gitProxy.ProxyOptions{
URL: os.Getenv("HTTPS_PROXY"),
}
}
// FIXME: Better auth.
if len(tmpBody.Field1) > 0 && len(tmpBody.Field2) > 0 {
cloneOptions.Auth = &http2.BasicAuth{