Compare commits

..

1 Commits

Author SHA1 Message Date
Geoff Bourne
78c24b580e Revert "Add use-proxy support to health extra args (#2973)"
This reverts commit 11d8d917f2.
2024-07-08 12:29:07 -05:00
116 changed files with 846 additions and 1673 deletions

View File

@@ -11,7 +11,6 @@ on:
- "docs/**" - "docs/**"
- "examples/**" - "examples/**"
- "notes/**" - "notes/**"
- "kustomize/**"
jobs: jobs:
build: build:
@@ -31,6 +30,7 @@ jobs:
- java8-graalvm-ce - java8-graalvm-ce
- java8-openj9 - java8-openj9
- java8-jdk - java8-jdk
- java8-alpine
- java11 - java11
include: include:
# JAVA 21: # JAVA 21:
@@ -74,6 +74,10 @@ jobs:
baseImage: eclipse-temurin:8u312-b07-jre-focal baseImage: eclipse-temurin:8u312-b07-jre-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64 platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.12.2 mcVersion: 1.12.2
- variant: java8-alpine
baseImage: openjdk:8-jre-alpine3.9
platforms: linux/amd64
mcVersion: 1.12.2
- variant: java8-graalvm-ce - variant: java8-graalvm-ce
baseImage: ghcr.io/graalvm/graalvm-ce:java8 baseImage: ghcr.io/graalvm/graalvm-ce:java8
platforms: linux/amd64 platforms: linux/amd64
@@ -93,14 +97,14 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v4.1.7
with: with:
# for build-files step # for build-files step
fetch-depth: 0 fetch-depth: 0
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v5.6.1 uses: docker/metadata-action@v5.5.1
with: with:
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's, # NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
# then the use of ${{ github.repository_owner }} will need to be replaced. # then the use of ${{ github.repository_owner }} will need to be replaced.
@@ -128,13 +132,13 @@ jobs:
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com> org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
- name: Setup Docker Buildx - name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3.8.0 uses: docker/setup-buildx-action@v3.4.0
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3.3.0 uses: docker/setup-qemu-action@v3.1.0
- name: Build for test - name: Build for test
uses: docker/build-push-action@v6.12.0 uses: docker/build-push-action@v5.4.0
with: with:
platforms: linux/amd64 platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }} tags: ${{ env.IMAGE_TO_TEST }}
@@ -157,14 +161,14 @@ jobs:
tests/test.sh tests/test.sh
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v3.3.0 uses: docker/login-action@v3.2.0
if: env.HAS_IMAGE_REPO_ACCESS if: env.HAS_IMAGE_REPO_ACCESS
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@v3.3.0 uses: docker/login-action@v3.2.0
if: env.HAS_IMAGE_REPO_ACCESS if: env.HAS_IMAGE_REPO_ACCESS
with: with:
registry: ghcr.io registry: ghcr.io
@@ -172,7 +176,7 @@ jobs:
password: ${{ github.token }} password: ${{ github.token }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6.12.0 uses: docker/build-push-action@v5.4.0
if: github.actor == github.repository_owner if: github.actor == github.repository_owner
with: with:
platforms: ${{ matrix.platforms }} platforms: ${{ matrix.platforms }}

View File

@@ -19,7 +19,7 @@ jobs:
steps: steps:
- name: on-publish - name: on-publish
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'
uses: SethCohen/github-releases-to-discord@v1.16.2 uses: SethCohen/github-releases-to-discord@v1.15.0
with: with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK }} webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
- name: on-success - name: on-success

View File

@@ -8,7 +8,6 @@ on:
- "docs/**" - "docs/**"
- "examples/**" - "examples/**"
- "notes/**" - "notes/**"
- "kustomize/**"
- "docker-compose*.yml" - "docker-compose*.yml"
- "mkdocs.yml" - "mkdocs.yml"
@@ -47,16 +46,16 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4.2.2 uses: actions/checkout@v4.1.7
with: with:
# for build-files step # for build-files step
fetch-depth: 0 fetch-depth: 0
- name: Setup Docker Buildx - name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3.8.0 uses: docker/setup-buildx-action@v3.4.0
- name: Confirm multi-arch build - name: Confirm multi-arch build
uses: docker/build-push-action@v6.12.0 uses: docker/build-push-action@v5.4.0
with: with:
platforms: ${{ matrix.platforms }} platforms: ${{ matrix.platforms }}
# ensure latest base image is used # ensure latest base image is used
@@ -66,7 +65,7 @@ jobs:
cache-from: type=gha,scope=${{ matrix.variant }} cache-from: type=gha,scope=${{ matrix.variant }}
- name: Build for test - name: Build for test
uses: docker/build-push-action@v6.12.0 uses: docker/build-push-action@v5.4.0
with: with:
# Only build single platform since loading multi-arch image into daemon fails with # Only build single platform since loading multi-arch image into daemon fails with
# "docker exporter does not currently support exporting manifest lists" # "docker exporter does not currently support exporting manifest lists"

View File

