mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
fix: 解决应用安装失败的问题 (#5319)
This commit is contained in:
parent
37de6aae66
commit
0e74acbec0
@ -840,11 +840,7 @@ func (a AppService) SyncAppListFromRemote() (err error) {
|
||||
oldAppIds = append(oldAppIds, old.ID)
|
||||
}
|
||||
|
||||
var transport *http.Transport
|
||||
ok, transportItem := xpack.LoadRequestTransport()
|
||||
if ok {
|
||||
transport = transportItem
|
||||
}
|
||||
transport := xpack.LoadRequestTransport()
|
||||
baseRemoteUrl := fmt.Sprintf("%s/%s/1panel", global.CONF.System.AppRepo, global.CONF.System.Mode)
|
||||
appsMap := getApps(oldApps, list.Apps)
|
||||
|
||||
|
@ -2,9 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
@ -17,22 +15,8 @@ func GetHttpRes(url string) (*http.Response, error) {
|
||||
client := &http.Client{
|
||||
Timeout: time.Second * 300,
|
||||
}
|
||||
transportItem := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 60 * time.Second,
|
||||
KeepAlive: 60 * time.Second,
|
||||
}).DialContext,
|
||||
TLSHandshakeTimeout: 5 * time.Second,
|
||||
ResponseHeaderTimeout: 10 * time.Second,
|
||||
IdleConnTimeout: 15 * time.Second,
|
||||
}
|
||||
ok, transport := xpack.LoadRequestTransport()
|
||||
if ok {
|
||||
transportItem.DialContext = transport.DialContext
|
||||
transportItem.Proxy = transport.Proxy
|
||||
}
|
||||
client.Transport = transportItem
|
||||
transport := xpack.LoadRequestTransport()
|
||||
client.Transport = transport
|
||||
|
||||
req, err := http.NewRequestWithContext(context.Background(), "GET", url, nil)
|
||||
if err != nil {
|
||||
|
@ -11,11 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleGet(url, method string) (int, []byte, error) {
|
||||
var transport *http.Transport
|
||||
ok, transportItem := xpack.LoadRequestTransport()
|
||||
if ok {
|
||||
transport = transportItem
|
||||
}
|
||||
transport := xpack.LoadRequestTransport()
|
||||
return HandleGetWithTransport(url, method, transport)
|
||||
}
|
||||
|
||||
|
@ -2,12 +2,26 @@
|
||||
|
||||
package xpack
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func RemoveTamper(website string) {}
|
||||
|
||||
func LoadRequestTransport() (bool, *http.Transport) {
|
||||
return false, nil
|
||||
func LoadRequestTransport() *http.Transport {
|
||||
return &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 60 * time.Second,
|
||||
KeepAlive: 60 * time.Second,
|
||||
}).DialContext,
|
||||
TLSHandshakeTimeout: 5 * time.Second,
|
||||
ResponseHeaderTimeout: 10 * time.Second,
|
||||
IdleConnTimeout: 15 * time.Second,
|
||||
}
|
||||
}
|
||||
|
||||
func LoadGpuInfo() []interface{} {
|
||||
|
Loading…
Reference in New Issue
Block a user