Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.20.1
ARG MC_HELPER_VERSION=1.20.3
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ There are optional volume paths that can be attached to supply content to be cop

By default, the [environment variable processing](#replacing-variables-inside-configs) is performed on synchronized files that match the expected suffixes in `REPLACE_ENV_SUFFIXES` (by default "yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml") and are not excluded by `REPLACE_ENV_VARIABLES_EXCLUDES` and `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. This processing can be disabled by setting `REPLACE_ENV_DURING_SYNC` to `false`.

If you want old mods/plugins to be removed before the content is brought over from those attach points, then add `-e REMOVE_OLD_MODS=TRUE`. You can fine tune the removal process by specifying the `REMOVE_OLD_MODS_INCLUDE` and `REMOVE_OLD_MODS_EXCLUDE` variables. By default, everything will be removed. You can also specify the `REMOVE_OLD_MODS_DEPTH` (default is 16) variable to only delete files up to a certain level.
If you want old mods/plugins to be removed before the content is brought over from those attach points, then add `-e REMOVE_OLD_MODS=TRUE`. You can fine tune the removal process by specifying the `REMOVE_OLD_MODS_INCLUDE` and `REMOVE_OLD_MODS_EXCLUDE` variables, which are comma separated lists of file glob patterns. If a directory is excluded, then it and all of its contents are excluded. By default, only jars are removed.

You can also specify the `REMOVE_OLD_MODS_DEPTH` (default is 16) variable to only delete files up to a certain level.

For example: `-e REMOVE_OLD_MODS=TRUE -e REMOVE_OLD_MODS_INCLUDE="*.jar" -e REMOVE_OLD_MODS_DEPTH=1` will remove all old jar files that are directly inside the `plugins/` or `mods/` directory.

Expand Down
7 changes: 5 additions & 2 deletions examples/docker-compose-spiget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ version: "3"
services:
mc:
# Only using IMAGE variable to allow for local testing
image: ${IMAGE:-itzg/minecraft-server}
image: itzg/minecraft-server
# image: ${IMAGE:-itzg/minecraft-server}
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: SPIGOT
SPIGET_RESOURCES: 34315,3836
# SPIGET_RESOURCES: 34315,3836
SPIGET_RESOURCES: ""
REMOVE_OLD_MODS: "true"
volumes:
- data:/data

Expand Down
2 changes: 1 addition & 1 deletion scripts/start-setupForgeApiMods
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e -o pipefail
: "${MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES:=false}"
: "${MODS_FORGEAPI_IGNORE_GAMETYPE:=false}"
: "${REMOVE_OLD_MODS_DEPTH:=1} "
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"

# FORGEAPI_BASE_URL used in manifest downloads below
FORGEAPI_BASE_URL=${FORGEAPI_BASE_URL:-https://api.curseforge.com/v1}
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-setupModpack
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e -o pipefail
: "${REMOVE_OLD_MODS:=false}"
: "${MODS_FILE:=}"
: "${REMOVE_OLD_MODS_DEPTH:=1} "
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
sum_file=/data/.generic_pack.sum

# shellcheck source=start-utils
Expand Down
1 change: 1 addition & 0 deletions scripts/start-spiget
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ handleDebugMode

: "${SPIGET_RESOURCES:=}"
: "${SPIGET_DOWNLOAD_TOLERANCE:=5}" # in minutes
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"

acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream)

Expand Down
10 changes: 9 additions & 1 deletion scripts/start-utils
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,15 @@ eula=${EULA,,}

function removeOldMods {
if [ -d "$1" ]; then
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE:-}" -delete
log "Removing old mods including:${REMOVE_OLD_MODS_INCLUDE} excluding:${REMOVE_OLD_MODS_EXCLUDE}"
mc-image-helper find \
--delete \
--type file,directory \
--min-depth=1 --max-depth "${REMOVE_OLD_MODS_DEPTH:-16}" \
--name "${REMOVE_OLD_MODS_INCLUDE:-*}" \
--exclude-name "${REMOVE_OLD_MODS_EXCLUDE:-}" \
--quiet \
"$1"
fi
}

Expand Down