Default bStats configuration to false (opt-in)

- Pre-create bStats config with `enabled: false` by default
- Apply changes to CraftBukkit, Spigot, and Paper Dockerfiles
- Consistent with existing implementation in Velocity proxy image
This commit is contained in:
Kris Lamoureux 2024-05-26 23:07:25 -04:00
parent 695fae915b
commit b1e6604093
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 21 additions and 3 deletions

View File

@ -14,6 +14,10 @@ ARG PREFIX="PLUGIN_"
ARG BASE_URL="https://hub.spigotmc.org/jenkins/job/BuildTools/"
ARG ARTIFACT_PATH="lastSuccessfulBuild/artifact/target/BuildTools.jar"
# Consider turning bStats (https://bStats.org) on but I'm turning it off by
# default because it collects information
ARG BSTATS_ENABLED=false
# Build in common container location
WORKDIR /build
@ -108,7 +112,12 @@ COPY --from=build /build/server.jar /app/server.jar
COPY --from=build /plugins/ /app/plugins/
# Generate initial settings
RUN java -jar server.jar --initSettings --nogui
RUN java -jar server.jar --initSettings --nogui && \
# Disable bStats by default
if [ "$BSTATS_ENABLED" = "false" ]; then \
mkdir -p /app/plugins/bStats/ && \
echo "enabled: false" > /app/plugins/bStats/config.yml; \
fi
# Back to root to copy the entrypoint in
USER root

View File

@ -9,6 +9,10 @@ ARG PREFIX="PLUGIN_"
# PaperMC base URL
ARG BASE_URL="https://api.papermc.io/v2/projects/paper/versions/${VERSION}"
# Consider turning bStats (https://bStats.org) on but I'm turning it off by
# default because it collects information
ARG BSTATS_ENABLED=false
# Download files
USER root
WORKDIR /app
@ -95,7 +99,12 @@ RUN set -eux && \
# Generate initial settings
USER minecraft
WORKDIR /app
RUN java -jar server.jar --initSettings --nogui
RUN java -jar server.jar --initSettings --nogui && \
# Disable bStats by default
if [ "$BSTATS_ENABLED" = "false" ]; then \
mkdir -p /app/plugins/bStats/ && \
echo "enabled: false" > /app/plugins/bStats/config.yml; \
fi
# Back to root to copy the entrypoint in
USER root

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -eux
set -eu
# Set eula value in eula.txt
set_eula() {