mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-18 15:36:22 +00:00
Compare commits
126 Commits
2021.27.0-
...
2022.1.1-j
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaa83fde87 | ||
|
|
c506cf11ac | ||
|
|
967d5159ea | ||
|
|
79f978359c | ||
|
|
4c7bb313be | ||
|
|
83d3555eab | ||
|
|
e93cc569c6 | ||
|
|
5c0cf03548 | ||
|
|
00cae995a7 | ||
|
|
4ba0a9c98c | ||
|
|
6520655d6c | ||
|
|
6bd722b11b | ||
|
|
4576882f07 | ||
|
|
224553f695 | ||
|
|
cc100fd8bb | ||
|
|
a7a0e54cb9 | ||
|
|
ce32eb8d4f | ||
|
|
39519427bb | ||
|
|
e1a2175425 | ||
|
|
107bebd34e | ||
|
|
620c35826b | ||
|
|
706709e6fd | ||
|
|
bd4f3a9a48 | ||
|
|
417fcface4 | ||
|
|
adde46bc73 | ||
|
|
6510a6f361 | ||
|
|
9204e06b63 | ||
|
|
95b5088c3b | ||
|
|
2c106575f0 | ||
|
|
234d70786e | ||
|
|
7cf7193ef4 | ||
|
|
1d923a5878 | ||
|
|
34125769fa | ||
|
|
c6124bdd01 | ||
|
|
9f0edde0b3 | ||
|
|
1d97fccfdf | ||
|
|
5ad85de964 | ||
|
|
c273e99007 | ||
|
|
72ea47148a | ||
|
|
25782fc63e | ||
|
|
283b5ba431 | ||
|
|
5933fffcca | ||
|
|
de5b7cb601 | ||
|
|
c836e29ac3 | ||
|
|
d9214f0204 | ||
|
|
a7efcfff49 | ||
|
|
618d6236ba | ||
|
|
929eeeedfc | ||
|
|
6494ca8864 | ||
|
|
d964231906 | ||
|
|
1d8c28e024 | ||
|
|
d63c570cf3 | ||
|
|
f7f1855e24 | ||
|
|
8ccf0201a8 | ||
|
|
fa9e59edd8 | ||
|
|
25a2ab6ff3 | ||
|
|
bb780c000d | ||
|
|
cb4691a9ac | ||
|
|
76b8b89295 | ||
|
|
551e4d6346 | ||
|
|
61a660ee48 | ||
|
|
5e9806736c | ||
|
|
d5865cd60c | ||
|
|
2b0b8f8a62 | ||
|
|
e94b40bddf | ||
|
|
2dabf34349 | ||
|
|
eb864c0fb8 | ||
|
|
2e0f469748 | ||
|
|
aa95dc291b | ||
|
|
d22280fae7 | ||
|
|
aac3c1c77a | ||
|
|
61b0eff4ca | ||
|
|
8c5f0a53bf | ||
|
|
fffeb7bb9c | ||
|
|
a060cc88d1 | ||
|
|
4421aaa22d | ||
|
|
3a51db6d24 | ||
|
|
969a23ae27 | ||
|
|
1a62592fe2 | ||
|
|
c316dbb5d2 | ||
|
|
bb64135c9b | ||
|
|
ef98de154c | ||
|
|
3d00077ef8 | ||
|
|
0d3ab75683 | ||
|
|
87681e64bb | ||
|
|
8ce986d3d7 | ||
|
|
67fda61de4 | ||
|
|
7c6ec41822 | ||
|
|
93af2025a2 | ||
|
|
c1b040af77 | ||
|
|
4148325787 | ||
|
|
7083cd15e8 | ||
|
|
7418dab476 | ||
|
|
94bbc8e649 | ||
|
|
3e5e62229a | ||
|
|
fe2a9d56ed | ||
|
|
27571999b2 | ||
|
|
bbd7d9e39a | ||
|
|
ef6f308229 | ||
|
|
49d89d3e73 | ||
|
|
74203b23f4 | ||
|
|
4fb791b490 | ||
|
|
ced25ad50a | ||
|
|
48efc224ba | ||
|
|
467c1d9954 | ||
|
|
9ced230f55 | ||
|
|
f3a8276362 | ||
|
|
b91d63716e | ||
|
|
46cccfd531 | ||
|
|
9fe1cb4a0d | ||
|
|
076038b470 | ||
|
|
aa416729ea | ||
|
|
812c6365ec | ||
|
|
42a5131b19 | ||
|
|
624f6a210f | ||
|
|
1c63cd18b7 | ||
|
|
6266a7e3cc | ||
|
|
871ecd4d9d | ||
|
|
c572c95161 | ||
|
|
f7b58fbbb1 | ||
|
|
eccfa444a9 | ||
|
|
e831d25706 | ||
|
|
12e931332b | ||
|
|
ceee9eddc9 | ||
|
|
60ba668743 | ||
|
|
fd1b15e01f |
2
.github/workflows/build-multiarch.yml
vendored
2
.github/workflows/build-multiarch.yml
vendored
@@ -8,8 +8,6 @@ on:
|
|||||||
- java11*
|
- java11*
|
||||||
- java16*
|
- java16*
|
||||||
- java17*
|
- java17*
|
||||||
- test/*
|
|
||||||
- fix/*
|
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
- "[0-9]+.[0-9]+.[0-9]+-java8-multiarch"
|
- "[0-9]+.[0-9]+.[0-9]+-java8-multiarch"
|
||||||
|
|||||||
35
.github/workflows/pr.yml
vendored
35
.github/workflows/pr.yml
vendored
@@ -3,13 +3,18 @@ name: Validate PR
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
types: [assigned, opened, synchronize, labeled]
|
||||||
|
paths-ignore:
|
||||||
|
- "*.md"
|
||||||
|
- "docs/**"
|
||||||
|
- "examples/**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
IMAGE_TO_TEST: itzg/minecraft-server:test-${{ github.repository_owner }}-${{ github.run_id }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.4.0
|
- uses: actions/checkout@v2.4.0
|
||||||
@@ -25,8 +30,34 @@ jobs:
|
|||||||
tags: ${{ env.IMAGE_TO_TEST }}
|
tags: ${{ env.IMAGE_TO_TEST }}
|
||||||
load: true
|
load: true
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
tests/test.sh
|
tests/test.sh
|
||||||
|
|
||||||
|
- name: Gather Docker metadata
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
itzg/minecraft-server
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
if: contains(github.event.pull_request.labels.*.name, 'ci/push-image')
|
||||||
|
uses: docker/build-push-action@v2.7.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
pull: true
|
||||||
|
push: true
|
||||||
|
cache-from: type=gha
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
|
.vscode
|
||||||
/data/
|
/data/
|
||||||
/.idea/
|
/.idea/
|
||||||
*.iml
|
*.iml
|
||||||
/gh-md-toc
|
*.zip
|
||||||
|
/gh-md-toc
|
||||||
|
|||||||
73
Dockerfile
73
Dockerfile
@@ -1,29 +1,30 @@
|
|||||||
FROM openjdk:8-jdk-alpine
|
FROM eclipse-temurin:8-jdk
|
||||||
|
|
||||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||||
|
|
||||||
RUN apk add --no-cache -U \
|
RUN apt-get update \
|
||||||
openssl \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
imagemagick \
|
apt-get install -y \
|
||||||
lsof \
|
imagemagick \
|
||||||
su-exec \
|
gosu \
|
||||||
shadow \
|
sudo \
|
||||||
bash \
|
net-tools \
|
||||||
curl iputils wget \
|
iputils-ping \
|
||||||
git \
|
curl \
|
||||||
jq \
|
git \
|
||||||
mysql-client \
|
jq \
|
||||||
tzdata \
|
dos2unix \
|
||||||
rsync \
|
mysql-client \
|
||||||
nano \
|
tzdata \
|
||||||
sudo \
|
rsync \
|
||||||
knock \
|
nano \
|
||||||
ttf-dejavu
|
unzip \
|
||||||
|
knockd \
|
||||||
|
ttf-dejavu \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
RUN addgroup -g 1000 minecraft \
|
RUN addgroup --gid 1000 minecraft \
|
||||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
&& adduser --system --shell /bin/false --uid 1000 --ingroup minecraft --home /data minecraft
|
||||||
&& mkdir -m 777 /data \
|
|
||||||
&& chown minecraft:minecraft /data /home/minecraft
|
|
||||||
|
|
||||||
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||||
|
|
||||||
@@ -31,9 +32,9 @@ EXPOSE 25565 25575
|
|||||||
|
|
||||||
# hook into docker BuildKit --platform support
|
# hook into docker BuildKit --platform support
|
||||||
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||||
ARG TARGETOS=linux
|
ARG TARGETOS
|
||||||
ARG TARGETARCH=amd64
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT=""
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
ARG EASY_ADD_VER=0.7.1
|
ARG EASY_ADD_VER=0.7.1
|
||||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||||
@@ -44,26 +45,26 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=1.5.1 --var app=rcon-cli --file {{.app}} \
|
--var version=1.5.1 --var app=rcon-cli --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=0.10.3 --var app=mc-monitor --file {{.app}} \
|
--var version=0.10.3 --var app=mc-monitor --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=1.8.0 --var app=mc-server-runner --file {{.app}} \
|
--var version=1.8.0 --var app=mc-server-runner --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.11.0
|
ARG MC_HELPER_VERSION=1.11.0
|
||||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
|
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/v${MC_HELPER_VERSION}
|
||||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||||
| tar -C /usr/share -zxf - \
|
| tar -C /usr/share -zxf - \
|
||||||
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
|
&& ln -s /usr/share/mc-image-helper-${MC_HELPER_VERSION}/bin/mc-image-helper /usr/bin
|
||||||
|
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
@@ -71,7 +72,7 @@ WORKDIR /data
|
|||||||
STOPSIGNAL SIGTERM
|
STOPSIGNAL SIGTERM
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
ENV UID=1000 GID=1000 \
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST \
|
TYPE=VANILLA VERSION=LATEST \
|
||||||
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
ENABLE_AUTOPAUSE=false AUTOPAUSE_TIMEOUT_EST=3600 AUTOPAUSE_TIMEOUT_KN=120 AUTOPAUSE_TIMEOUT_INIT=600 \
|
||||||
|
|||||||
69
README.md
69
README.md
@@ -24,6 +24,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
**TABLE OF CONTENTS**
|
**TABLE OF CONTENTS**
|
||||||
|
|
||||||
<!--ts-->
|
<!--ts-->
|
||||||
|
* [Mitigated Log4jShell Vulnerability](#mitigated-log4jshell-vulnerability)
|
||||||
* [Looking for a Bedrock Dedicated Server](#looking-for-a-bedrock-dedicated-server)
|
* [Looking for a Bedrock Dedicated Server](#looking-for-a-bedrock-dedicated-server)
|
||||||
* [Interacting with the server](#interacting-with-the-server)
|
* [Interacting with the server](#interacting-with-the-server)
|
||||||
* [Data Directory](#data-directory)
|
* [Data Directory](#data-directory)
|
||||||
@@ -45,6 +46,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server)
|
* [Running a Bukkit/Spigot server](#running-a-bukkitspigot-server)
|
||||||
* [Running a Paper server](#running-a-paper-server)
|
* [Running a Paper server](#running-a-paper-server)
|
||||||
* [Running an Airplane server](#running-an-airplane-server)
|
* [Running an Airplane server](#running-an-airplane-server)
|
||||||
|
* [Running a Pufferfish server](#running-a-pufferfish-server)
|
||||||
* [Running a Purpur server](#running-a-purpur-server)
|
* [Running a Purpur server](#running-a-purpur-server)
|
||||||
* [Running a Magma server](#running-a-magma-server)
|
* [Running a Magma server](#running-a-magma-server)
|
||||||
* [Running a Mohist server](#running-a-mohist-server)
|
* [Running a Mohist server](#running-a-mohist-server)
|
||||||
@@ -74,6 +76,7 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Cloning world from a container path](#cloning-world-from-a-container-path)
|
* [Cloning world from a container path](#cloning-world-from-a-container-path)
|
||||||
* [Overwrite world on start](#overwrite-world-on-start)
|
* [Overwrite world on start](#overwrite-world-on-start)
|
||||||
* [Datapacks](#datapacks)
|
* [Datapacks](#datapacks)
|
||||||
|
* [VanillaTweaks](#vanillatweaks)
|
||||||
* [Server configuration](#server-configuration)
|
* [Server configuration](#server-configuration)
|
||||||
* [Message of the Day](#message-of-the-day)
|
* [Message of the Day](#message-of-the-day)
|
||||||
* [Difficulty](#difficulty)
|
* [Difficulty](#difficulty)
|
||||||
@@ -136,10 +139,14 @@ By default, the container will download the latest version of the "vanilla" [Min
|
|||||||
* [Running on RaspberryPi](#running-on-raspberrypi)
|
* [Running on RaspberryPi](#running-on-raspberrypi)
|
||||||
* [Contributing](#contributing)
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
<!-- Added by: runner, at: Wed Dec 22 13:01:43 UTC 2021 -->
|
<!-- Added by: runner, at: Thu Jan 6 12:50:03 UTC 2022 -->
|
||||||
|
|
||||||
<!--te-->
|
<!--te-->
|
||||||
|
|
||||||
|
## Mitigated Log4jShell Vulnerability
|
||||||
|
|
||||||
|
**Please ensure you have pulled the latest image** since [all official mitigations](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition) are automatically applied by the container startup process.
|
||||||
|
|
||||||
## Looking for a Bedrock Dedicated Server
|
## Looking for a Bedrock Dedicated Server
|
||||||
|
|
||||||
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
|
||||||
@@ -285,6 +292,7 @@ When using the image `itzg:/minecraft-server` without a tag, the `latest` image
|
|||||||
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
|
| java11-openj9 | 11 | Debian | OpenJ9 | amd64 |
|
||||||
| java16-openj9 | 16 | Debian | OpenJ9 | amd64 |
|
| java16-openj9 | 16 | Debian | OpenJ9 | amd64 |
|
||||||
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
| java17 | 17 | Ubuntu | Hotspot | amd64,arm64,armv7 |
|
||||||
|
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
|
||||||
|
|
||||||
For example, to use Java version 8 on any supported architecture:
|
For example, to use Java version 8 on any supported architecture:
|
||||||
|
|
||||||
@@ -479,6 +487,18 @@ Extra variables:
|
|||||||
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||||
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
- `USE_FLARE_FLAGS=false` : set to true to add appropriate flags for the [Flare](https://blog.airplane.gg/flare) profiler
|
||||||
|
|
||||||
|
### Running a Pufferfish server
|
||||||
|
|
||||||
|
A [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) server, which is "a highly optimized Paper fork designed for large servers requiring both maximum performance, stability, and "enterprise" features."
|
||||||
|
|
||||||
|
-e TYPE=PUFFERFISH
|
||||||
|
|
||||||
|
> NOTE: The `VERSION` variable is used to select a Pufferfish branch to download from. The available options are "LATEST" and "1.18"
|
||||||
|
|
||||||
|
Extra variables:
|
||||||
|
- `PUFFERFISH_BUILD=lastSuccessfulBuild` : set a specific Pufferfish build to use
|
||||||
|
- `FORCE_REDOWNLOAD=false` : set to true to force the located server jar to be re-downloaded
|
||||||
|
|
||||||
### Running a Purpur server
|
### Running a Purpur server
|
||||||
|
|
||||||
A [Purpur](https://purpur.pl3x.net/) server, which is "drop-in replacement for Paper servers designed for configurability, new fun and exciting gameplay features, and performance built on top of Airplane."
|
A [Purpur](https://purpur.pl3x.net/) server, which is "drop-in replacement for Paper servers designed for configurability, new fun and exciting gameplay features, and performance built on top of Airplane."
|
||||||
@@ -804,6 +824,47 @@ Datapacks can be installed in a similar manner to mods/plugins. There are many e
|
|||||||
* `REMOVE_OLD_DATAPACKS_EXCLUDE`
|
* `REMOVE_OLD_DATAPACKS_EXCLUDE`
|
||||||
Datapacks will be placed in `/data/$LEVEL/datapacks`
|
Datapacks will be placed in `/data/$LEVEL/datapacks`
|
||||||
|
|
||||||
|
### VanillaTweaks
|
||||||
|
|
||||||
|
VanillaTweaks datapacks can be installed with a share code from the website UI **OR** a json file to specify packs to download and install.
|
||||||
|
|
||||||
|
Accepted Parameters:
|
||||||
|
|
||||||
|
- `VANILLATWEAKS_FILE`
|
||||||
|
- `VANILLATWEAKS_SHARECODE`
|
||||||
|
- `REMOVE_OLD_VANILLATWEAKS`
|
||||||
|
- `REMOVE_OLD_VANILLATWEAKS_DEPTH`
|
||||||
|
- `REMOVE_OLD_VANILLATWEAKS_INCLUDE`
|
||||||
|
- `REMOVE_OLD_VANILLATWEAKS_EXCLUDE`
|
||||||
|
|
||||||
|
Example of expected Vanillatweaks sharecode:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
VANILLATWEAKS_SHARECODE: MGr52E
|
||||||
|
```
|
||||||
|
|
||||||
|
Example of expected Vanillatweaks file format:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"version": "1.18",
|
||||||
|
"packs": {
|
||||||
|
"survival": [
|
||||||
|
"graves",
|
||||||
|
"multiplayer sleep",
|
||||||
|
"afk display",
|
||||||
|
"armor statues",
|
||||||
|
"unlock all recipes",
|
||||||
|
"fast leaf decay",
|
||||||
|
"coordinates hud"
|
||||||
|
],
|
||||||
|
"items": ["armored elytra"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Datapacks will be placed in `/data/$LEVEL/datapacks`
|
||||||
|
|
||||||
## Server configuration
|
## Server configuration
|
||||||
|
|
||||||
By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started. If the `server.properties` file already exists, the values in them will not be changed.
|
By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started. If the `server.properties` file already exists, the values in them will not be changed.
|
||||||
@@ -1400,10 +1461,6 @@ To enable remote JMX, such as for profiling with VisualVM or JMC, add the enviro
|
|||||||
|
|
||||||
When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adjusted according to the article.
|
When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adjusted according to the article.
|
||||||
|
|
||||||
Large page support can also be enabled by adding
|
|
||||||
|
|
||||||
-e USE_LARGE_PAGES=true
|
|
||||||
|
|
||||||
### HTTP Proxy
|
### HTTP Proxy
|
||||||
|
|
||||||
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`
|
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`
|
||||||
@@ -1459,6 +1516,8 @@ Enable the Autopause functionality by setting:
|
|||||||
|
|
||||||
Autopause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
|
Autopause is not compatible with `EXEC_DIRECTLY=true` and the two cannot be set together.
|
||||||
|
|
||||||
|
> When configuring kubernetes readiness/liveness health checks with auto-pause enabled, be sure to reference the `mc-health` wrapper script rather than `mc-status` directly.
|
||||||
|
|
||||||
The following environment variables define the behaviour of auto-pausing:
|
The following environment variables define the behaviour of auto-pausing:
|
||||||
* `AUTOPAUSE_TIMEOUT_EST`, default `3600` (seconds)
|
* `AUTOPAUSE_TIMEOUT_EST`, default `3600` (seconds)
|
||||||
describes the time between the last client disconnect and the pausing of the process (read as timeout established)
|
describes the time between the last client disconnect and the pausing of the process (read as timeout established)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ services:
|
|||||||
VERSION: ${VERSION:-1.17.1}
|
VERSION: ${VERSION:-1.17.1}
|
||||||
FORGEVERSION: ${FORGEVERSION:-37.0.90}
|
FORGEVERSION: ${FORGEVERSION:-37.0.90}
|
||||||
GENERIC_PACK: /modpacks/${MODPACK:-Server-Files-0.0.21.zip}
|
GENERIC_PACK: /modpacks/${MODPACK:-Server-Files-0.0.21.zip}
|
||||||
|
REMOVE_OLD_MODS: "${REMOVE_OLD_MODS:-false}"
|
||||||
ports:
|
ports:
|
||||||
- "25565:25565"
|
- "25565:25565"
|
||||||
|
|
||||||
|
|||||||
27
examples/vanilla-tweaks/docker-compose.yml
Normal file
27
examples/vanilla-tweaks/docker-compose.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
version: "3.3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
vanillatweaks_file:
|
||||||
|
restart: "no"
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
ports:
|
||||||
|
- "25565:25565/tcp"
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
VANILLATWEAKS_FILE: /config/vanillatweaks-datapacks.json
|
||||||
|
REMOVE_OLD_VANILLATWEAKS: "TRUE"
|
||||||
|
volumes:
|
||||||
|
- data:/data
|
||||||
|
- ./vanillatweaks-datapacks.json:/config/vanillatweaks-datapacks.json:ro
|
||||||
|
vanillatweaks_sharecode:
|
||||||
|
# port is set to 25566 to not conflict with vanillatweaks_file example
|
||||||
|
ports:
|
||||||
|
- "25566:25565/tcp"
|
||||||
|
restart: "no"
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
VANILLATWEAKS_SHARECODE: MGr52E
|
||||||
|
REMOVE_OLD_VANILLATWEAKS: "TRUE"
|
||||||
15
examples/vanilla-tweaks/vanillatweaks-datapacks.json
Normal file
15
examples/vanilla-tweaks/vanillatweaks-datapacks.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"version": "1.18",
|
||||||
|
"packs": {
|
||||||
|
"survival": [
|
||||||
|
"graves",
|
||||||
|
"multiplayer sleep",
|
||||||
|
"afk display",
|
||||||
|
"armor statues",
|
||||||
|
"unlock all recipes",
|
||||||
|
"fast leaf decay",
|
||||||
|
"coordinates hud"
|
||||||
|
],
|
||||||
|
"items": ["armored elytra"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,15 +5,15 @@ current_uptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java_running() {
|
java_running() {
|
||||||
[[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
[[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
java_process_exists() {
|
java_process_exists() {
|
||||||
[[ -n "$(ps -a -o comm | grep 'java')" ]]
|
[[ -n "$(ps -ax -o comm | grep 'java')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
rcon_client_exists() {
|
rcon_client_exists() {
|
||||||
[[ -n "$(ps -a -o comm | grep 'rcon-cli')" ]]
|
[[ -n "$(ps -ax -o comm | grep 'rcon-cli')" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
mc_server_listening() {
|
mc_server_listening() {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
[unpauseMCServer-server]
|
[unpauseMCServer-server]
|
||||||
sequence = 25565
|
sequence = 25565
|
||||||
seq_timeout = 1
|
seq_timeout = 1
|
||||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
[unpauseMCServer-rcon]
|
[unpauseMCServer-rcon]
|
||||||
sequence = 25575
|
sequence = 25575
|
||||||
seq_timeout = 1
|
seq_timeout = 1
|
||||||
command = /sbin/su-exec minecraft:minecraft /autopause/resume.sh
|
command = /usr/sbin/gosu minecraft:minecraft /autopause/resume.sh
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
[unpauseMCServer-bedrock]
|
[unpauseMCServer-bedrock]
|
||||||
sequence = 19132:udp
|
sequence = 19132:udp
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
|
||||||
# save world
|
# save world
|
||||||
rcon-cli save-all >/dev/null
|
rcon-cli save-all >/dev/null
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; then
|
||||||
logAutopauseAction "Knocked, resuming Java process"
|
logAutopauseAction "Knocked, resuming Java process"
|
||||||
pkill -CONT java
|
pkill -CONT java
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ 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 su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
|
exec gosu ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration "$@"
|
||||||
else
|
else
|
||||||
exec ${SCRIPTS:-/}start-configuration "$@"
|
exec ${SCRIPTS:-/}start-configuration "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ fi
|
|||||||
|
|
||||||
if ! which java > /dev/null; then
|
if ! which java > /dev/null; then
|
||||||
log "Fixing PATH to include java"
|
log "Fixing PATH to include java"
|
||||||
PATH="${PATH}:/usr/bin"
|
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||||
@@ -131,6 +131,10 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
exec ${SCRIPTS:-/}start-deployFabric "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
FTBA)
|
||||||
|
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
FTB|CURSEFORGE)
|
FTB|CURSEFORGE)
|
||||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||||
;;
|
;;
|
||||||
@@ -167,6 +171,10 @@ case "${TYPE^^}" in
|
|||||||
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
PUFFERFISH)
|
||||||
|
exec ${SCRIPTS:-/}start-deployPufferfish "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
CANYON)
|
CANYON)
|
||||||
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
||||||
;;
|
;;
|
||||||
@@ -183,7 +191,7 @@ case "${TYPE^^}" in
|
|||||||
log "Invalid type: '$TYPE'"
|
log "Invalid type: '$TYPE'"
|
||||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||||
log " CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM,"
|
log " CURSEFORGE, SPONGEVANILLA, PURPUR, CUSTOM,"
|
||||||
log " MAGMA, MOHIST, CATSERVER, AIRPLANE, CANYON, LIMBO, CRUCIBLE"
|
log " MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH, CANYON, LIMBO, CRUCIBLE"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ fi
|
|||||||
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
||||||
: ${AIRPLANE_TYPE:=airplane}
|
: ${AIRPLANE_TYPE:=airplane}
|
||||||
|
|
||||||
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
||||||
AIRPLANE_BRANCH="1.17"
|
AIRPLANE_BRANCH="1.17"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -36,8 +36,7 @@ done
|
|||||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||||
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-${AIRPLANE_TYPE}.jar"
|
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-${AIRPLANE_TYPE}.jar"
|
||||||
log "Downloading Airplane from $downloadUrl ..."
|
log "Downloading Airplane from $downloadUrl ..."
|
||||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
if ! get -o "$SERVER" "$downloadUrl"; then
|
||||||
if [ ! -f "$SERVER" ]; then
|
|
||||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -35,11 +35,37 @@ 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."
|
||||||
requireVar FTB_SERVER_MOD
|
requireVar FTB_SERVER_MOD
|
||||||
|
|
||||||
if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
downloadModpack() {
|
||||||
if ! [ -f "${FTB_SERVER_MOD}" ]; then
|
srv_modpack=${FTB_SERVER_MOD}
|
||||||
log "ERROR unable to find requested modpack file ${FTB_SERVER_MOD}"
|
if isURL "${srv_modpack}"; then
|
||||||
exit 2
|
log "Downloading modpack from ${srv_modpack}..."
|
||||||
|
if ! srv_modpack=$(get -o /data --output-filename --skip-existing "${srv_modpack}"); then
|
||||||
|
log "ERROR: failed to download modpack"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [[ "${srv_modpack:0:5}" == "data/" ]]; then
|
||||||
|
# Prepend with "/"
|
||||||
|
srv_modpack="/${srv_modpack}"
|
||||||
|
fi
|
||||||
|
if [[ ! "${srv_modpack:0:1}" == "/" ]]; then
|
||||||
|
# If not an absolute path, assume file is in "/data"
|
||||||
|
srv_modpack=/data/${srv_modpack}
|
||||||
|
fi
|
||||||
|
if [[ ! -f "${srv_modpack}" ]]; then
|
||||||
|
log "FTB server modpack ${srv_modpack} not found."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then
|
||||||
|
log "FTB server modpack ${srv_modpack} is not a zip archive."
|
||||||
|
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
FTB_SERVER_MOD=${srv_modpack}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
||||||
|
downloadModpack
|
||||||
|
|
||||||
needsInstall=true
|
needsInstall=true
|
||||||
installMarker=/data/.curseforge-installed
|
installMarker=/data/.curseforge-installed
|
||||||
@@ -47,7 +73,7 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
|||||||
if [ "$(cat $installMarker)" != "${FTB_SERVER_MOD}" ]; then
|
if [ "$(cat $installMarker)" != "${FTB_SERVER_MOD}" ]; then
|
||||||
log "Upgrading modpack"
|
log "Upgrading modpack"
|
||||||
|
|
||||||
serverJar=$(find "${FTB_BASE_DIR}" -not -name "forge*installer.jar" -name "forge*.jar")
|
serverJar=$(find "${FTB_BASE_DIR}" -type f \( -path "*/libraries/*" -o -path "*/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -print)
|
||||||
if [[ "${serverJar}" ]]; then
|
if [[ "${serverJar}" ]]; then
|
||||||
rm -rf "$(dirname "${serverJar}")"/{mods,*.jar,libraries,resources,scripts,config}
|
rm -rf "$(dirname "${serverJar}")"/{mods,*.jar,libraries,resources,scripts,config}
|
||||||
fi
|
fi
|
||||||
@@ -85,8 +111,6 @@ if ! isTrue "${USE_MODPACK_START_SCRIPT:-true}"; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
forgeInstallerJar=$(ls -t "${forgeInstallerJar}" | head -1)
|
|
||||||
|
|
||||||
log "Installing forge server"
|
log "Installing forge server"
|
||||||
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
||||||
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
(cd "${dirOfInstaller}"; java -jar "$(basename "${forgeInstallerJar}")" --installServer)
|
||||||
@@ -134,32 +158,9 @@ fi
|
|||||||
# also check for the start script rather than just the folder
|
# also check for the start script rather than just the folder
|
||||||
# this allows saving just the world separate from the rest of the data directory
|
# this allows saving just the world separate from the rest of the data directory
|
||||||
if [[ $startScriptCount = 0 ]]; then
|
if [[ $startScriptCount = 0 ]]; then
|
||||||
|
downloadModpack
|
||||||
srv_modpack=${FTB_SERVER_MOD}
|
srv_modpack=${FTB_SERVER_MOD}
|
||||||
if isURL "${srv_modpack}"; then
|
|
||||||
log "Downloading modpack from ${srv_modpack}..."
|
|
||||||
if ! srv_modpack=$(get -o /data --output-filename --skip-existing "${srv_modpack}"); then
|
|
||||||
log "ERROR: failed to download modpack"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if [[ "${srv_modpack:0:5}" == "data/" ]]; then
|
|
||||||
# Prepend with "/"
|
|
||||||
srv_modpack="/${srv_modpack}"
|
|
||||||
fi
|
|
||||||
if [[ ! "${srv_modpack:0:1}" == "/" ]]; then
|
|
||||||
# If not an absolute path, assume file is in "/data"
|
|
||||||
srv_modpack=/data/${srv_modpack}
|
|
||||||
fi
|
|
||||||
if [[ ! -f "${srv_modpack}" ]]; then
|
|
||||||
log "FTB server modpack ${srv_modpack} not found."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
if [[ ! "${srv_modpack: -4}" == ".zip" ]]; then
|
|
||||||
log "FTB server modpack ${srv_modpack} is not a zip archive."
|
|
||||||
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||||
mkdir -p "${FTB_BASE_DIR}"
|
mkdir -p "${FTB_BASE_DIR}"
|
||||||
unzip -o "${srv_modpack}" -d "${FTB_BASE_DIR}" | awk '{printf "."} END {print ""}'
|
unzip -o "${srv_modpack}" -d "${FTB_BASE_DIR}" | awk '{printf "."} END {print ""}'
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ if [ ! -d "$librariesDir" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir "$librariesDir"
|
|
||||||
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
if ! unzip /tmp/libraries.zip -d "$librariesDir"; then
|
||||||
log "ERROR: failed to unzip Crucible libraries"
|
log "ERROR: failed to unzip Crucible libraries"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
46
scripts/start-deployPufferfish
Executable file
46
scripts/start-deployPufferfish
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. ${SCRIPTS:-/}start-utils
|
||||||
|
set -euo pipefail
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
IFS=$'\n\t'
|
||||||
|
|
||||||
|
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.18" ] ; then
|
||||||
|
log "ERROR: Pufferfish server type only supports VERSION=LATEST, VERSION=1.18. Note that these are branches, not #.#.# versions."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
: ${PUFFERFISH_BUILD:=lastSuccessfulBuild}
|
||||||
|
|
||||||
|
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.18" ]; then
|
||||||
|
PUFFERFISH_BRANCH="1.18"
|
||||||
|
PUFFERFISH_VERSION="1.18.1-R0.1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Using Pufferfish-${PUFFERFISH_BRANCH} branch"
|
||||||
|
|
||||||
|
export SERVER=pufferfish-${PUFFERFISH_BRANCH}-${PUFFERFISH_BUILD}.jar
|
||||||
|
|
||||||
|
log "Removing old Pufferfish versions ..."
|
||||||
|
shopt -s nullglob
|
||||||
|
for f in pufferfish-*.jar; do
|
||||||
|
[[ $f != $SERVER ]] && rm $f
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||||
|
artifact="build/libs/pufferfish-paperclip-${PUFFERFISH_VERSION}-SNAPSHOT-reobf.jar"
|
||||||
|
downloadUrl="https://ci.pufferfish.host/job/Pufferfish-${PUFFERFISH_BRANCH}/${PUFFERFISH_BUILD}/artifact/${artifact}"
|
||||||
|
log "Downloading Pufferfish from $downloadUrl ..."
|
||||||
|
if ! get -o "$SERVER" "$downloadUrl"; then
|
||||||
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize on Spigot for later operations
|
||||||
|
export TYPE=SPIGOT
|
||||||
|
export FAMILY=SPIGOT
|
||||||
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
|
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
. ${SCRIPTS:-/}start-utils
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
isDebugging && set -x
|
isDebugging && set -x
|
||||||
|
|
||||||
: ${VANILLA_VERSION:?}
|
: ${VANILLA_VERSION:?}
|
||||||
@@ -10,12 +11,10 @@ isDebugging && set -x
|
|||||||
: ${FORCE_REDOWNLOAD:=false}
|
: ${FORCE_REDOWNLOAD:=false}
|
||||||
|
|
||||||
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||||
PURPUR_BUILD=$(curl -fsSL "https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}" |
|
if ! PURPUR_BUILD=$(get --json-path=".builds.latest" "https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}"); then
|
||||||
jq -r '.builds.latest' || echo "")
|
|
||||||
if [[ -z ${PURPUR_BUILD} ]]; then
|
|
||||||
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||||
log " Please check if a download is available at https://purpur.pl3x.net/downloads/"
|
log " Please check if a download is available at https://purpur.pl3x.net/downloads/"
|
||||||
exit 3
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
|||||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||||
downloadUrl="https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
downloadUrl="https://api.purpurmc.org/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||||
log "Downloading Purpur from $downloadUrl ..."
|
log "Downloading Purpur from $downloadUrl ..."
|
||||||
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
if ! get -o "$SERVER" "$downloadUrl"; then
|
||||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
@@ -35,4 +34,4 @@ export TYPE=SPIGOT
|
|||||||
export FAMILY=SPIGOT
|
export FAMILY=SPIGOT
|
||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|
||||||
|
|||||||
@@ -236,12 +236,6 @@ if isTrue "${USE_AIKAR_FLAGS}"; then
|
|||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if isTrue "${USE_LARGE_PAGES}"; then
|
|
||||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
|
||||||
-XX:+UseLargePagesInMetaspace
|
|
||||||
"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if isTrue "${USE_FLARE_FLAGS}"; then
|
if isTrue "${USE_FLARE_FLAGS}"; then
|
||||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||||
-XX:+UnlockDiagnosticVMOptions
|
-XX:+UnlockDiagnosticVMOptions
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ set -e -o pipefail
|
|||||||
: "${MODS_FILE:=}"
|
: "${MODS_FILE:=}"
|
||||||
: "${REMOVE_OLD_MODS_DEPTH:=1} "
|
: "${REMOVE_OLD_MODS_DEPTH:=1} "
|
||||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
|
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar}"
|
||||||
|
sum_file=/data/.generic_pack.sum
|
||||||
|
|
||||||
# shellcheck source=start-utils
|
# shellcheck source=start-utils
|
||||||
. "${SCRIPTS:-/}start-utils"
|
. "${SCRIPTS:-/}start-utils"
|
||||||
@@ -18,6 +19,7 @@ CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
|||||||
if isTrue "${REMOVE_OLD_MODS}" && [ -z "${MODS_FILE}" ]; then
|
if isTrue "${REMOVE_OLD_MODS}" && [ -z "${MODS_FILE}" ]; then
|
||||||
removeOldMods /data/mods
|
removeOldMods /data/mods
|
||||||
removeOldMods /data/plugins
|
removeOldMods /data/plugins
|
||||||
|
rm -f "$sum_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If packwiz url passed, bootstrap packwiz and update mods before other modpack processing
|
# If packwiz url passed, bootstrap packwiz and update mods before other modpack processing
|
||||||
@@ -204,7 +206,6 @@ if [[ "${GENERIC_PACKS}" ]]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
sum_file=/data/.generic_pack.sum
|
|
||||||
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
|
isDebugging && [ -f "$sum_file}" ] && cat "$sum_file"
|
||||||
if ! sha256sum -c "${sum_file}" --status 2> /dev/null; then
|
if ! sha256sum -c "${sum_file}" --status 2> /dev/null; then
|
||||||
base_dir=/tmp/generic_pack_base
|
base_dir=/tmp/generic_pack_base
|
||||||
|
|||||||
84
scripts/start-setupVanillaTweaks
Normal file
84
scripts/start-setupVanillaTweaks
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e -o pipefail
|
||||||
|
|
||||||
|
: "${REMOVE_OLD_VANILLATWEAKS:=false}"
|
||||||
|
: "${VANILLATWEAKS_FILE:=}"
|
||||||
|
: "${VANILLATWEAKS_SHARECODE:=}"
|
||||||
|
: "${REMOVE_OLD_VANILLATWEAKS_DEPTH:=1} "
|
||||||
|
: "${REMOVE_OLD_VANILLATWEAKS_INCLUDE:=*.zip}"
|
||||||
|
|
||||||
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-/}start-utils"
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
out_dir=/data/${LEVEL:-world}/datapacks
|
||||||
|
|
||||||
|
# Remove old VANILLATWEAKS
|
||||||
|
if isTrue "${REMOVE_OLD_VANILLATWEAKS}" && [ -z "${VANILLATWEAKS_FILE}" ]; then
|
||||||
|
if [ -d "$out_dir" ]; then
|
||||||
|
find "$out_dir" -mindepth 1 -maxdepth ${REMOVE_OLD_VANILLATWEAKS_DEPTH:-16} -wholename "${REMOVE_OLD_VANILLATWEAKS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_VANILLATWEAKS_EXCLUDE:-}" -delete
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Example: VANILLATWEAKS_SHARECODE=MGr52E
|
||||||
|
# Code generated from the UI website, typically a alphanumeric 6 digit code.
|
||||||
|
if [[ "$VANILLATWEAKS_SHARECODE" ]]; then
|
||||||
|
VANILLATWEAKS_FILE=/tmp/vanillatweaksfile.json
|
||||||
|
SHARECODE_LOOKUP_URL="https://vanillatweaks.net/assets/server/sharecode.php?code=${VANILLATWEAKS_SHARECODE}"
|
||||||
|
curl -f $SHARECODE_LOOKUP_URL -o $VANILLATWEAKS_FILE
|
||||||
|
if [ ! -f "$VANILLATWEAKS_FILE" ]; then
|
||||||
|
log "ERROR: Unable to use share code provided to retreive vanillatweaks file"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use vanillatweaks file to specify VT and datapacks
|
||||||
|
if [[ "$VANILLATWEAKS_FILE" ]]; then
|
||||||
|
if [ ! -f "$VANILLATWEAKS_FILE" ]; then
|
||||||
|
log "ERROR: given VANILLATWEAKS_FILE file does not exist"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
PACKS=$(jq -jc '.packs' $VANILLATWEAKS_FILE)
|
||||||
|
if [ ! "$PACKS" ]; then
|
||||||
|
log "ERROR: unable to retrieve packs from $VANILLATWEAKS_FILE"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
VT_VERSION=$(jq -jc '.version' $VANILLATWEAKS_FILE)
|
||||||
|
if [ ! "$VT_VERSION" ]; then
|
||||||
|
log "ERROR: unable to retrieve version from $VANILLATWEAKS_FILE"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download and unzip packs
|
||||||
|
if [[ "$PACKS" ]] && [[ "$VT_VERSION" ]]; then
|
||||||
|
VT_ZIPDATA_URL=https://vanillatweaks.net/assets/server/zipdatapacks.php
|
||||||
|
DOWNLOAD_URL=$(curl -X POST -F "packs=${PACKS}" -F "version=${VT_VERSION}" $VT_ZIPDATA_URL | jq -r '.link')
|
||||||
|
if [ ! "$DOWNLOAD_URL" ]; then
|
||||||
|
log "ERROR: unable to retrieve DOWNLOAD_URL from vanillatweaks.net!"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
TEMPZIP=/tmp/vanillatweaks.zip
|
||||||
|
if ! get -o $TEMPZIP "https://vanillatweaks.net${DOWNLOAD_URL}"; then
|
||||||
|
log "ERROR: failed to download from ${DOWNLOAD_URL}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$out_dir"
|
||||||
|
if ! unzip -o -d "$out_dir" $TEMPZIP; then
|
||||||
|
log "ERROR: failed to unzip the ${PACKS} from ${$TEMPZIP}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# clean up files time!
|
||||||
|
rm -f $TEMPZIP
|
||||||
|
# cleans up temp vanilla tweaks file download to get stored packs
|
||||||
|
if [[ "$VANILLATWEAKS_SHARECODE" ]]; then
|
||||||
|
rm -f $VANILLATWEAKS_FILE
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "${SCRIPTS:-/}start-setupDatapack" "$@"
|
||||||
@@ -69,4 +69,4 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "${SCRIPTS:-/}start-setupDatapack" "$@"
|
exec "${SCRIPTS:-/}start-setupVanillaTweaks" "$@"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3.8"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
monitor:
|
monitor:
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
mc:
|
mc:
|
||||||
image: itzg/minecraft-server
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
environment:
|
environment:
|
||||||
EULA: "true"
|
EULA: "true"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
GENERIC_PACKS: https://github.com/itzg/mc-image-helper/releases/download/v1.9.5/mc-image-helper-1.9.5.zip,/packs/testing.zip
|
GENERIC_PACKS: https://github.com/itzg/mc-image-helper/releases/download/v1.9.5/mc-image-helper-1.9.5.zip,/packs/testing.zip
|
||||||
DEBUG: "true"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./packs:/packs
|
- ./packs:/packs
|
||||||
- data:/data
|
- data:/data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data: {}
|
data: {}
|
||||||
@@ -1,22 +1,56 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# go to script root directory
|
||||||
cd "$(dirname "$0")" || exit 1
|
cd "$(dirname "$0")" || exit 1
|
||||||
|
|
||||||
failed=false
|
# compose down function for reuse
|
||||||
|
|
||||||
down() {
|
down() {
|
||||||
docker-compose down -v
|
docker-compose down -v --remove-orphans
|
||||||
}
|
}
|
||||||
|
|
||||||
docker-compose run monitor || failed=true
|
fullMinecraftUpTest(){
|
||||||
echo "
|
name=$1
|
||||||
Result: failed=$failed"
|
failed=false
|
||||||
|
# run the monitor to validate the Minecraft image is healthy
|
||||||
|
docker-compose run monitor || failed=true
|
||||||
|
echo "${name} Result: failed=$failed"
|
||||||
|
|
||||||
if $failed; then
|
# docker-compose logs outputs messages from the specified container
|
||||||
docker-compose logs mc
|
if $failed; then
|
||||||
|
docker-compose logs mc
|
||||||
|
down
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
down
|
down
|
||||||
exit 1
|
}
|
||||||
else
|
|
||||||
down
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
setupOnlyMinecraftTest(){
|
||||||
|
folder=$1
|
||||||
|
failed=false
|
||||||
|
# run the monitor to validate the Minecraft image is healthy
|
||||||
|
docker-compose --log-level ERROR up --quiet-pull --exit-code-from mc 2>/dev/null || failed=true
|
||||||
|
echo "${folder} Result: failed=$failed"
|
||||||
|
|
||||||
|
# docker-compose logs outputs messages from the specified container
|
||||||
|
if $failed; then
|
||||||
|
docker-compose logs mc
|
||||||
|
down
|
||||||
|
cd ..
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
down
|
||||||
|
cd ..
|
||||||
|
}
|
||||||
|
|
||||||
|
# run tests on base docker compose and validate mc service with monitor
|
||||||
|
fullMinecraftUpTest 'Full Vanilla Test'
|
||||||
|
|
||||||
|
# go through each folder to test builds
|
||||||
|
FOLDERS=$(ls)
|
||||||
|
for folder in $FOLDERS; do
|
||||||
|
# If folder is a directory
|
||||||
|
if [ -d "$folder" ]; then
|
||||||
|
cd "$folder"
|
||||||
|
setupOnlyMinecraftTest $folder
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|||||||
14
tests/vanillatweaks_file/docker-compose.yml
Normal file
14
tests/vanillatweaks_file/docker-compose.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
restart: "no"
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
VANILLATWEAKS_FILE: /config/vanillatweaks-datapacks.json
|
||||||
|
REMOVE_OLD_VANILLATWEAKS: "TRUE"
|
||||||
|
volumes:
|
||||||
|
- ./vanillatweaks-datapacks.json:/config/vanillatweaks-datapacks.json:ro
|
||||||
17
tests/vanillatweaks_file/vanillatweaks-datapacks.json
Normal file
17
tests/vanillatweaks_file/vanillatweaks-datapacks.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"type": "datapacks",
|
||||||
|
"version": "1.18",
|
||||||
|
"packs": {
|
||||||
|
"survival": [
|
||||||
|
"graves",
|
||||||
|
"multiplayer sleep",
|
||||||
|
"afk display",
|
||||||
|
"armor statues",
|
||||||
|
"unlock all recipes",
|
||||||
|
"fast leaf decay",
|
||||||
|
"coordinates hud"
|
||||||
|
],
|
||||||
|
"items": ["armored elytra"]
|
||||||
|
},
|
||||||
|
"result": "ok"
|
||||||
|
}
|
||||||
12
tests/vanillatweaks_sharecode/docker-compose.yml
Normal file
12
tests/vanillatweaks_sharecode/docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mc:
|
||||||
|
restart: "no"
|
||||||
|
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
SETUP_ONLY: "TRUE"
|
||||||
|
VERSION: ${MINECRAFT_VERSION:-LATEST}
|
||||||
|
VANILLATWEAKS_SHARECODE: MGr52E
|
||||||
|
REMOVE_OLD_VANILLATWEAKS: "TRUE"
|
||||||
Reference in New Issue
Block a user