@@ -1,3 +1,5 @@
# syntax = docker/dockerfile:1.3
ARG BASE_IMAGE=eclipse-temurin:21-jre ARG BASE_IMAGE=eclipse-temurin:21-jre
FROM ${BASE_IMAGE} FROM ${BASE_IMAGE}
@@ -7,14 +9,9 @@ ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
ARG TARGETVARIANT ARG TARGETVARIANT
# The following three arg/env vars get used by the platform specific "install-packages" script
ARG EXTRA_DEB_PACKAGES=""
ARG EXTRA_DNF_PACKAGES=""
ARG EXTRA_ALPINE_PACKAGES=""
ARG FORCE_INSTALL_PACKAGES=1 ARG FORCE_INSTALL_PACKAGES=1
RUN --mount=target=/build,source=build \ RUN --mount=target=/build,source=build \
TARGET=${TARGETARCH}${TARGETVARIANT} \ TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
/build/run.sh install-packages
RUN --mount=target=/build,source=build \ RUN --mount=target=/build,source=build \
/build/run.sh setup-user /build/run.sh setup-user
@@ -26,31 +23,31 @@ EXPOSE 25565
ARG APPS_REV=1 ARG APPS_REV=1
ARG GITHUB_BASEURL=https://github.com ARG GITHUB_BASEURL=https://github.com
ARG EASY_ADD_VERSION=0.8.8 ARG EASY_ADD_VERSION=0.8.6
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
ARG RESTIFY_VERSION=1.7.5 ARG RESTIFY_VERSION=1.7.3
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
ARG RCON_CLI_VERSION=1.6.9 ARG RCON_CLI_VERSION=1.6.7
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
ARG MC_MONITOR_VERSION=0.15.0 ARG MC_MONITOR_VERSION=0.12.12
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
ARG MC_SERVER_RUNNER_VERSION=1.12.3 ARG MC_SERVER_RUNNER_VERSION=1.12.2
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
ARG MC_HELPER_VERSION=1.40.11 ARG MC_HELPER_VERSION=1.39.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
@@ -64,7 +61,7 @@ WORKDIR /data
STOPSIGNAL SIGTERM STOPSIGNAL SIGTERM
# End user MUST set EULA and change RCON_PASSWORD # End user MUST set EULA and change RCON_PASSWORD
ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000 LC_ALL=en_US.UTF-8 ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000
COPY --chmod=755 scripts/start* / COPY --chmod=755 scripts/start* /
COPY --chmod=755 bin/ /usr/local/bin/ COPY --chmod=755 bin/ /usr/local/bin/
@@ -77,4 +74,4 @@ RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPa
RUN dos2unix /start* /auto/* RUN dos2unix /start* /auto/*
ENTRYPOINT [ "/start" ] ENTRYPOINT [ "/start" ]
HEALTHCHECK --start-period=2m --retries=2 --interval=30s CMD mc-health HEALTHCHECK --start-period=1m --interval=5s --retries=24 CMD mc-health

View File

@@ -10,12 +10,10 @@
There you will find things like There you will find things like
- [Quick start with Docker Compose](https://docker-minecraft-server.readthedocs.io/en/latest/#using-docker-compose) - [Quick start with Docker Compose](https://docker-minecraft-server.readthedocs.io/en/latest/#using-docker-compose)
- Running [different versions of Minecraft](https://docker-minecraft-server.readthedocs.io/en/latest/versions/minecraft/) and using [various server types](https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/) for Java Edition - Running [different versions of Minecraft](https://docker-minecraft-server.readthedocs.io/en/latest/versions/minecraft/) and using [various server types](https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/)
- [Setting server properties via container environment variables](https://docker-minecraft-server.readthedocs.io/en/latest/configuration/server-properties/) - [Setting server properties via container environment variables](https://docker-minecraft-server.readthedocs.io/en/latest/configuration/server-properties/)
- [Managing mods and plugins with automated downloads and cleanup](https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/) - [Managing mods and plugins with automated downloads and cleanup](https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/)
- [Using various modpack providers/platforms](https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/) - [Using various modpack providers/platforms](https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/)
- ...and much more - ...and much more
There are also many examples located in [the examples directory](examples) of this repo. There are also many examples located in [the examples directory](examples) of this repo.
This image only supports Java edition natively; however, if looking for a server that is compatible with Bedrock edition, then use [itzg/minecraft-bedrock-server](https://github.com/itzg/docker-minecraft-bedrock-server) or [refer to this section](https://docker-minecraft-server.readthedocs.io/en/latest/misc/examples/#bedrock-compatible-server) to add Bedrock compatibility to a Java edition server.

View File

@@ -3,22 +3,26 @@
: "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}" : "${CONSOLE_IN_NAMED_PIPE:=/tmp/minecraft-console-in}"
if isFalse "${CREATE_CONSOLE_IN_PIPE:-false}"; then if isFalse "${CREATE_CONSOLE_IN_PIPE:-false}"; then
error "Console pipe needs to be enabled by setting CREATE_CONSOLE_IN_PIPE to true" echo "ERROR: console pipe needs to be enabled by setting CREATE_CONSOLE_IN_PIPE to true"
fi fi
if [ $# = 0 ]; then if [ $# = 0 ]; then
error "Pass console commands as arguments" echo "ERROR: pass console commands as arguments"
exit 1 exit 1
fi fi
if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then if [ ! -p "${CONSOLE_IN_NAMED_PIPE}" ]; then
error "Named pipe ${CONSOLE_IN_NAMED_PIPE} is missing" echo "ERROR: named pipe ${CONSOLE_IN_NAMED_PIPE} is missing"
exit 1 exit 1
fi fi
if [ "$(id -u)" = 0 -a $UID != 0 ]; then if [ "$(id -u)" = 0 ]; then
exec $(getSudoFromDistro) minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE}'" if [[ $(getDistro) == alpine ]]; then
exec su-exec minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
else
exec gosu minecraft bash -c "echo '$*' > '${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}'"
fi
else else
echo "$@" >"${CONSOLE_IN_NAMED_PIPE}" echo "$@" >"${CONSOLE_IN_NAMED_PIPE:-/tmp/minecraft-console-in}"
fi fi

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
warning "mcstatus is deprecated; calling mc-monitor instead" echo "WARNING: mcstatus is deprecated; calling mc-monitor instead"
##### mcstatus shim for mc-monitor ##### mcstatus shim for mc-monitor
# handles translating calls to # handles translating calls to
@@ -11,8 +11,8 @@ addr="$1"
IFS=':' IFS=':'
read -a parts <<< "${addr}" read -a parts <<< "${addr}"
args=(--host ${parts[0]})
if [[ ${#parts[*]} -gt 1 ]]; then if [[ ${#parts[*]} -gt 1 ]]; then
args+=(--port ${parts[1]}) exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
else
exec mc-monitor status --host ${parts[0]}
fi fi
exec mc-monitor ${args[@]}

View File

@@ -44,7 +44,7 @@ do
if [[ "$RCON_CMDS_STARTUP" ]]; then if [[ "$RCON_CMDS_STARTUP" ]]; then
while read -r cmd; do while read -r cmd; do
run_command "$cmd" run_command "$cmd"
done <<< "$(echo -e "$RCON_CMDS_STARTUP")" done <<< "$RCON_CMDS_STARTUP"
fi fi
if if
[[ -z "$RCON_CMDS_ON_CONNECT" ]] && [[ -z "$RCON_CMDS_ON_CONNECT" ]] &&
@@ -66,7 +66,7 @@ do
logRcon "First Clients has Connected, running first connect cmds" logRcon "First Clients has Connected, running first connect cmds"
while read -r cmd; do while read -r cmd; do
run_command "$cmd" run_command "$cmd"
done <<< "$(echo -e "$RCON_CMDS_FIRST_CONNECT")" done <<< "$RCON_CMDS_FIRST_CONNECT"
fi fi
# When a client joins # When a client joins
@@ -74,13 +74,13 @@ do
logRcon "Clients have Connected, running connect cmds" logRcon "Clients have Connected, running connect cmds"
while read -r cmd; do while read -r cmd; do
run_command "$cmd" run_command "$cmd"
done <<< "$(echo -e "$RCON_CMDS_ON_CONNECT")" done <<< "$RCON_CMDS_ON_CONNECT"
# When a client leaves # When a client leaves
elif (( CURR_CLIENTCONNECTIONS < CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_DISCONNECT" ]]; then elif (( CURR_CLIENTCONNECTIONS < CLIENTCONNECTIONS )) && [[ "$RCON_CMDS_ON_DISCONNECT" ]]; then
logRcon "Clients have Disconnected, running disconnect cmds" logRcon "Clients have Disconnected, running disconnect cmds"
while read -r cmd; do while read -r cmd; do
run_command "$cmd" run_command "$cmd"
done <<< "$(echo -e "$RCON_CMDS_ON_DISCONNECT")" done <<< "$RCON_CMDS_ON_DISCONNECT"
fi fi
# Last client connection # Last client connection
@@ -89,7 +89,7 @@ do
logRcon "ALL Clients have Disconnected, running last disconnect cmds" logRcon "ALL Clients have Disconnected, running last disconnect cmds"
while read -r cmd; do while read -r cmd; do
run_command "$cmd" run_command "$cmd"
done <<< "$(echo -e "$RCON_CMDS_LAST_DISCONNECT")" done <<< "$RCON_CMDS_LAST_DISCONNECT"
fi fi
CLIENTCONNECTIONS=$CURR_CLIENTCONNECTIONS CLIENTCONNECTIONS=$CURR_CLIENTCONNECTIONS
;; ;;

View File

@@ -3,8 +3,6 @@
set -e set -e
set -o pipefail set -o pipefail
# Install necessary packages
# shellcheck disable=SC2086
apk add --no-cache -U \ apk add --no-cache -U \
openssl \ openssl \
imagemagick \ imagemagick \
@@ -16,33 +14,26 @@ apk add --no-cache -U \
procps \ procps \
shadow \ shadow \
bash \ bash \
curl \ curl iputils \
iputils \
git \ git \
jq \ jq \
mysql-client \ mysql-client \
tzdata \ tzdata \
rsync \ rsync \
nano \ nano \
ncurses \
sudo \ sudo \
tar \ tar \
zstd \ zstd \
nfs-utils \ nfs-utils \
libpcap \ libpcap \
libwebp \ libwebp \
libcap \ libcap
${EXTRA_ALPINE_PACKAGES}
# Download and install patched knockd # Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd setcap cap_net_raw=ep /usr/local/sbin/knockd
# Set Git credentials globally # Set git credentials
cat <<EOF >> /etc/gitconfig echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF

View File

@@ -1,22 +1,12 @@
#!/bin/bash #!/bin/bash
set -euo pipefail if [[ $(uname -m) == "aarch64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64
GOSU_VERSION="1.16" chmod +x /bin/gosu
GOSU_BASE_URL="https://github.com/tianon/gosu/releases/download/$GOSU_VERSION" elif [[ $(uname -m) == "x86_64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64
case $(uname -m) in chmod +x /bin/gosu
"aarch64") else
GOSU_ARCH="gosu-arm64" echo "Not supported!"
;; exit 1
"x86_64") fi
GOSU_ARCH="gosu-amd64"
;;
*)
echo "Architecture not supported!"
exit 1
;;
esac
curl -sL -o /bin/gosu "${GOSU_BASE_URL}/${GOSU_ARCH}"
chmod +x /bin/gosu

View File

@@ -4,26 +4,20 @@ export TARGET
set -euo pipefail set -euo pipefail
# Install and configure dnf
microdnf install dnf -y microdnf install dnf -y
dnf install 'dnf-command(config-manager)' -y dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled ol8_codeready_builder dnf config-manager --set-enabled ol8_codeready_builder
tee /etc/yum.repos.d/ol8-epel.repo<<EOF
# Add EPEL repository
tee /etc/yum.repos.d/ol8-epel.repo <<EOF
[ol8_developer_EPEL] [ol8_developer_EPEL]
name=Oracle Linux \$releasever EPEL (\$basearch) name= Oracle Linux \$releasever EPEL (\$basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/\$basearch/ baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1 gpgcheck=1
enabled=1 enabled=1
EOF EOF
# Update system
dnf update -y dnf update -y
# Install necessary packages
# shellcheck disable=SC2086
dnf install -y \ dnf install -y \
ImageMagick \ ImageMagick \
file \ file \
@@ -32,6 +26,7 @@ dnf install -y \
iputils \ iputils \
curl \ curl \
git \ git \
git-lfs \
jq \ jq \
dos2unix \ dos2unix \
mysql \ mysql \
@@ -45,30 +40,20 @@ dnf install -y \
libpcap \ libpcap \
libwebp \ libwebp \
findutils \ findutils \
which \ which
glibc-langpack-en \
${EXTRA_DNF_PACKAGES}
# Install Git LFS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
dnf update -y dnf update -y
dnf install -y git-lfs dnf install -y \
git-lfs
# Clean up DNF when done
dnf clean all
# Install gosu (assuming the script /build/ol/install-gosu.sh exists and is executable)
bash /build/ol/install-gosu.sh bash /build/ol/install-gosu.sh
# Download and install patched knockd # Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd setcap cap_net_raw=ep /usr/local/sbin/knockd
# Set git credentials globally # Set git credentials
cat <<EOF >> /etc/gitconfig echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF

View File

@@ -4,9 +4,8 @@ export TARGET
set -euo pipefail set -euo pipefail
# Update and install packages
apt-get update apt-get update
# shellcheck disable=SC2086
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
apt-get install -y \ apt-get install -y \
imagemagick \ imagemagick \
@@ -28,26 +27,21 @@ apt-get install -y \
lbzip2 \ lbzip2 \
nfs-common \ nfs-common \
libpcap0.8 \ libpcap0.8 \
${EXTRA_DEB_PACKAGES} webp
# Install Git LFS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
apt-get update apt-get update
apt-get install -y git-lfs apt-get install -y \
git-lfs
# Clean up APT when done
apt-get clean apt-get clean
# Download and install patched knockd # Patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd setcap cap_net_raw=ep /usr/local/sbin/knockd
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \; find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
# Set git credentials globally # Set git credentials
cat <<EOF >> /etc/gitconfig echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF

View File

@@ -2,9 +2,5 @@
set -e set -e
if id ubuntu > /dev/null 2>&1; then
deluser ubuntu
fi
addgroup --gid 1000 minecraft addgroup --gid 1000 minecraft
adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft

View File

@@ -1,4 +1,4 @@
FROM python:3.9 FROM python:3.8
RUN pip install --upgrade pip RUN pip install --upgrade pip

View File

@@ -138,8 +138,7 @@ The following example shows a patch-set file where various fields in the `paper.
} }
``` ```
Supports the file formats: Supports the file formats:
- JSON - JSON
- JSON5 - JSON5
- Yaml - Yaml

View File

@@ -128,7 +128,7 @@ When either is set, [whitelisting of connecting users](https://minecraft.wiki/w/
To change the behavior when the whitelist file already exists, set the variable `EXISTING_WHITELIST_FILE` to one of the following options: To change the behavior when the whitelist file already exists, set the variable `EXISTING_WHITELIST_FILE` to one of the following options:
`SKIP` `SKIP` (default)
: Skip processing of the whitelist file when one is already present. This is the same as setting the legacy variable `OVERRIDE_WHITELIST` to "false". : Skip processing of the whitelist file when one is already present. This is the same as setting the legacy variable `OVERRIDE_WHITELIST` to "false".
`SYNCHRONIZE` `SYNCHRONIZE`
@@ -137,7 +137,7 @@ To change the behavior when the whitelist file already exists, set the variable
`MERGE` `MERGE`
: Merge the list of users from `WHITELIST` into the existing file. `WHITELIST_FILE` cannot be used with this option. : Merge the list of users from `WHITELIST` into the existing file. `WHITELIST_FILE` cannot be used with this option.
`SYNC_FILE_MERGE_LIST` (default) `SYNC_FILE_MERGE_LIST`
: When `WHITELIST_FILE` is provided it will overwrite an existing whitelist file. Also, if `WHITELIST` is provided, then those users will be merged into the newly copied file. : When `WHITELIST_FILE` is provided it will overwrite an existing whitelist file. Also, if `WHITELIST` is provided, then those users will be merged into the newly copied file.
!!! note !!! note
@@ -171,7 +171,7 @@ Similar to the whitelist, users can be provisioned as operators (aka administrat
To change the behavior when the ops file already exists, set the variable `EXISTING_OPS_FILE` to one of the following options: To change the behavior when the ops file already exists, set the variable `EXISTING_OPS_FILE` to one of the following options:
`SKIP` `SKIP` (default)
: Skip processing of the ops file when one is already present. This is the same as setting the legacy variable `OVERRIDE_OPS` to "false". : Skip processing of the ops file when one is already present. This is the same as setting the legacy variable `OVERRIDE_OPS` to "false".
`SYNCHRONIZE` `SYNCHRONIZE`
@@ -180,7 +180,7 @@ To change the behavior when the ops file already exists, set the variable `EXIST
`MERGE` `MERGE`
: Merge the list of users from `OPS` into the existing file. `OPS_FILE` cannot be used with this option. : Merge the list of users from `OPS` into the existing file. `OPS_FILE` cannot be used with this option.
`SYNC_FILE_MERGE_LIST` (default) `SYNC_FILE_MERGE_LIST`
: When `OPS_FILE` is provided it will overwrite an existing ops file. Also, if `OPS` is provided, then those users will be merged into the newly copied file. : When `OPS_FILE` is provided it will overwrite an existing ops file. Also, if `OPS` is provided, then those users will be merged into the newly copied file.
!!! note !!! note
@@ -495,11 +495,4 @@ When using `docker run` from a bash shell, the entries must be quoted with the `
| SIMULATION_DISTANCE | simulation-distance | | SIMULATION_DISTANCE | simulation-distance |
| SYNC_CHUNK_WRITES | sync-chunk-writes | | SYNC_CHUNK_WRITES | sync-chunk-writes |
| USE_NATIVE_TRANSPORT | use-native-transport | | USE_NATIVE_TRANSPORT | use-native-transport |
| HIDE_ONLINE_PLAYERS | hide-online-players |
| RESOURCE_PACK_ID | resource-pack-id |
| RESOURCE_PACK_PROMPT | resource-pack-prompt |
| MAX_CHAINED_NEIGHBOR_UPDATES | max-chained-neighbor-updates |
| LOG_IPS | log-ips |
| REGION_FILE_COMPRESSION | region-file-compression |
| BUG_REPORT_LINK | bug-report-link |
| PAUSE_WHEN_EMPTY_SECONDS | pause-when-empty-seconds |

View File

@@ -19,7 +19,7 @@ where, in this case, the standard server port 25565, will be exposed on your hos
!!! note !!! note
If you plan on running a server for a longer amount of time it is highly recommended using a management layer such as [Docker Compose](#using-docker-compose) or [Kubernetes](misc/deployment/index.md#on-kubernetes) to allow for incremental reconfiguration and image upgrades. If you plan on running a server for a longer amount of time it is highly recommended using a management layer such as [Docker Compose](#using-docker-compose) or [Kubernetes](#deployment-templates-and-examples) to allow for incremental reconfiguration and image upgrades.
!!! info !!! info

View File

@@ -16,7 +16,7 @@ A file called `.paused` is created in `/data` directory when the server is pause
A `.skip-pause` file can be created in the `/data` directory to make the server skip autopausing, for as long as the file is present. The autopause timer will also be reset. A `.skip-pause` file can be created in the `/data` directory to make the server skip autopausing, for as long as the file is present. The autopause timer will also be reset.
A starting, example compose file has been provided in [the examples](https://github.com/itzg/docker-minecraft-server/blob/master/examples/autopause/compose.yml). A starting, example compose file has been provided in [examples/docker-compose-autopause.yml](https://github.com/itzg/docker-minecraft-server/blob/master/examples/docker-compose-autopause.yml).
Auto-pause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together. Auto-pause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.

View File

@@ -2,7 +2,7 @@
An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other. An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other.
!!! note !!! note
the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted. the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted.
@@ -25,6 +25,3 @@ The following environment variables define the behavior of auto-stopping:
describes period of the daemonized state machine, that handles the stopping of the server describes period of the daemonized state machine, that handles the stopping of the server
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output > To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output
## Proxy Support
If you make use of PROXY Protocol, i.e. through something like HAProxy or Fly.io, you will need to enable it in your variety of server's configuration, and then set the `USES_PROXY_PROTOCOL` envar to `true`. This lets Autostop monitor the server, where it otherwise wouldn't

View File

@@ -26,11 +26,3 @@ or just a plain build
```shell ```shell
docker build -t IMG_PREFIX/minecraft-server . docker build -t IMG_PREFIX/minecraft-server .
``` ```
## Installing extra packages
The following build args can be set to install additional packages for the respective base image distro:
- `EXTRA_DEB_PACKAGES`
- `EXTRA_DNF_PACKAGES`
- `EXTRA_ALPINE_PACKAGES`

View File

@@ -26,54 +26,6 @@ services:
[Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml) [Source](https://github.com/itzg/docker-minecraft-server/blob/master/examples/geyser/docker-compose.yml)
## Lazymc - Put your Minecraft server to rest when idle
With [lazymc-docker-proxy](https://github.com/joesturge/lazymc-docker-proxy) you are able to use [lazymc](https://github.com/timvisee/lazymc) with the minecraft container.
```yaml
services:
lazymc:
container_name: lazymc
image: ghcr.io/joesturge/lazymc-docker-proxy:latest
environment:
# Point to the service name of the Minecraft server
SERVER_ADDRESS: mc:25565
# Required to find the container to manage it
LAZYMC_GROUP: mc
restart: unless-stopped
volumes:
# you should mount the minecraft server dir under /server, using read only.
- data:/server:ro
# you need to supply the docker socket, so that the container can run docker command
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
# lazymc-docker-proxy acts as a proxy, so there is
# no need to expose the server port on the Minecraft container
- "25565:25565"
# Standard Docker Minecraft server, also works with other server types
mc:
image: itzg/minecraft-server:java21
container_name: minecraft-server
# We need to add a label here so that lazymc-docker-proxy knows which
# container to manage
labels:
- lazymc.group=mc
tty: true
stdin_open: true
# This container should be managed solely by the lazymc container
# so set restart to no, or else the container will start again...
restart: no
environment:
EULA: "TRUE"
volumes:
- data:/data
volumes:
data:
```
[Source](https://github.com/joesturge/lazymc-docker-proxy/blob/master/docker-compose.yaml)
## Lazytainer - Stop Minecraft container based on traffic ## Lazytainer - Stop Minecraft container based on traffic
Monitors network traffic to the Minecraft containers. If there is traffic, the container runs, otherwise the container is stopped/paused. Monitors network traffic to the Minecraft containers. If there is traffic, the container runs, otherwise the container is stopped/paused.

View File

@@ -3,5 +3,3 @@ To troubleshoot the container initialization, such as when server files are pre-
To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`. To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`.
To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`. To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`.
If you are experiencing any issues with the "Changing ownership of /data" step, that can be disabled by setting `SKIP_CHOWN_DATA` to `true`.

View File

@@ -22,27 +22,22 @@ The following formats are supported in the list of project-file references:
- Project ID, such as `238222`. _The newest applicable file will be automatically selected._ - Project ID, such as `238222`. _The newest applicable file will be automatically selected._
- Project slug or ID, `:`, and a file ID, such as `jei:4593548` or `238222:4593548` - Project slug or ID, `:`, and a file ID, such as `jei:4593548` or `238222:4593548`
- Project slug or ID, `@`, and a partial filename, such as `jei@10.2.1.1005`. This option is useful to refer to a version of the mod/plugin rather than looking up the file ID. - Project slug or ID, `@`, and a partial filename, such as `jei@10.2.1.1005`. This option is useful to refer to a version of the mod/plugin rather than looking up the file ID.
- An `@` followed by the **container path** to a listing file
!!! info "More about listing files" An `@` followed by the container path to a listing file can also be provided as a project-file reference. Each line is processed as a reference where blank lines and comments that start with `#` are ignored.
Each line in the listing file is processed as one of the references above; however, blank lines and comments that start with `#` are ignored. For example, `CURSEFORGE_FILES` can be set to "@/extras/cf-mods.txt" where the container file `/extras/cf-mods.txt` contains
Make sure to place the listing file in a mounted directory/volume or declare an appropriate mount for it.
For example, `CURSEFORGE_FILES` can be set to "@/extras/cf-mods.txt", assuming "/extras" has been added to `volumes` section, where the container file `/extras/cf-mods.txt` contains
```text
# This comment is ignored
jei:10.2.1.1005
# This and previous blank line are ignore
geckolib
aquaculture
naturalist
```
!!! tip "Multi-line values in Docker Compose" ```text
# This comment is ignored
jei:10.2.1.1005
# This and previous blank line are ignore
geckolib
aquaculture
naturalist
```
!!! tip "Docker Compose"
Making use of the space delimited option, compose file declarations can be organized nicely with a [multi-line string](https://yaml-multiline.info/), such as Making use of the space delimited option, compose file declarations can be organized nicely with a [multi-line string](https://yaml-multiline.info/), such as

View File

@@ -1,10 +1,10 @@
# Working with mods and plugins # Working with mods and plugins
## Modpack platforms ## Mod platforms
By far the easiest way to work with mod and plugins, especially large numbers of them, is to utilize modpacks with [one of the supported modpack platforms](../types-and-platforms/index.md). By far the easiest way to work with mod and plugins, especially large numbers of them, is to utilize modpacks with [one of the supported mod platforms](../types-and-platforms/index.md).
The following are some supported modpack platforms: The following are some supported mod platforms:
- [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md) - [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md)
- [CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md) - [CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md)

View File

@@ -1,26 +1,24 @@
# Auto-download from Modrinth # Auto-download from Modrinth
[Modrinth](https://modrinth.com/) is an open source modding platform with a clean, easy to use website for finding [Fabric, Forge, etc mods](https://modrinth.com/mods) and [Paper, etc plugins](https://modrinth.com/plugins), and [datapacks](https://modrinth.com/datapacks). At startup, the container will automatically locate and download the newest versions of mod/plugin files that correspond to the `TYPE` and `VERSION` in use. Older file versions downloaded previously will automatically be cleaned up. [Modrinth](https://modrinth.com/) is an open source modding platform with a clean, easy to use website for finding [Fabric and Forge mods](https://modrinth.com/mods). At startup, the container will automatically locate and download the newest versions of mod/plugin files that correspond to the `TYPE` and `VERSION` in use. Older file versions downloaded previously will automatically be cleaned up.
- **MODRINTH_PROJECTS** : comma or newline separated list of project slugs (short name) or IDs. The project ID is located in the "Technical information" section. The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example: - **MODRINTH_PROJECTS** : comma or newline separated list of project slugs (short name) or IDs. The project ID is located in the "Technical information" section. The slug is the part of the page URL that follows `/mod/`:
``` ```
https://modrinth.com/mod/fabric-api https://modrinth.com/mod/fabric-api
---------- ----------
| |
+-- project slug +-- project slug
``` ```
Also, a specific version (or release type) can be declared adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`. Also, a specific version/type can be declared using colon symbol and version id/type after the project slug. The version id can be found in the 'Metadata' section. Valid version types are `release`, `beta`, `alpha`.
To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select. !!! example
| Description | Example projects entry | | Description | Example |
|---------------------------------|----------------------------| |---------------------------------|-----------------------|
| Select latest version | `fabric-api` | | Select latest version | `fabric-api` |
| Select specific version | `fabric-api:PbVeub96` | | Select specific version | `fabric-api:PbVeub96` |
| Select latest beta version | `fabric-api:beta` | | Select latest beta version | `fabric-api:beta` |
| Latest version using project ID | `P7dR8mSH` | | Latest version using project ID | `P7dR8mSH` |
| Latest version of datapack | `datapack:terralith` |
| Specific version of datapack | `datapack:terralith:2.5.5` |
## Extra options ## Extra options

View File

@@ -1,6 +1,6 @@
mkdocs-material == 9.5.50 mkdocs-material == 9.5.28
mkdocs-autorefs == 1.3.0 mkdocs-autorefs == 1.0.1
mkdocstrings == 0.27.0 mkdocstrings == 0.25.1
mkdocs-literate-nav == 0.6.1 mkdocs-literate-nav == 0.6.1
mdx-gh-links == 0.4 mdx-gh-links == 0.4
mkdocs-click == 0.8.1 mkdocs-click == 0.8.1

View File

@@ -1,4 +1,4 @@
# Server Types and Modpack Platforms # Server Types and Mod Platforms
Server types can be selected by setting the `TYPE` environment variable to one of the types described in these sections. Server types can be selected by setting the `TYPE` environment variable to one of the types described in these sections.
@@ -6,7 +6,7 @@ The default server type is [the official software provided by Mojang](https://ww
**From the sections to the left...** **From the sections to the left...**
The **modpack platforms** take a modpack identifier, file, etc and use that to select and download the appropriate version of a mod loader, such as Forge or Fabric, downloading declared mods/plugins, and apply any additional files. The modpack platforms are selected by setting `MODPACK_PLATFORM`; however, for ease of use and backward compatibility, the selection can be set in `TYPE` or `MOD_PLATFORM`. The **mod platforms** take a modpack identifier, file, etc and use that to select and download the appropriate version of a mod loader, such as Forge or Fabric, downloading declared mods/plugins, and apply any additional files. The mod platforms are selected by setting `MOD_PLATFORM`; however, for ease of use and compatibility, the selection can be set in `TYPE`.
The individual **server types** allow for selecting the mod loader / server type and specific versions of those. The individual **server types** allow for selecting the mod loader / server type and specific versions of those.

View File

@@ -1,6 +1,6 @@
# Auto CurseForge # Auto CurseForge
To manage a CurseForge modpack automatically with upgrade support, pinned or latest version tracking, set `MODPACK_PLATFORM`, `MOD_PLATFORM` or `TYPE` to "AUTO_CURSEFORGE". The appropriate mod loader (Forge / Fabric) version will be automatically installed as declared by the modpack. This mode will also take care of cleaning up unused files installed by previous versions of the modpack, but world data is never auto-removed. To manage a CurseForge modpack automatically with upgrade support, pinned or latest version tracking, set `MOD_PLATFORM` or `TYPE` to "AUTO_CURSEFORGE". The appropriate mod loader (Forge / Fabric) version will be automatically installed as declared by the modpack. This mode will also take care of cleaning up unused files installed by previous versions of the modpack, but world data is never auto-removed.
## API Key ## API Key
@@ -116,7 +116,7 @@ If you wish to use an unpublished modpack zip, set the container path to the fil
image: itzg/minecraft-server image: itzg/minecraft-server
environment: environment:
EULA: true EULA: true
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_MODPACK_MANIFEST: /manifests/manifest.json CF_MODPACK_MANIFEST: /manifests/manifest.json
@@ -164,11 +164,6 @@ Quite often there are mods that need to be excluded, such as ones that did not p
Mods can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given. Mods can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given.
!!! note
`CF_FORCE_INCLUDE_MODS` will not download additional mods.
For additional mods, refer to [the `CURSEFORGE_FILES` variable](../../mods-and-plugins/curseforge-files.md).
A mod's project ID can be obtained from the right hand side of the project page: A mod's project ID can be obtained from the right hand side of the project page:
![cf-project-id](../../img/cf-project-id.png) ![cf-project-id](../../img/cf-project-id.png)

View File

@@ -4,7 +4,7 @@
This mod platform type is deprecated. Please use [AUTO_CURSEFORGE](auto-curseforge.md) for new deployments. This mod platform type is deprecated. Please use [AUTO_CURSEFORGE](auto-curseforge.md) for new deployments.
Enable this server mode by setting `MODPACK_PLATFORM`, `MOD_PLATFORM` or `TYPE` to "CURSEFORGE" along with the following specific variables. Enable this server mode by setting `MOD_PLATFORM` or `TYPE` to "CURSEFORGE" along with the following specific variables.
You need to specify a modpack to run, using the `CF_SERVER_MOD` environment You need to specify a modpack to run, using the `CF_SERVER_MOD` environment
variable. A CurseForge server modpack is available together with its respective variable. A CurseForge server modpack is available together with its respective

View File

@@ -3,7 +3,7 @@
!!! note !!! note
Requires one of the Ubuntu with Hotspot images listed in [the Java versions section](../../versions/java.md). Requires one of the Ubuntu with Hotspot images listed in [the Java versions section](../../versions/java.md).
[Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by setting `MODPACK_PLATFORM`, `MOD_PLATFORM` or `TYPE` to "FTBA" [Feed the Beast application](https://www.feed-the-beast.com/) modpacks are supported by setting `MOD_PLATFORM` or `TYPE` to "FTBA"
!!! note !!! note
The "A" at the end of "FTBA" is important. The value "FTB" used to be an alias for "CURSEFORGE". The "A" at the end of "FTBA" is important. The value "FTB" used to be an alias for "CURSEFORGE".

View File

@@ -1,6 +1,6 @@
# Modrinth Modpacks # Modrinth Modpacks
[Modrinth Modpacks](https://modrinth.com/modpacks) can automatically be installed along with the required mod loader (Forge or Fabric) by setting `MODPACK_PLATFORM`, `MOD_PLATFORM` or `TYPE` to "MODRINTH". Upgrading (and downgrading) takes care of cleaning up old files and upgrading (and downgrading) the mod loader. [Modrinth Modpacks](https://modrinth.com/modpacks) can automatically be installed along with the required mod loader (Forge or Fabric) by setting `MOD_PLATFORM` or `TYPE` to "MODRINTH". Upgrading (and downgrading) takes care of cleaning up old files and upgrading (and downgrading) the mod loader.
## Modpack project ## Modpack project

View File

@@ -1,9 +1,5 @@
# Bukkit/Spigot # Bukkit/Spigot
!!! failure "GetBukkit site no longer supports automated downloads"
The downloads provider <https://getbukkit.org> seems to no longer support automated downloads. As such, it is highly recommended to switch to [Paper](paper.md) instead since it is actively maintained and fully compatible with Bukkit/Spigot plugins.
Run a Bukkit/Spigot server type by setting the environment variable `TYPE` to "BUKKIT" or "SPIGOT". Run a Bukkit/Spigot server type by setting the environment variable `TYPE` to "BUKKIT" or "SPIGOT".
!!! example !!! example

View File

@@ -32,7 +32,7 @@ A [Ketting](https://github.com/kettingpowered/Ketting-1-20-x) server, which is a
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.20.1" or later. There are limited base versions supported, so you will also need to set `VERSION`, such as "1.20.1" or later.
`FORGE_VERSION` and `KETTING_VERSION` may be specified; however, they will be defaulted by the [Ketting launcher](https://github.com/kettingpowered/kettinglauncher) otherwise. `FORGE_VERSION` and `KETTING_VERSION` may be specified; however, they will be defaulted by the [Ketting launcher](https://github.com/kettingpowered/kettinglauncher) otherwise.
Available Ketting Versions may be found at [https://reposilite.c0d3m4513r.com/#/Ketting-Server-Releases/org/kettingpowered/server/forge](https://reposilite.c0d3m4513r.com/#/Ketting-Server-Releases/org/kettingpowered/server/forge). Available Ketting Versions may be found at [https://github.com/kettingpowered/Ketting-1-20-x/packages/2041866/versions](https://github.com/kettingpowered/Ketting-1-20-x/packages/2041866/versions).
The Version structure is `MinecraftVersion-ForgeVersion-KettingVersion` (e.g. `1.20.1-47.2.20-0.1.4` is for Minecraft `1.20.1`, Forge `47.2.20` and Ketting `0.1.4`). The Version structure is `MinecraftVersion-ForgeVersion-KettingVersion` (e.g. `1.20.1-47.2.20-0.1.4` is for Minecraft `1.20.1`, Forge `47.2.20` and Ketting `0.1.4`).
### Mohist ### Mohist

View File

@@ -6,8 +6,6 @@ To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "exper
!!! example !!! example
Using `docker run` command line
``` ```
docker run ... -e TYPE=PAPER ... docker run ... -e TYPE=PAPER ...
@@ -17,34 +15,6 @@ To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "exper
docker run ... -e TYPE=PAPER -e PAPER_CHANNEL=experimental ... docker run ... -e TYPE=PAPER -e PAPER_CHANNEL=experimental ...
``` ```
Using a compose file:
```yaml
environment:
TYPE: PAPER
```
```yaml
environment:
TYPE: PAPER
VERSION: 1.20.6
PAPER_BUILD: 140
```
```yaml
environment:
TYPE: PAPER
PAPER_CHANNEL: experimental
```
!!! tip
If you see the following error, it likely means you need to set the env var `PAPER_CHANNEL` to "experimental"
```
No build found for version 1.21 with channel 'default'
```
If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=<url>`. If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=<url>`.
@@ -87,19 +57,13 @@ Extra variables:
### Folia ### Folia
A [Folia server](https://papermc.io/software/folia) can be used by setting the environment variable `TYPE` to "FOLIA". Enable Folia server mode by adding a `-e TYPE=FOLIA` to your command-line.
By default, the container will run the latest experimental build of [Folia server](https://papermc.io/downloads), but you can also choose to run a specific build with `-e FOLIABUILD=26`. The release channel can be changed with the variable `FOLIA_CHANNEL`; however, only experimental builds are available at this time. By default, the container will run the latest build of [Folia server](https://papermc.io/downloads), but you can also choose to run a specific build with `-e FOLIABUILD=26`.
!!! example
Using `docker run`
```
docker run -d -v /path/on/host:/data \ docker run -d -v /path/on/host:/data \
-e TYPE=FOLIA \ -e TYPE=FOLIA \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server -p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
```
If you are hosting your own copy of Folia you can override the download URL with `FOLIA_DOWNLOAD_URL=<url>`. If you are hosting your own copy of Folia you can override the download URL with `FOLIA_DOWNLOAD_URL=<url>`.

View File

@@ -563,35 +563,35 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>RCON_CMDS_STARTUP</code></td> <td><code>RCON_CMDS_STARTUP</code></td>
<td>RCON commands to execute when the server starts.</td> <td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td> <td><code></code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>RCON_CMDS_ON_CONNECT</code></td> <td><code>RCON_CMDS_ON_CONNECT</code></td>
<td>RCON commands to execute whenever a client connects to the server.</td> <td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td> <td><code></code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>RCON_CMDS_FIRST_CONNECT</code></td> <td><code>RCON_CMDS_ON_DISCONNECT</code></td>
<td>RCON commands to execute on the first client connection to the server.</td> <td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td> <td><code></code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>RCON_CMDS_ON_DISCONNECT</code></td> <td><code>RCON_CMDS_LAST_DISCONNECT</code></td>
<td>RCON commands to execute whenever a client disconnects from the server.</td> <td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td> <td><code></code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
<tr> <tr>
<td><code>RCON_CMDS_LAST_DISCONNECT</code></td> <td><code>RCON_CMDS_STARTUP</code></td>
<td>RCON commands to execute when the last client disconnects from the server.</td> <td>RCON commands can be configured to execute when the server starts, a client connects, or a client disconnects</td>
<td><code></code></td> <td><code></code></td>
<td>⬜️</td> <td>⬜️</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -23,6 +23,7 @@ where `<tag>` refers to the first column of this table:
| java17-alpine | 17 | Alpine | Hotspot | amd64 (1) | | java17-alpine | 17 | Alpine | Hotspot | amd64 (1) |
| java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 | | java11 | 11 | Ubuntu | Hotspot | amd64, arm64, armv7 |
| java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 | | java8 | 8 | Ubuntu | Hotspot | amd64, arm64, armv7 |
| java8-alpine | 8 | Alpine | Hotspot | amd64 (1) |
| java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 | | java8-jdk | 8 | Ubuntu | Hotspot+JDK | amd64 |
| java8-openj9 | 8 | Debian | OpenJ9 | amd64 | | java8-openj9 | 8 | Debian | OpenJ9 | amd64 |
| java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 | | java8-graalvm-ce | 8 | Oracle | GraalVM CE | amd64 |
@@ -132,6 +133,5 @@ The following image tags have been deprecated and are no longer receiving update
- java17-openj9 - java17-openj9
- java20-graalvm, java20, java20-alpine - java20-graalvm, java20, java20-alpine
- java8-multiarch is still built and pushed, but please move to java8 instead - java8-multiarch is still built and pushed, but please move to java8 instead
- java8-alpine
[^1]: Based on the [Oracle GraalMV images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise. [^1]: Based on the [Oracle GraalMV images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images), which as of JDK 17, are now under the [GraalVM Free License](https://blogs.oracle.com/java/post/graalvm-free-license) incorporating what used to be known as the GraalVM Enterprise.

View File

@@ -3,7 +3,7 @@ services:
image: itzg/minecraft-server image: itzg/minecraft-server
environment: environment:
EULA: true EULA: true
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# from .env # from .env
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-of-fabric-7 CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-of-fabric-7

View File

@@ -1,25 +0,0 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: true
MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: all-the-mods-10
# Optional: select a specific version/file
# CF_FILENAME_MATCHER: "1.17"
MEMORY: 4G
CF_OVERRIDES_EXCLUSIONS: |
shaderpacks/**
volumes:
# Use managed volume by default, but can change to a relative path like
# ./data:/data
# to use a host directory
- mc-data:/data
volumes:
mc-data:

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8 CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-9 CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-9

View File

@@ -3,7 +3,7 @@ services:
image: itzg/minecraft-server image: itzg/minecraft-server
environment: environment:
EULA: true EULA: true
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_MODPACK_MANIFEST: /manifests/manifest.json CF_MODPACK_MANIFEST: /manifests/manifest.json

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/minecraft-eternal/files/4102634 CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/minecraft-eternal/files/4102634

View File

@@ -3,7 +3,7 @@ services:
image: itzg/minecraft-server image: itzg/minecraft-server
environment: environment:
EULA: true EULA: true
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file # Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_SLUG: better-mc-fabric-bmc1 CF_SLUG: better-mc-fabric-bmc1

View File

@@ -1,20 +1,22 @@
services: services:
mc: mc:
image: itzg/minecraft-server image: itzg/minecraft-server:java17
environment: environment:
DEBUG: true
SETUP_ONLY: true
EULA: true EULA: true
MODPACK_PLATFORM: MODRINTH TYPE: MODRINTH
MODRINTH_MODPACK: https://modrinth.com/modpack/better-mc-forge-bmc4/version/v32.5 VERSION: 1.20.1
MODRINTH_EXCLUDE_FILES: |
XaeroPlus
XaerosWorldMap
MODRINTH_OVERRIDES_EXCLUSIONS: |
mods/citresewn-*.jar
**/datapacks/BE_default_endgen_fix*
MODRINTH_FORCE_SYNCHRONIZE: true
MEMORY: 4G MEMORY: 4G
MODRINTH_MODPACK: better-mc-forge-bmc4
MODRINTH_VERSION: v28
MODRINTH_OVERRIDES_EXCLUSIONS: |
mods/NekosEnchantedBooks-*.jar
mods/citresewn-*.jar
volumes:
- data:/data
ports: ports:
- "25565:25565" - "25565:25565"
# declare /data volume mapping as desired
# volumes: volumes:
# - ./data:/data data: {}

