With AUTO_CURSEFORGE handle modpacks not allowed for distribution by author (#2059)

This commit is contained in:
Geoff Bourne 2023-04-02 18:19:42 -05:00 committed by GitHub
parent 94df6cca20
commit 0599fa64c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 8 deletions

View File

@ -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 - \

View File

@ -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

1
examples/one-block-modded/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.env

View File

@ -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: {}