docker-minecraft-server icon indicating copy to clipboard operation
docker-minecraft-server copied to clipboard

Broken ftp protocol support for map download ($WORLD)

Open super-bunny opened this issue 2 years ago • 3 comments

Describe the problem

I try to start a container with a map hosted on a ftp server but it fail to download the map.

This commit (18d8aba) seems to introduce a regression on ftp protocol support for map download. You've replaced the curl command with the get sub command of mc-image-helper which seems to not support ftp protocol.

Container definition

docker run -it -p 25565:25565 -e EULA=TRUE -e WORLD=ftp://host/path/to/map.zip itzg/minecraft-server

Container logs

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Jun 27 14:17 /data'
[init] Resolved version given LATEST into 1.19 and major version 1.19
[init] Resolving type given VANILLA
[init] Locating download for minecraft_server.1.19.jar ...
[init] Downloading world from ftp://host/path/to/map.zip
[mc-image-helper] 23:06:22.036 ERROR : 'get' command failed: Unroutable protocol scheme: ftp://host
[init] ERROR: failed to download world from ftp://host/path/to/map.zip

super-bunny avatar Jul 06 '22 23:07 super-bunny

FTP wasn't intended to be supported, so I'll queue this up as an enhancement.

itzg avatar Jul 07 '22 13:07 itzg

Too bad, it was previously supported thanks to #850 :slightly_frowning_face: Also in your url check function (in start-utils script), ftp url are still allowed:

function isURL() {
  local value=$1
  if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
    return 0
  else
    return 1
  fi
}

This is a cool feature, I hope you will support it officially. :slightly_smiling_face:

super-bunny avatar Jul 07 '22 14:07 super-bunny

I'll certainly get it added especially since it should be easy to "port" into mc-image-helper.

itzg avatar Jul 07 '22 14:07 itzg