mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-08-30 02:37:14 +00:00
Include Log4jPatcher javaagent (#2148)
This commit is contained in:
@@ -70,6 +70,8 @@ COPY --chmod=644 files/log4j2.xml /image/log4j2.xml
|
|||||||
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
|
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
|
||||||
COPY --chmod=755 files/auto /auto
|
COPY --chmod=755 files/auto /auto
|
||||||
|
|
||||||
|
RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPatcher/releases/download/v1.0.1/Log4jPatcher-1.0.1.jar
|
||||||
|
|
||||||
RUN dos2unix /start* /auto/*
|
RUN dos2unix /start* /auto/*
|
||||||
|
|
||||||
ENTRYPOINT [ "/start" ]
|
ENTRYPOINT [ "/start" ]
|
||||||
|
|||||||
@@ -77,6 +77,16 @@ if ${useFallbackJvmFlag}; then
|
|||||||
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
|
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if versionLessThan 1.7; then
|
||||||
|
: # No patch required here.
|
||||||
|
elif versionLessThan 1.18.1; then
|
||||||
|
if isTrue ${SKIP_LOG4J_PATCHER:-false}; then
|
||||||
|
log "Skipping Log4jPatcher, make sure you are not affected"
|
||||||
|
else
|
||||||
|
JVM_OPTS="-javaagent:/image/Log4jPatcher.jar ${JVM_OPTS}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
||||||
if ! ${canUseRollingLogs}; then
|
if ! ${canUseRollingLogs}; then
|
||||||
log "ERROR: Using rolling logs is currently not possible in the selected version due to CVE-2021-44228"
|
log "ERROR: Using rolling logs is currently not possible in the selected version due to CVE-2021-44228"
|
||||||
|
|||||||
Reference in New Issue
Block a user