diff --git a/Dockerfile b/Dockerfile index 5a9926f2..6bc36b5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ --var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \ --from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz -ARG MC_HELPER_VERSION=1.25.23 +ARG MC_HELPER_VERSION=1.26.1 ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \ | tar -C /usr/share -zxf - \ diff --git a/README.md b/README.md index 5b381e67..afeebc27 100644 --- a/README.md +++ b/README.md @@ -631,14 +631,14 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat > ```shell > docker run ... -e "CF_API_KEY=\$11\$22\$33aaaaaaaaaaaaaaaaaaaaaaaaaa" > ``` -> You can use a `.env` file, in the same directory as your `docker-compose.yaml`, and define your API Key there to remove the need to escape the `$` in your API Key. The `.env` file is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). > -> *.env* -> ``` -> CF_API_KEY=$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa +> To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). `$`'s in the value still need to escaped with a second `$` and the variable needs to be referenced from the compose file, such as: +> ```yaml +> environment: +> CF_API_KEY: ${CF_API_KEY} > ``` > -> To use with `docker run` you need to specify the `.env` file +> To use the equivalent with `docker run` you need to specify the `.env` file explicitly: > ``` > docker run --env-file=.env itzg/minecraft-server > ``` @@ -664,6 +664,8 @@ For example: -e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8 ``` +If the authors of the modpack have disallowed project distribution, then the desired **client** modpack zip will need to be manually downloaded and made available to the container. The path to that file must be passed to `CF_MODPACK_ZIP`. + The latest file will be located and used by default, but if a specific version is desired you can use one of the following options. With any of these options **do not select a server file** -- they lack the required manifest and defeat the ability to consistently automate startup. - Use `CF_PAGE_URL`, but include the full URL to a specific file diff --git a/examples/one-block-modded/.gitignore b/examples/one-block-modded/.gitignore new file mode 100644 index 00000000..4cb512ec --- /dev/null +++ b/examples/one-block-modded/.gitignore @@ -0,0 +1 @@ +/.env \ No newline at end of file diff --git a/examples/one-block-modded/docker-compose.yml b/examples/one-block-modded/docker-compose.yml index 397f27ac..2148f9ee 100644 --- a/examples/one-block-modded/docker-compose.yml +++ b/examples/one-block-modded/docker-compose.yml @@ -8,13 +8,19 @@ services: environment: EULA: "true" TYPE: AUTO_CURSEFORGE - CF_API_KEY: # allocate from https://console.curseforge.com/ - CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/one-block-modded/files/4136487" + # CF_API_KEY=... must be set in .env file or as environment variable + CF_API_KEY: ${CF_API_KEY} + CF_SLUG: one-block-modded + # Modpack client zip must be manually downloaded from + # https://www.curseforge.com/minecraft/modpacks/one-block-modded + # due to authors disallowing project distribution + CF_MODPACK_ZIP: /modpacks/Modded+OneBock.zip CF_SET_LEVEL_FROM: OVERRIDES DEBUG: "false" MEMORY: 4G volumes: - mc-data:/data + - ./modpacks:/modpacks:ro volumes: mc-data: {} \ No newline at end of file