View File

@@ -1,13 +0,0 @@
services:
mc:
image: itzg/minecraft-server:java8
environment:
EULA: true
TYPE: canyon
VERSION: b1.7.3
ports:
- "25565:25565"
volumes:
- mc-data:/data
volumes:
mc-data:

View File

@@ -1,34 +0,0 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: true
ALLOW_FLIGHT: true
MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: craftoria
MEMORY: 8G
CF_EXCLUDE_MODS: |
737481
363363
394468
986380
844662
568563
915902
690971
455508
1089803
511319
volumes:
# Use managed volume by default, but can change to a relative path like
# ./data:/data
# to use a host directory
- mc-data:/data
volumes:
mc-data:

View File

@@ -1,21 +1,22 @@
services: services:
mc: mc:
image: itzg/minecraft-server # FTBA support is only available in non-Alpine images
image: itzg/minecraft-server:${IMAGE_TAG:-java8-multiarch}
ports: ports:
# expose the Minecraft server port outside of container # expose the Minecraft server port outside of container
- "25565:25565" - 25565:25565
environment: environment:
# REQUIRED for all types # REQUIRED for all types
EULA: "TRUE" EULA: "TRUE"
# Set server type (vs the default of vanilla) # Set server type (vs the default of vanilla)
TYPE: FTBA TYPE: FTBA
# Use Pack ID from https://www.feed-the-beast.com/modpacks/119-ftb-presents-direwolf20-120?tab=about # Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/
FTB_MODPACK_ID: "119" FTB_MODPACK_ID: "31"
# FTB_MODPACK_VERSION_ID: "" FTB_MODPACK_VERSION_ID: ""
volumes: volumes:
# use a named, managed volume for data volume # use a named, managed volume for data volume
- data:/data - ftba:/data
volumes: volumes:
# declared the named volume, but use default/local storage engine # declared the named volume, but use default/local storage engine
data: {} ftba: {}

View File

@@ -13,11 +13,8 @@ services:
- ./data:/data - ./data:/data
ngrok: ngrok:
image: ngrok/ngrok:latest image: shkoliar/ngrok:latest
command:
- "tcp"
- "mc:25565"
environment:
NGROK_AUTHTOKEN: <YourAuthTokenHere>
ports: ports:
- 4551:4551 - 4551:4551
environment:
- PARAMS=tcp -region=us -authtoken=YourAuthTokenHere mc:25565

View File

@@ -1,21 +0,0 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
# Game port
- "25565:25565/tcp"
environment:
EULA: "TRUE"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/ftb-evolution
# This modpack includes an override client-side only mod that will prevent the server from starting.
# For more information on override exclusions see:
# https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#excluding-overrides-files
CF_OVERRIDES_EXCLUSIONS: mods/rgp_client*.jar
MEMORY: 6G
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data

View File

@@ -1,25 +0,0 @@
services:
mc:
# make sure this java version matches with pack java version
image: itzg/minecraft-server:java21
tty: true
stdin_open: true
ports:
- "25565:25565"
environment:
EULA: "TRUE"
TYPE: CUSTOM
GENERIC_PACKS: GT_New_Horizons_2.7.2_Server_Java_17-21
GENERIC_PACKS_SUFFIX: .zip
GENERIC_PACKS_PREFIX: https://downloads.gtnewhorizons.com/ServerPacks/
# if this isn't true, then the container tries to download the modpack every run
SKIP_GENERIC_PACK_UPDATE_CHECK: "true"
MEMORY: 6G
# Make sure that this matches what is in your pack's startserver bash file
JVM_OPTS: -Dfml.readTimeout=180 @java9args.txt
CUSTOM_JAR_EXEC: -jar lwjgl3ify-forgePatches.jar nogui
volumes:
# attach a managed volume, change to a relative or absolute host directory if needed
- mc-data:/data
volumes:
mc-data:

View File

@@ -1,40 +0,0 @@
services:
lazymc:
container_name: lazymc
image: ghcr.io/joesturge/lazymc-docker-proxy:latest
environment:
# Point to the service name of the Minecraft server
SERVER_ADDRESS: mc:25565
# Required to find the container to manage it
LAZYMC_GROUP: mc
restart: unless-stopped
volumes:
# you should mount the minecraft server dir under /server, using read only.
- data:/server:ro
# you need to supply the docker socket, so that the container can run docker command
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
# lazymc-docker-proxy acts as a proxy, so there is
# no need to expose the server port on the Minecraft container
- "25565:25565"
# Standard Docker Minecraft server, also works with other server types
mc:
image: itzg/minecraft-server:java21
container_name: minecraft-server
# We need to add a label here so that lazymc-docker-proxy knows which
# container to manage
labels:
- lazymc.group=mc
tty: true
stdin_open: true
# This container should be managed solely by the lazymc container
# so set restart to no, or else the container will start again...
restart: no
environment:
EULA: "TRUE"
volumes:
- data:/data
volumes:
data:

View File

@@ -7,7 +7,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "TRUE" EULA: "TRUE"
MODPACK_PLATFORM: MODRINTH MOD_PLATFORM: MODRINTH
MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2 MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2
# or for auto-upgrading to latest # or for auto-upgrading to latest
# MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric # MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric

View File

@@ -3,15 +3,13 @@ services:
image: itzg/minecraft-server image: itzg/minecraft-server
environment: environment:
EULA: true EULA: true
MODPACK_PLATFORM: MODRINTH MOD_PLATFORM: MODRINTH
# Download the mrpack file from https://modrinth.com/modpack/cobblemon-fabric/version/1.4.1 and place in # Download the mrpack file from https://modrinth.com/modpack/cobblemon-fabric/version/1.4.1 and place in
# modpacks directory next to this compose file. # modpacks directory next to this compose file.
MODRINTH_MODPACK: /modpacks/Cobblemon Modpack [Fabric] 1.4.1.mrpack MODRINTH_MODPACK: /modpacks/Cobblemon Modpack [Fabric] 1.4.1.mrpack
ports:
- "25565:25565"
volumes: volumes:
- mc-data:/data - mc-data:/data
- ./modpacks:/modpacks:ro - ./modpacks:/modpacks:ro
volumes: volumes:
mc-data: {} mc-data: {}

