Skip to content

PACKWIZ_URL does not accept file:// URIs #1487

@darcros

Description

@darcros

Describe the problem

If PACKWIZ_URL is set to a file:// URI it gets ignored and the modpack doesn't get installed.
Event tough the packwiz docs don't mention it, file:// URIs are actually a supported way to install local modpacks (as stated in packwiz/packwiz-installer#19 and packwiz/packwiz-installer#20).

The problem is here:

if isURL "${PACKWIZ_URL}"; then

and is caused by the fact that isURL only accepts https://, http:// or ftp:// schemes:
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
}

Container definition

version: "3.8"

services:
  minecraft:
    image: itzg/minecraft-server
    ports:
      - 25565:25565
    volumes:
      - ./mc-server-data:/data
      - ./my-modpack/:/packwiz:ro
    environment:
      EULA: "TRUE"
      TYPE: "FABRIC"
      VERSION: "1.18.2"

      PACKWIZ_URL: "file:///packwiz/pack.toml"

Container logs

$ DEBUG=true docker-compose up
[init] Changing ownership of /data to 1000 ...
[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 2 1000 1000 4096 Apr 23 10:47 /data'
[init] Resolved version given 1.18.2 into 1.18.2 and major version 1.18
[init] Resolving type given FABRIC
[init] Checking Fabric Launcher version information.
[init] Checking Fabric Loader version information.
[init] Downloading https://meta.fabricmc.net/v2/versions/loader/1.18.2/0.14.1/0.10.2/server/jar ...
[init] Downloading Packwiz v0.0.3
[init] Creating server.properties in /data/server.properties
[init] Disabling whitelist functionality
[init] Setting white-list to 'false' in /data/server.properties
[init] WARNING: whitelist enabled but not enforced. Set ENFORCE_WHITELIST=TRUE or update 'enforce-whitelist' in server.properties to enforce the whitelist.
[init] Setting enable-rcon to 'true' in /data/server.properties
[init] Setting rcon.password to 'minecraft' in /data/server.properties
[init] Setting rcon.port to '25575' in /data/server.properties
[init] Setting motd to 'A Fabric Minecraft Server powered by Docker' in /data/server.properties
[init] Checking for JSON files.
[init] Setting initial memory to 1G and max to 1G
[init] Starting the Minecraft server...

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions