Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
feature: support non-ipv4 format node address for Dragonfly
Browse files Browse the repository at this point in the history
Signed-off-by: Starnop <[email protected]>
  • Loading branch information
starnop committed Jul 30, 2019
1 parent 9c2fced commit 621893d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Name | Flag | Remark
------------------------------ | ------------------------- | ----------
dfdaemon proxy server port | dfdaemon --port | The port should be in the range of 2000-65535.
dfget uploader server port | dfget server --port | You can use command `dfget server` to start a uploader server before using dfget to download if you don't want to use a random port.
supernode register port | supernode --port | You can use `dfget --node IP:port` to register with the specified supernode register port.
supernode register port | supernode --port | You can use `dfget --node host:port` to register with the specified supernode register port.
supernode cdn file server port | supernode --download-port | You should prepare a file server firstly and listen on the port that flag `download-port` will use.

**NOTE**: The supernode maintains both Java and Golang versions currently. And the above table is for the Golang version. And you will get a guide [here](https://d7y.io/en-us/docs/userguide/supernode_configuration.html) for Java version.
Expand Down
3 changes: 1 addition & 2 deletions apis/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,7 @@ definitions:
format: "ipv4"
superNodeIp:
type: "string"
description: "IP address of supernode that the client can connect to"
format: "ipv4"
description: "The address of supernode that the client can connect to"
hostName:
type: "string"
description: "host name of peer client node."
Expand Down
22 changes: 2 additions & 20 deletions apis/types/task_register_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/dfdaemon/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func init() {
rf.String("ratelimit", util.NetLimit(), "net speed limit,format:xxxM/K")
rf.String("urlfilter", "Signature&Expires&OSSAccessKeyId", "filter specified url fields")
rf.Bool("notbs", true, "not try back source to download if throw exception")
rf.StringSlice("node", nil, "specify the addresses(IP:port) of supernodes that will be passed to dfget.")
rf.StringSlice("node", nil, "specify the addresses(host:port) of supernodes that will be passed to dfget.")

exitOnError(bindRootFlags(viper.GetViper()), "bind root command flags")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/dfget/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func initFlags() {
flagSet.StringSliceVar(&cfg.Header, "header", nil,
"http header, eg: --header='Accept: *' --header='Host: abc'")
flagSet.StringSliceVarP(&cfg.Node, "node", "n", nil,
"specify the addresses(IP:port) of supernodes")
"specify the addresses(host:port) of supernodes")
flagSet.BoolVar(&cfg.Notbs, "notbs", false,
"disable back source downloading for requested file when p2p fails to download it")
flagSet.BoolVar(&cfg.DFDaemon, "dfdaemon", false,
Expand Down
2 changes: 1 addition & 1 deletion hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ main() {
if [[ "1" == "${USE_DOCKER}" ]]
then
echo "Begin to build with docker."
case "$1" in
case "${1-}" in
dfdaemon)
build-dfdaemon-docker
;;
Expand Down
10 changes: 5 additions & 5 deletions hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd "${curDir}" || return
. ./env.sh

install() {
case "$1" in
case "${1-}" in
dfclient)
install-client
;;
Expand Down Expand Up @@ -53,7 +53,7 @@ install-supernode(){


uninstall() {
case "$1" in
case "${1-}" in
dfclient)
uninstall-client
;;
Expand Down Expand Up @@ -101,12 +101,12 @@ createDir() {
}

main() {
case "$1" in
case "${1-}" in
install)
install "$2"
install "${2-}"
;;
uninstall)
uninstall "$2"
uninstall "${2-}"
;;
*)
echo "You must specify the subcommand 'install' or 'uninstall'."
Expand Down
2 changes: 1 addition & 1 deletion hack/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ main() {
FPM="fpm"
fi

case "$1" in
case "${1-}" in
rpm )
build_rpm
;;
Expand Down
2 changes: 1 addition & 1 deletion supernode/server/0.3_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (s *Server) registry(ctx context.Context, rw http.ResponseWriter, req *http
PeerID: peerID,
RawURL: request.RawURL,
TaskURL: request.TaskURL,
SupernodeIP: request.SuperNodeIP.String(),
SupernodeIP: request.SuperNodeIP,
}
resp, err := s.TaskMgr.Register(ctx, taskCreateRequest)
if err != nil {
Expand Down

0 comments on commit 621893d

Please sign in to comment.