View File

@@ -4,7 +4,7 @@ services:
environment: environment:
EULA: true EULA: true
MOTD: | MOTD: |
A §l§cMinecraft§r server line one
line two line two
# or # or
# MOTD: "line one\nline two" # MOTD: "line one\nline two"

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# CF_API_KEY=... must be set in .env file or as environment variable # CF_API_KEY=... must be set in .env file or as environment variable
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_SLUG: one-block-modded CF_SLUG: one-block-modded

View File

@@ -1,60 +0,0 @@
# A Form to Load New Config Files to Paper MC
In this example, we illustrate how to efficiently load and manage different configuration files to optimize a Paper Minecraft server. To implement this, it is necessary to create a dedicated repository where the configuration files can be stored and later retrieved. The repository should adhere to a specific structure to facilitate seamless integration with your Docker setup. Notably, the configurations must be organized into a folder named after the version of Minecraft you are using.
For reference, I have provided this [repository](https://github.com/Alpha018/paper-config-optimized), which contains optimized configuration files for the latest version of Minecraft. You can use this repository by linking directly to the configuration files in your Docker file, as demonstrated in the example below.
## Usage
You can directly use the optimized configuration files from this repository by accessing them through the GitHub raw URLs. Simply replace the env var like the docker compose with any other repo with different configurations.
To use the raw files, you can download or link to them using the following pattern:
```yaml
services:
mc:
image: itzg/minecraft-server
container_name: paper
environment:
EULA: "true"
TYPE: "PAPER"
VIEW_DISTANCE: 10
MEMORY: 2G
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/[your-username]/[your-repository]/main/[file-path]"
ports:
- "25565:25565"
volumes:
- mc-paper:/data
restart: unless-stopped
volumes:
mc-paper: {}
```
For example:
```yaml
services:
mc:
image: itzg/minecraft-server
container_name: paper
environment:
EULA: "true"
TYPE: "PAPER"
VIEW_DISTANCE: 10
MEMORY: 2G
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main"
ports:
- "25565:25565"
volumes:
- mc-paper:/data
restart: unless-stopped
volumes:
mc-paper: {}
```
Feel free to explore and use the configurations in this repo to enhance your Minecraft server's performance.
## Contribution
If you'd like to improve or suggest changes to these configurations, feel free to submit a pull request in this [repository](https://github.com/Alpha018/paper-config-optimized). We welcome contributions from the community!

View File

@@ -1,17 +0,0 @@
services:
mc:
image: itzg/minecraft-server
container_name: paper
environment:
EULA: "true"
TYPE: "PAPER"
VIEW_DISTANCE: 10
MEMORY: 2G
PAPER_CONFIG_REPO: "https://raw.githubusercontent.com/Alpha018/paper-config-optimized/main"
ports:
- "25565:25565"
volumes:
- mc-paper:/data
restart: unless-stopped
volumes:
mc-paper: {}

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/ CF_API_KEY: # allocate from https://console.curseforge.com/
CF_SLUG: the-pixelmon-modpack CF_SLUG: the-pixelmon-modpack
CF_FILENAME_MATCHER: "9.1.2" CF_FILENAME_MATCHER: "9.1.2"

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/prominence-2-rpg CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/prominence-2-rpg

View File

@@ -6,7 +6,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file # allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/roguelike-adventures-and-dungeons-2 CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/roguelike-adventures-and-dungeons-2
@@ -14,8 +14,11 @@ services:
#CF_FILENAME_MATCHER: "0.2.34" #CF_FILENAME_MATCHER: "0.2.34"
CF_EXCLUDE_MODS: | CF_EXCLUDE_MODS: |
controlling controlling
craftpresence
creative-core creative-core
default-options default-options
equipment-compare
item-borders
itemphysic-lite itemphysic-lite
konkrete konkrete
oauth oauth

View File

@@ -3,7 +3,7 @@ services:
image: itzg/minecraft-server:java8-multiarch image: itzg/minecraft-server:java8-multiarch
environment: environment:
EULA: true EULA: true
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file # Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file
CF_API_KEY: ${CF_API_KEY} CF_API_KEY: ${CF_API_KEY}
CF_SLUG: rlcraft CF_SLUG: rlcraft

View File

@@ -1,21 +0,0 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
# Game port
- "25565:25565/tcp"
# Voice chat port
- "24454:24454/udp"
environment:
EULA: "TRUE"
TYPE: "FABRIC"
VERSION: "1.21.1"
# This will select the latest version of simple voice chat for 1.21.1.
# You can specify a version by appending :versionID (e.g. simple-voice-chat:anabvqRL)
MODRINTH_PROJECTS: "simple-voice-chat"
MEMORY: 8G
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data

View File

@@ -1,21 +0,0 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
# Game port
- "25565:25565/tcp"
# Voice chat port
- "24454:24454/udp"
environment:
EULA: "TRUE"
TYPE: "NEOFORGE"
VERSION: "1.21.1"
# This will select the latest version of simple voice chat for 1.21.1.
# You can specify a version by appending :versionID (e.g. simple-voice-chat:anabvqRL)
MODRINTH_PROJECTS: "simple-voice-chat"
MEMORY: 8G
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data

View File

@@ -1,21 +0,0 @@
services:
mc:
image: itzg/minecraft-server
tty: true
stdin_open: true
ports:
# Game port
- "25565:25565/tcp"
# Voice chat port
- "24454:24454/udp"
environment:
EULA: "TRUE"
TYPE: "PAPER"
VERSION: "1.21.1"
# This will select the latest version of simple voice chat for 1.21.1.
# You can specify a version by appending :versionID (e.g. simple-voice-chat:anabvqRL)
MODRINTH_PROJECTS: "simple-voice-chat"
MEMORY: 8G
volumes:
# attach the relative directory 'data' to the container's /data path
- ./data:/data

View File

@@ -1,19 +0,0 @@
services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
# https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/
MODPACK_PLATFORM: AUTO_CURSEFORGE
# CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/skyfactory-5/files/6044634
CF_SLUG: skyfactory-5
CF_FILENAME_MATCHER: 5.0.2
# Loads from .env file
CF_API_KEY: ${CF_API_KEY}
MEMORY: 4G
ports:
- "25565:25565"
volumes:
- mc-data:/data
volumes:
mc-data:

View File

@@ -5,7 +5,7 @@ services:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/ CF_API_KEY: # allocate from https://console.curseforge.com/
CF_FORCE_SYNCHRONIZE: "true" CF_FORCE_SYNCHRONIZE: "true"
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/valhelsia-5/files/4429560 CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/valhelsia-5/files/4429560

View File

@@ -1,18 +1,17 @@
services: services:
mc: mc:
image: itzg/minecraft-server:java17 image: itzg/minecraft-server
ports: ports:
- "25565:25565" - "25565:25565"
environment: environment:
EULA: "true" EULA: "true"
MODPACK_PLATFORM: AUTO_CURSEFORGE MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ CF_API_KEY: # allocate from https://console.curseforge.com/
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: vault-hunters-1-18-2 CF_SLUG: vault-hunters-1-18-2
MOTD: "§4----- §2 Vault Hunters: 1.18.2 §4 -----§r\\n §4------ §e vaulthunters.gg §4------" CF_FILENAME_MATCHER: "Update-10.0.0"
MOTD: "§4----- §2 Vault Hunters: 1.18.2u10.0.0 §4 -----§r\\n §4------ §e vaulthunters.gg §4------"
MEMORY: 6G # 4G for base server + 2G per player MEMORY: 6G # 4G for base server + 2G per player
CF_EXCLUDE_MODS: | CF_EXCLUDE_MODS: reauth
reauth
ALLOW_FLIGHT: true ALLOW_FLIGHT: true
ENABLE_COMMAND_BLOCK: true ENABLE_COMMAND_BLOCK: true
DIFFICULTY: hard DIFFICULTY: hard
@@ -20,4 +19,4 @@ services:
- mc-data:/data - mc-data:/data
volumes: volumes:
mc-data: {} mc-data: {}

View File

@@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
# shellcheck source=../scripts/start-utils
. "${SCRIPTS:-/}start-utils"
current_uptime() { current_uptime() {
awk '{print $1}' /proc/uptime | cut -d . -f 1 awk '{print $1}' /proc/uptime | cut -d . -f 1
} }
@@ -18,20 +16,14 @@ rcon_client_exists() {
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]] [[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
} }
use_proxy() {
if isTrue "$USES_PROXY_PROTOCOL"; then
echo "--use-proxy"
fi
}
mc_server_listening() { mc_server_listening() {
mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --timeout 10s >&/dev/null mc-monitor status --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --timeout 10s >& /dev/null
} }
java_clients_connections() { java_clients_connections() {
local connections local connections
if java_running; then if java_running ; then
if ! connections=$(mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --show-player-count); then if ! connections=$(mc-monitor status --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" --show-player-count); then
# consider it a non-zero player count if the ping fails # consider it a non-zero player count if the ping fails
# otherwise a laggy server with players connected could get paused # otherwise a laggy server with players connected could get paused
connections=1 connections=1

View File

@@ -1,51 +1,43 @@
{ {
"globalExcludes": [ "globalExcludes": [
"advancement-plaques",
"ambience-music-mod",
"ambientsounds", "ambientsounds",
"auudio-forge",
"ambience-music-mod",
"appleskin", "appleskin",
"armor-chroma", "armor-chroma",
"armor-toughness-bar", "armor-toughness-bar",
"audio-extension-for-fancymenu-forge",
"auudio-forge",
"beehivetooltips", "beehivetooltips",
"better-advancements", "better-advancements",
"betterf3",
"betterfps",
"better-foliage", "better-foliage",
"better-placement", "better-placement",
"better-sprinting", "better-sprinting",
"better-third-person",
"better-tips-nbt-tag", "better-tips-nbt-tag",
"betterf3", "better-third-person",
"betterfps",
"biomeinfo", "biomeinfo",
"block-drops-jei-addon", "block-drops-jei-addon",
"blur-forge",
"cartography",
"cherished-worlds", "cherished-worlds",
"chunk-animator", "chunk-animator",
"clickable-advancements", "clickable-advancements",
"configured", "configured",
"controlling", "controlling",
"craftpresence",
"ctm", "ctm",
"custom-main-menu", "custom-main-menu",
"dark-mode-everywhere",
"defensive-measures", "defensive-measures",
"ding", "ding",
"drippy-loading-screen", "drippy-loading-screen",
"dynamic-surroundings",
"dynamiclights-reforged", "dynamiclights-reforged",
"dynamic-surroundings",
"easiervillagertrading", "easiervillagertrading",
"effective-forge", "effective-forge",
"embeddium", "embeddium",
"embeddium-extension", "embeddium-extension",
"embeddium-extras", "embeddium-extras",
"enchantment-descriptions", "enchantment-descriptions",
"enhancedvisuals",
"entity-collision-fps-fix", "entity-collision-fps-fix",
"entity-texture-features-fabric", "entity-texture-features-fabric",
"entityculling", "entityculling",
"equipment-compare",
"extreme-sound-muffler", "extreme-sound-muffler",
"ezzoom", "ezzoom",
"fading-night-vision", "fading-night-vision",
@@ -53,57 +45,42 @@
"fancymenu", "fancymenu",
"faster-ladder-climbing", "faster-ladder-climbing",
"foamfix-optimization-mod", "foamfix-optimization-mod",
"fps-reducer",
"free-cam", "free-cam",
"ftb-backups-2", "ftb-backups-2",
"fullscreen-windowed-borderless-for-minecraft", "fullscreen-windowed-borderless-for-minecraft",
"hwyla", "hwyla",
"iceberg",
"ignitioncoil", "ignitioncoil",
"inmisaddon", "inmisaddon",
"iris-flywheel-compat",
"irisshaders", "irisshaders",
"item-borders", "iris-flywheel-compat",
"item-highlighter",
"item-obliterator", "item-obliterator",
"itemphysic-lite",
"itemzoom", "itemzoom",
"just-enough-harvestcraft", "just-enough-harvestcraft",
"just-enough-mekanism-multiblocks",
"just-enough-resources-jer", "just-enough-resources-jer",
"just-zoom",
"konkrete",
"legendary-tooltips", "legendary-tooltips",
"lighty",
"loot-capacitor-tooltips",
"lootbeams", "lootbeams",
"loot-capacitor-tooltips",
"magnesium-extras", "magnesium-extras",
"menumobs", "menumobs",
"minecraft-rich-presence", "minecraft-rich-presence",
"model-gap-fix",
"more-overlays", "more-overlays",
"mouse-tweaks", "mouse-tweaks",
"neat", "neat",
"necronomicon",
"nekos-enchanted-books", "nekos-enchanted-books",
"no-nv-flash",
"no-recipe-book", "no-recipe-book",
"no-nv-flash",
"not-enough-animations", "not-enough-animations",
"oculus", "oculus",
"oldjavawarning", "oldjavawarning",
"overloaded-armor-bar", "overloaded-armor-bar",
"packmenu",
"packmodemenu", "packmodemenu",
"reauth", "reauth",
"reblured",
"reeses-sodium-options",
"reforgium",
"resource-reloader", "resource-reloader",
"rubidium", "rubidium",
"rubidium-extra", "rubidium-extra",
"ryoamiclights", "ryoamiclights",
"schematica", "schematica",
"seamless-loading-screen",
"seamless-loading-screen-forge",
"searchables", "searchables",
"shulkerboxviewer", "shulkerboxviewer",
"skin-layers-3d", "skin-layers-3d",
@@ -111,9 +88,6 @@
"smooth-font", "smooth-font",
"smoothwater", "smoothwater",
"sodium", "sodium",
"sodium-extra",
"sodium-options-api",
"sodium-rubidium-occlusion-culling-fix",
"sound-filters", "sound-filters",
"sound-physics-remastered", "sound-physics-remastered",
"stellar-sky", "stellar-sky",
@@ -122,34 +96,29 @@
"textrues-rubidium-options", "textrues-rubidium-options",
"thaumic-jei", "thaumic-jei",
"tips", "tips",
"toast-control",
"torohealth-damage-indicators", "torohealth-damage-indicators",
"true-darkness", "true-darkness",
"ungrab-mouse-mod", "ungrab-mouse-mod",
"vanillafix", "vanillafix",
"visuality", "visuality",
"waila-harvestability", "waila-harvestability",
"wawla",
"xaeroplus",
"yungs-menu-tweaks",
"zume" "zume"
], ],
"modpacks": { "modpacks": {
"all-of-fabric-6": { "all-of-fabric-6": {
"forceIncludes": ["revelationary"]
},
"create-arcane-engineering": {
"forceIncludes": ["just-enough-resources-jer"]
},
"skyfactory-5": {
"forceIncludes": [ "forceIncludes": [
"colored-torches", "revelationary"
"dye-mob-dye",
"openstairs"
] ]
}, },
"valhelsia-5": { "valhelsia-5": {
"excludes": ["modernfix"] "excludes": [
"modernfix"
]
},
"create-arcane-engineering": {
"forceIncludes": [
"just-enough-resources-jer"
]
} }
} }
} }

View File

@@ -1,87 +1,15 @@
{ {
"globalExcludes": [ "globalExcludes": [
"3dskinlayers", "3dskinlayers",
"ae2-emi-crafting",
"AmbientSounds",
"amecs",
"Animation_Overhaul",
"appleskin",
"auudio",
"axolotlbuckets",
"BadOptimizations",
"BetterAdvancements",
"betterbeds",
"BetterThirdPerson",
"BHMenu",
"blur",
"Boat-Item-View",
"bobby",
"cat_jam",
"chat_heads",
"chatanimation",
"cherishedworlds",
"citresewn", "citresewn",
"clickadv",
"connectedness",
"connector", "connector",
"craftpresence",
"cwb",
"DisableCustomWorldsAdvice",
"drippyloadingscreen",
"eating-animation",
"emiffect",
"emitrades",
"entity_model_features", "entity_model_features",
"entity_texture_features", "entity_texture_features",
"entityculling",
"euphoriapatcher", "euphoriapatcher",
"fallingleaves",
"fancymenu",
"fast-ip-ping",
"FauxCustomEntityData",
"feytweaks",
"figura",
"GeckoLibIrisCompat",
"gpumemleakfix",
"Highlighter",
"ImmediatelyFast",
"indium",
"iris",
"iris-flywheel",
"ItemBorders",
"ItemLocks",
"justzoom",
"language-reload",
"lazy-language-loader",
"LegendaryTooltips",
"loadmyresources",
"lootbeams",
"MindfulDarkness",
"MouseTweaks",
"nicer-skies",
"notenoughanimations", "notenoughanimations",
"oculus", "oculus",
"OverflowingBars",
"PickUpNotifier",
"PresenceFootsteps",
"Prism",
"reforgium",
"reeses_sodium_options",
"ResourcePackOverrides",
"ryoamiclights", "ryoamiclights",
"screenshot_viewer", "yungsmenutweaks"
"Searchables",
"seasonhud",
"ShoulderSurfing",
"skinlayers3d",
"sodium",
"sorted_enchantments",
"visuality",
"VR-Combat",
"YeetusExperimentus",
"yungsmenutweaks",
"Zoomify",
"zume"
], ],
"globalForceIncludes": [], "globalForceIncludes": [],
"modpacks": {} "modpacks": {}

View File

@@ -1,66 +1,58 @@
{ {
"allow-flight": {"env": "ALLOW_FLIGHT"},
"allow-nether": {"env": "ALLOW_NETHER"},
"bug-report-link": {"env": "BUG_REPORT_LINK"},
"announce-player-achievements": {"env": "ANNOUNCE_PLAYER_ACHIEVEMENTS"},
"broadcast-console-to-ops": {"env": "BROADCAST_CONSOLE_TO_OPS"},
"broadcast-rcon-to-ops": {"env": "BROADCAST_RCON_TO_OPS"},
"difficulty": {"env": "DIFFICULTY"},
"enable-command-block": {"env": "ENABLE_COMMAND_BLOCK"},
"enable-jmx-monitoring": {"env": "ENABLE_JMX"},
"enable-query": {"env": "ENABLE_QUERY"},
"enable-rcon": {"env": "ENABLE_RCON"},
"enable-status": {"env": "ENABLE_STATUS"},
"enforce-secure-profile": {"env": "ENFORCE_SECURE_PROFILE"},
"enforce-whitelist": {"env": "ENFORCE_WHITELIST"},
"entity-broadcast-range-percentage": {"env": "ENTITY_BROADCAST_RANGE_PERCENTAGE"},
"force-gamemode": {"env": "FORCE_GAMEMODE"},
"function-permission-level": {"env": "FUNCTION_PERMISSION_LEVEL"},
"gamemode": {"env": "MODE"},
"generate-structures": {"env": "GENERATE_STRUCTURES"},
"generator-settings": {"env": "GENERATOR_SETTINGS"},
"hardcore": {"env": "HARDCORE"},
"hide-online-players": {"env": "HIDE_ONLINE_PLAYERS"},
"initial-disabled-packs": {"env": "INITIAL_DISABLED_PACKS"},
"initial-enabled-packs": {"env": "INITIAL_ENABLED_PACKS"},
"level-name": {"env": "LEVEL"},
"level-seed": {"env": "SEED"},
"level-type": {"env": "LEVEL_TYPE"},
"log-ips": {"env": "LOG_IPS"},
"max-build-height": {"env": "MAX_BUILD_HEIGHT"},
"max-chained-neighbor-updates": {"env": "MAX_CHAINED_NEIGHBOR_UPDATES"},
"max-players": {"env": "MAX_PLAYERS"},
"max-tick-time": {"env": "MAX_TICK_TIME"},
"max-world-size": {"env": "MAX_WORLD_SIZE"},
"motd": {"env": "MOTD"}, "motd": {"env": "MOTD"},
"network-compression-threshold": {"env": "NETWORK_COMPRESSION_THRESHOLD"}, "gamemode": {"env": "MODE"},
"online-mode": {"env": "ONLINE_MODE"}, "difficulty": {"env": "DIFFICULTY"},
"op-permission-level": {"env": "OP_PERMISSION_LEVEL"}, "white-list": {"env": "WHITELIST_PROP"},
"pause-when-empty-seconds": {"env": "PAUSE_WHEN_EMPTY_SECONDS"}, "enforce-whitelist": {"env": "ENFORCE_WHITELIST"},
"player-idle-timeout": {"env": "PLAYER_IDLE_TIMEOUT"}, "level-type": {"env": "LEVEL_TYPE"},
"prevent-proxy-connections": {"env": "PREVENT_PROXY_CONNECTIONS"},
"previews-chat": {"env": "PREVIEWS_CHAT"},
"pvp": {"env": "PVP"},
"query.port": {"env": "QUERY_PORT"},
"rcon.password": {"env": "RCON_PASSWORD"},
"rcon.port": {"env": "RCON_PORT"},
"region-file-compression": {"env": "REGION_FILE_COMPRESSION"},
"resource-pack": {"env": "RESOURCE_PACK"},
"resource-pack-id": {"env": "RESOURCE_PACK_ID"},
"resource-pack-prompt": {"env": "RESOURCE_PACK_PROMPT"},
"resource-pack-sha1": {"env": "RESOURCE_PACK_SHA1"},
"require-resource-pack": {"env": "RESOURCE_PACK_ENFORCE"},
"server-ip": {"env": "SERVER_IP"},
"server-name": {"env": "SERVER_NAME"}, "server-name": {"env": "SERVER_NAME"},
"server-ip": {"env": "SERVER_IP"},
"server-port": {"env": "SERVER_PORT"}, "server-port": {"env": "SERVER_PORT"},
"simulation-distance": {"env": "SIMULATION_DISTANCE"}, "allow-nether": {"env": "ALLOW_NETHER"},
"snooper-enabled": {"env": "SNOOPER_ENABLED"}, "announce-player-achievements": {"env": "ANNOUNCE_PLAYER_ACHIEVEMENTS"},
"enable-command-block": {"env": "ENABLE_COMMAND_BLOCK"},
"spawn-animals": {"env": "SPAWN_ANIMALS"}, "spawn-animals": {"env": "SPAWN_ANIMALS"},
"spawn-monsters": {"env": "SPAWN_MONSTERS"}, "spawn-monsters": {"env": "SPAWN_MONSTERS"},
"spawn-npcs": {"env": "SPAWN_NPCS"}, "spawn-npcs": {"env": "SPAWN_NPCS"},
"spawn-protection": {"env": "SPAWN_PROTECTION"}, "spawn-protection": {"env": "SPAWN_PROTECTION"},
"sync-chunk-writes": {"env": "SYNC_CHUNK_WRITES"}, "generate-structures": {"env": "GENERATE_STRUCTURES"},
"use-native-transport": {"env": "USE_NATIVE_TRANSPORT"},
"view-distance": {"env": "VIEW_DISTANCE"}, "view-distance": {"env": "VIEW_DISTANCE"},
"white-list": {"env": "WHITELIST_PROP"} "hardcore": {"env": "HARDCORE"},
"snooper-enabled": {"env": "SNOOPER_ENABLED"},
"max-build-height": {"env": "MAX_BUILD_HEIGHT"},
"force-gamemode": {"env": "FORCE_GAMEMODE"},
"max-tick-time": {"env": "MAX_TICK_TIME"},
"enable-query": {"env": "ENABLE_QUERY"},
"query.port": {"env": "QUERY_PORT"},
"enable-rcon": {"env": "ENABLE_RCON"},
"rcon.password": {"env": "RCON_PASSWORD"},
"rcon.port": {"env": "RCON_PORT"},
"max-players": {"env": "MAX_PLAYERS"},
"max-world-size": {"env": "MAX_WORLD_SIZE"},
"level-name": {"env": "LEVEL"},
"level-seed": {"env": "SEED"},
"pvp": {"env": "PVP"},
"generator-settings": {"env": "GENERATOR_SETTINGS"},
"online-mode": {"env": "ONLINE_MODE"},
"allow-flight": {"env": "ALLOW_FLIGHT"},
"resource-pack": {"env": "RESOURCE_PACK"},
"resource-pack-sha1": {"env": "RESOURCE_PACK_SHA1"},
"require-resource-pack": {"env": "RESOURCE_PACK_ENFORCE"},
"player-idle-timeout": {"env": "PLAYER_IDLE_TIMEOUT"},
"broadcast-console-to-ops": {"env": "BROADCAST_CONSOLE_TO_OPS"},
"broadcast-rcon-to-ops": {"env": "BROADCAST_RCON_TO_OPS"},
"enable-jmx-monitoring": {"env": "ENABLE_JMX"},
"sync-chunk-writes": {"env": "SYNC_CHUNK_WRITES"},
"enable-status": {"env": "ENABLE_STATUS"},
"entity-broadcast-range-percentage": {"env": "ENTITY_BROADCAST_RANGE_PERCENTAGE"},
"function-permission-level": {"env": "FUNCTION_PERMISSION_LEVEL"},
"network-compression-threshold": {"env": "NETWORK_COMPRESSION_THRESHOLD"},
"op-permission-level": {"env": "OP_PERMISSION_LEVEL"},
"prevent-proxy-connections": {"env": "PREVENT_PROXY_CONNECTIONS"},
"use-native-transport": {"env": "USE_NATIVE_TRANSPORT"},
"simulation-distance": {"env": "SIMULATION_DISTANCE"},
"previews-chat": {"env": "PREVIEWS_CHAT"},
"enforce-secure-profile": {"env": "ENFORCE_SECURE_PROFILE"},
"initial-enabled-packs": {"env": "INITIAL_ENABLED_PACKS"},
"initial-disabled-packs": {"env": "INITIAL_DISABLED_PACKS"}
} }

View File

@@ -13,24 +13,10 @@ configMapGenerator:
- name: mc - name: mc
envs: envs:
- mc.env - mc.env
patches:
# Example of using a patch to set external service name for mc-router to pick up
- path: set-external-servername.yml
``` ```
### mc.env ### mc.env
``` ```
EULA=true EULA=true
TYPE=FORGE TYPE=FORGE
```
###
```yaml
apiVersion: v1
kind: Service
metadata:
name: mc
annotations:
mc-router.itzg.me/externalServerName: forge.example.com
``` ```

View File

@@ -6,7 +6,6 @@
# The Dockerfile ENVs take precedence here, but defaulting for testing consistency # The Dockerfile ENVs take precedence here, but defaulting for testing consistency
: "${UID:=1000}" : "${UID:=1000}"
: "${GID:=1000}" : "${GID:=1000}"
: "${SKIP_CHOWN_DATA:=false}"
umask "${UMASK:=0002}" umask "${UMASK:=0002}"
@@ -39,7 +38,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
fi fi
fi fi
if isTrue "${SKIP_CHOWN_DATA}" || [[ $(stat -c "%u" /data) != "$UID" ]]; then if [[ $(stat -c "%u" /data) != "$UID" ]]; then
log "Changing ownership of /data to $UID ..." log "Changing ownership of /data to $UID ..."
chown -R ${runAsUser}:${runAsGroup} /data chown -R ${runAsUser}:${runAsGroup} /data
fi fi
@@ -48,7 +47,12 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf echo 'hosts: files dns' > /etc/nsswitch.conf
fi fi
exec $(getSudoFromDistro) ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@" distro=$(getDistro)
if [[ $distro == alpine ]]; then
exec su-exec ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@"
else
exec gosu ${runAsUser}:${runAsGroup} "${SCRIPTS:-/}start-configuration" "$@"
fi
else else
exec "${SCRIPTS:-/}start-configuration" "$@" exec "${SCRIPTS:-/}start-configuration" "$@"
fi fi

View File

@@ -26,40 +26,60 @@ isDebugging && set -x
cp /auto/knockd-config.cfg /tmp/knockd-config.cfg cp /auto/knockd-config.cfg /tmp/knockd-config.cfg
function updatePort() {
regseq="^\s*sequence\s*=\s*$1\s*$"
linenum=$(grep -nm${2} sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
sed -i "${linenum}s/sequence.*/sequence = $1/" /tmp/knockd-config.cfg
log "Updated $3 port in knockd config"
fi
}
# update server port to listen to # update server port to listen to
updatePort $SERVER_PORT 1 "server" regseq="^\s*sequence\s*=\s*$SERVER_PORT\s*$"
linenum=$(grep -nm1 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
sed -i "${linenum}s/sequence.*/sequence = $SERVER_PORT/" /tmp/knockd-config.cfg
log "Updated server port in knockd config"
fi
# update rcon port to listen to # update rcon port to listen to
updatePort $RCON_PORT 2 "rcon" regseq="^\s*sequence\s*=\s*$RCON_PORT\s*$"
linenum=$(grep -nm2 sequence /tmp/knockd-config.cfg | cut -d : -f 1 | tail -n1)
isNumericElseSetToDefault "AUTOPAUSE_PERIOD" 10 if ! [[ $(awk "NR==$linenum" /tmp/knockd-config.cfg) =~ $regseq ]]; then
checkIfNotZeroElseSetToDefault "AUTOPAUSE_PERIOD" 10 sed -i "${linenum}s/sequence.*/sequence = $RCON_PORT/" /tmp/knockd-config.cfg
isNumericElseSetToDefault "AUTOPAUSE_TIMEOUT_KN" 120 log "Updated rcon port in knockd config"
isNumericElseSetToDefault "AUTOPAUSE_TIMEOUT_EST" 3600 fi
isNumericElseSetToDefault "AUTOPAUSE_TIMEOUT_INIT" 600
if ! [[ $AUTOPAUSE_PERIOD =~ ^[0-9]+$ ]]; then
AUTOPAUSE_PERIOD=10
export AUTOPAUSE_PERIOD
log "Warning: AUTOPAUSE_PERIOD is not numeric, set to 10 (seconds)"
fi
if [ "$AUTOPAUSE_PERIOD" -eq "0" ] ; then
AUTOPAUSE_PERIOD=10
export AUTOPAUSE_PERIOD
log "Warning: AUTOPAUSE_PERIOD must not be 0, set to 10 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_KN =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_KN=120
export AUTOPAUSE_TIMEOUT_KN
log "Warning: AUTOPAUSE_TIMEOUT_KN is not numeric, set to 120 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_EST =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_EST=3600
export AUTOPAUSE_TIMEOUT_EST
log "Warning: AUTOPAUSE_TIMEOUT_EST is not numeric, set to 3600 (seconds)"
fi
if ! [[ $AUTOPAUSE_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
AUTOPAUSE_TIMEOUT_INIT=600
export AUTOPAUSE_TIMEOUT_INIT
log "Warning: AUTOPAUSE_TIMEOUT_INIT is not numeric, set to 600 (seconds)"
fi
if [[ "$AUTOPAUSE_KNOCK_INTERFACE" == "lo" ]] ; then if [[ "$AUTOPAUSE_KNOCK_INTERFACE" == "lo" ]] ; then
logWarning "AUTOPAUSE_KNOCK_INTERFACE is set to the local loopback interface." log "Warning: AUTOPAUSE_KNOCK_INTERFACE is set to the local loopback interface."
logWarning " This is not advisable, as incoming connections are likely not picked up there." log " This is not advisable, as incoming connections are likely not picked up there."
logWarning " Continuing with this setting." log " Continuing with this setting."
fi fi
if [[ -n "$MAX_TICK_TIME" && "$MAX_TICK_TIME" != "-1" ]] ; then if [[ -n "$MAX_TICK_TIME" && "$MAX_TICK_TIME" != "-1" ]] ; then
logWarning "MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)" log "Warning: MAX_TICK_TIME is non-default, for autopause to work properly, this check should be disabled (-1 for versions >= 1.8.1)"
elif [[ -z "$MAX_TICK_TIME" ]] ; then elif [[ -z "$MAX_TICK_TIME" ]] ; then
MAX_TICK_TIME=-1
if versionLessThan 1.8.1; then if versionLessThan 1.8.1; then
# 10 years # 10 years
MAX_TICK_TIME=315360000000 MAX_TICK_TIME=315360000000
else
MAX_TICK_TIME=-1
fi fi
export MAX_TICK_TIME export MAX_TICK_TIME
fi fi

View File

@@ -20,9 +20,25 @@ log "Autostop functionality enabled"
isDebugging && set -x isDebugging && set -x
isNumericElseSetToDefault "AUTOSTOP_PERIOD" 10 if ! [[ $AUTOSTOP_PERIOD =~ ^[0-9]+$ ]]; then
checkIfNotZeroElseSetToDefault "AUTOSTOP_PERIOD" 10 AUTOSTOP_PERIOD=10
isNumericElseSetToDefault "AUTOSTOP_TIMEOUT_EST" 3600 export AUTOSTOP_PERIOD
isNumericElseSetToDefault "AUTOSTOP_TIMEOUT_INIT" 1800 log "Warning: AUTOSTOP_PERIOD is not numeric, set to 10 (seconds)"
fi
if [ "$AUTOSTOP_PERIOD" -eq "0" ] ; then
AUTOSTOP_PERIOD=10
export AUTOSTOP_PERIOD
log "Warning: AUTOSTOP_PERIOD must not be 0, set to 10 (seconds)"
fi
if ! [[ $AUTOSTOP_TIMEOUT_EST =~ ^[0-9]+$ ]] ; then
AUTOSTOP_TIMEOUT_EST=3600
export AUTOSTOP_TIMEOUT_EST
log "Warning: AUTOSTOP_TIMEOUT_EST is not numeric, set to 3600 (seconds)"
fi
if ! [[ $AUTOSTOP_TIMEOUT_INIT =~ ^[0-9]+$ ]] ; then
AUTOSTOP_TIMEOUT_INIT=1800
export AUTOSTOP_TIMEOUT_INIT
log "Warning: AUTOSTOP_TIMEOUT_INIT is not numeric, set to 1800 (seconds)"
fi
/auto/autostop-daemon.sh & /auto/autostop-daemon.sh &

View File

@@ -36,10 +36,10 @@ log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
if [ ! -e /data/eula.txt ]; then if [ ! -e /data/eula.txt ]; then
if ! isTrue "$EULA"; then if ! isTrue "$EULA"; then
log "" log ""
logError "Please accept the Minecraft EULA at" log "Please accept the Minecraft EULA at"
logError " https://account.mojang.com/documents/minecraft_eula" log " https://account.mojang.com/documents/minecraft_eula"
logError "by adding the following immediately after 'docker run':" log "by adding the following immediately after 'docker run':"
logError " -e EULA=TRUE" log " -e EULA=TRUE"
log "" log ""
exit 1 exit 1
fi fi
@@ -63,10 +63,10 @@ if isTrue "${ENABLE_RCON:-true}"; then
if [[ -v RCON_PASSWORD_FILE ]]; then if [[ -v RCON_PASSWORD_FILE ]]; then
if [ ! -e "${RCON_PASSWORD_FILE}" ]; then if [ ! -e "${RCON_PASSWORD_FILE}" ]; then
log "" log ""
logError "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist." log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist."
logError "Please ensure your configuration." log "Please ensure your configuration."
logError "If you are using Docker Secrets feature, please check this for further information: " log "If you are using Docker Secrets feature, please check this for further information: "
logError " https://docs.docker.com/engine/swarm/secrets" log " https://docs.docker.com/engine/swarm/secrets"
log "" log ""
exit 1 exit 1
else else
@@ -91,12 +91,12 @@ fi
# Auto-pause/stop # Auto-pause/stop
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then
logError "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true" log "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true"
exit 1 exit 1
fi fi
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${ENABLE_AUTOSTOP}"; then
logError "ENABLE_AUTOPAUSE=true is incompatible with ENABLE_AUTOSTOP=true" log "ENABLE_AUTOPAUSE=true is incompatible with ENABLE_AUTOSTOP=true"
exit 1 exit 1
fi fi
@@ -112,9 +112,9 @@ function fixJavaPath() {
# Some Docker management UIs grab all the image declared variables and present them for configuration. # Some Docker management UIs grab all the image declared variables and present them for configuration.
# When upgrading images across Java versions, that creates a mismatch in PATH's expected by base image. # When upgrading images across Java versions, that creates a mismatch in PATH's expected by base image.
if ! which java > /dev/null; then if ! which java > /dev/null; then
logError " Your Docker provider has an annoying flaw where it" log "ERROR: your Docker provider has an annoying flaw where it"
logError " tries to set PATH even though the container establishes" log " tries to set PATH even though the container establishes"
logError " a very specific value." log " a very specific value."
sleep 2 sleep 2
# now find where java might be # now find where java might be
for d in /opt/java/openjdk/bin /usr/bin; do for d in /opt/java/openjdk/bin /usr/bin; do
@@ -129,7 +129,7 @@ function fixJavaPath() {
if ! fixJavaPath; then if ! fixJavaPath; then
logError "could not locate path that contains java" log "ERROR: could not locate path that contains java"
exit 1 exit 1
fi fi
@@ -158,20 +158,15 @@ then
"${SCRIPTS:-/}start-rconcmds" "${SCRIPTS:-/}start-rconcmds"
fi fi
: "${MODPACK_PLATFORM:=${MOD_PLATFORM:-}}" : "${MOD_PLATFORM:=}"
if [[ $MODPACK_PLATFORM && $TYPE && $TYPE != VANILLA ]]; then
logWarning "Avoid setting TYPE and MODPACK_PLATFORM"
fi
case "${TYPE^^}" in case "${TYPE^^}" in
AUTO_CURSEFORGE|MODRINTH|CURSEFORGE|FTB|FTBA) AUTO_CURSEFORGE|MODRINTH|CURSEFORGE|FTB|FTBA)
MODPACK_PLATFORM="$TYPE" MOD_PLATFORM="$TYPE"
;; ;;
esac esac
if [[ $MODPACK_PLATFORM ]]; then if [[ $MOD_PLATFORM ]]; then
case "${MODPACK_PLATFORM^^}" in case "${MOD_PLATFORM^^}" in
FTB|CURSEFORGE) FTB|CURSEFORGE)
exec "${SCRIPTS:-/}start-deployCF" "$@" exec "${SCRIPTS:-/}start-deployCF" "$@"
;; ;;
@@ -189,7 +184,7 @@ if [[ $MODPACK_PLATFORM ]]; then
;; ;;
*) *)
logError "Invalid MODPACK_PLATFORM: '$MODPACK_PLATFORM'" log "ERROR; Invalid MOD_PLATFORM: '$MOD_PLATFORM'"
exit 1 exit 1
;; ;;
esac esac
@@ -224,7 +219,7 @@ case "${TYPE^^}" in
QUILT) QUILT)
exec "${SCRIPTS:-/}start-deployQuilt" "$@" exec "${SCRIPTS:-/}start-deployQuilt" "$@"
;; ;;
VANILLA) VANILLA)
exec "${SCRIPTS:-/}start-deployVanilla" "$@" exec "${SCRIPTS:-/}start-deployVanilla" "$@"
;; ;;
@@ -278,11 +273,11 @@ case "${TYPE^^}" in
;; ;;
*) *)
logError "Invalid TYPE: '$TYPE'" log "ERROR: Invalid TYPE: '$TYPE'"
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT," log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH," log " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH,"
logError " CANYON, LIMBO, CRUCIBLE" log " CANYON, LIMBO, CRUCIBLE"
exit 1 exit 1
;; ;;
esac esac

