Adjust publicUrl to volume server only.
This commit is contained in:
@@ -49,7 +49,6 @@ var cmdServer = &Command{
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
serverIp = cmdServer.Flag.String("ip", "localhost", "ip or server name")
|
serverIp = cmdServer.Flag.String("ip", "localhost", "ip or server name")
|
||||||
serverPublicUrl = cmdServer.Flag.String("publicUrl", "", "publicly accessible address")
|
|
||||||
serverBindIp = cmdServer.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
|
serverBindIp = cmdServer.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
|
||||||
serverMaxCpu = cmdServer.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
|
serverMaxCpu = cmdServer.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
|
||||||
serverTimeout = cmdServer.Flag.Int("idleTimeout", 10, "connection idle seconds")
|
serverTimeout = cmdServer.Flag.Int("idleTimeout", 10, "connection idle seconds")
|
||||||
@@ -71,6 +70,7 @@ var (
|
|||||||
volumePulse = cmdServer.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats")
|
volumePulse = cmdServer.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats")
|
||||||
volumeIndexType = cmdServer.Flag.String("volume.index", "memory", "Choose [memory|leveldb|boltdb] mode for memory~performance balance.")
|
volumeIndexType = cmdServer.Flag.String("volume.index", "memory", "Choose [memory|leveldb|boltdb] mode for memory~performance balance.")
|
||||||
volumeFixJpgOrientation = cmdServer.Flag.Bool("volume.images.fix.orientation", true, "Adjust jpg orientation when uploading.")
|
volumeFixJpgOrientation = cmdServer.Flag.Bool("volume.images.fix.orientation", true, "Adjust jpg orientation when uploading.")
|
||||||
|
volumeServerPublicUrl = cmdServer.Flag.String("volume.publicUrl", "", "publicly accessible address")
|
||||||
isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer")
|
isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer")
|
||||||
|
|
||||||
serverWhiteList []string
|
serverWhiteList []string
|
||||||
@@ -230,8 +230,8 @@ func runServer(cmd *Command, args []string) bool {
|
|||||||
if *volumePublicPort == 0 {
|
if *volumePublicPort == 0 {
|
||||||
*volumePublicPort = *volumePort
|
*volumePublicPort = *volumePort
|
||||||
}
|
}
|
||||||
if *serverPublicUrl == "" {
|
if *volumeServerPublicUrl == "" {
|
||||||
*serverPublicUrl = *serverIp + ":" + strconv.Itoa(*volumePublicPort)
|
*volumeServerPublicUrl = *serverIp + ":" + strconv.Itoa(*volumePublicPort)
|
||||||
}
|
}
|
||||||
isSeperatedPublicPort := *volumePublicPort != *volumePort
|
isSeperatedPublicPort := *volumePublicPort != *volumePort
|
||||||
volumeMux := http.NewServeMux()
|
volumeMux := http.NewServeMux()
|
||||||
@@ -247,7 +247,7 @@ func runServer(cmd *Command, args []string) bool {
|
|||||||
volumeNeedleMapKind = storage.NeedleMapBoltDb
|
volumeNeedleMapKind = storage.NeedleMapBoltDb
|
||||||
}
|
}
|
||||||
volumeServer := weed_server.NewVolumeServer(volumeMux, publicVolumeMux,
|
volumeServer := weed_server.NewVolumeServer(volumeMux, publicVolumeMux,
|
||||||
*serverIp, *volumePort, *serverPublicUrl,
|
*serverIp, *volumePort, *volumeServerPublicUrl,
|
||||||
folders, maxCounts,
|
folders, maxCounts,
|
||||||
volumeNeedleMapKind,
|
volumeNeedleMapKind,
|
||||||
*serverIp+":"+strconv.Itoa(*masterPort), *volumePulse, *serverDataCenter, *serverRack,
|
*serverIp+":"+strconv.Itoa(*masterPort), *volumePulse, *serverDataCenter, *serverRack,
|
||||||
|
|||||||
Reference in New Issue
Block a user