From 6df44d3c95219d695bf13a90c21f01cb9d5108aa Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 22 Dec 2023 11:32:43 -0800 Subject: [PATCH] option to filer.copy with public volume server url fix https://github.com/seaweedfs/seaweedfs/issues/5126 --- weed/command/filer_copy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index 4cef053fc..e1a8999f3 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -46,6 +46,7 @@ type CopyOptions struct { ttlSec int32 checkSize *bool verbose *bool + volumeServerAccess *string } func init() { @@ -61,6 +62,7 @@ func init() { copy.concurrentChunks = cmdFilerCopy.Flag.Int("concurrentChunks", 8, "concurrent chunk copy goroutines for each file") copy.checkSize = cmdFilerCopy.Flag.Bool("check.size", false, "copy when the target file size is different from the source file") copy.verbose = cmdFilerCopy.Flag.Bool("verbose", false, "print out details during copying") + copy.volumeServerAccess = cmdMount.Flag.String("volumeServerAccess", "direct", "access volume servers by [direct|publicUrl|filerProxy]") } var cmdFilerCopy = &Command{ @@ -580,6 +582,9 @@ func (worker *FileCopyWorker) WithFilerClient(streamingMode bool, fn func(filer_ } func (worker *FileCopyWorker) AdjustedUrl(location *filer_pb.Location) string { + if *worker.options.volumeServerAccess == "publicUrl" { + return location.PublicUrl + } return location.Url }