View File

@@ -20,48 +20,69 @@ set -eu
: "${CF_OVERRIDES_EXCLUSIONS:=}" # --overrides-exclusions : "${CF_OVERRIDES_EXCLUSIONS:=}" # --overrides-exclusions
: "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}" : "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}"
: "${CF_MODPACK_MANIFEST:=}" : "${CF_MODPACK_MANIFEST:=}"
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
resultsFile=/data/.install-curseforge.env resultsFile=/data/.install-curseforge.env
isDebugging && set -x isDebugging && set -x
ensureRemoveAllModsOff "MODPACK_PLATFORM=AUTO_CURSEFORGE" ensureRemoveAllModsOff "MOD_PLATFORM=AUTO_CURSEFORGE"
args=( args=(
--results-file="$resultsFile" --results-file="$resultsFile"
)
if [[ $CF_PAGE_URL ]]; then
args+=(--modpack-page-url="$CF_PAGE_URL")
fi
if [[ $CF_FILE_ID ]]; then
args+=(--file-id="$CF_FILE_ID")
fi
if [[ $CF_SLUG ]]; then
args+=(--slug="$CF_SLUG")
fi
if [[ $CF_MODPACK_MANIFEST ]]; then
args+=(--modpack-manifest="$CF_MODPACK_MANIFEST")
fi
if [[ $CF_FILENAME_MATCHER ]]; then
args+=(--filename-matcher="$CF_FILENAME_MATCHER")
fi
if [[ ${CF_SET_LEVEL_FROM} ]]; then
args+=(--set-level-from="$CF_SET_LEVEL_FROM")
fi
if [[ ${CF_OVERRIDES_EXCLUSIONS} ]]; then
args+=(--overrides-exclusions="$CF_OVERRIDES_EXCLUSIONS")
fi
if [[ ${CF_IGNORE_MISSING_FILES} ]]; then
args+=(--ignore-missing-files="$CF_IGNORE_MISSING_FILES")
fi
args+=(
--force-synchronize="$CF_FORCE_SYNCHRONIZE" --force-synchronize="$CF_FORCE_SYNCHRONIZE"
--force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER" --force-reinstall-modloader="$CF_FORCE_REINSTALL_MODLOADER"
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING" --overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
) )
setArg() {
arg="${1?}"
var="${2?}"
if [[ ${!var} ]]; then if [[ $CF_EXCLUDE_MODS ]]; then
args+=("${arg}=${!var}") args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
fi fi
} if [[ $CF_FORCE_INCLUDE_MODS ]]; then
setArg --modpack-page-url CF_PAGE_URL args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
setArg --file-id CF_FILE_ID fi
setArg --slug CF_SLUG if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
setArg --modpack-manifest CF_MODPACK_MANIFEST args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
setArg --filename-matcher CF_FILENAME_MATCHER fi
setArg --set-level-from CF_SET_LEVEL_FROM if [[ $CF_DOWNLOADS_REPO ]]; then
setArg --overrides-exclusions CF_OVERRIDES_EXCLUSIONS args+=( --downloads-repo="$CF_DOWNLOADS_REPO" )
setArg --ignore-missing-files CF_IGNORE_MISSING_FILES fi
setArg --api-cache-default-ttl CF_API_CACHE_DEFAULT_TTL
setArg --exclude-mods CF_EXCLUDE_MODS
setArg --force-include-mods CF_FORCE_INCLUDE_MODS
setArg --exclude-include-file CF_EXCLUDE_INCLUDE_FILE
setArg --downloads-repo CF_DOWNLOADS_REPO
if ! mc-image-helper install-curseforge "${args[@]}"; then if ! mc-image-helper install-curseforge "${args[@]}"; then
logError "Failed to auto-install CurseForge modpack" log "ERROR failed to auto-install CurseForge modpack"
exit 1 exit 1
fi fi
applyResultsFile ${resultsFile} # grab SERVER, TYPE, VERSION and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
resolveFamily resolveFamily
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -6,56 +6,47 @@ isDebugging && set -x
set -eo pipefail set -eo pipefail
spigotBuildLog="/data/spigot_build.log"
function handleFailedSpigotBuild {
logError "Failed to build Spigot"
cat ${spigotBuildLog}
exit 1
}
function buildSpigotFromSource { function buildSpigotFromSource {
local tempDir="/data/temp"
if [[ ${TYPE^^} = *BUKKIT ]] && ! versionLessThan "1.14"; then if [[ ${TYPE^^} = *BUKKIT ]] && ! versionLessThan "1.14"; then
logError "Craftbukkit build is only supported for versions less than 1.14" log "ERR craftbukkit build is only supported for versions less than 1.14"
exit 1 exit 1
fi fi
log "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee" log "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
rm -rf ${tempDir} rm -rf /data/temp
mkdir ${tempDir} mkdir /data/temp
cd ${tempDir} cd /data/temp
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}" jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
logn '' logn ''
curl -sSL -o ${tempDir}/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \ curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
java $jvmOpts -jar ${tempDir}/BuildTools.jar --rev "$VERSION" 2>&1 |tee ${spigotBuildLog}| while read l; do echo -n .; done; log "done" java $jvmOpts -jar /data/temp/BuildTools.jar --rev "$VERSION" 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; log "done"
case ${TYPE^^} in case ${TYPE^^} in
SPIGOT) SPIGOT)
if ! mv spigot-*.jar "/data/${SERVER}"; then if ! mv spigot-*.jar "/data/${SERVER}"; then
handleFailedSpigotBuild log "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi fi
;; ;;
*BUKKIT) *BUKKIT)
if ! mv craftbukkit-*.jar "/data/${SERVER}"; then if ! mv craftbukkit-*.jar "/data/${SERVER}"; then
handleFailedSpigotBuild log "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi fi
;; ;;
esac esac
log "Cleaning up" log "Cleaning up"
rm -rf ${tempDir} rm -rf /data/temp
cd /data cd /data
} }
function downloadSpigot { function downloadSpigot {
local match local match
local getBukkitBaseUrl="https://getbukkit.org/download/"
local getBukkitSpigotUrl="${getBukkitBaseUrl}spigot"
case "$TYPE" in case "$TYPE" in
*BUKKIT|*bukkit) *BUKKIT|*bukkit)
match="CraftBukkit" match="CraftBukkit"
@@ -70,21 +61,18 @@ function downloadSpigot {
esac esac
if [[ ${VERSION^^} = LATEST ]]; then if [[ ${VERSION^^} = LATEST ]]; then
if ! VERSION=$(restify ${getBukkitSpigotUrl} --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]'); then if ! VERSION=$(restify https://getbukkit.org/download/spigot --attribute='property=og:title' | jq -r '.[0] | .attributes | select(.property == "og:title") | .content | split(" ") | .[-1]'); then
logError "Failed to retrieve latest version from ${getBukkitSpigotUrl} -- site might be down" log "ERROR: failed to retrieve latest version from https://getbukkit.org/download/spigot -- site might be down"
exit 1 exit 1
fi fi
fi fi
if [[ -z $downloadUrl ]]; then if [[ -z $downloadUrl ]]; then
downloadBaseUrl="https://"
downloadSuffixUrl=".getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
if versionLessThan 1.16.5 || { [[ ${getbukkitFlavor} = "craftbukkit" ]] && [[ ${VERSION} = "1.16.5" ]] ; }; then if versionLessThan 1.16.5 || { [[ ${getbukkitFlavor} = "craftbukkit" ]] && [[ ${VERSION} = "1.16.5" ]] ; }; then
downloadBaseUrl+="cdn" downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
else else
downloadBaseUrl+="download" downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar"
fi fi
downloadUrl="${downloadBaseUrl}${downloadSuffixUrl}"
fi fi
setServerVar setServerVar
@@ -106,7 +94,7 @@ function downloadSpigot {
cat <<EOF cat <<EOF
ERROR: failed to download from $downloadUrl ERROR: failed to download from $downloadUrl
Visit ${getBukkitBaseUrl}${getbukkitFlavor} to lookup the Visit https://getbukkit.org/download/${getbukkitFlavor} to lookup the
exact version or see if download site is unavailable. exact version or see if download site is unavailable.
Click into the version entry to find the **exact** version. Click into the version entry to find the **exact** version.

View File

@@ -25,7 +25,7 @@ loadForgeVars() {
isDebugging && set -x isDebugging && set -x
if [[ ${VERSION^^} == LATEST ]]; then if [[ ${VERSION^^} == LATEST ]]; then
logWarning "For the old TYPE=CURSEFORGE mechanism it is best to set VERSION to a specific value" log "WARNING for the old TYPE=CURSEFORGE mechanism it is best to set VERSION to a specific value"
fi fi
resolveVersion resolveVersion
@@ -39,7 +39,7 @@ FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
log "Looking for Feed-The-Beast / CurseForge server modpack." log "Looking for Feed-The-Beast / CurseForge server modpack."
if [[ ! $FTB_SERVER_MOD ]]; then if [[ ! $FTB_SERVER_MOD ]]; then
logError "CF_SERVER_MOD or FTB_SERVER_MOD is required to be set" log "ERROR: CF_SERVER_MOD or FTB_SERVER_MOD is required to be set"
exit 1 exit 1
fi fi
@@ -48,7 +48,7 @@ downloadModpack() {
if isURL "${srv_modpack}"; then if isURL "${srv_modpack}"; then
log "Downloading modpack from ${srv_modpack}..." log "Downloading modpack from ${srv_modpack}..."
if ! srv_modpack=$(get -o /data --output-filename --skip-existing "${srv_modpack}"); then if ! srv_modpack=$(get -o /data --output-filename --skip-existing "${srv_modpack}"); then
logError "Failed to download modpack" log "ERROR: failed to download modpack"
exit 1 exit 1
fi fi
fi fi
@@ -61,12 +61,12 @@ downloadModpack() {
srv_modpack=/data/${srv_modpack} srv_modpack=/data/${srv_modpack}
fi fi
if [[ ! -f "${srv_modpack}" ]]; then if [[ ! -f "${srv_modpack}" ]]; then
logError "FTB server modpack: ${srv_modpack} not found." log "FTB server modpack ${srv_modpack} not found."
exit 2 exit 2
fi fi
if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then
logError "FTB server modpack: ${srv_modpack} is not a zip archive." log "FTB server modpack ${srv_modpack} is not a zip archive."
logError "Please set FTB_SERVER_MOD to a file with a .zip extension." log "Please set FTB_SERVER_MOD to a file with a .zip extension."
exit 2 exit 2
fi fi
FTB_SERVER_MOD=${srv_modpack} FTB_SERVER_MOD=${srv_modpack}
@@ -104,7 +104,7 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
if [[ $forgeInstallerUrl ]]; then if [[ $forgeInstallerUrl ]]; then
forgeInstallerJar="${FTB_BASE_DIR}/forge-installer.jar" forgeInstallerJar="${FTB_BASE_DIR}/forge-installer.jar"
if ! curl -fsSL -o "$forgeInstallerJar" "$forgeInstallerUrl" ; then if ! curl -fsSL -o "$forgeInstallerJar" "$forgeInstallerUrl" ; then
logError "Failed to download Forge installer from $forgeInstallerUrl" log "ERROR failed to download Forge installer from $forgeInstallerUrl"
exit 2 exit 2
fi fi
fi fi
@@ -113,9 +113,9 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
fi fi
if [[ -z "${forgeInstallerJar}" ]]; then if [[ -z "${forgeInstallerJar}" ]]; then
logError "Unable to find forge installer in modpack" log "ERROR Unable to find forge installer in modpack"
logError " or download using modpack config." log " or download using modpack config."
logError " Make sure you downloaded the server files." log " Make sure you downloaded the server files."
exit 2 exit 2
fi fi
@@ -129,7 +129,7 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
SERVER=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print) SERVER=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
logError "Unable to locate installed forge server jar" log "ERROR unable to locate installed forge server jar"
isDebugging && find "${FTB_BASE_DIR}" -name "forge*.jar" isDebugging && find "${FTB_BASE_DIR}" -name "forge*.jar"
exit 2 exit 2
fi fi
@@ -213,7 +213,7 @@ EOF
startScript="${FTB_BASE_DIR}/ServerStart.sh" startScript="${FTB_BASE_DIR}/ServerStart.sh"
chmod +x "$startScript" chmod +x "$startScript"
else else
logError "Modpack missing start script and unable to find Forge jar to generate one" log "ERROR: Modpack missing start script and unable to find Forge jar to generate one"
exit 2 exit 2
fi fi
fi fi
@@ -244,7 +244,7 @@ legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
if isTrue "${FTB_LEGACYJAVAFIXER}" && [ ! -e "${legacyJavaFixerPath}" ]; then if isTrue "${FTB_LEGACYJAVAFIXER}" && [ ! -e "${legacyJavaFixerPath}" ]; then
log "Installing legacy java fixer to ${legacyJavaFixerPath}" log "Installing legacy java fixer to ${legacyJavaFixerPath}"
if ! get -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}; then if ! get -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}; then
logError "Failed to download legacy java fixer from ${legacyJavaFixerUrl}" log "ERROR failed to download legacy java fixer from ${legacyJavaFixerUrl}"
exit 1 exit 1
fi fi
fi fi

View File

@@ -9,19 +9,20 @@ isDebugging && set -x
: "${CANYON_BUILD:=lastSuccessfulBuild}" : "${CANYON_BUILD:=lastSuccessfulBuild}"
if [ "${VERSION}" != "b1.7.3" ]; then if [ "${VERSION}" != "b1.7.3" ]; then
logError "Canyon server type only supports VERSION=b1.7.3" log "ERROR: Canyon server type only supports VERSION=b1.7.3"
exit 1 exit 1
fi fi
canyonJob="https://canyonmodded.p0rtal.gay/job/Canyonmodded" canyonJob="https://jenkins.glass-launcher.net/job/Canyon"
githubUrl="https://github.com/KoboDev/SupplyAndDemand/releases/download" githubUrl="https://github.com/KoboDev/SupplyAndDemand/releases/download"
canyonBuildJSON=$(curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json")
buildRelPath=$( buildRelPath=$(
jq -r '.artifacts[0].relativePath' <<< "$canyonBuildJSON" curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
) jq -r '.artifacts[0].relativePath'
)
buildNumber=$( buildNumber=$(
jq -r '.number'<<< "$canyonBuildJSON" curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
jq -r '.number'
) )
baseName=$(basename "${buildRelPath}") baseName=$(basename "${buildRelPath}")
@@ -50,7 +51,7 @@ if [ ! -f "$SERVER" ]; then
fi fi
curl -fsSL -o "$SERVER" "$downloadUrl" curl -fsSL -o "$SERVER" "$downloadUrl"
if [ ! -f "$SERVER" ]; then if [ ! -f "$SERVER" ]; then
logError "Failed to download from $downloadUrl" log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3 exit 3
fi fi
fi fi

View File

@@ -11,7 +11,7 @@ latestAsset=$(
) )
if [[ -z "${latestAsset}" ]]; then if [[ -z "${latestAsset}" ]]; then
logError "Latest release of Catserver is missing universal.jar asset" log "ERROR: latest release of Catserver is missing universal.jar asset"
exit 1 exit 1
fi fi

View File

@@ -18,18 +18,18 @@ fi
if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VERSION}-.*\.jar/)].browser_download_url" \ if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VERSION}-.*\.jar/)].browser_download_url" \
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then --accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
logError "Failed to access ${CRUCIBLE_RELEASE} release of Crucible" log "ERROR: failed to access ${CRUCIBLE_RELEASE} release of Crucible"
exit 1 exit 1
fi fi
if [[ $downloadUrl = null ]]; then if [[ $downloadUrl = null ]]; then
logError "Failed to locate Crucible jar for $VERSION from ${CRUCIBLE_RELEASE}" log "ERROR: failed to locate Crucible jar for $VERSION from ${CRUCIBLE_RELEASE}"
exit 1 exit 1
fi fi
log "Downloading Crucible from $downloadUrl" log "Downloading Crucible from $downloadUrl"
if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then
logError "Crucible jar from $downloadUrl" log "ERROR: failed to download Crucible jar from $downloadUrl"
exit 1 exit 1
fi fi
@@ -37,18 +37,18 @@ librariesDir=/data/libraries
if [ ! -d "$librariesDir" ]; then if [ ! -d "$librariesDir" ]; then
if ! librariesUrl=$(get --json-path "$.assets[?(@.name == 'libraries.zip')].browser_download_url" \ if ! librariesUrl=$(get --json-path "$.assets[?(@.name == 'libraries.zip')].browser_download_url" \
--accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then --accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then
logError "Failed to access ${CRUCIBLE_RELEASE} release of Crucible for libraries" log "ERROR: failed to access ${CRUCIBLE_RELEASE} release of Crucible for libraries"
exit 1 exit 1
fi fi
log "Downloading Crucible libraries" log "Downloading Crucible libraries"
if ! get -o /tmp/libraries.zip "$librariesUrl"; then if ! get -o /tmp/libraries.zip "$librariesUrl"; then
logError "Failed to download Crucible libraries from $librariesUrl" log "ERROR: failed to download Crucible libraries from $librariesUrl"
exit 1 exit 1
fi fi
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
logError "Failed to unzip Crucible libraries" log "ERROR: failed to unzip Crucible libraries"
exit 1 exit 1
fi fi
rm /tmp/libraries.zip rm /tmp/libraries.zip

View File

@@ -41,4 +41,4 @@ fi
# Allow for overriding Family on custom for testing. # Allow for overriding Family on custom for testing.
export FAMILY="${FAMILY:-HYBRID}" export FAMILY="${FAMILY:-HYBRID}"
exec "${SCRIPTS:-/}start-spiget" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -1,8 +1,6 @@
#!/bin/bash #!/bin/bash
: "${FTB_FORCE_REINSTALL:=false}" : "${FTB_FORCE_REINSTALL:=false}"
: "${FTB_BASE_URL:=https://api.feed-the-beast.com/v1/modpacks}"
# Legacy base URL was https://api.modpacks.ch
ftbInstallMarker=".ftb-installed" ftbInstallMarker=".ftb-installed"
@@ -11,105 +9,72 @@ ftbInstallMarker=".ftb-installed"
isDebugging && set -x isDebugging && set -x
set -e set -e
#
#{
# "id": 119,
# "name": "FTB Presents Direwolf20 1.20",
# "versionName": "1.16.0",
# "versionId": 12252,
# "modPackTargets": {
# "modLoader": {
# "name": "neoforge",
# "version": "47.1.84"
# },
# "javaVersion": "17.0.7+7",
# "mcVersion": "1.20.1"
# },
ftbManifest=.manifest.json
function getModLoaderName() {
jq -r ".modPackTargets.modLoader.name" ${ftbManifest}
}
function getModLoaderVersion() {
jq -r ".modPackTargets.modLoader.version" ${ftbManifest}
}
function getMinecraftVersion() {
jq -r ".modPackTargets.mcVersion" ${ftbManifest}
}
if [[ $(getDistro) = alpine ]]; then if [[ $(getDistro) = alpine ]]; then
logError "The FTBA installer is not supported on Alpine. Use the java8-multiarch image tag instead." log "ERROR: the FTBA installer is not supported on Alpine. Use the java8-multiarch image tag instead."
exit 1 exit 1
fi fi
if ! [[ -v FTB_MODPACK_ID ]]; then if ! [[ -v FTB_MODPACK_ID ]]; then
logError "FTB_MODPACK_ID is required with TYPE=FTB" log "ERROR FTB_MODPACK_ID is required with TYPE=FTB"
exit 1 exit 1
fi fi
if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
logError "FTB_MODPACK_ID needs to be numeric" log "ERROR FTB_MODPACK_ID needs to be numeric"
exit 1 exit 1
fi fi
if [[ ! $FTB_MODPACK_VERSION_ID ]]; then if [[ ! $FTB_MODPACK_VERSION_ID ]]; then
if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL "${FTB_BASE_URL}/public/modpack/${FTB_MODPACK_ID}" | jq -r '.versions | sort_by(.updated)[-1].id'); then if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then
logError "Unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}" log "ERROR unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}"
exit 1 exit 1
fi fi
elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then
logError "FTB_MODPACK_VERSION_ID needs to be numeric" log "ERROR FTB_MODPACK_VERSION_ID needs to be numeric"
exit 1 exit 1
fi fi
if isTrue "$FTB_FORCE_REINSTALL" || if isTrue "$FTB_FORCE_REINSTALL" || ! [ -f "${ftbInstallMarker}" ] || [ "$(cat "${ftbInstallMarker}")" != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
! [ -f "${ftbManifest}" ] || ftbInstaller=/data/ftb-installer
! [ -f "${ftbInstallMarker}" ] ||
[ "$(cat "${ftbInstallMarker}")" != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then
ftbInstaller=/data/ftb-installer-v2
arm=
if ! [[ -f "${ftbInstaller}" ]]; then if ! [[ -f "${ftbInstaller}" ]]; then
log "Downloading FTB installer"
if [ "$(uname -m)" == "aarch64" ]; then if [ "$(uname -m)" == "aarch64" ]; then
log "Downloading FTB installer for ARM" log "Downloading ARM installer"
arm="/arm" curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/arm/linux -o "${ftbInstaller}"
else else
log "Downloading FTB installer for x86" log "Downloading x86 installer"
fi curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server/linux -o "${ftbInstaller}"
# Example: https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/linux
# https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/arm/linux
# 1-1 is a placeholder modpack for just grabbing the installer
if ! get -o "${ftbInstaller}" "${FTB_BASE_URL}/public/modpack/1/1/server${arm}/linux"; then
logError "Failed to download FTB installer"
exit 1
fi fi
chmod +x "${ftbInstaller}" chmod +x "${ftbInstaller}"
fi fi
log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}" log "Installing modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID}"
log "This could take a while..." log "This could take a while..."
${ftbInstaller} -pack "${FTB_MODPACK_ID}" -version "${FTB_MODPACK_VERSION_ID}" -auto -force | tee ftb-installer.log ${ftbInstaller} "${FTB_MODPACK_ID}" "${FTB_MODPACK_VERSION_ID}" --noscript --auto > ftb-installer.log
rm -f forge*installer.jar rm -f forge*installer.jar
echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker} echo "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" > ${ftbInstallMarker}
writeEula writeEula
# some modpacks result in --w----r-- permissions
chmod a+r version.json
else else
log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go" log "FTB modpack ID ${FTB_MODPACK_ID}, version ID ${FTB_MODPACK_VERSION_ID} is ready to go"
fi fi
modLoader="$(getModLoaderName)" forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
modLoaderVersion="$(getModLoaderVersion)" fabricVersion=$(jq -r '.targets|unique[] | select(.name == "fabric") | .version' version.json)
mcVersion=$(getMinecraftVersion) mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
VERSION="$mcVersion" VERSION="$mcVersion"
export VERSION export VERSION
variants=( variants=(
"forge-${mcVersion}-${forgeVersion}.jar"
"forge-${mcVersion}-${forgeVersion}-universal.jar"
"forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar"
"fabric-${mcVersion}-${fabricVersion}-server-launch.jar"
run.sh run.sh
"${modLoader}-${mcVersion}-${modLoaderVersion}-universal.jar"
"${modLoader}-${mcVersion}-${modLoaderVersion}-${mcVersion}-universal.jar"
"${modLoader}-${mcVersion}-${modLoaderVersion}-server-launch.jar"
"${modLoader}-${mcVersion}-${modLoaderVersion}.jar"
) )
for f in "${variants[@]}"; do for f in "${variants[@]}"; do
if [ -f $f ]; then if [ -f $f ]; then
@@ -118,37 +83,11 @@ for f in "${variants[@]}"; do
fi fi
done done
if ! [ -v SERVER ]; then if ! [ -v SERVER ]; then
logError "Unable to locate the installed FTB server jar" log "ERROR unable to locate the installed FTB server jar"
logError " Tried looking for ${variants[*]}" log " Tried looking for ${variants[*]}"
exit 2 exit 2
fi fi
# Remap the TYPE and FAMILY based on discovered server jar export FAMILY=FORGE
if [[ $SERVER = run.sh ]]; then
if grep -q neoforge "$SERVER"; then
export FAMILY=FORGE
export TYPE=NEOFORGE
elif grep -q forge "$SERVER"; then
export FAMILY=FORGE
export TYPE=FORGE
elif grep -q fabric run.s; then
export FAMILY=FABRIC
export TYPE=FABRIC
else
logError "Unrecognized loader type in $SERVER"
cat "$SERVER"
exit 1
fi
elif [[ $SERVER = forge* ]]; then
export FAMILY=FORGE
export TYPE=FORGE
elif [[ $SERVER = fabric* ]]; then
export FAMILY=FABRIC
export TYPE=FABRIC
else
logError "Unrecognized loader type from $SERVER"
exit 1
fi
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -16,35 +16,40 @@ isDebugging && set -x
# Custom fabric jar # Custom fabric jar
if [[ $FABRIC_LAUNCHER ]]; then if [[ $FABRIC_LAUNCHER ]]; then
if ! mc-image-helper install-fabric-loader \ if ! mc-image-helper install-fabric-loader \
--results-file=${resultsFile} \ --results-file=${resultsFile} \
--from-local-file="$FABRIC_LAUNCHER"; then --from-local-file="$FABRIC_LAUNCHER"; then
logError "Failed to use provided Fabric launcher" log "ERROR failed to use provided Fabric launcher"
exit 1 exit 1
fi fi
# Custom fabric jar url # Custom fabric jar url
elif [[ $FABRIC_LAUNCHER_URL ]]; then elif [[ $FABRIC_LAUNCHER_URL ]]; then
if ! mc-image-helper install-fabric-loader \ if ! mc-image-helper install-fabric-loader \
--results-file=${resultsFile} \ --results-file=${resultsFile} \
--from-url="$FABRIC_LAUNCHER_URL"; then --from-url="$FABRIC_LAUNCHER_URL"; then
logError "Failed to installFabric launcher from $FABRIC_LAUNCHER_URL" log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER_URL"
exit 1 exit 1
fi fi
# Official fabric launcher # Official fabric launcher
else else
if ! mc-image-helper install-fabric-loader \ if ! mc-image-helper install-fabric-loader \
--results-file=${resultsFile} \ --results-file=${resultsFile} \
--minecraft-version="${VERSION}" \ --minecraft-version="${VERSION}" \
--installer-version="${FABRIC_LAUNCHER_VERSION}" \ --installer-version="${FABRIC_LAUNCHER_VERSION}" \
--loader-version="${FABRIC_LOADER_VERSION}"; then --loader-version="${FABRIC_LOADER_VERSION}"; then
logError "Failed to installFabric launcher given $VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION" log "ERROR failed to install Fabric launcher given $VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
exit 1 exit 1
fi fi
fi fi
applyResultsFile ${resultsFile} # grab SERVER, etc and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
export FAMILY=FABRIC export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -1,12 +1,5 @@
#!/bin/bash #!/bin/bash
: "${FOLIA_CHANNEL:=experimental}"
# shellcheck source=start-utils
. "${SCRIPTS:-/}start-utils"
set -o pipefail
handleDebugMode
if [[ $FOLIA_DOWNLOAD_URL ]]; then if [[ $FOLIA_DOWNLOAD_URL ]]; then
export PAPER_DOWNLOAD_URL="$FOLIA_DOWNLOAD_URL" export PAPER_DOWNLOAD_URL="$FOLIA_DOWNLOAD_URL"
fi fi
@@ -15,7 +8,4 @@ if [[ $FOLIABUILD ]]; then
export PAPERBUILD="$FOLIABUILD" export PAPERBUILD="$FOLIABUILD"
fi fi
PAPER_PROJECT="folia" \ PAPER_PROJECT="folia" PAPER_NAME="FoliaMC" exec "${SCRIPTS:-/}start-deployPaper" "$@"
PAPER_NAME="FoliaMC" \
PAPER_CHANNEL="${FOLIA_CHANNEL}" \
exec "${SCRIPTS:-/}start-deployPaper" "$@"

