autocf: add support for mods downloads repo (#2106)

This commit is contained in:
Geoff Bourne 2023-04-29 20:30:59 -05:00 committed by GitHub
parent 982f40e4b4
commit bad30b5022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 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.27.7
ARG MC_HELPER_VERSION=1.27.8
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

@ -678,6 +678,8 @@ For example:
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
```
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@ -8,12 +8,11 @@ services:
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
CF_FILENAME_MATCHER: "1.0.6"
MEMORY: 4G
volumes:
- mc-data:/data
volumes:
mc-data: {}
- ./data:/data
- ./downloads:/downloads

View File

@ -15,7 +15,7 @@ set -eu
: "${CF_FORCE_INCLUDE_MODS:=}"
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
: "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}"
resultsFile=/data/.install-curseforge.env
@ -53,6 +53,9 @@ fi
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
fi
if [[ $CF_DOWNLOADS_REPO ]]; then
args+=( --downloads-repo="$CF_DOWNLOADS_REPO" )
fi
if ! mc-image-helper install-curseforge "${args[@]}"; then
log "ERROR failed to auto-install CurseForge modpack"