Compare commits

...
18 Commits
Author SHA1 Message Date
renovate[bot] 0699bd8497 Update all non-major dependencies (#4410) 2026-11-21 08:14:30 -06:00
Geoff Bourne dad39111b3 Java4Shell is now fixed in base image (#4409) 2026-11-20 19:24:09 -06:00
Ahmed Nefzaoui f2400958a7 docs: add Minecraft Server Manager (MSM) to related projects (#4407) 2026-11-19 07:18:19 -06:00
Vitalii Kotenko 2b70dfce94 Add HANGAR_PROJECTS to download plugins from Hangar (#4392) 2026-11-18 19:52:29 -06:00
renovate[bot] 0c04150581 Update dependency itzg/mc-image-helper to v1.78.2 (#4401) 2026-11-18 07:41:13 -06:00
dependabot[bot] 0c2d4be97f build(deps): bump pymdown-extensions from 12.3 to 13.1 in /docs (#4403) 2026-11-18 07:40:41 -06:00
dependabot[bot] 0a313b247b build(deps): bump the patches group in /docs with 2 updates (#4402) 2026-11-18 07:27:37 -06:00
Geoff Bourne 22613f0349 Mitigate Java4Shell by disabling UseBASE64Intrinsics for Java 17 and later versions (#4400) 2026-11-17 18:08:00 -06:00
LB 99f8c589d3 Parse .mc-health.env instead of sourcing it (#4399) 2026-11-17 13:59:03 -06:00
renovate[bot] cc5205bd44 Update dependency itzg/mc-image-helper to v1.78.1 (#4398)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-17 07:39:31 -06:00
renovate[bot] 2e867a1046 Update all non-major dependencies (#4397)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 13:57:24 -06:00
renovate[bot] f355e8a718 Update all non-major dependencies (#4395)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-15 09:50:09 -06:00
Aleksei Potsetsuev c2b14e7eaa Exclude client-only Smart Particles and You Must Know This Notice for CurseForge packs (#4396) 2026-11-15 08:46:05 -06:00
eliasehmann 30b26426f4 Support json as a value of LOG_CONSOLE_FORMAT / LOG_FILE_FORMAT for JSON log lines (#4393) 2026-11-14 10:29:12 -06:00
renovate[bot]andGeoff Bourne 58fa0ad96a Update all non-major dependencies (#4391)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2026-11-11 13:13:53 -06:00
Geoff BourneandCopilot App ea0284235e build(deps): combine docs dependency updates (#4390)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-11 12:21:52 -06:00
dependabot[bot] 2f610eef70 build(deps): bump docker/login-action from 4.7.0 to 4.8.0 in the updates group (#4387) 2026-11-11 08:16:41 -06:00
renovate[bot] 5d45bcc72f Update dependency itzg/mc-image-helper to v1.76.2 (#4386) 2026-11-11 08:16:20 -06:00
21 changed files with 202 additions and 30 deletions

No files matched your search

+6 -6
View File
@@ -94,25 +94,25 @@ jobs:
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.5 mcVersion: 1.16.5
# Pin version for pre-Java 17 # Pin version for pre-Java 17
mcHelperVersion: 1.51.6-java8 mcHelperVersion: 1.51.7-java8
# JAVA 11 # JAVA 11
- variant: java11 - variant: java11
baseImage: adoptopenjdk:11-jre-hotspot baseImage: adoptopenjdk:11-jre-hotspot
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.16.4 mcVersion: 1.16.4
# Pin version for pre-Java 17 # Pin version for pre-Java 17
mcHelperVersion: 1.51.6-java8 mcHelperVersion: 1.51.7-java8
# JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies # JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies
- variant: java8 - variant: java8
baseImage: eclipse-temurin:8-jre baseImage: eclipse-temurin:8-jre
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.12.2 mcVersion: 1.12.2
mcHelperVersion: 1.51.6-java8 mcHelperVersion: 1.51.7-java8
- variant: java8-jdk - variant: java8-jdk
baseImage: eclipse-temurin:8-jdk baseImage: eclipse-temurin:8-jdk
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
mcVersion: 1.12.2 mcVersion: 1.12.2
mcHelperVersion: 1.51.6-java8 mcHelperVersion: 1.51.7-java8
env: env:
# Assume they line up, but when forked change to your Docker Hub username # Assume they line up, but when forked change to your Docker Hub username
DOCKER_HUB_ORG: ${{ github.repository_owner }} DOCKER_HUB_ORG: ${{ github.repository_owner }}
@@ -193,14 +193,14 @@ jobs:
tests/test.sh tests/test.sh
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v4.7.0 uses: docker/login-action@v4.8.0
if: env.HAS_IMAGE_REPO_ACCESS == 'true' if: env.HAS_IMAGE_REPO_ACCESS == 'true'
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR - name: Login to GHCR
uses: docker/login-action@v4.7.0 uses: docker/login-action@v4.8.0
if: env.HAS_IMAGE_REPO_ACCESS == 'true' if: env.HAS_IMAGE_REPO_ACCESS == 'true'
with: with:
registry: ghcr.io registry: ghcr.io
+1 -1
View File
@@ -62,7 +62,7 @@ jobs:
# For GLIBC_2.34 support # For GLIBC_2.34 support
knockdRepoOrg: Metalcape/knock knockdRepoOrg: Metalcape/knock
# Pin version for Java 8, be sure to also set in build.yml # Pin version for Java 8, be sure to also set in build.yml
mcHelperVersion: 1.51.6-java8 mcHelperVersion: 1.51.7-java8
env: env:
IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }} IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
+6 -6
View File
@@ -28,36 +28,36 @@ ARG APPS_REV=1
ARG GITHUB_BASEURL=https://github.com ARG GITHUB_BASEURL=https://github.com
# renovate: datasource=github-releases packageName=itzg/easy-add # renovate: datasource=github-releases packageName=itzg/easy-add
ARG EASY_ADD_VERSION=0.8.19 ARG EASY_ADD_VERSION=0.8.20
ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add RUN chmod +x /usr/bin/easy-add
# renovate: datasource=github-releases packageName=itzg/restify # renovate: datasource=github-releases packageName=itzg/restify
ARG RESTIFY_VERSION=1.7.21 ARG RESTIFY_VERSION=1.7.22
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \ --var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
# renovate: datasource=github-releases packageName=itzg/rcon-cli # renovate: datasource=github-releases packageName=itzg/rcon-cli
ARG RCON_CLI_VERSION=1.7.9 ARG RCON_CLI_VERSION=1.9.0
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${RCON_CLI_VERSION} --var app=rcon-cli --file {{.app}} \ --var version=${RCON_CLI_VERSION} --var app=rcon-cli --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
# renovate: datasource=github-releases packageName=itzg/mc-monitor # renovate: datasource=github-releases packageName=itzg/mc-monitor
ARG MC_MONITOR_VERSION=1.19.0 ARG MC_MONITOR_VERSION=1.21.0
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \ --var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
# renovate: datasource=github-releases packageName=itzg/mc-server-runner # renovate: datasource=github-releases packageName=itzg/mc-server-runner
ARG MC_SERVER_RUNNER_VERSION=1.16.2 ARG MC_SERVER_RUNNER_VERSION=1.17.0
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \ --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 --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
# renovate: datasource=github-releases packageName=itzg/mc-image-helper versioning=loose # renovate: datasource=github-releases packageName=itzg/mc-image-helper versioning=loose
ARG MC_HELPER_VERSION=1.76.1 ARG MC_HELPER_VERSION=1.78.3
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} 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 # used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1 ARG MC_HELPER_REV=1
+4
View File
@@ -160,3 +160,7 @@ When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adju
The set of flags documented there can be added by setting the environment variable `USE_MEOWICE_FLAGS` to `true`. There is an optional `USE_MEOWICE_GRAALVM_FLAGS` variable to enable GraalVM specific optimizations, defaults to `FALSE`. The set of flags documented there can be added by setting the environment variable `USE_MEOWICE_FLAGS` to `true`. There is an optional `USE_MEOWICE_GRAALVM_FLAGS` variable to enable GraalVM specific optimizations, defaults to `FALSE`.
MeowIce's flags use the G1 garbage collector by default. MeowIce also provides a [ZGC version of the flags](https://github.com/MeowIce/meowice-flags#zgc-version-for-large-servers-with-32gb-allocated-heap), which is recommended for servers with 32GB or more of allocated memory and many CPU cores. To use it instead, also set `USE_MEOWICE_ZGC_FLAGS` to `true`. When `MAX_MEMORY` (or `MEMORY`) is larger than 2GB, the soft max heap size is set to 2GB below it, as in MeowIce's flags. MeowIce's flags use the G1 garbage collector by default. MeowIce also provides a [ZGC version of the flags](https://github.com/MeowIce/meowice-flags#zgc-version-for-large-servers-with-32gb-allocated-heap), which is recommended for servers with 32GB or more of allocated memory and many CPU cores. To use it instead, also set `USE_MEOWICE_ZGC_FLAGS` to `true`. When `MAX_MEMORY` (or `MEMORY`) is larger than 2GB, the soft max heap size is set to 2GB below it, as in MeowIce's flags.
## Mitigating Java4Shell exploit (CVE-2026-114938)
The latest image now includes a base image that includes the upstream fix [listed here](https://adoptium.net/news/2026/11/temurin-november-2026-cspu-java4shell).
+24
View File
@@ -130,6 +130,30 @@ For full control over how log messages are formatted, you can customize the Log4
- `LOG_TERMINAL_FORMAT` : Format for interactive terminal console (used with `docker attach`) - `LOG_TERMINAL_FORMAT` : Format for interactive terminal console (used with `docker attach`)
Default: `[%d{HH:mm:ss} %level]: %msg%n` Default: `[%d{HH:mm:ss} %level]: %msg%n`
### JSON log output
Set a format variable to `json` to output one JSON object per line instead of text, which suits log pipelines that parse container output, such as Loki, Elasticsearch, or Datadog. For example, to get JSON in `docker logs` while `logs/latest.log` stays plain text:
```yaml
environment:
GENERATE_LOG4J2_CONFIG: "true"
LOG_CONSOLE_FORMAT: json
```
`LOG_FILE_FORMAT` and `LOG_TERMINAL_FORMAT` accept `json` as well. Each line uses field names from the [Elastic Common Schema](https://www.elastic.co/guide/en/ecs/current/index.html), the same ones as Log4j's `EcsLayout.json` template:
```json
{"@timestamp":"2026-11-12T13:50:43.459Z","ecs.version":"1.2.0","log.level":"INFO","message":"Done (3.214s)! For help, type \"help\"","process.thread.name":"Server thread","log.logger":"net.minecraft.server.dedicated.DedicatedServer"}
```
When a log event carries an exception, an `error.stack_trace` field holds the stack trace. Timestamps are in UTC.
!!! note
- JSON output requires Minecraft 1.18.1 or newer. For older versions the default text format is used and a warning is logged.
- Only the server's log output is JSON. Lines written by the image's startup scripts (prefixed with `[init]`) and output that bypasses Log4j, such as JVM warnings, remain plain text, so a log shipper should skip lines that don't parse as JSON.
- Minecraft server jars don't include Log4j's `log4j-layout-template-json` module, so the JSON is built with a pattern layout rather than `JsonTemplateLayout`, and custom event templates aren't supported. For a different JSON shape, set the format variable to your own pattern using `%enc{...}{JSON}` to escape values.
### Example configurations ### Example configurations
Simple timestamp customization (most common use case): Simple timestamp customization (most common use case):
+5 -1
View File
@@ -36,4 +36,8 @@ A Velocity plugin that stops idle backend servers and wakes them when players co
### [Kobblestone](https://github.com/kobblestoneio/kobblestone) ### [Kobblestone](https://github.com/kobblestoneio/kobblestone)
A Kubernetes operator for Minecraft that supports custom resource types to manage servers, routers, backups and more. A Kubernetes operator for Minecraft that supports custom resource types to manage servers, routers, backups and more.
### [Minecraft Server Manager (MSM)](https://github.com/anefzaoui/minecraft-server-manager)
A self-hosted web panel that creates and manages `itzg/minecraft-server` containers, one per server, with modpacks pinned through the image's Modrinth/CurseForge/FTB support, backups, schedules and rollback.
+39
View File
@@ -0,0 +1,39 @@
# Auto-download from Hangar
[Hangar](https://hangar.papermc.io/) is PaperMC's plugin repository for [Paper](../types-and-platforms/server-types/paper.md) and its derivatives. At startup, the container will automatically locate and download the newest version of each plugin that supports the `VERSION` in use. Older file versions downloaded previously will automatically be cleaned up.
## Usage
To use this feature, set the environment variable `HANGAR_PROJECTS` to a comma or newline separated list of projects. This is supported when `TYPE` is `PAPER`, `FOLIA`, `PURPUR`, `PUFFERFISH`, or `LEAF`.
Each project entry can be any of the following combinations where a colon (`:`) is used to separate the different parts:
```
Project
Project : Version
@ Listing File
```
Where:
- **Project** is the project slug or ID. The slug is the last part of the project page URL, such as "Maintenance" from <https://hangar.papermc.io/kennytv/Maintenance>
- **Version** is the version name, such as "5.1.1". When omitted, the newest version from the channel given by `HANGAR_CHANNEL` that supports the Minecraft `VERSION` is selected. Selecting a specific version skips the Minecraft version check.
- **Listing file** is a container path to a file containing a list of projects
Append a `?` to a project, such as `Maintenance?`, to mark it as optional. An optional project that is not available is skipped with a warning instead of failing the startup.
By default, the newest version from the "Release" channel will be selected. You can instead choose another channel by setting `HANGAR_CHANNEL`, such as "Snapshot". The channels of a project are listed on its versions page.
!!! note "External downloads"
Some projects, such as [Floodgate](https://hangar.papermc.io/GeyserMC/Floodgate), link to a file hosted outside of Hangar. That file is downloaded from the external location and is downloaded again when the external file has been modified.
### Example
```yaml
environment:
TYPE: PAPER
HANGAR_PROJECTS: |
ViaVersion
Maintenance:5.1.1
```
+9 -9
View File
@@ -1,25 +1,25 @@
click==8.5.0 click==8.5.1
colorama==0.4.6 colorama==0.4.6
deepmerge==3.0.1 deepmerge==4.0.0
ghp-import==2.1.0 ghp-import==2.1.0
griffe==2.4.1 griffe==2.4.1
Jinja2==3.1.6 Jinja2==3.1.6
Markdown==3.11.2 Markdown==3.11.3
MarkupSafe==3.0.4 MarkupSafe==3.0.4
mergedeep==1.3.4 mergedeep==1.3.4
mkdocs==1.6.1 mkdocs==1.6.1
mkdocs-autorefs==1.4.5 mkdocs-autorefs==1.4.5
mkdocs-get-deps==0.2.2 mkdocs-get-deps==0.2.2
mkdocstrings==1.0.8 mkdocstrings==1.0.8
mkdocstrings-python==2.0.10 mkdocstrings-python==2.0.11
packaging==26.3 packaging==26.3
pathspec==1.1.1 pathspec==1.1.1
platformdirs==4.14.2 platformdirs==4.14.5
Pygments==2.21.0 Pygments==2.21.0
pymdown-extensions==12.3 pymdown-extensions==13.1
python-dateutil==3.0.0 python-dateutil==4.0.0
PyYAML==6.0.3 PyYAML==6.0.3
pyyaml_env_tag==1.1 pyyaml_env_tag==1.1
six==1.17.0 six==1.17.0
watchdog==6.0.0 watchdog==7.1.0
zensical==0.0.74 zensical==0.1.1
@@ -52,6 +52,8 @@ If you have attached a host directory to the `/data` volume, then you can instal
[You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md) [You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md)
[You can also auto-download plugins from Hangar using `HANGAR_PROJECTS`.](../../mods-and-plugins/hangar.md)
## Alternatives ## Alternatives
### Pufferfish ### Pufferfish
@@ -126,6 +128,8 @@ If you have attached a host directory to the `/data` volume, then you can instal
[You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md) [You can also auto-download plugins using `SPIGET_RESOURCES`.](../../mods-and-plugins/spiget.md)
[You can also auto-download plugins from Hangar using `HANGAR_PROJECTS`.](../../mods-and-plugins/hangar.md)
!!! note !!! note
The Folia type inherits from the Paper type. Paper's variables will override the Folia ones. The Folia type inherits from the Paper type. Paper's variables will override the Folia ones.
+3 -3
View File
@@ -65,19 +65,19 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
</tr> </tr>
<tr> <tr>
<td><code>LOG_CONSOLE_FORMAT</code></td> <td><code>LOG_CONSOLE_FORMAT</code></td>
<td>Log4j2 pattern for console output (what you see in <code>docker logs</code>)</td> <td>Log4j2 pattern for console output (what you see in <code>docker logs</code>), or <code>json</code> for <a href="../configuration/misc-options/#json-log-output">JSON lines</a></td>
<td><code>[%d{HH:mm:ss}] [%t/%level]: %msg%n</code></td> <td><code>[%d{HH:mm:ss}] [%t/%level]: %msg%n</code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>LOG_FILE_FORMAT</code></td> <td><code>LOG_FILE_FORMAT</code></td>
<td>Log4j2 pattern for file logs (written to <code>logs/latest.log</code>)</td> <td>Log4j2 pattern for file logs (written to <code>logs/latest.log</code>), or <code>json</code> for <a href="../configuration/misc-options/#json-log-output">JSON lines</a></td>
<td><code>[%d{HH:mm:ss}] [%t/%level]: %msg%n</code></td> <td><code>[%d{HH:mm:ss}] [%t/%level]: %msg%n</code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>LOG_TERMINAL_FORMAT</code></td> <td><code>LOG_TERMINAL_FORMAT</code></td>
<td>Log4j2 pattern for interactive terminal console (used with <code>docker attach</code>)</td> <td>Log4j2 pattern for interactive terminal console (used with <code>docker attach</code>), or <code>json</code> for <a href="../configuration/misc-options/#json-log-output">JSON lines</a></td>
<td><code>[%d{HH:mm:ss} %level]: %msg%n</code></td> <td><code>[%d{HH:mm:ss} %level]: %msg%n</code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
+2
View File
@@ -142,6 +142,7 @@
"shulkerboxviewer", "shulkerboxviewer",
"skin-layers-3d", "skin-layers-3d",
"smart-hud", "smart-hud",
"smart-particles",
"smithing-template-viewer", "smithing-template-viewer",
"smooth-font", "smooth-font",
"smooth-swapping", "smooth-swapping",
@@ -173,6 +174,7 @@
"wawla", "wawla",
"welcome-screen", "welcome-screen",
"xaeroplus", "xaeroplus",
"you-must-know-this-notice",
"yungs-menu-tweaks", "yungs-menu-tweaks",
"zume" "zume"
], ],
+1
View File
@@ -0,0 +1 @@
{"@timestamp":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}{UTC}","ecs.version":"1.2.0","log.level":"%level","message":"%enc{%msg}{JSON}","process.thread.name":"%enc{%t}{JSON}","log.logger":"%enc{%c}{JSON}"%notEmpty{,"error.stack_trace":"%enc{%replace{%ex}{^\s+|\s+$}{}}{JSON}"}}%ex{none}%n
+13 -1
View File
@@ -1,8 +1,20 @@
#!/bin/bash #!/bin/bash
. "/image/scripts/start-utils" . "/image/scripts/start-utils"
# The healthcheck runs as root, but /data is writable by the server, so only
# known settings are read from this file; it is never sourced.
MC_HEALTH_EXTRA_ARGS=()
if [ -f /data/.mc-health.env ]; then if [ -f /data/.mc-health.env ]; then
. /data/.mc-health.env while read -r line; do
case "$line" in
DISABLE_HEALTHCHECK=true)
DISABLE_HEALTHCHECK=true
;;
--use-old-server-list-ping|--use-server-list-ping|--use-proxy)
MC_HEALTH_EXTRA_ARGS+=("$line")
;;
esac
done < /data/.mc-health.env
fi fi
if isTrue "${DISABLE_HEALTHCHECK}"; then if isTrue "${DISABLE_HEALTHCHECK}"; then
+1 -3
View File
@@ -5,9 +5,7 @@
: "${USE_MEOWICE_GRAALVM_FLAGS:=false}" : "${USE_MEOWICE_GRAALVM_FLAGS:=false}"
: "${USE_MEOWICE_ZGC_FLAGS:=false}" : "${USE_MEOWICE_ZGC_FLAGS:=false}"
if isTrue "${USE_MEOWICE_FLAGS}" || isTrue "${USE_MEOWICE_GRAALVM_FLAGS}"; then java_major_version=$(mc-image-helper java-release)
java_major_version=$(mc-image-helper java-release)
fi
if isTrue "${USE_MEOWICE_FLAGS}"; then if isTrue "${USE_MEOWICE_FLAGS}"; then
if [[ $java_major_version -gt 16 ]]; then if [[ $java_major_version -gt 16 ]]; then
+29
View File
@@ -67,6 +67,30 @@ elif ${useGeneratedLogs}; then
ROLLING_LOG_FILE_PATTERN='logs/%d{yyyy-MM-dd}-%i.log.gz' ROLLING_LOG_FILE_PATTERN='logs/%d{yyyy-MM-dd}-%i.log.gz'
fi fi
# A format of "json" selects one JSON object per line with ECS field names.
# Minecraft server jars don't bundle log4j-layout-template-json, and their launchers
# load Log4j in an isolated class loader, so the JSON is produced by PatternLayout
# with JSON-encoded fields. %enc{...}{JSON} is available in all Log4j versions
# bundled since Minecraft 1.18.1 (Log4j 2.17).
LOG_JSON_FORMAT=$(</image/log4j2-json-pattern.txt)
# The format goes into an XML attribute, so escape it.
# Replacements are quoted so bash 5.2's patsub_replacement doesn't expand "&".
LOG_JSON_FORMAT=${LOG_JSON_FORMAT//&/"&amp;"}
LOG_JSON_FORMAT=${LOG_JSON_FORMAT//</"&lt;"}
LOG_JSON_FORMAT=${LOG_JSON_FORMAT//>/"&gt;"}
LOG_JSON_FORMAT=${LOG_JSON_FORMAT//\"/"&quot;"}
for logFormatVar in LOG_CONSOLE_FORMAT LOG_TERMINAL_FORMAT LOG_FILE_FORMAT; do
if [[ ${!logFormatVar:-} && ${!logFormatVar,,} == json ]]; then
if versionLessThan 1.18.1; then
logWarning "${logFormatVar}=json requires Minecraft 1.18.1 or newer, using the default format"
printf -v "$logFormatVar" '%s' ''
else
printf -v "$logFormatVar" '%s' "$LOG_JSON_FORMAT"
fi
fi
done
# Pattern format defaults (compatible with vanilla Minecraft) # Pattern format defaults (compatible with vanilla Minecraft)
# Note: Can't use ${VAR:=default} syntax because } in the value breaks parsing # Note: Can't use ${VAR:=default} syntax because } in the value breaks parsing
if [ -z "${LOG_CONSOLE_FORMAT}" ]; then if [ -z "${LOG_CONSOLE_FORMAT}" ]; then
@@ -126,5 +150,10 @@ EOF
# Apply the log4j2 configuration # Apply the log4j2 configuration
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}" JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
else else
for logFormatVar in LOG_CONSOLE_FORMAT LOG_TERMINAL_FORMAT LOG_FILE_FORMAT; do
if [[ ${!logFormatVar:-} && ${!logFormatVar,,} == json ]]; then
logWarning "${logFormatVar}=json is ignored since the image is not generating the log4j2 configuration. Set GENERATE_LOG4J2_CONFIG=true to use it."
fi
done
rm -f "${LOGFILE}" rm -f "${LOGFILE}"
fi fi
+26
View File
@@ -332,6 +332,30 @@ function handleModrinthProjects() {
fi fi
} }
function handleHangarProjects() {
: "${HANGAR_CHANNEL:=Release}"
if [[ -v HANGAR_PROJECTS ]]; then
# Older helper builds, including Java 8, don't have the hangar command
if ! mc-image-helper has-feature hangar; then
logError "HANGAR_PROJECTS is not supported by this image variant"
exit 1
fi
if ! isType PAPER FOLIA PURPUR PUFFERFISH LEAF; then
logError "HANGAR_PROJECTS requires a Paper based TYPE, such as PAPER, FOLIA, or PURPUR"
exit 1
fi
mc-image-helper hangar \
--output-directory=/data \
--projects="${HANGAR_PROJECTS}" \
--game-version="${VERSION}" \
--platform=PAPER \
--channel="$HANGAR_CHANNEL"
fi
}
function handleCurseForgeFiles() { function handleCurseForgeFiles() {
args=( args=(
--use-http2="$CF_USE_HTTP2" --use-http2="$CF_USE_HTTP2"
@@ -387,6 +411,8 @@ handleGenericPacks
handleModrinthProjects handleModrinthProjects
handleHangarProjects
if usesMods || usesPlugins; then if usesMods || usesPlugins; then
handleCurseForgeFiles handleCurseForgeFiles
fi fi
@@ -0,0 +1,11 @@
services:
mc:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"
SETUP_ONLY: "true"
TYPE: PAPER
VERSION: 1.21.4
HANGAR_PROJECTS: ViaVersion
volumes:
- ./data:/data
+1
View File
@@ -0,0 +1 @@
mc-image-helper has-feature hangar || exit 1
+1
View File
@@ -0,0 +1 @@
mc-image-helper assert fileExists "plugins/ViaVersion-*.jar"
@@ -0,0 +1,11 @@
services:
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "TRUE"
SETUP_ONLY: "TRUE"
GENERATE_LOG4J2_CONFIG: "true"
LOG_CONSOLE_FORMAT: json
volumes:
- ./data:/data
@@ -0,0 +1,5 @@
mc-image-helper assert fileExists /data/log4j2.xml
# console appender uses the JSON pattern
grep -A1 '<Console name="SysOut"' /data/log4j2.xml | grep -q '&quot;ecs.version&quot;'
# file appender keeps the default text pattern
grep -A1 '<RollingRandomAccessFile name="File"' /data/log4j2.xml | grep -qF 'pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n"'