View File

@@ -6,29 +6,36 @@
# shellcheck source=start-utils # shellcheck source=start-utils
. "${SCRIPTS:-$(dirname "$0")}/start-utils" . "${SCRIPTS:-$(dirname "$0")}/start-utils"
isDebugging && set -x isDebugging && set -x
resultsFile=/data/.run-forge.env
function mc-image-helper-forge() {
mc-image-helper install-forge \
--output-directory=/data \
--results-file="${resultsFile}" \
--minecraft-version="${VERSION}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}" "$@"
}
if [[ ${FORGE_INSTALLER} ]]; then if [[ ${FORGE_INSTALLER} ]]; then
if ! mc-image-helper-forge --forge-installer="${FORGE_INSTALLER}" ; then if ! mc-image-helper install-forge \
logError "Failed to installForge given installer ${FORGE_INSTALLER}" --output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VERSION}" \
--forge-installer="${FORGE_INSTALLER}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install Forge given installer ${FORGE_INSTALLER}"
exit 1 exit 1
fi fi
else else
if ! mc-image-helper-forge --forge-version="${FORGE_VERSION}"; then if ! mc-image-helper install-forge \
logError "Failed to install Forge" --output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VERSION}" \
--forge-version="${FORGE_VERSION}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install Forge"
exit 1 exit 1
fi fi
fi fi
applyResultsFile ${resultsFile}
# grab SERVER and export it
set -a
source /data/.run-forge.env
set +a
export FAMILY=FORGE export FAMILY=FORGE

