From 2b54ca5b6391d966893434e5b0d4d5cd4d980bb7 Mon Sep 17 00:00:00 2001 From: Crafter-Y Date: Tue, 30 Sep 2025 11:00:08 +0200 Subject: [PATCH 1/2] implementing DOWNLOAD_EXTRA_CONFIGS --- Dockerfile | 2 +- scripts/start-setupEnvVariables | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c0166b26a53..262edfc6801 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,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.48.14 +ARG MC_HELPER_VERSION=1.49.0 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 diff --git a/scripts/start-setupEnvVariables b/scripts/start-setupEnvVariables index f62ef1b8348..9fb1aa08952 100755 --- a/scripts/start-setupEnvVariables +++ b/scripts/start-setupEnvVariables @@ -17,6 +17,7 @@ handleDebugMode : "${DOWNLOAD_DEFAULTS:=}" : "${DOWNLOAD_DEFAULT_CONFIGS:=}" : "${SKIP_DOWNLOAD_DEFAULTS:=false}" +: "${DOWNLOAD_EXTRA_CONFIGS:=}" if isTrue "${REPLACE_ENV_IN_PLACE}"; then log "Replacing env variables in ${REPLACE_ENV_PATHS} that match the prefix '$REPLACE_ENV_VARIABLE_PREFIX' ..." @@ -54,6 +55,15 @@ if isFalse "$SKIP_DOWNLOAD_DEFAULTS"; then fi fi +if [[ $DOWNLOAD_EXTRA_CONFIGS ]]; then + mc-image-helper mcopy \ + --to /data \ + --skip-existing \ + --skip-up-to-date=false \ + --quiet-when-skipped \ + "$DOWNLOAD_EXTRA_CONFIGS" +fi + if [[ ${PATCH_DEFINITIONS} ]]; then log "Applying patch definitions from ${PATCH_DEFINITIONS}" mc-image-helper patch \ From 5d695f1e380e97c57b2ad69c7d5c636e2861291f Mon Sep 17 00:00:00 2001 From: Crafter-Y Date: Tue, 30 Sep 2025 17:07:29 +0200 Subject: [PATCH 2/2] adding docs --- docs/configuration/misc-options.md | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/configuration/misc-options.md b/docs/configuration/misc-options.md index 068ee997b28..d8032c6b10d 100644 --- a/docs/configuration/misc-options.md +++ b/docs/configuration/misc-options.md @@ -1,4 +1,3 @@ - ## Running with a custom server JAR If you would like to run a custom server JAR, set `-e TYPE=CUSTOM` and pass the custom server @@ -142,6 +141,37 @@ To enable support for optimized SIMD operations, the JVM flag can be set with th SIMD optimized operations are supported by Pufferfish and Purpur. +## Downloading extra configuration files + +You can download additional configuration files or other resources before the server starts by using the `DOWNLOAD_EXTRA_CONFIGS` environment variable. This is useful for downloading configs that you want to patch or modify during the startup process. + +The format uses a `<` separator between the destination path and the source URL: + +``` +DOWNLOAD_EXTRA_CONFIGS=destination