diff --git a/Dockerfile b/Dockerfile index e43b815772f..8638fd16ae8 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.24.8 +ARG MC_HELPER_VERSION=1.24.9 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 - \ @@ -64,6 +64,7 @@ COPY --chmod=755 scripts/start* / COPY --chmod=755 bin/ /usr/local/bin/ COPY --chmod=755 bin/mc-health /health.sh COPY --chmod=644 files/log4j2.xml /image/log4j2.xml +COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json COPY --chmod=755 files/auto /auto RUN dos2unix /start* /auto/* diff --git a/README.md b/README.md index aafec5536e6..590abfb09df 100644 --- a/README.md +++ b/README.md @@ -651,11 +651,18 @@ The following two examples both refer to version 1.0.7 of ATM8: -e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8 -e CF_FILENAME_MATCHER=1.0.7 ``` -If there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions, then they can be excluded by passing a comma or space delimited list of project IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the project IDs via `CF_FORCE_INCLUDE_MODS`. Known, mis-tagged mods have been included in the defaults. +A lot of the time there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes two options to exclude/include mods: + +Global and per modpack exclusions can be declared in a JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](files/cf-exclude-include.json) will be used. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema). + +Alternatively, they can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. If either of these are set, then `CF_EXCLUDE_INCLUDE_FILE` will be **disabled**. + +If needing to iterate on the options above, set `CF_FORCE_SYNCHRONIZE` to "true" to ensure the exclude/includes are re-evaluated. + +> **NOTE:** these options are provided to empower you get your server up and running quickly. Please help out by reporting an issue with the respective mod project. Ideally mod developers should [use correct registrations for one-sided client mods](https://docs.minecraftforge.net/en/latest/concepts/sides/#writing-one-sided-mods). Understandably, those code changes may be non-trivial, so mod authors can also add "Client" to the game versions when publishing. Other configuration available: - `CF_PARALLEL_DOWNLOADS` (default is 4): specify how many parallel mod downloads to perform -- `CF_FORCE_SYNCHRONIZE`: set to "true" to force the inputs and exclusions to be re-evaluated ### Old approach diff --git a/files/cf-exclude-include.json b/files/cf-exclude-include.json new file mode 100644 index 00000000000..62ad8e64f33 --- /dev/null +++ b/files/cf-exclude-include.json @@ -0,0 +1,18 @@ +{ + "globalExcludes": [ + "oculus", + "extreme-sound-muffler", + "entityculling", + "rubidium", + "nekos-enchanted-books", + "skin-layers-3d", + "not-enough-animations", + "entity-texture-features-fabric", + "carry-on", + "ignitioncoil", + "defensive-measures" + ], + "globalForceIncludes": [ + "revelationary" + ] +} \ No newline at end of file diff --git a/scripts/start-deployAutoCF b/scripts/start-deployAutoCF index da85aa5e049..135e6429e54 100644 --- a/scripts/start-deployAutoCF +++ b/scripts/start-deployAutoCF @@ -10,6 +10,9 @@ set -eu : "${CF_FILENAME_MATCHER:=}" : "${CF_PARALLEL_DOWNLOADS:=4}" : "${CF_FORCE_SYNCHRONIZE:=false}" +: "${CF_EXCLUDE_INCLUDE_FILE:=/image/cf-exclude-include.json}" +: "${CF_EXCLUDE_MODS:=}" +: "${CF_FORCE_INCLUDE_MODS:=}" resultsFile=/data/.install-curseforge.env @@ -35,27 +38,18 @@ args+=( --force-synchronize="$CF_FORCE_SYNCHRONIZE" ) -defaultModExcludes=( - 581495 # oculus - 363363 # extreme-sound-muffler - 448233 # entityculling - 574856 # rubidium - 441114 # nekos-enchanted-books - 521480 # skin-layers-3d - 433760 # not-enough-animations - 568563 # entity-texture-features-fabric - 274259 # carry-on - 787666 # ignitioncoil, not a client mod, but doesn't seem to play nice with server mode - 700629 # defensive-measures - ) -: "${CF_EXCLUDE_MODS:=${defaultModExcludes[@]}}" -args+=(--exclude-mods="$CF_EXCLUDE_MODS") - -defaultModForceIncludes=( - 656526 # revelationary -) -: "${CF_FORCE_INCLUDE_MODS:=${defaultModForceIncludes[@]}}" -args+=(--force-include-mods="$CF_FORCE_INCLUDE_MODS") +if [[ $CF_EXCLUDE_MODS || $CF_FORCE_INCLUDE_MODS ]]; then + if [[ $CF_EXCLUDE_MODS ]]; then + args+=( --exclude-mods="$CF_EXCLUDE_MODS" ) + fi + if [[ $CF_FORCE_INCLUDE_MODS ]]; then + args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" ) + fi +else + if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then + args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" ) + fi +fi if ! mc-image-helper install-curseforge "${args[@]}"; then log "ERROR failed to auto-install CurseForge modpack"