From af1b8a4d833bcc0f12d71d3fe0e1a831423d37f6 Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 21 Jul 2023 10:11:31 +0800 Subject: [PATCH 1/2] cmd/sync: sync custom endpoint env without mount point --- cmd/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/sync.go b/cmd/sync.go index 977178a45699..52eff72a4fc8 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -22,6 +22,7 @@ import ( "net/http" _ "net/http/pprof" "net/url" + "os" "path/filepath" "regexp" "runtime" @@ -315,6 +316,9 @@ func createSyncStorage(uri string, conf *sync.Config) (object.ObjectStorage, err if err != nil { return nil, fmt.Errorf("unescape %s: %s", u.Host, err) } + if os.Getenv(endpoint) != "" { + conf.Env["endpoint"] = os.Getenv(endpoint) + } } else if !conf.NoHTTPS && supportHTTPS(name, u.Host) { endpoint = "https://" + u.Host } else { From 289f46294365079bff70ddf93a80c61865d01ce5 Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 21 Jul 2023 10:58:12 +0800 Subject: [PATCH 2/2] fix --- cmd/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/sync.go b/cmd/sync.go index 52eff72a4fc8..2560a54394f6 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -317,7 +317,7 @@ func createSyncStorage(uri string, conf *sync.Config) (object.ObjectStorage, err return nil, fmt.Errorf("unescape %s: %s", u.Host, err) } if os.Getenv(endpoint) != "" { - conf.Env["endpoint"] = os.Getenv(endpoint) + conf.Env[endpoint] = os.Getenv(endpoint) } } else if !conf.NoHTTPS && supportHTTPS(name, u.Host) { endpoint = "https://" + u.Host