mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
284 Commits
2021.6.0-j
...
2021.17.0-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61b0eff4ca | ||
|
|
5018298c81 | ||
|
|
37b81aa0be | ||
|
|
6a3a0465a4 | ||
|
|
34d67d6018 | ||
|
|
9c4403d7ff | ||
|
|
8c5f0a53bf | ||
|
|
3c0566cb87 | ||
|
|
fffeb7bb9c | ||
|
|
4357066cdf | ||
|
|
67ca9a7fc4 | ||
|
|
9c9c295a79 | ||
|
|
daa3292000 | ||
|
|
2da5e2b2ec | ||
|
|
c5119ad27b | ||
|
|
4808507da8 | ||
|
|
a060cc88d1 | ||
|
|
11a286fe26 | ||
|
|
4421aaa22d | ||
|
|
ca80b4730f | ||
|
|
3a51db6d24 | ||
|
|
80a8ce8a46 | ||
|
|
969a23ae27 | ||
|
|
d804323cab | ||
|
|
1a62592fe2 | ||
|
|
cbaef446ac | ||
|
|
c316dbb5d2 | ||
|
|
8aa1312ae2 | ||
|
|
bb64135c9b | ||
|
|
7ec09fcfe9 | ||
|
|
ef98de154c | ||
|
|
c090095e08 | ||
|
|
f24bc00eb9 | ||
|
|
3d00077ef8 | ||
|
|
f91ee5d245 | ||
|
|
0d3ab75683 | ||
|
|
dd6700e659 | ||
|
|
87681e64bb | ||
|
|
ca8a27babe | ||
|
|
8ce986d3d7 | ||
|
|
19cc894662 | ||
|
|
15320f0eb2 | ||
|
|
67fda61de4 | ||
|
|
af758af51a | ||
|
|
9d231801da | ||
|
|
7c6ec41822 | ||
|
|
33c2154a98 | ||
|
|
f890b316da | ||
|
|
93af2025a2 | ||
|
|
2e4cf0b731 | ||
|
|
f5a319b0b3 | ||
|
|
2533d2c694 | ||
|
|
b1fed81821 | ||
|
|
0064c0357f | ||
|
|
20cd8cce1d | ||
|
|
bc8af2784f | ||
|
|
e300810a16 | ||
|
|
33b48a8a4b | ||
|
|
6f2f1174e6 | ||
|
|
adbe75ae7e | ||
|
|
dae2add713 | ||
|
|
38946fd294 | ||
|
|
c1b040af77 | ||
|
|
047ef107ae | ||
|
|
1bb2f92f5b | ||
|
|
727a1f29d1 | ||
|
|
012bd3a307 | ||
|
|
ae5b19b0aa | ||
|
|
81d9c55eee | ||
|
|
4148325787 | ||
|
|
90cfe0e151 | ||
|
|
491800280c | ||
|
|
d60c2e0815 | ||
|
|
fb0babe261 | ||
|
|
e6bc8abdc1 | ||
|
|
7083cd15e8 | ||
|
|
fbee644b4e | ||
|
|
aaf327b308 | ||
|
|
d404e0f50e | ||
|
|
c5bb83c6d0 | ||
|
|
7418dab476 | ||
|
|
8bf3b64831 | ||
|
|
94bbc8e649 | ||
|
|
9ff04f8637 | ||
|
|
dd7953ab4c | ||
|
|
23fde3387a | ||
|
|
3e5e62229a | ||
|
|
ecbdb2b18d | ||
|
|
fe2a9d56ed | ||
|
|
373921777a | ||
|
|
2f489b04ae | ||
|
|
a2c393ccc5 | ||
|
|
73a11c91d2 | ||
|
|
8673f919fd | ||
|
|
1e32161652 | ||
|
|
38eb769c1b | ||
|
|
5e372ed9f4 | ||
|
|
e027a81317 | ||
|
|
0a51713bd7 | ||
|
|
d5cde03db1 | ||
|
|
27571999b2 | ||
|
|
449f2bfa09 | ||
|
|
bbd7d9e39a | ||
|
|
c9815e2ccb | ||
|
|
9bd6bc64b0 | ||
|
|
a5fe016854 | ||
|
|
93cd299c77 | ||
|
|
e8f8d8b4d4 | ||
|
|
b806ea6871 | ||
|
|
cb17180dea | ||
|
|
78ec4ba2a7 | ||
|
|
317104de30 | ||
|
|
63412975c3 | ||
|
|
9c87f8749d | ||
|
|
5fc36516f4 | ||
|
|
c608c8a57e | ||
|
|
853a9884d7 | ||
|
|
ecafaf4ea1 | ||
|
|
eb490e92c3 | ||
|
|
98c7e43927 | ||
|
|
d8786d4785 | ||
|
|
ef6f308229 | ||
|
|
02181021ce | ||
|
|
49d89d3e73 | ||
|
|
fa60f8c16e | ||
|
|
3084a2f409 | ||
|
|
f473cfc6f2 | ||
|
|
8a34aa5c45 | ||
|
|
74203b23f4 | ||
|
|
cc204c297f | ||
|
|
bb210ff59e | ||
|
|
4fb791b490 | ||
|
|
671e84bec9 | ||
|
|
fc2ba2df32 | ||
|
|
e5bee8e79b | ||
|
|
1b13ddcf32 | ||
|
|
de707049d4 | ||
|
|
e95ae2dbbb | ||
|
|
4606c27cdc | ||
|
|
ba88bf72ce | ||
|
|
75967cec02 | ||
|
|
0a35f661bd | ||
|
|
f141806fb4 | ||
|
|
d80f40075c | ||
|
|
44dbe80096 | ||
|
|
c7546ef08a | ||
|
|
6fe5bb4aa8 | ||
|
|
589a9aa3db | ||
|
|
2c8d1a9255 | ||
|
|
a8c11c0cdb | ||
|
|
34ae93f379 | ||
|
|
bd57d291c1 | ||
|
|
7310daf51d | ||
|
|
78d9d888db | ||
|
|
ced25ad50a | ||
|
|
bccdc7f5e8 | ||
|
|
3854526389 | ||
|
|
74072847ca | ||
|
|
c5857bfc0b | ||
|
|
8b380894f9 | ||
|
|
b090737162 | ||
|
|
476abc9dad | ||
|
|
a2cbf07b6d | ||
|
|
2a67344b93 | ||
|
|
48efc224ba | ||
|
|
9ecb617d2e | ||
|
|
9381776345 | ||
|
|
5a47bb11ba | ||
|
|
467c1d9954 | ||
|
|
4be4fc4808 | ||
|
|
d939be28e6 | ||
|
|
bb8c7756c7 | ||
|
|
9ced230f55 | ||
|
|
3261fbd7e9 | ||
|
|
7164d2b885 | ||
|
|
185fccf712 | ||
|
|
0c860ade12 | ||
|
|
f3a8276362 | ||
|
|
cfb2739cd9 | ||
|
|
b1bb3f38f3 | ||
|
|
0f0017b02d | ||
|
|
a99f7a494b | ||
|
|
b91d63716e | ||
|
|
65b3997e72 | ||
|
|
5e8f947ce5 | ||
|
|
3e9308d315 | ||
|
|
46cccfd531 | ||
|
|
5f48a4e5e5 | ||
|
|
9fe1cb4a0d | ||
|
|
e593ca4bda | ||
|
|
b731eaaffb | ||
|
|
076038b470 | ||
|
|
75f5a430e4 | ||
|
|
e0c721585e | ||
|
|
da21c2e0a7 | ||
|
|
2b989e4c39 | ||
|
|
7d6c80b941 | ||
|
|
a3039eea12 | ||
|
|
cbf9577a24 | ||
|
|
aa416729ea | ||
|
|
70ea32e89d | ||
|
|
10a3037ab3 | ||
|
|
9ccfca5061 | ||
|
|
812c6365ec | ||
|
|
52cbf1fb64 | ||
|
|
190e401452 | ||
|
|
b881a27c8d | ||
|
|
6fab527eed | ||
|
|
9690832247 | ||
|
|
42a5131b19 | ||
|
|
60a68963a8 | ||
|
|
624f6a210f | ||
|
|
e5948081a7 | ||
|
|
7aa47e2a60 | ||
|
|
327538a98f | ||
|
|
f6c71e27d8 | ||
|
|
4628da7ea2 | ||
|
|
02ba96c421 | ||
|
|
87f6fe6b20 | ||
|
|
8049bd5b80 | ||
|
|
5225ba06c8 | ||
|
|
d695fc3fbc | ||
|
|
a2132292ac | ||
|
|
c31b191b96 | ||
|
|
c4b573f608 | ||
|
|
28810fcba3 | ||
|
|
8d1989a595 | ||
|
|
d022956e24 | ||
|
|
2bdaa4dc4e | ||
|
|
46bfbaada1 | ||
|
|
e659343821 | ||
|
|
44138564b0 | ||
|
|
3c77abbbab | ||
|
|
209c6e6dab | ||
|
|
6fa827e9a1 | ||
|
|
cd3ea7fd2e | ||
|
|
d3bd697cb2 | ||
|
|
6c6bf030c5 | ||
|
|
6e2b3ae0c7 | ||
|
|
9915929340 | ||
|
|
298bf5fb0a | ||
|
|
6ae431b2f0 | ||
|
|
1c63cd18b7 | ||
|
|
44769b6001 | ||
|
|
ebabfeb669 | ||
|
|
6266a7e3cc | ||
|
|
5c1f176848 | ||
|
|
4186cfd91c | ||
|
|
457e9b53c7 | ||
|
|
21572d3547 | ||
|
|
89afba7437 | ||
|
|
f397dd71a9 | ||
|
|
02e0a47a52 | ||
|
|
b176be942d | ||
|
|
60809fe5ad | ||
|
|
51c5902db0 | ||
|
|
4a8e416fe1 | ||
|
|
090e624ebc | ||
|
|
ce4efd0b70 | ||
|
|
c8dc751b82 | ||
|
|
7c862df92a | ||
|
|
e49c1c2f01 | ||
|
|
57390b02ca | ||
|
|
a698248dff | ||
|
|
b8ef6eba3f | ||
|
|
cc5fe0859a | ||
|
|
8f15aac6fc | ||
|
|
84ce3b4b47 | ||
|
|
b07c43a32f | ||
|
|
ce1b337f7f | ||
|
|
ee8e1b9322 | ||
|
|
20bd5c4c36 | ||
|
|
de082d0fb2 | ||
|
|
3cc5cdbc06 | ||
|
|
b69ec47b18 | ||
|
|
51fc8e824d | ||
|
|
aff9031284 | ||
|
|
397d080da2 | ||
|
|
cb5d052829 | ||
|
|
0908d21bed | ||
|
|
4d878985d4 | ||
|
|
72d7d4a65e | ||
|
|
cb0add3b90 | ||
|
|
71a48ce10f |
7
.github/dependabot.yml
vendored
Normal file
7
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
85
.github/workflows/build-multiarch.yml
vendored
85
.github/workflows/build-multiarch.yml
vendored
@@ -2,56 +2,58 @@ name: Build and publish multiarch
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- multiarch
|
||||
- java8-multiarch
|
||||
- multiarch-latest
|
||||
- java15
|
||||
- master
|
||||
- "*-multiarch"
|
||||
- "multiarch*"
|
||||
- java8-openj9
|
||||
- java11*
|
||||
- java16*
|
||||
- test/multiarch/*
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch-latest"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java15"
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-multiarch*"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-*multiarch"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java8-openj9"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java11*"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java16*"
|
||||
paths-ignore:
|
||||
- "*.md"
|
||||
- "docs/**"
|
||||
- "examples/**"
|
||||
|
||||
jobs:
|
||||
docker-buildx:
|
||||
if: github.repository == 'itzg/docker-minecraft-server'
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.2.0
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=itzg/minecraft-server
|
||||
VERSION=edge
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
fi
|
||||
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/heads/}
|
||||
if [[ $VERSION == master ]]; then
|
||||
VERSION=latest
|
||||
fi
|
||||
fi
|
||||
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
echo ::set-output name=cache_from::${TAGS}
|
||||
echo ::set-output name=version::${VERSION//\//-}
|
||||
echo ::set-output name=cache_version::${VERSION//\//-}
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: |
|
||||
itzg/minecraft-server
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
flavor: |
|
||||
latest=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v2.1.6
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v1.2.0
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
@@ -61,22 +63,25 @@ jobs:
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v2.6.1
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
# ensure latest base image is used
|
||||
pull: true
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
labels: |
|
||||
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.source=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||
org.opencontainers.image.revision=${{ github.sha }}
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
- # Temp fix
|
||||
# https://github.com/docker/build-push-action/issues/252
|
||||
# https://github.com/moby/buildkit/issues/1896
|
||||
name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
21
.github/workflows/generate-toc.yml
vendored
Normal file
21
.github/workflows/generate-toc.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Generate README table of contents
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- README.md
|
||||
jobs:
|
||||
generate:
|
||||
if: github.repository == 'itzg/docker-minecraft-server'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- run: |
|
||||
curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
|
||||
chmod a+x gh-md-toc
|
||||
./gh-md-toc --insert --no-backup README.md
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4.11.0
|
||||
with:
|
||||
commit_message: "docs: Auto update markdown TOC"
|
||||
25
.github/workflows/main.yml
vendored
25
.github/workflows/main.yml
vendored
@@ -3,14 +3,12 @@ name: Build and Publish
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- java8
|
||||
- openj9
|
||||
- openj9-11
|
||||
- adopt11
|
||||
- test/*
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-java8"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9"
|
||||
- "[0-9]+.[0-9]+.[0-9]+-openj9-11"
|
||||
@@ -22,7 +20,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -33,7 +31,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Prepare
|
||||
id: prep
|
||||
@@ -51,20 +49,17 @@ jobs:
|
||||
fi
|
||||
TAGS="${DOCKER_IMAGE}:${VERSION//\//-}"
|
||||
echo ::set-output name=tags::${TAGS}
|
||||
echo ::set-output name=cache_from::${TAGS}
|
||||
echo ::set-output name=version::${VERSION//\//-}
|
||||
echo ::set-output name=cache_version::${VERSION//\//-}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v2.1.6
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-${{ github.sha }}
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-${{ steps.prep.outputs.cache_version }}-
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Login to DockerHub
|
||||
@@ -75,7 +70,7 @@ jobs:
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v2.6.1
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
@@ -86,7 +81,7 @@ jobs:
|
||||
# tags determined by prep step
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||
labels: |
|
||||
org.opencontainers.image.documentation=https://github.com/itzg/docker-minecraft-server
|
||||
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
|
||||
@@ -95,3 +90,11 @@ jobs:
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
|
||||
- # Temp fix
|
||||
# https://github.com/docker/build-push-action/issues/252
|
||||
# https://github.com/moby/buildkit/issues/1896
|
||||
name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
2
.github/workflows/pr.yml
vendored
2
.github/workflows/pr.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/data/
|
||||
/.idea/
|
||||
*.iml
|
||||
*.iml
|
||||
/gh-md-toc
|
||||
@@ -1,16 +1,16 @@
|
||||
FROM ubuntu:18.04
|
||||
FROM adoptopenjdk:8-jre-hotspot
|
||||
|
||||
LABEL org.opencontainers.image.authors="Geoff Bourne <itzgeoff@gmail.com>"
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get install -y \
|
||||
openjdk-8-jre-headless \
|
||||
imagemagick \
|
||||
gosu \
|
||||
sudo \
|
||||
net-tools \
|
||||
curl wget \
|
||||
git \
|
||||
jq \
|
||||
dos2unix \
|
||||
mysql-client \
|
||||
@@ -48,7 +48,7 @@ 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
|
||||
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=0.1.7 --var app=mc-monitor --file {{.app}} \
|
||||
--var version=0.7.1 --var app=mc-monitor --file {{.app}} \
|
||||
--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} \
|
||||
@@ -66,6 +66,8 @@ COPY server.properties /tmp/server.properties
|
||||
COPY log4j2.xml /tmp/log4j2.xml
|
||||
WORKDIR /data
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENV UID=1000 GID=1000 \
|
||||
MEMORY="1G" \
|
||||
TYPE=VANILLA VERSION=LATEST \
|
||||
@@ -82,5 +84,6 @@ RUN dos2unix /start* && chmod +x /start*
|
||||
RUN dos2unix /health.sh && chmod +x /health.sh
|
||||
RUN dos2unix /autopause/* && chmod +x /autopause/*.sh
|
||||
|
||||
|
||||
ENTRYPOINT [ "/start" ]
|
||||
HEALTHCHECK --start-period=1m CMD /health.sh
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
#!/bin/bash
|
||||
#set -x
|
||||
# Use this variable to indicate a list of branches that docker hub is watching
|
||||
branches_list=('java8' 'java8-multiarch' 'openj9' 'openj9-11' 'adopt11' 'java15' 'multiarch' 'multiarch-latest')
|
||||
branches_list=(
|
||||
'java8'
|
||||
'java8-multiarch'
|
||||
'java8-openj9'
|
||||
'java11'
|
||||
'java11-openj9'
|
||||
'java16'
|
||||
'java16-openj9'
|
||||
'multiarch-latest'
|
||||
)
|
||||
|
||||
function TrapExit {
|
||||
echo "Checking out back in master"
|
||||
|
||||
BIN
docs/level-vs-world.drawio.png
Normal file
BIN
docs/level-vs-world.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/world-copy-compose-project.drawio.png
Normal file
BIN
docs/world-copy-compose-project.drawio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
minecraft:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3.2'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
15
examples/docker-compose-fabric.yml
Normal file
15
examples/docker-compose-fabric.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
image: ${IMAGE:-itzg/minecraft-server}
|
||||
environment:
|
||||
EULA: "true"
|
||||
TYPE: FABRIC
|
||||
ports:
|
||||
- 25565:25565
|
||||
volumes:
|
||||
- fabric:/data
|
||||
|
||||
volumes:
|
||||
fabric: {}
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3.7"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3.7"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3.7'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
@@ -9,4 +9,4 @@ services:
|
||||
EULA: "TRUE"
|
||||
volumes:
|
||||
# attach the relative directory 'data' to the container's /data path
|
||||
./data:/data
|
||||
- ./data:/data
|
||||
|
||||
17
examples/docker-compose-spiget.yml
Normal file
17
examples/docker-compose-spiget.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
mc:
|
||||
# Only using IMAGE variable to allow for local testing
|
||||
image: ${IMAGE:-itzg/minecraft-server}
|
||||
ports:
|
||||
- 25565:25565
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
TYPE: SPIGOT
|
||||
SPIGET_RESOURCES: 9089,34315,3836
|
||||
volumes:
|
||||
- data:/data
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: '3.8'
|
||||
# Forge with Sponge API support. THIS REQUIRES DOWNLOADING SPONGEFORGE.
|
||||
# Place the SpongeForge jar file in /data/mods. Other Forge mods go here as well.
|
||||
# Place Sponge mods in /data/mods/plugins. Yes, this is a directory inside the Forge mod directory. Do NOT use /data/plugins.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: "3.7"
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
mc:
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Place server [modpacks downloaded from CurseForge](https://www.curseforge.com/minecraft/modpacks) in this directory.
|
||||
|
||||
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/2787018>.
|
||||
The example [`docker-compose-curseforge.yml`](../docker-compose-curseforge.yml) references a modpack downloaded from <https://www.curseforge.com/minecraft/modpacks/skyfactory-4/files/3012800>.
|
||||
|
||||
2
start
2
start
@@ -5,7 +5,7 @@
|
||||
umask 0002
|
||||
chmod g+w /data
|
||||
|
||||
if [ $(id -u) = 0 ]; then
|
||||
if ! isTrue "${SKIP_SUDO:-false}" && [ $(id -u) = 0 ]; then
|
||||
runAsUser=minecraft
|
||||
runAsGroup=minecraft
|
||||
|
||||
|
||||
@@ -54,6 +54,11 @@ if [[ $RCON_PASSWORD_FILE ]]; then
|
||||
log ""
|
||||
fi
|
||||
|
||||
if ! which java > /dev/null; then
|
||||
log "Fixing PATH to include java"
|
||||
PATH="${PATH}:/opt/java/openjdk/bin"
|
||||
fi
|
||||
|
||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||
|
||||
case "X$VERSION" in
|
||||
@@ -104,7 +109,7 @@ case "${TYPE^^}" in
|
||||
exec ${SCRIPTS:-/}start-deployFTBA "$@"
|
||||
;;
|
||||
|
||||
CURSEFORGE|FTB)
|
||||
FTB|CURSEFORGE)
|
||||
exec ${SCRIPTS:-/}start-deployCF "$@"
|
||||
;;
|
||||
|
||||
@@ -144,11 +149,19 @@ case "${TYPE^^}" in
|
||||
exec ${SCRIPTS:-/}start-deployYatopia "$@"
|
||||
;;
|
||||
|
||||
AIRPLANE)
|
||||
exec ${SCRIPTS:-/}start-deployAirplane "$@"
|
||||
;;
|
||||
|
||||
CANYON)
|
||||
exec ${SCRIPTS:-/}start-deployCanyon "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Invalid type: '$TYPE'"
|
||||
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTBA (multiarch-only),"
|
||||
log " CURSE_INSTANCE, CURSEFORGE, SPONGEVANILLA, TUINITY, PURPUR"
|
||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA"
|
||||
log " CUSTOM, MAGMA, MOHIST, CATSERVER, YATOPIA, AIRPLANE, CANYON"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
|
||||
49
start-deployAirplane
Normal file
49
start-deployAirplane
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
if [ "${VERSION}" != "LATEST" ] && [ "${VERSION}" != "1.16" ] && [ "${VERSION}" != "1.17" ] && [ "${VERSION}" != "PURPUR" ] && [ "${VERSION}" != "PURPUR-1.16" ] ; then
|
||||
log "ERROR: Airplane server type only supports VERSION=LATEST, VERSION=1.17, VERSION=1.16, VERSION=PURPUR or VERSION=PURPUR-1.16. Note that these are branches, not #.#.# versions."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
: ${AIRPLANE_BUILD:=lastSuccessfulBuild}
|
||||
|
||||
if [ "${VERSION}" = "LATEST" ] || [ "${VERSION}" = "1.17" ]; then
|
||||
AIRPLANE_BRANCH="1.17"
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" = "1.16" ]; then
|
||||
AIRPLANE_BRANCH="1.16"
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" = "PURPUR" ]; then
|
||||
AIRPLANE_BRANCH="Purpur-1.17"
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" = "PURPUR-1.16" ]; then
|
||||
AIRPLANE_BRANCH="Purpur-1.16"
|
||||
fi
|
||||
|
||||
log "Using Airplane-${AIRPLANE_BRANCH} branch"
|
||||
|
||||
export SERVER=airplane-${AIRPLANE_BRANCH}-${AIRPLANE_BUILD}.jar
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
|
||||
downloadUrl="https://ci.tivy.ca/job/Airplane-${AIRPLANE_BRANCH}/${AIRPLANE_BUILD}/artifact/launcher-airplane.jar"
|
||||
log "Downloading Airplane from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
@@ -64,7 +64,11 @@ function downloadSpigot {
|
||||
fi
|
||||
|
||||
if [[ -z $downloadUrl ]]; then
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
if versionLessThan 1.16.5; then
|
||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
else
|
||||
downloadUrl="https://download.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||
fi
|
||||
fi
|
||||
|
||||
setServerVar
|
||||
@@ -82,7 +86,9 @@ function downloadSpigot {
|
||||
|
||||
ERROR: failed to download from $downloadUrl
|
||||
Visit https://getbukkit.org/download/${getbukkitFlavor} to lookup the
|
||||
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-LATEST
|
||||
exact version, such as 1.4.6-R0.4-SNAPSHOT or 1.8-R0.1-SNAPSHOT-latest.
|
||||
Click into the version entry to find the **exact** version, because something
|
||||
like "1.8" is not sufficient according to their download naming.
|
||||
|
||||
EOF
|
||||
|
||||
@@ -123,5 +129,4 @@ fi
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
|
||||
@@ -3,6 +3,24 @@
|
||||
set -e
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
loadForgeVars() {
|
||||
cfgFile=${1?}
|
||||
pat='^([^#;][^=]+)=[:space:]*([^;]*)'
|
||||
while read -r line || [[ -n "$line" ]] ; do
|
||||
if [[ $line =~ $pat ]]; then
|
||||
#echo "MATCHED $line"
|
||||
k=${BASH_REMATCH[1]}
|
||||
v=${BASH_REMATCH[2]}
|
||||
case $k in
|
||||
FORGEURL)
|
||||
forgeInstallerUrl="$v"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done < "$cfgFile"
|
||||
}
|
||||
|
||||
isDebugging && set -x
|
||||
|
||||
: ${FTB_BASE_DIR:=${CF_BASE_DIR:-/data/FeedTheBeast}}
|
||||
@@ -42,23 +60,39 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o "${FTB_SERVER_MOD}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
|
||||
serverJar=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -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 [[ -z "$serverJar" ]]; then
|
||||
forgeInstallerJar=$(find ${FTB_BASE_DIR} -name "forge*installer.jar")
|
||||
|
||||
if [ -f "${FTB_BASE_DIR}/settings.cfg" ]; then
|
||||
loadForgeVars "${FTB_BASE_DIR}/settings.cfg"
|
||||
|
||||
if [[ $forgeInstallerUrl ]]; then
|
||||
forgeInstallerJar="${FTB_BASE_DIR}/forge-installer.jar"
|
||||
if ! curl -fsSL -o "$forgeInstallerJar" "$forgeInstallerUrl" ; then
|
||||
log "ERROR failed to download Forge installer from $forgeInstallerUrl"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
else
|
||||
forgeInstallerJar=$(find "${FTB_BASE_DIR}" -name "forge*installer.jar")
|
||||
fi
|
||||
|
||||
if [[ -z "${forgeInstallerJar}" ]]; then
|
||||
log "ERROR Unable to find forge installer in modpack."
|
||||
log "ERROR Unable to find forge installer in modpack"
|
||||
log " or download using modpack config."
|
||||
log " Make sure you downloaded the server files."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
log "Installing forge server"
|
||||
(cd $(dirname "${forgeInstallerJar}"); java -jar $(basename "${forgeInstallerJar}") --installServer) | awk '{printf "."} END {print ""}'
|
||||
dirOfInstaller=$(dirname "${forgeInstallerJar}")
|
||||
(cd "${dirOfInstaller}"; java -jar $(basename "${forgeInstallerJar}") --installServer)
|
||||
fi
|
||||
|
||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||
fi
|
||||
|
||||
export SERVER=$(find ${FTB_BASE_DIR} -path "*/libraries/*" -prune -type f -o -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
export SERVER=$(find ${FTB_BASE_DIR} -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -maxdepth 2 -print)
|
||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||
log "ERROR unable to locate installed forge server jar"
|
||||
isDebugging && find ${FTB_BASE_DIR} -name "forge*.jar"
|
||||
@@ -76,6 +110,7 @@ entryScriptExpr="
|
||||
-o -name ServerStartLinux.sh
|
||||
-o -name LaunchServer.sh
|
||||
-o -name server-start.sh
|
||||
-o -name start-server.sh
|
||||
-o -name startserver.sh
|
||||
-o -name StartServer.sh
|
||||
"
|
||||
@@ -134,13 +169,23 @@ if [[ $startScriptCount = 0 ]]; then
|
||||
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o "${srv_modpack}" -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
|
||||
installScript=$(find "${FTB_BASE_DIR}" -maxdepth 2 -type f -name install.sh)
|
||||
if [[ "$installScript" ]]; then
|
||||
(
|
||||
cd "$(dirname "${installScript}")"
|
||||
chmod +x ./install.sh
|
||||
log "Running included install.sh"
|
||||
./install.sh
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
||||
|
||||
# Allow up to 2 levels since some modpacks have a top-level directory named
|
||||
# for the modpack
|
||||
forgeJar=$(find ${FTB_BASE_DIR} -maxdepth 2 -name 'forge*.jar' -a -not -name 'forge*installer')
|
||||
forgeJar=$(find ${FTB_BASE_DIR} -type f \( -path "/libraries/*" -o -path "/mods/*" \) -prune -o -name "forge*.jar" -not -name "forge*installer.jar" -maxdepth 2 -print)
|
||||
if [[ "$forgeJar" ]]; then
|
||||
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||
log "No entry script found, so building one for ${forgeJar}"
|
||||
|
||||
54
start-deployCanyon
Normal file
54
start-deployCanyon
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
: ${CANYON_BUILD:=lastSuccessfulBuild}
|
||||
JAVA_VER=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)
|
||||
|
||||
if [ "${JAVA_VER}" != "8" ]; then
|
||||
log "ERROR: Canyon server type only supports Java version 8"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${VERSION}" != "b1.7.3" ]; then
|
||||
log "ERROR: Canyon server type only supports VERSION=b1.7.3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
canyonJob="https://ci.velocitypowered.com/job/Canyon"
|
||||
|
||||
buildRelPath=$(
|
||||
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||
jq -r '.artifacts[0].relativePath'
|
||||
)
|
||||
buildNumber=$(
|
||||
curl -fsSL "${canyonJob}/${CANYON_BUILD}/api/json" |
|
||||
jq -r '.number'
|
||||
)
|
||||
baseName=$(basename "${buildRelPath}")
|
||||
|
||||
# Add build tag to non-tagged builds for version detection
|
||||
if [ ${baseName%.*} = 'canyon-server' ]; then
|
||||
export SERVER=${baseName%.*}_build${buildNumber}.jar
|
||||
else
|
||||
export SERVER="${baseName}"
|
||||
fi
|
||||
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
downloadUrl="${canyonJob}/${CANYON_BUILD}/artifact/${buildRelPath}"
|
||||
log "Downloading Canyon build ${buildNumber} from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Normalize on Spigot for later operations
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
if isURL ${CUSTOM_SERVER}; then
|
||||
filename=$(basename ${CUSTOM_SERVER})
|
||||
|
||||
@@ -52,12 +52,14 @@ fi
|
||||
|
||||
isDebugging && cat version.json
|
||||
forgeVersion=$(jq -r '.targets|unique[] | select(.name == "forge") | .version' version.json)
|
||||
fabricVersion=$(jq -r '.targets|unique[] | select(.name == "fabric") | .version' version.json)
|
||||
mcVersion=$(jq -r '.targets|unique[] | select(.name == "minecraft") | .version' version.json)
|
||||
|
||||
variants=(
|
||||
forge-${mcVersion}-${forgeVersion}.jar
|
||||
forge-${mcVersion}-${forgeVersion}-universal.jar
|
||||
forge-${mcVersion}-${forgeVersion}-${mcVersion}-universal.jar
|
||||
fabric-${mcVersion}-${fabricVersion}-server-launch.jar
|
||||
)
|
||||
for f in ${variants[@]}; do
|
||||
if [ -f $f ]; then
|
||||
@@ -66,7 +68,7 @@ for f in ${variants[@]}; do
|
||||
fi
|
||||
done
|
||||
if ! [ -v SERVER ]; then
|
||||
log "ERROR unable to locate the installed forge server jar"
|
||||
log "ERROR unable to locate the installed FTB server jar"
|
||||
ls *.jar
|
||||
exit 2
|
||||
fi
|
||||
|
||||
@@ -3,58 +3,50 @@ set -eu
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
requireVar VANILLA_VERSION
|
||||
export TYPE=FABRIC
|
||||
export SERVER=fabric-server-${VANILLA_VERSION}.jar
|
||||
|
||||
FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
||||
FABRIC_INSTALLER_VERSION=${FABRIC_INSTALLER_VERSION:-${FABRICVERSION:-LATEST}}
|
||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Checking Fabric version information."
|
||||
case $FABRIC_INSTALLER_VERSION in
|
||||
LATEST)
|
||||
isDebugging && set -x
|
||||
|
||||
if [[ ! -e ${SERVER} ]]; then
|
||||
|
||||
: ${FABRIC_INSTALLER:=}
|
||||
: ${FABRIC_INSTALLER_URL:=}
|
||||
: ${FABRIC_INSTALLER_VERSION:=${FABRICVERSION:-LATEST}}
|
||||
|
||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Checking Fabric version information."
|
||||
if [[ ${FABRIC_INSTALLER_VERSION^^} = LATEST ]]; then
|
||||
FABRIC_INSTALLER_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
markerVersion=$FABRIC_INSTALLER_VERSION
|
||||
FABRIC_INSTALLER="fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
FABRIC_INSTALLER_URL="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER="fabric-installer.jar"
|
||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||
markerVersion=custom
|
||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
installMarker="/data/.fabric-installed-${VANILLA_VERSION}-${markerVersion}"
|
||||
|
||||
debug Checking for installMarker ${installMarker}
|
||||
if [[ ! -e $installMarker ]]; then
|
||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||
log "Downloading installer version $FABRIC_INSTALLER_VERSION"
|
||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/${FABRIC_INSTALLER_VERSION}/fabric-installer-${FABRIC_INSTALLER_VERSION}.jar"
|
||||
log "...trying $downloadUrl"
|
||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||
else
|
||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if isDebugging; then
|
||||
debug "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
||||
else
|
||||
log "Installing Fabric using $FABRIC_INSTALLER"
|
||||
fi
|
||||
log "Installing Fabric ${VANILLA_VERSION} using $FABRIC_INSTALLER"
|
||||
|
||||
tries=3
|
||||
set +e
|
||||
while ((--tries >= 0)); do
|
||||
java -jar $FABRIC_INSTALLER server -mcversion $VANILLA_VERSION -downloadMinecraft
|
||||
java -jar $FABRIC_INSTALLER server \
|
||||
-mcversion $VANILLA_VERSION \
|
||||
-downloadMinecraft \
|
||||
-dir /data
|
||||
if [[ $? == 0 ]]; then
|
||||
break
|
||||
fi
|
||||
@@ -64,13 +56,9 @@ if [[ ! -e $installMarker ]]; then
|
||||
log "Fabric failed to install after several tries." >&2
|
||||
exit 10
|
||||
fi
|
||||
export SERVER=fabric-server-launch.jar
|
||||
log "Using server $SERVER"
|
||||
echo $SERVER > $installMarker
|
||||
|
||||
else
|
||||
export SERVER=$(< $installMarker)
|
||||
mv fabric-server-launch.jar ${SERVER}
|
||||
fi
|
||||
|
||||
# Contineut to Final Setup
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
export TYPE=FORGE
|
||||
: ${FORGEVERSION:=RECOMMENDED}
|
||||
isDebugging && set -x
|
||||
|
||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||
norm=$VANILLA_VERSION
|
||||
@@ -45,6 +46,8 @@ elif [[ -z $FORGE_INSTALLER ]]; then
|
||||
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
||||
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
||||
exit 2
|
||||
else
|
||||
shortForgeVersion=$VANILLA_VERSION-custom
|
||||
fi
|
||||
|
||||
installMarker="/data/.forge-installed-$shortForgeVersion"
|
||||
@@ -65,7 +68,7 @@ if [ ! -e $installMarker ]; then
|
||||
log "Unable to compute URL for $normForgeVersion"
|
||||
exit 2
|
||||
fi
|
||||
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
||||
downloadUrl=https://maven.minecraftforge.net/net/minecraftforge/forge/$fn
|
||||
log "...trying $downloadUrl"
|
||||
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
||||
break
|
||||
@@ -97,7 +100,11 @@ if [ ! -e $installMarker ]; then
|
||||
log "Finding installed server jar..."
|
||||
unset -v latest
|
||||
for file in *forge*.jar; do
|
||||
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
|
||||
if ! [[ $file =~ installer ]]; then
|
||||
if [[ -z $latest ]] || [[ $file -nt $latest ]]; then
|
||||
latest=$file
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [[ -z $latest ]]; then
|
||||
log "Unable to derive server jar for Forge"
|
||||
|
||||
@@ -8,12 +8,12 @@ isDebugging && set -x
|
||||
requireVar VANILLA_VERSION
|
||||
: ${MOHIST_BUILD:=lastSuccessfulBuild}
|
||||
|
||||
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
|
||||
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
||||
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
||||
|
||||
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
|
||||
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
||||
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
@@ -26,7 +26,7 @@ buildRelPath=$(
|
||||
baseName=$(basename "${buildRelPath}")
|
||||
if [[ ${baseName} != *-server.jar* ]]; then
|
||||
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
||||
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
|
||||
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
||||
log " and set VERSION accordingly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -57,6 +57,7 @@ else
|
||||
fi
|
||||
|
||||
log "Removing old PaperMC versions ..."
|
||||
shopt -s nullglob
|
||||
for f in paper-*.jar; do
|
||||
[[ $f != $SERVER ]] && rm $f
|
||||
done
|
||||
@@ -75,5 +76,4 @@ fi
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
|
||||
@@ -10,7 +10,7 @@ isDebugging && set -x
|
||||
: ${FORCE_REDOWNLOAD:=false}
|
||||
|
||||
if [[ ${PURPUR_BUILD} == LATEST ]]; then
|
||||
PURPUR_BUILD=$(curl -fsSL "https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}" |
|
||||
PURPUR_BUILD=$(curl -fsSL "https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}" |
|
||||
jq -r '.builds.latest' || echo "")
|
||||
if [[ -z ${PURPUR_BUILD} ]]; then
|
||||
log "ERROR: Failed to locate a Purpur build for ${VANILLA_VERSION}."
|
||||
@@ -22,7 +22,7 @@ fi
|
||||
export SERVER="purpur-${VANILLA_VERSION}-${PURPUR_BUILD}.jar"
|
||||
|
||||
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
||||
downloadUrl="https://purpur.pl3x.net/api/v1/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||
downloadUrl="https://api.pl3x.net/v2/purpur/${VANILLA_VERSION}/${PURPUR_BUILD}/download"
|
||||
log "Downloading Purpur from $downloadUrl ..."
|
||||
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
@@ -34,5 +34,4 @@ fi
|
||||
export TYPE=SPIGOT
|
||||
export SKIP_LOG4J_CONFIG=true
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
|
||||
if [ "${VERSION}" != "LATEST" ]; then
|
||||
log "ERROR: Tunity server type only supports VERSION=LATEST"
|
||||
log "ERROR: Tuinity server type only supports VERSION=LATEST"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
: ${TUNITY_BUILD:=lastSuccessfulBuild}
|
||||
export SERVER=tunity-${VANILLA_VERSION}-${TUNITY_BUILD}.jar
|
||||
: ${TUINITY_BUILD:=lastSuccessfulBuild}
|
||||
export SERVER=tuinity-${VANILLA_VERSION}-${TUINITY_BUILD}.jar
|
||||
|
||||
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUNITY_BUILD}/artifact/tuinity-paperclip.jar"
|
||||
log "Downloading Tunity (build $TUNITY_BUILD) from $downloadUrl ..."
|
||||
downloadUrl="https://ci.codemc.io/job/Spottedleaf/job/Tuinity/${TUINITY_BUILD}/artifact/tuinity-paperclip.jar"
|
||||
log "Downloading Tuinity (build $TUINITY_BUILD) from $downloadUrl ..."
|
||||
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||
if [ ! -f "$SERVER" ]; then
|
||||
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||
@@ -23,5 +23,4 @@ fi
|
||||
# Normalize on Spigot for later operations
|
||||
export TYPE=SPIGOT
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
exec ${SCRIPTS:-/}start-spiget "$@"
|
||||
|
||||
@@ -6,7 +6,7 @@ IFS=$'\n\t'
|
||||
isDebugging && set -x
|
||||
|
||||
: ${VANILLA_VERSION:?}
|
||||
: ${RELEASE:=stable}
|
||||
: ${RELEASE:=latest}
|
||||
: ${FORCE_REDOWNLOAD:=false}
|
||||
|
||||
requireEnum RELEASE stable latest
|
||||
|
||||
@@ -42,7 +42,7 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then
|
||||
$dirExcludes \
|
||||
-type f \
|
||||
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||
-or -name "*.conf" -or -name "*.properties" \) \
|
||||
-or -name "*.conf" -or -name "*.properties" -or -name "*.hjson" -or -name "*.json" \) \
|
||||
$fileExcludes \
|
||||
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||
done
|
||||
|
||||
@@ -11,21 +11,9 @@ fi
|
||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||
|
||||
# Remove old mods/plugins
|
||||
if isTrue ${REMOVE_OLD_MODS}; then
|
||||
remove_mods_dest="/data/mods"
|
||||
case ${TYPE} in
|
||||
SPIGOT|BUKKIT|PAPER)
|
||||
remove_mods_dest="/data/plugins"
|
||||
;;
|
||||
esac
|
||||
|
||||
# only try to remove existing mods dir
|
||||
if [ -d "$remove_mods_dest" ]; then
|
||||
log "Removing old mods in $remove_mods_dest..."
|
||||
find $remove_mods_dest -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE}" -delete
|
||||
else
|
||||
log "Directory $remove_mods_dest does not exist; removing nothing."
|
||||
fi
|
||||
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
||||
removeOldMods /data/mods
|
||||
removeOldMods /data/plugins
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||
@@ -37,35 +25,39 @@ if [[ "$MODPACK" ]]; then
|
||||
downloadUrl=$(curl -Ls -o /dev/null -w %{effective_url} $MODPACK)
|
||||
if ! [[ $downloadUrl == *.zip ]]; then
|
||||
log "ERROR Invalid URL given for MODPACK: $downloadUrl resolved from $MODPACK"
|
||||
log " Must be HTTP or HTTPS and a ZIP file"
|
||||
log " Must be HTTP, HTTPS or FTP and a ZIP file"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
log "Downloading mod/plugin pack via HTTP"
|
||||
log "Downloading mod/plugin pack"
|
||||
log " from $downloadUrl ..."
|
||||
if ! curl -sSL -o /tmp/modpack.zip "$downloadUrl"; then
|
||||
log "ERROR: failed to download from $downloadUrl"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
elif [[ "$MODPACK" =~ .*\.zip ]]; then
|
||||
if ! cp $MODPACK /tmp/modpack.zip; then
|
||||
log "ERROR: failed to copy from $MODPACK"
|
||||
exit 2
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
|
||||
else
|
||||
log "ERROR Invalid URL given for MODPACK: $MODPACK"
|
||||
log "ERROR Invalid URL or Path given for MODPACK: $MODPACK"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
else
|
||||
mkdir -p /data/mods
|
||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||
log "ERROR: failed to unzip the modpack from $downloadUrl"
|
||||
fi
|
||||
fi
|
||||
rm -f /tmp/modpack.zip
|
||||
fi
|
||||
|
||||
# If supplied with a URL for a plugin download it.
|
||||
@@ -99,8 +91,18 @@ if [[ "$MODS" ]]; then
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
elif [[ -f "$i" && "$i" =~ .*\.jar ]]; then
|
||||
log "Copying plugin located at $i ..."
|
||||
out_file=$(basename "$i")
|
||||
if ! cp "$i" "${out_dir}/$out_file"; then
|
||||
log "ERROR: failed to copy from $i into $out_dir"
|
||||
exit 2
|
||||
fi
|
||||
elif [[ -d "$i" ]]; then
|
||||
log "Copying plugin jars from $i ..."
|
||||
cp "$i"/*.jar "${out_dir}"
|
||||
else
|
||||
log "ERROR Invalid URL given in MODS: $i"
|
||||
log "ERROR Invalid URL or path given in MODS: $i"
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -21,18 +21,20 @@ if [ -d /plugins ]; then
|
||||
fi
|
||||
|
||||
# If any modules have been provided, copy them over
|
||||
: ${COPY_MODS_DEST:="/data/mods"}
|
||||
|
||||
if [ -d /mods ]; then
|
||||
log "Copying any mods over..."
|
||||
mkdir -p /data/mods
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods /data
|
||||
mkdir -p "${COPY_MODS_DEST}"
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ "${COPY_MODS_DEST}"
|
||||
fi
|
||||
|
||||
: ${COPY_CONFIG_DEST:="/data/config"}
|
||||
|
||||
if [ -d /config ]; then
|
||||
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
||||
mkdir -p $COPY_CONFIG_DEST
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
||||
log "Copying any configs from /config to ${COPY_CONFIG_DEST}"
|
||||
mkdir -p "${COPY_CONFIG_DEST}"
|
||||
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ "${COPY_CONFIG_DEST}"
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|
||||
|
||||
@@ -19,7 +19,7 @@ function setServerProp {
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${var//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||
else
|
||||
log "Adding ${prop} with '${var}' in ${SERVER_PROPERTIES}"
|
||||
echo "${prop}=${var//\\/\\\\}" >> "$SERVER_PROPERTIES"
|
||||
echo "${prop}=${var}" >> "$SERVER_PROPERTIES"
|
||||
fi
|
||||
else
|
||||
isDebugging && log "Skip setting ${prop}"
|
||||
@@ -27,10 +27,14 @@ function setServerProp {
|
||||
}
|
||||
|
||||
function customizeServerProps {
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
if [ -n "$WHITELIST" ] || isTrue ${ENABLE_WHITELIST:-false}; then
|
||||
log "Creating whitelist"
|
||||
setServerProp "whitelist" "true"
|
||||
setServerProp "white-list" "true"
|
||||
else
|
||||
log "Disabling whitelist"
|
||||
setServerProp "whitelist" "false"
|
||||
setServerProp "white-list" "false"
|
||||
fi
|
||||
|
||||
# If not provided, generate a reasonable default message-of-the-day,
|
||||
@@ -177,8 +181,8 @@ function customizeServerProps {
|
||||
}
|
||||
|
||||
# Deploy server.properties file
|
||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||
if [[ ${TYPE} == "CURSEFORGE" ]]; then
|
||||
export SERVER_PROPERTIES="${FTB_DIR}/server.properties"
|
||||
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||
fi
|
||||
|
||||
@@ -210,7 +214,7 @@ fi
|
||||
|
||||
if isDebugging; then
|
||||
log "DEBUG Dumping server.properties"
|
||||
cat /data/server.properties
|
||||
cat "${SERVER_PROPERTIES}"
|
||||
fi
|
||||
|
||||
exec ${SCRIPTS:-/}start-finalSetupEnvVariables $@
|
||||
|
||||
@@ -7,13 +7,20 @@ isDebugging && set -x
|
||||
: ${LEVEL:=world}
|
||||
export LEVEL
|
||||
|
||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||
if [ $TYPE = "CURSEFORGE" ]; then
|
||||
worldDest=$FTB_DIR/$LEVEL
|
||||
else
|
||||
worldDest=/data/$LEVEL
|
||||
fi
|
||||
|
||||
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then
|
||||
if isTrue "${FORCE_WORLD_COPY}"; then
|
||||
log "Removing existing world data in $worldDest ${worldDest}_nether ${worldDest}_the_end"
|
||||
rm -rf "$worldDest" \
|
||||
"${worldDest}_nether" \
|
||||
"${worldDest}_the_end"
|
||||
fi
|
||||
|
||||
if isURL $WORLD; then
|
||||
curl -fsSL "$WORLD" -o /tmp/world.zip
|
||||
zipSrc=/tmp/world.zip
|
||||
@@ -59,8 +66,8 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
# Reorganise if a Spigot server
|
||||
log "Moving End and Nether maps to Spigot location"
|
||||
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
|
||||
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
|
||||
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "${worldDest}_the_end"
|
||||
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "${worldDest}_nether"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
isDebugging && set -x
|
||||
|
||||
if [ -n "$OPS" ]; then
|
||||
log "Updating ops"
|
||||
rm -f /data/ops.txt.converted
|
||||
echo $OPS | awk -v RS=, '{print}' > /data/ops.txt
|
||||
|
||||
if isTrue "${OVERRIDE_OPS}"; then
|
||||
log "Recreating ops.json file at server startup"
|
||||
rm -f /data/ops.json
|
||||
fi
|
||||
fi
|
||||
if isTrue "${OVERRIDE_OPS}"; then
|
||||
log "Recreating ops.json file at server startup"
|
||||
rm -f /data/ops.json
|
||||
fi
|
||||
|
||||
if [ -n "$WHITELIST" ]; then
|
||||
log "Updating whitelist"
|
||||
rm -f /data/white-list.txt.converted
|
||||
echo $WHITELIST | awk -v RS=, '{print}' > /data/white-list.txt
|
||||
|
||||
if isTrue "${OVERRIDE_WHITELIST}"; then
|
||||
log "Recreating whitelist.json file at server startup"
|
||||
rm -f /data/whitelist.json
|
||||
fi
|
||||
fi
|
||||
if isTrue "${OVERRIDE_WHITELIST}"; then
|
||||
log "Recreating whitelist.json file at server startup"
|
||||
rm -f /data/whitelist.json
|
||||
fi
|
||||
|
||||
if [ -n "$ICON" ]; then
|
||||
@@ -39,16 +38,16 @@ if [ -n "$ICON" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! isTrue ${SKIP_LOG4J_CONFIG}; then
|
||||
# Set up log configuration
|
||||
LOGFILE="/data/log4j2.xml"
|
||||
if [ ! -e "$LOGFILE" ]; then
|
||||
log "Creating log4j2.xml in ${LOGFILE}"
|
||||
cp /tmp/log4j2.xml "$LOGFILE"
|
||||
else
|
||||
log "log4j2.xml already created, skipping"
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||
if isTrue ${ENABLE_ROLLING_LOGS:-false}; then
|
||||
# Set up log configuration
|
||||
LOGFILE="/data/log4j2.xml"
|
||||
if [ ! -e "$LOGFILE" ]; then
|
||||
log "Creating log4j2.xml in ${LOGFILE}"
|
||||
cp /tmp/log4j2.xml "$LOGFILE"
|
||||
else
|
||||
log "log4j2.xml already created, skipping"
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||
@@ -61,15 +60,14 @@ for j in $JSON_FILES; do
|
||||
fi
|
||||
done
|
||||
|
||||
EXTRA_ARGS=""
|
||||
# Optional disable console
|
||||
if versionLessThan 1.14 && [[ ${CONSOLE,,} = false ]]; then
|
||||
EXTRA_ARGS+="--noconsole"
|
||||
EXTRA_ARGS+=" --noconsole"
|
||||
fi
|
||||
|
||||
# Optional disable GUI for headless servers
|
||||
if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
||||
EXTRA_ARGS="${EXTRA_ARGS} nogui"
|
||||
EXTRA_ARGS+=" nogui"
|
||||
fi
|
||||
|
||||
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||
@@ -146,6 +144,13 @@ if isTrue "${USE_LARGE_PAGES}"; then
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${USE_FLARE_FLAGS}"; then
|
||||
JVM_XX_OPTS="${JVM_XX_OPTS}
|
||||
-XX:+UnlockDiagnosticVMOptions
|
||||
-XX:+DebugNonSafepoints
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
@@ -167,11 +172,6 @@ function copyFilesForCurseForge() {
|
||||
cp -f /data/eula.txt "${FTB_DIR}/"
|
||||
}
|
||||
|
||||
if ! which java > /dev/null; then
|
||||
log "Fixing PATH to include java"
|
||||
PATH="${PATH}:/usr/bin"
|
||||
fi
|
||||
|
||||
mcServerRunnerArgs="--stop-duration ${STOP_DURATION:-60}s"
|
||||
if [[ ${TYPE} == "CURSE_INSTANCE" ]]; then
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
@@ -207,10 +207,24 @@ EOF
|
||||
|
||||
cd "${FTB_DIR}"
|
||||
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||
|
||||
finalArgs=(
|
||||
"${FTB_SERVER_START}"
|
||||
)
|
||||
|
||||
if isTrue ${SETUP_ONLY:=false}; then
|
||||
echo "SETUP_ONLY: ${finalArgs[@]}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${mcServerRunnerArgs} "${FTB_SERVER_START}"
|
||||
if isTrue ${EXEC_DIRECTLY:-false}; then
|
||||
"${finalArgs[@]}"
|
||||
else
|
||||
exec mc-server-runner ${mcServerRunnerArgs} "${finalArgs[@]}"
|
||||
fi
|
||||
else
|
||||
# If we have a bootstrap.txt file... feed that in to the server stdin
|
||||
if [ -f /data/bootstrap.txt ]; then
|
||||
@@ -218,8 +232,28 @@ else
|
||||
fi
|
||||
|
||||
log "Starting the Minecraft server..."
|
||||
|
||||
finalArgs=(
|
||||
$JVM_XX_OPTS
|
||||
$JVM_OPTS
|
||||
$expandedDOpts
|
||||
-jar $SERVER
|
||||
"$@" $EXTRA_ARGS
|
||||
)
|
||||
|
||||
if isTrue ${SETUP_ONLY:=false}; then
|
||||
echo "SETUP_ONLY: java ${finalArgs[@]}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if isTrue ${DEBUG_EXEC}; then
|
||||
set -x
|
||||
fi
|
||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar $SERVER "$@" $EXTRA_ARGS
|
||||
|
||||
if isTrue ${EXEC_DIRECTLY:-false}; then
|
||||
exec java "${finalArgs[@]}"
|
||||
else
|
||||
exec mc-server-runner ${bootstrapArgs} ${mcServerRunnerArgs} java "${finalArgs[@]}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
69
start-spiget
Normal file
69
start-spiget
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
. ${SCRIPTS:-/}start-utils
|
||||
handleDebugMode
|
||||
|
||||
: ${SPIGET_RESOURCES:=}
|
||||
|
||||
containsJars() {
|
||||
file=${1?}
|
||||
|
||||
pat='\.jar$'
|
||||
|
||||
while read -r line; do
|
||||
if [[ $line =~ $pat ]]; then
|
||||
return 0
|
||||
fi
|
||||
done <<<$(unzip -l "$file")
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
getResourceFromSpiget() {
|
||||
resource=${1?}
|
||||
|
||||
log "Downloading resource ${resource} ..."
|
||||
|
||||
mkdir -p /data/plugins
|
||||
|
||||
if [ -f /data/plugins/.${resource} ]; then
|
||||
log "Resource '${resource}' already downloaded"
|
||||
else
|
||||
tmpfile="/tmp/${resource}.zip"
|
||||
url="https://api.spiget.org/v2/resources/${resource}/download"
|
||||
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
|
||||
log "ERROR failed to download resource '${resource}' from ${url}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if containsJars "${tmpfile}"; then
|
||||
log "Extracting contents of resource ${resource} into plugins"
|
||||
unzip -o -q -d /data/plugins "${tmpfile}"
|
||||
touch "/data/plugins/.${resource}"
|
||||
rm "${tmpfile}"
|
||||
else
|
||||
log "Moving resource ${resource} into plugins"
|
||||
mv "${tmpfile}" "/data/plugins/${resource}.jar"
|
||||
touch "/data/plugins/.${resource}"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [[ ${SPIGET_RESOURCES} ]]; then
|
||||
if isTrue ${REMOVE_OLD_MODS:-false}; then
|
||||
removeOldMods /data/plugins
|
||||
REMOVE_OLD_MODS=false
|
||||
fi
|
||||
|
||||
log "Getting plugins via Spiget"
|
||||
IFS=',' read -r -a resources <<<"${SPIGET_RESOURCES}"
|
||||
for resource in "${resources[@]}"; do
|
||||
getResourceFromSpiget "${resource}"
|
||||
done
|
||||
fi
|
||||
|
||||
# Continue to Final Setup
|
||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
||||
17
start-utils
17
start-utils
@@ -11,7 +11,7 @@ function join_by() {
|
||||
function isURL() {
|
||||
local value=$1
|
||||
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
|
||||
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" || ${value:0:6} == "ftp://" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@@ -57,13 +57,20 @@ function isTrue() {
|
||||
}
|
||||
|
||||
function isDebugging() {
|
||||
if [[ -v DEBUG ]] && [[ ${DEBUG^^} == TRUE ]]; then
|
||||
if isTrue "${DEBUG:-false}"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function handleDebugMode() {
|
||||
if isDebugging; then
|
||||
set -x
|
||||
extraCurlArgs=(-v)
|
||||
fi
|
||||
}
|
||||
|
||||
function debug() {
|
||||
if isDebugging; then
|
||||
log "DEBUG: $*"
|
||||
@@ -167,3 +174,9 @@ eula=${EULA,,}
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
function removeOldMods {
|
||||
if [ -d "$1" ]; then
|
||||
find "$1" -mindepth 1 -maxdepth ${REMOVE_OLD_MODS_DEPTH:-16} -wholename "${REMOVE_OLD_MODS_INCLUDE:-*}" -not -wholename "${REMOVE_OLD_MODS_EXCLUDE:-}" -delete
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ services:
|
||||
restart: "no"
|
||||
build:
|
||||
context: ..
|
||||
args:
|
||||
TARGETOS: linux
|
||||
TARGETARCH: amd64
|
||||
cache_from:
|
||||
- itzg/minecraft-server:latest
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user