View File

@@ -9,7 +9,7 @@ if ! SERVER=$(mc-image-helper github download-latest-asset \
--name-pattern="kettinglauncher-.+?(?<!-sources)\.jar" \ --name-pattern="kettinglauncher-.+?(?<!-sources)\.jar" \
kettingpowered/kettinglauncher kettingpowered/kettinglauncher
); then ); then
logError "Failed to download Ketting launcher" log "ERROR: failed to download Ketting launcher"
exit 1 exit 1
fi fi
@@ -17,12 +17,12 @@ export SERVER
resolveVersion resolveVersion
EXTRA_ARGS+=" -minecraftVersion $VERSION" EXTRA_ARGS+="-minecraftVersion $VERSION"
if [[ ${KETTING_VERSION:-} ]]; then if [[ ${KETTING_VERSION:-} ]]; then
EXTRA_ARGS+=" -kettingVersion $KETTING_VERSION" EXTRA_ARGS+="-kettingVersion $KETTING_VERSION"
fi fi
if [[ ${FORGE_VERSION:-} ]]; then if [[ ${FORGE_VERSION:-} ]]; then
EXTRA_ARGS+=" -forgeVersion $FORGE_VERSION" EXTRA_ARGS+="-forgeVersion $FORGE_VERSION"
fi fi
export EXTRA_ARGS export EXTRA_ARGS

View File

