Skip to content

Commit

Permalink
modrinth: support excluding mods from modpack (#2524)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Dec 3, 2023
1 parent 2507028 commit c0c6e6d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz

ARG MC_HELPER_VERSION=1.37.2
ARG MC_HELPER_VERSION=1.37.3
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1
Expand Down
24 changes: 15 additions & 9 deletions docs/misc/contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,38 @@ VERSION=1.12.2 /scripts/start-magma

> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
## Using development copy of mc-image-helper
## Using development copy of tools

In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
In the cloned repo, such as [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:

```shell
./gradlew distTar
```

!!! note

The distribution's version will be `0.0.0-<branch>-SNAPSHOT`

Assuming Java 18 or newer:
For Go base tools, run

```shell
cd build/distributions
jwebserver -b 0.0.0.0 -p 8008
goreleaser release --snapshot --clean
```

If `jwebserver` is not available, try `java -m jdk.httpserver -p 8008`
Clone [itzg/github-releases-proxy](https://github.com/itzg/github-releases-proxy) and run it according to the instructions shown there.

In the Docker build, configure the following

```shell
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
--build-arg GITHUB_BASEURL=http://host.docker.internal:8080 \
--build-arg APPS_REV=1
```

Now the image can be built like normal, and it will install mc-image-helper from the locally built copy.
and declare one or more version overrides, such as

```
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT
```

## Generating release notes

Expand Down
2 changes: 1 addition & 1 deletion docs/types-and-platforms/mod-platforms/auto-curseforge.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat

A CurseForge API key is **required** to use this feature. Go to their [developer console](https://console.curseforge.com/), generate an API key, and set the environment variable `CF_API_KEY`.

When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`.
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`. Refer to [this compose file reference section](https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution) for more information.

Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
```yaml
Expand Down
13 changes: 13 additions & 0 deletions docs/types-and-platforms/mod-platforms/modrinth-modpacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@ Some mods, such as [MCInstance Loader](https://modrinth.com/mod/mcinstance-loade
config/mcinstanceloader/pack.mcinstance
```

## Excluding files

To exclude client mods that are incorrectly declared by the modpack as server-compatible, set `MODRINTH_EXCLUDE_FILES` to a comma or newline delimited list of partial file names to exclude. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.

!!! example

In a Compose file:
```yaml
MODRINTH_EXCLUDE_FILES: |
notenoughanimations
lambdynamiclights
euphoriapatcher
```
1 change: 1 addition & 0 deletions scripts/start-deployModrinth
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ setArg() {
setArg --loader MODRINTH_LOADER
setArg --version MODRINTH_VERSION
setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE
setArg --exclude-files MODRINTH_EXCLUDE_FILES

if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
log "ERROR failed to install Modrinth modpack"
Expand Down

0 comments on commit c0c6e6d

Please sign in to comment.