@@ -22,7 +22,7 @@ baseUrl="https://ci.loohpjames.com/job/Limbo/${LIMBO_BUILD}"
buildInfoUrl="${baseUrl}/api/json" buildInfoUrl="${baseUrl}/api/json"
buildJson=$(curl -fsSL "${buildInfoUrl}") buildJson=$(curl -fsSL "${buildInfoUrl}")
if [ $? != 0 ]; then if [ $? != 0 ]; then
logError "Failed to get build info from ${buildInfoUrl} (status=$?)" log "ERROR failed to get build info from ${buildInfoUrl} (status=$?)"
exit 1 exit 1
fi fi
@@ -30,14 +30,8 @@ if [[ ${LIMBO_BUILD} = lastStableBuild ]]; then
LIMBO_BUILD=$(jq -r '.number' <<<${buildJson}) LIMBO_BUILD=$(jq -r '.number' <<<${buildJson})
log "Resolved latest Limbo build to ${LIMBO_BUILD}" log "Resolved latest Limbo build to ${LIMBO_BUILD}"
fi fi
artifactPath=$(jq -r '.artifacts[] | select(.fileName|test("^Limbo-")) | .relativePath' <<<${buildJson})
getRelativePath() { defaultSchemaPath=$(jq -r '.artifacts[] | select(.fileName|test(".*\\.schem")) | .relativePath' <<<${buildJson})
local pattern=$1
jq -r --arg pattern "$pattern" '.artifacts[] | select(.fileName|test($pattern)) | .relativePath' <<<${buildJson}
}
artifactPath=$(getRelativePath "^Limbo-")
defaultSchemaPath=$(getRelativePath ".*\\.schem")
export SERVER="limbo-${LIMBO_BUILD}.jar" export SERVER="limbo-${LIMBO_BUILD}.jar"
@@ -45,7 +39,7 @@ if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
downloadUrl="${baseUrl}/artifact/${artifactPath}" downloadUrl="${baseUrl}/artifact/${artifactPath}"
log "Downloading Limbo from $downloadUrl ..." log "Downloading Limbo from $downloadUrl ..."
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
logError "Failed to download from $downloadUrl (status=$?)" log "ERROR: failed to download from $downloadUrl (status=$?)"
exit 3 exit 3
fi fi
@@ -54,7 +48,7 @@ fi
if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then if [ ! -f "${LIMBO_SCHEMA_FILENAME}" ]; then
log "Downloading default schem file" log "Downloading default schem file"
if ! curl -o "${LIMBO_SCHEMA_FILENAME}" -fsSL "${baseUrl}/artifact/${defaultSchemaPath}"; then if ! curl -o "${LIMBO_SCHEMA_FILENAME}" -fsSL "${baseUrl}/artifact/${defaultSchemaPath}"; then
logError "Failed to download schema file $baseUrl (status=$?)" log "ERROR: failed to download schema file $baseUrl (status=$?)"
exit 3 exit 3
fi fi
fi fi

View File

@@ -9,17 +9,17 @@ isDebugging && set -x
resolveVersion resolveVersion
if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest/${MAGMA_VERSION}"); then if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest/${MAGMA_VERSION}"); then
logError "Failed to locate latest Magma download for ${VERSION}. Is that version supported?" log "ERROR failed to locate latest Magma download for ${VERSION}. Is that version supported?"
exit 1 exit 1
fi fi
if [[ $downloadUrl == null ]]; then if [[ $downloadUrl == null ]]; then
logError "Magma does not seem to be available for $VERSION" log "ERROR Magma does not seem to be available for $VERSION"
exit 1 exit 1
fi fi
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
logError "Failed to download Magma server jar from $downloadUrl" log "ERROR: failed to download Magma server jar from $downloadUrl"
exit 1 exit 1
fi fi

View File

@@ -10,7 +10,7 @@ isDebugging && set -x
resolveVersion resolveVersion
if [ -z $MAGMA_MAINTAINED_TAG ]; then if [ -z $MAGMA_MAINTAINED_TAG ]; then
logError "The variable MAGMA_MAINTAINED_TAG is not specified" log "ERROR the variable MAGMA_MAINTAINED_TAG is not specified"
exit 1 exit 1
fi fi
@@ -20,7 +20,7 @@ if [[ ${VERSION} = "1.12.2" ]]; then
fileName="Magma-${VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar" fileName="Magma-${VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
else else
if [ -z $FORGE_VERSION ]; then if [ -z $FORGE_VERSION ]; then
logError "The variable FORGE_VERSION is not specified" log "ERROR the variable FORGE_VERSION is not specified"
exit 1 exit 1
fi fi
fileName="magma-${VERSION}-${FORGE_VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar" fileName="magma-${VERSION}-${FORGE_VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
@@ -28,7 +28,7 @@ fi
downloadUrl="https://github.com/magmamaintained/Magma-${VERSION}/releases/download/${MAGMA_MAINTAINED_TAG}/${fileName}" downloadUrl="https://github.com/magmamaintained/Magma-${VERSION}/releases/download/${MAGMA_MAINTAINED_TAG}/${fileName}"
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
logError "Failed to download Magma Maintained server jar from $downloadUrl" log "ERROR: failed to download Magma Maintained server jar from $downloadUrl"
exit 1 exit 1
fi fi

View File

@@ -16,13 +16,13 @@ resultsFile=/data/.install-modrinth.env
: "${MODRINTH_DEFAULT_EXCLUDE_INCLUDES=/image/modrinth-exclude-include.json}" : "${MODRINTH_DEFAULT_EXCLUDE_INCLUDES=/image/modrinth-exclude-include.json}"
if [[ ! $MODRINTH_MODPACK ]]; then if [[ ! $MODRINTH_MODPACK ]]; then
logError "MODRINTH_MODPACK must be set when using TYPE/MODPACK_PLATFORM/MOD_PLATFORM of MODRINTH" log "ERROR: MODRINTH_MODPACK must be set when using TYPE/MOD_PLATFORM of MODRINTH"
exit 1 exit 1
fi fi
isDebugging && set -x isDebugging && set -x
ensureRemoveAllModsOff "MODPACK_PLATFORM=MODRINTH" ensureRemoveAllModsOff "MOD_PLATFORM=MODRINTH"
args=( args=(
--results-file="$resultsFile" --results-file="$resultsFile"
@@ -64,11 +64,15 @@ setArg --overrides-exclusions MODRINTH_OVERRIDES_EXCLUSIONS
setArg --default-exclude-includes MODRINTH_DEFAULT_EXCLUDE_INCLUDES setArg --default-exclude-includes MODRINTH_DEFAULT_EXCLUDE_INCLUDES
if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
logError "Failed to installModrinth modpack" log "ERROR failed to install Modrinth modpack"
exit 1 exit 1
fi fi
applyResultsFile ${resultsFile} # grab SERVER, TYPE, VERSION and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
resolveFamily resolveFamily
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -9,46 +9,35 @@ isDebugging && set -x
resolveVersion resolveVersion
: "${MOHIST_BUILD:=lastSuccessfulBuild}" : "${MOHIST_BUILD:=lastSuccessfulBuild}"
mohistBaseUrl="https://mohistmc.com/api/v2/projects/mohist/" mohistJobs=https://ci.codemc.io/job/MohistMC/job/
mohistApiUrl="${mohistBaseUrl}${VERSION}/builds/" mohistJob=${mohistJobs}Mohist-${VERSION}/
function logMohistAvailableVerisons(){ if ! get --exists "${mohistJob}"; then
logError " check ${mohistBaseUrl} for available versions" log "ERROR: mohist builds do not exist for ${VERSION}"
logError " and set VERSION accordingly" log " check https://ci.codemc.io/job/MohistMC/ for available versions"
} log " and set VERSION accordingly"
if ! get --exists "${mohistApiUrl}"; then
logError "Mohist builds do not exist for ${VERSION}"
logMohistAvailableVerisons
exit 1 exit 1
fi fi
if [[ "${MOHIST_BUILD}" == "lastSuccessfulBuild" ]]; then buildRelPath=$(
# Get the latest build number from the API get --json-path '$.artifacts[0].relativePath' "${mohistJob}${MOHIST_BUILD}/api/json"
buildNumber=$(
get --json-path '$.builds[-1].number' "${mohistApiUrl}"
)
MOHIST_BUILD="${buildNumber}"
fi
downloadUrl=$(
get --json-path "$.builds[?(@.number==${MOHIST_BUILD})].url" "${mohistApiUrl}"
) )
if [[ -z "${downloadUrl}" ]]; then baseName=$(basename "${buildRelPath}")
logError "Could not find build ${MOHIST_BUILD} for version ${VERSION}" if [[ ${baseName} != *-server.jar* ]]; then
logMohistAvailableVerisons log "ERROR: mohist build for ${VERSION} is not a valid server jar, found ${baseName}"
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
log " and set VERSION accordingly"
exit 1 exit 1
fi fi
SERVER="/data/mohist-${VERSION}-${MOHIST_BUILD}-server.jar" export SERVER="/data/${baseName}"
if [ ! -f "${SERVER}" ]; then if [ ! -f "${SERVER}" ]; then
log "Downloading Mohist build ${MOHIST_BUILD} for ${VERSION}" log "Downloading ${baseName}"
get -o "${SERVER}" "${downloadUrl}" get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
fi fi
export FAMILY=HYBRID export FAMILY=HYBRID
export SERVER
exec "${SCRIPTS:-/}start-spiget" "$@" exec "${SCRIPTS:-/}start-spiget" "$@"

View File

@@ -15,11 +15,15 @@ if ! mc-image-helper install-neoforge \
--minecraft-version="${VERSION}" \ --minecraft-version="${VERSION}" \
--neoforge-version="${NEOFORGE_VERSION}" \ --neoforge-version="${NEOFORGE_VERSION}" \
--force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then --force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then
logError "Failed to install NeoForge" log "ERROR failed to install Forge"
exit 1 exit 1
fi fi
applyResultsFile ${resultsFile} # grab SERVER and export it
set -a
# shellcheck disable=SC1090
source ${resultsFile}
set +a
export FAMILY=FORGE export FAMILY=FORGE

View File

@@ -10,7 +10,7 @@ handleDebugMode
: "${PAPER_CHANNEL:=default}" : "${PAPER_CHANNEL:=default}"
: "${PAPER_DOWNLOAD_URL:=}" : "${PAPER_DOWNLOAD_URL:=}"
: "${PAPER_CUSTOM_JAR:=}" : "${PAPER_CUSTOM_JAR:=}"
: "${PAPER_CONFIG_DEFAULTS_REPO:=${PAPER_CONFIG_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}}" : "${PAPER_CONFIG_DEFAULTS_REPO:=https://raw.githubusercontent.com/dayyeeet/minecraft-default-configs/main}"
resultsFile=/data/.paper.env resultsFile=/data/.paper.env
if [[ $PAPER_CUSTOM_JAR ]]; then if [[ $PAPER_CUSTOM_JAR ]]; then
@@ -20,10 +20,15 @@ elif [[ $PAPER_DOWNLOAD_URL ]]; then
--output-directory=/data \ --output-directory=/data \
--results-file="$resultsFile" \ --results-file="$resultsFile" \
--url="$PAPER_DOWNLOAD_URL"; then --url="$PAPER_DOWNLOAD_URL"; then
logError "Failed to download from custom PaperMC URL" log "ERROR: failed to download from custom PaperMC URL"
exit 1 exit 1
fi fi
applyResultsFile ${resultsFile} # grab SERVER and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
else else
args=( args=(
--output-directory=/data --output-directory=/data
@@ -36,25 +41,17 @@ else
args+=(--build="$PAPER_BUILD") args+=(--build="$PAPER_BUILD")
fi fi
if ! mc-image-helper install-paper "${args[@]}"; then if ! mc-image-helper install-paper "${args[@]}"; then
logError "Failed to download $PAPER_PROJECT" log "ERROR: failed to download $PAPER_PROJECT"
exit 1 exit 1
fi fi
applyResultsFile ${resultsFile} # grab SERVER and export it
fi set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
defaultTopLevelConfigs="bukkit.yml spigot.yml"
if versionLessThan 1.19; then
defaultTopLevelConfigs+=" paper.yml"
else
# Download default configs to allow for consistent patching
DOWNLOAD_DEFAULT_CONFIGS=$(buildDownloadList "$PAPER_CONFIG_DEFAULTS_REPO" "$VERSION" paper-global.yml paper-world-defaults.yml)
export DOWNLOAD_DEFAULT_CONFIGS
fi fi
# Download top-level configs to allow for consistent patching
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PAPER_CONFIG_DEFAULTS_REPO" "$VERSION" $defaultTopLevelConfigs)
export DOWNLOAD_DEFAULTS
# Normalize on Spigot for downstream operations # Normalize on Spigot for downstream operations
export FAMILY=SPIGOT export FAMILY=SPIGOT

View File

@@ -9,7 +9,7 @@ isDebugging && set -x
IFS=$'\n\t' IFS=$'\n\t'
if versionLessThan 1.17; then if versionLessThan 1.17; then
logError "Pufferfish server type only supports versions 1.17, 1.18 or 1.19, use PUFFERFISH_BUILD to select the the correct build 47 => 1.18.1, 50 => 1.18.2 etc" log "ERROR: Pufferfish server type only supports versions 1.17, 1.18 or 1.19, use PUFFERFISH_BUILD to select the the correct build 47 => 1.18.1, 50 => 1.18.2 etc"
exit 1 exit 1
fi fi
@@ -35,7 +35,7 @@ done
if [[ ! -f "$SERVER" ]] || isTrue "${FORCE_REDOWNLOAD:-false}"; then if [[ ! -f "$SERVER" ]] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
log "Downloading Pufferfish from $PUFFERFISH_BUILD_DOWNLOAD_URL ..." log "Downloading Pufferfish from $PUFFERFISH_BUILD_DOWNLOAD_URL ..."
if ! get -o "$SERVER" "$PUFFERFISH_BUILD_DOWNLOAD_URL"; then if ! get -o "$SERVER" "$PUFFERFISH_BUILD_DOWNLOAD_URL"; then
logError "Failed to download from $PUFFERFISH_BUILD_DOWNLOAD_URL (status=$?)" log "ERROR: failed to download from $PUFFERFISH_BUILD_DOWNLOAD_URL (status=$?)"
exit 3 exit 3
fi fi
fi fi

View File

@@ -15,10 +15,16 @@ if [[ $PURPUR_DOWNLOAD_URL ]]; then
if ! mc-image-helper install-purpur \ if ! mc-image-helper install-purpur \
--output-directory=/data \ --output-directory=/data \
--results-file="$resultsFile" \ --results-file="$resultsFile" \
--url="${PURPUR_DOWNLOAD_URL}"; then --url="$PURPUR_DOWNLOAD_URL}"; then
logError "Failed to download from custom Purpur URL" log "ERROR: failed to download from custom Purpur URL"
exit 1 exit 1
fi fi
# grab SERVER and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
else else
args=( args=(
--output-directory=/data --output-directory=/data
@@ -29,13 +35,16 @@ else
args+=(--build="$PURPUR_BUILD") args+=(--build="$PURPUR_BUILD")
fi fi
if ! mc-image-helper install-purpur "${args[@]}"; then if ! mc-image-helper install-purpur "${args[@]}"; then
logError "Failed to download Purpur" log "ERROR: failed to download Purpur"
exit 1 exit 1
fi fi
# grab SERVER and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
fi fi
applyResultsFile ${resultsFile}
# Normalize on Spigot for later operations # Normalize on Spigot for later operations
export FAMILY=SPIGOT export FAMILY=SPIGOT

View File

@@ -12,18 +12,10 @@ set -eu
isDebugging && set -x isDebugging && set -x
function mc-image-helper-quilt(){
mc-image-helper install-quilt \
--loader-version="$QUILT_LOADER_VERSION" \
--minecraft-version="$VERSION" \
--output-directory=/data \
--results-file="$resultsFile" "$@"
}
resultsFile=/data/.quilt.env resultsFile=/data/.quilt.env
if [[ $QUILT_LAUNCHER ]]; then if [[ $QUILT_LAUNCHER ]]; then
logWarning "Use of QUILT_LAUNCHER is a deprecated feature." log "WARNING: use of QUILT_LAUNCHER is a deprecated feature."
SERVER="$QUILT_LAUNCHER" SERVER="$QUILT_LAUNCHER"
export SERVER export SERVER
resolveVersion resolveVersion
@@ -32,24 +24,38 @@ if [[ $QUILT_LAUNCHER ]]; then
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"
elif [[ $QUILT_LAUNCHER_URL ]]; then elif [[ $QUILT_LAUNCHER_URL ]]; then
logError "QUILT_LAUNCHER_URL is not longer supported. Pre-download and use QUILT_LAUNCHER." log "ERROR: QUILT_LAUNCHER_URL is not longer supported. Pre-download and use QUILT_LAUNCHER."
exit 2 exit 2
elif [[ $QUILT_INSTALLER_URL ]]; then elif [[ $QUILT_INSTALLER_URL ]]; then
if ! mc-image-helper-quilt --installer-url="$QUILT_INSTALLER_URL"; then if ! mc-image-helper install-quilt \
logError "Failed to installQuilt given custom installer URL $QUILT_INSTALLER_URL" --loader-version="$QUILT_LOADER_VERSION" \
--minecraft-version="$VERSION" \
--output-directory=/data \
--results-file="$resultsFile" \
--installer-url="$QUILT_INSTALLER_URL"; then
log "ERROR: failed to install Quilt given custom installer URL $QUILT_INSTALLER_URL"
exit 2 exit 2
fi fi
else else
if ! mc-image-helper-quilt --installer-version="$QUILT_INSTALLER_VERSION"; then if ! mc-image-helper install-quilt \
logError "Failed to installQuilt given installer version $QUILT_INSTALLER_VERSION" --loader-version="$QUILT_LOADER_VERSION" \
--minecraft-version="$VERSION" \
--output-directory=/data \
--results-file="$resultsFile" \
--installer-version="$QUILT_INSTALLER_VERSION"; then
log "ERROR: failed to install Quilt given installer version $QUILT_INSTALLER_VERSION"
exit 2 exit 2
fi fi
fi fi
applyResultsFile ${resultsFile} # grab SERVER, VERSION and export it
set -a
# shellcheck disable=SC1090
source "${resultsFile}"
set +a
export FAMILY=FABRIC export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@" exec "${SCRIPTS:-/}start-setupWorld" "$@"

View File

@@ -24,7 +24,11 @@ esac
# If not SPONGEVERSION selected, detect last version on selected branch # If not SPONGEVERSION selected, detect last version on selected branch
if [ -z $SPONGEVERSION ]; then if [ -z $SPONGEVERSION ]; then
log "Choosing Version for Sponge" log "Choosing Version for Sponge"
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r --arg SPONGEBRANCH "$SPONGEBRANCH" '.buildTypes.$SPONGEBRANCH.latest.version') if [ "$SPONGEBRANCH" == "stable" ]; then
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version')
else
SPONGEVERSION=$(curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.bleeding.latest.version')
fi
fi fi
VERSION="$SPONGEVERSION" VERSION="$SPONGEVERSION"

Some files were not shown because too many files have changed in this diff Show More