mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
150881a941 | ||
|
|
43accdf2f0 | ||
|
|
6363949bda | ||
|
|
b6b2da9d38 | ||
|
|
c40a47ebba | ||
|
|
94f9bc74f0 | ||
|
|
0f4cb9c429 | ||
|
|
66ed0eda1b | ||
|
|
ea3a6644a8 | ||
|
|
c0c6e6d78d | ||
|
|
2507028193 | ||
|
|
2084f1ea12 | ||
|
|
ca2c15ea8e | ||
|
|
a5ec64de24 | ||
|
|
33c75bd2da | ||
|
|
2917af8ca4 | ||
|
|
9d7232c8b8 | ||
|
|
051436c1df | ||
|
|
9b21661aaf | ||
|
|
47b903d134 | ||
|
|
fc4331232c | ||
|
|
5dc833c108 | ||
|
|
feb6a41c11 | ||
|
|
92947c92dc | ||
|
|
e8ffa0fc0d | ||
|
|
4c0bd61faf | ||
|
|
85a957fe6f | ||
|
|
37a5d50f70 | ||
|
|
eb279d0fa0 | ||
|
|
aba27ad444 | ||
|
|
f5c332736d | ||
|
|
bf621356c1 | ||
|
|
19948065d5 | ||
|
|
3b7ddcdbbd | ||
|
|
8c74fc34cb | ||
|
|
89889c556b | ||
|
|
951a55707d | ||
|
|
377273e5a3 | ||
|
|
78fd5457d4 | ||
|
|
2e07ba431d | ||
|
|
2dca9220e2 | ||
|
|
8ee9d6d2eb | ||
|
|
8faf560721 | ||
|
|
a1d0830a8e | ||
|
|
5642b8db35 | ||
|
|
ee562599f4 | ||
|
|
1ffcb5c221 | ||
|
|
8cdf4d0072 | ||
|
|
1545236cc6 | ||
|
|
2ebcc0fe00 | ||
|
|
e5f818bdf1 | ||
|
|
df497ce3d8 | ||
|
|
f7ff2779d9 | ||
|
|
c9e14864f5 | ||
|
|
ec539a5dd2 | ||
|
|
7427bc9043 | ||
|
|
8ab104f6b7 | ||
|
|
f15cbb4ca1 | ||
|
|
fa235e97c5 |
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
@@ -21,3 +21,4 @@ updates:
|
||||
- "*"
|
||||
update-types:
|
||||
- patch
|
||||
- minor
|
||||
|
||||
32
.github/workflows/build-multiarch.yml
vendored
32
.github/workflows/build-multiarch.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
||||
matrix:
|
||||
# NOTE: the "latest" variant is identified in the Docker meta step's 'latest' config
|
||||
variant:
|
||||
- java20
|
||||
- java20-alpine
|
||||
- java20-graalvm
|
||||
- java21-graalvm
|
||||
- java21
|
||||
- java21-alpine
|
||||
- java17
|
||||
- java17-graalvm
|
||||
- java17-jdk
|
||||
@@ -35,19 +35,19 @@ jobs:
|
||||
- java11-openj9
|
||||
- java11-jdk
|
||||
include:
|
||||
# JAVA 20:
|
||||
- variant: java20
|
||||
baseImage: eclipse-temurin:20-jre
|
||||
# JAVA 21:
|
||||
- variant: java21-graalvm
|
||||
baseImage: container-registry.oracle.com/graalvm/jdk:21-ol8
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.20.2
|
||||
- variant: java21
|
||||
baseImage: eclipse-temurin:21-jre
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.19.3
|
||||
- variant: java20-alpine
|
||||
baseImage: eclipse-temurin:20-jre-alpine
|
||||
- variant: java21-alpine
|
||||
baseImage: eclipse-temurin:21-jre-alpine
|
||||
platforms: linux/amd64
|
||||
mcVersion: 1.19.3
|
||||
- variant: java20-graalvm
|
||||
baseImage: container-registry.oracle.com/graalvm/jdk:20-ol8
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.19.3
|
||||
# JAVA 17:
|
||||
- variant: java17
|
||||
# jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343
|
||||
@@ -111,14 +111,14 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.0
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v5.2.0
|
||||
with:
|
||||
# NOTE for forks: if your Docker Hub organization doesn't match your Github repo's,
|
||||
# then the use of ${{ github.repository_owner }} will need to be replaced.
|
||||
@@ -150,7 +150,7 @@ jobs:
|
||||
uses: docker/setup-qemu-action@v3.0.0
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v5.0.0
|
||||
uses: docker/build-push-action@v5.1.0
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
tags: ${{ env.IMAGE_TO_TEST }}
|
||||
@@ -188,7 +188,7 @@ jobs:
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5.0.0
|
||||
uses: docker/build-push-action@v5.1.0
|
||||
if: github.actor == github.repository_owner
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
|
||||
26
.github/workflows/discord.yml
vendored
26
.github/workflows/discord.yml
vendored
@@ -1,8 +1,11 @@
|
||||
name: Discord notifications
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_run:
|
||||
workflows: ["ContinuousIntegration", "Build and Publish", "Build and publish multiarch" ]
|
||||
workflows: ["Build and Publish"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
@@ -14,13 +17,26 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: on-publish
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
uses: SethCohen/github-releases-to-discord@v1.15.0
|
||||
with:
|
||||
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
- name: on-success
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "Github repo: ${{ github.repository }}\n- Branch: ${{ github.event.workflow_run.head_branch }}\n- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)\n- Status: 🎉 ${{ github.event.workflow_run.conclusion }} 🍏"
|
||||
args: |
|
||||
Github repo: ${{ github.repository }}
|
||||
- Branch: ${{ github.event.workflow_run.head_branch }}
|
||||
- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)
|
||||
- Status: 🎉 ${{ github.event.workflow_run.conclusion }} 🍏
|
||||
- name: on-failure
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
if: github.event.workflow_run.conclusion == 'failure'
|
||||
uses: Ilshidur/action-discord@master
|
||||
with:
|
||||
args: "Github repo: ${{ github.repository }}\n- Branch: ${{ github.event.workflow_run.head_branch }}\n- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)\n- Status: 🤔 ${{ github.event.workflow_run.conclusion }} 💣💥"
|
||||
args: |
|
||||
Github repo: ${{ github.repository }}
|
||||
- Branch: ${{ github.event.workflow_run.head_branch }}
|
||||
- [Link: to Actions](<${{ github.event.workflow_run.html_url }}>)
|
||||
- Status: 🤔 ${{ github.event.workflow_run.conclusion }} 💣💥
|
||||
|
||||
2
.github/workflows/stale-check.yml
vendored
2
.github/workflows/stale-check.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Process Stale Issues
|
||||
uses: actions/stale@v8
|
||||
uses: actions/stale@v9
|
||||
with:
|
||||
stale-issue-label: status/stale
|
||||
stale-pr-label: status/stale
|
||||
|
||||
14
.github/workflows/verify-pr.yml
vendored
14
.github/workflows/verify-pr.yml
vendored
@@ -16,14 +16,14 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
variant:
|
||||
- java20
|
||||
- java21
|
||||
- java17
|
||||
- java17-alpine
|
||||
- java8-multiarch
|
||||
include:
|
||||
# JAVA 20:
|
||||
- variant: java20
|
||||
baseImage: eclipse-temurin:20-jre
|
||||
# JAVA 21:
|
||||
- variant: java21
|
||||
baseImage: eclipse-temurin:21-jre
|
||||
platforms: linux/amd64,linux/arm64
|
||||
mcVersion: 1.19.4
|
||||
# JAVA 17:
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.0
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
# for build-files step
|
||||
fetch-depth: 0
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v3.0.0
|
||||
|
||||
- name: Confirm multi-arch build
|
||||
uses: docker/build-push-action@v5.0.0
|
||||
uses: docker/build-push-action@v5.1.0
|
||||
with:
|
||||
platforms: ${{ matrix.platforms }}
|
||||
# ensure latest base image is used
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||
|
||||
- name: Build for test
|
||||
uses: docker/build-push-action@v5.0.0
|
||||
uses: docker/build-push-action@v5.1.0
|
||||
with:
|
||||
# Only build single platform since loading multi-arch image into daemon fails with
|
||||
# "docker exporter does not currently support exporting manifest lists"
|
||||
|
||||
35
Dockerfile
35
Dockerfile
@@ -22,28 +22,35 @@ COPY --chmod=644 files/sudoers* /etc/sudoers.d
|
||||
|
||||
EXPOSE 25565
|
||||
|
||||
ARG EASY_ADD_VER=0.8.0
|
||||
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||
ARG APPS_REV=1
|
||||
ARG GITHUB_BASEURL=https://github.com
|
||||
|
||||
ARG EASY_ADD_VERSION=0.8.2
|
||||
ADD ${GITHUB_BASEURL}/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||
RUN chmod +x /usr/bin/easy-add
|
||||
|
||||
ARG RESTIFY_VERSION=1.7.1
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.7.0 --var app=restify --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG RCON_CLI_VERSION=1.6.4
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.6.2 --var app=rcon-cli --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=${RCON_CLI_VERSION} --var app=rcon-cli --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_MONITOR_VERSION=0.12.6
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=0.12.2 --var app=mc-monitor --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=${MC_MONITOR_VERSION} --var app=mc-monitor --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_SERVER_RUNNER_VERSION=1.9.1
|
||||
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
|
||||
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||
|
||||
ARG MC_HELPER_VERSION=1.35.3
|
||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
ARG MC_HELPER_VERSION=1.37.4
|
||||
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
||||
# used for cache busting local copy of mc-image-helper
|
||||
ARG MC_HELPER_REV=1
|
||||
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
|
||||
@@ -61,9 +68,7 @@ ENV TYPE=VANILLA VERSION=LATEST EULA="" UID=1000 GID=1000
|
||||
COPY --chmod=755 scripts/start* /
|
||||
COPY --chmod=755 bin/ /usr/local/bin/
|
||||
COPY --chmod=755 bin/mc-health /health.sh
|
||||
COPY --chmod=644 files/log4j2.xml /image/log4j2.xml
|
||||
# By default this file gets retrieved from repo, but bundle in image as potential fallback
|
||||
COPY --chmod=644 files/cf-exclude-include.json /image/cf-exclude-include.json
|
||||
COPY --chmod=644 files/* /image/
|
||||
COPY --chmod=755 files/auto /auto
|
||||
|
||||
RUN curl -fsSL -o /image/Log4jPatcher.jar https://github.com/CreeperHost/Log4jPatcher/releases/download/v1.0.1/Log4jPatcher-1.0.1.jar
|
||||
|
||||
@@ -101,11 +101,11 @@ secrets:
|
||||
|
||||
## Patching existing files
|
||||
|
||||
JSON path based patches can be applied to one or more existing files by setting the variable `PATCH_DEFINITIONS` to the path of a directory that contains one or more [patch definition json files](https://github.com/itzg/mc-image-helper#patchdefinition) or a [patch set json file](https://github.com/itzg/mc-image-helper#patchset).
|
||||
JSON path based patches can be applied to one or more existing files by setting the variable `PATCH_DEFINITIONS` to the path of a directory that contains one or more [patch definition json files](https://github.com/itzg/mc-image-helper#patchdefinition) or a [patch set json file](https://github.com/itzg/mc-image-helper#patchset).
|
||||
|
||||
Variable placeholders in the patch values can be restricted by setting `REPLACE_ENV_VARIABLE_PREFIX`, which defaults to "CFG_".
|
||||
The `file` and `value` fields of the patch definitions may contain `${...}` variable placeholders. The allowed environment variables in placeholders can be restricted by setting `REPLACE_ENV_VARIABLE_PREFIX`, which defaults to "CFG_".
|
||||
|
||||
The following example shows a patch-set file were various fields in the `paper.yaml` configuration file can be modified and added:
|
||||
The following example shows a patch-set file where various fields in the `paper.yaml` configuration file can be modified and added:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -139,4 +139,8 @@ The following example shows a patch-set file were various fields in the `paper.y
|
||||
}
|
||||
```
|
||||
|
||||
> **NOTES:** Only JSON and Yaml files can be patched at this time. TOML support is planned to be added next. Removal of comments and other cosmetic changes will occur when patched files are processed.
|
||||
Supports the file formats:
|
||||
- JSON
|
||||
- JSON5
|
||||
- Yaml
|
||||
- TOML, but processed output is not pretty
|
||||
|
||||
@@ -62,11 +62,30 @@ you can use
|
||||
|
||||
## Enable Remote JMX for Profiling
|
||||
|
||||
To enable remote JMX, such as for profiling with VisualVM or JMC, add the environment variable `ENABLE_JMX=true`, set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as:
|
||||
To enable remote JMX, such as for profiling with VisualVM or JMC, set the environment variable `ENABLE_JMX` to "true", set `JMX_HOST` to the IP/host running the Docker container, and add a port forwarding of TCP port 7091, such as:
|
||||
|
||||
```
|
||||
-e ENABLE_JMX=true -e JMX_HOST=$HOSTNAME -p 7091:7091
|
||||
```
|
||||
!!! example
|
||||
|
||||
With `docker run`
|
||||
|
||||
```
|
||||
-e ENABLE_JMX=true -e JMX_HOST=$HOSTNAME -p 7091:7091
|
||||
```
|
||||
|
||||
If needing to map to a different port, then also set the environment variable `JMX_PORT` to the desired host port.
|
||||
|
||||
!!! example
|
||||
|
||||
With a compose file:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
ENABLE_JMX: true
|
||||
JMX_HOST: ${HOSTNAME}
|
||||
JMX_PORT: "7092"
|
||||
ports:
|
||||
- "7092:7092"
|
||||
```
|
||||
|
||||
## Enable Aikar's Flags
|
||||
|
||||
|
||||
@@ -1,32 +1,74 @@
|
||||
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.
|
||||
In order to unify management of the Minecraft server container, all of the [`server.properties`](https://minecraft.wiki/w/Server.properties) entries can be managed by the environment variables described in the sections below. Some of the mappings provide additional functionality above and beyond the properties file.
|
||||
|
||||
If you prefer to manually manage the `server.properties` file, set `OVERRIDE_SERVER_PROPERTIES` to "false". Similarly, you can entirely skip the startup script's creation of `server.properties` by setting `SKIP_SERVER_PROPERTIES` to "true".
|
||||
|
||||
> NOTE: to clear a server property, set the variable to an empty string, such as `-e RESOURCE_PACK=""`. A variables that maps to a server property that is unset, is ignored and the existing `server.property` is left unchanged.
|
||||
!!! note
|
||||
|
||||
To clear a server property, set the variable to an empty string, such as `-e RESOURCE_PACK=""`. An unset variable is ignored and the existing `server.property` is left unchanged.
|
||||
|
||||
## Placeholders
|
||||
|
||||
When declaring a server properties via container environment variables, those values may contain placeholders that are processed when the `server.properties` file is updated.
|
||||
|
||||
The syntax of placeholders is DOS-style, `%VAR%`, to avoid being processed by Docker or the shell and the following options are available:
|
||||
|
||||
`%VAR%` or `%env:VAR%`
|
||||
|
||||
: Replaced with the resolved value or the environment variable `VAR`
|
||||
|
||||
`%date:FMT%`
|
||||
|
||||
: Formats the current date/time with the given `FMT` string processed by [Java's DateTimeFormatter](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html).
|
||||
|
||||
Any declared or resolved environment variable may be referenced, such as `VERSION` and `TYPE`. Additionally, [Modrinth](../types-and-platforms/mod-platforms/modrinth-modpacks.md) and [Auto CurseForge](../types-and-platforms/mod-platforms/auto-curseforge.md) modpacks will expose the environment variables `MODPACK_NAME` and `MODPACK_VERSION`. The originally declared version, such as "LATEST" or "SNAPSHOT", is available in the variable `DECLARED_VERSION`
|
||||
|
||||
!!! example
|
||||
|
||||
As a compose file environment entry:
|
||||
|
||||
```yaml
|
||||
MOTD: Running %MODPACK_NAME% version %env:MODPACK_VERSION%
|
||||
LEVEL: world-%date:yyyy-MM-dd%
|
||||
```
|
||||
|
||||
!!! warning
|
||||
|
||||
Placeholders are not supported when manually managing `server.properties`
|
||||
|
||||
## Properties
|
||||
|
||||
### Message of the Day
|
||||
|
||||
The message of the day, shown below each server entry in the client UI, can be changed with the `MOTD` environment variable, such as
|
||||
|
||||
-e MOTD="My Server"
|
||||
|
||||
If you leave it off, a default is computed from the server type and version, such as
|
||||
The message of the day, shown below each server entry in the client UI, can be changed with the `MOTD` environment variable or a default is computed from the server type and version, such as
|
||||
|
||||
A Paper Minecraft Server powered by Docker
|
||||
|
||||
That way you can easily differentiate between several servers you may have started.
|
||||
That way you can easily differentiate between several server types you may have started.
|
||||
|
||||
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.wiki/w/Formatting_codes) to be used consistently with all server versions. For example,
|
||||
The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.wiki/w/Formatting_codes) to be used consistently with all server versions. For Minecraft versions less than 1.20, unicode characters in `server.properties` will be escaped as `\uXXXX`, by default. That behavior can be altered by setting `SERVER_PROPERTIES_ESCAPE_UNICODE` to "true" or "false".
|
||||
|
||||
-e MOTD="A §l§cMinecraft§r §nserver"
|
||||
!!! example
|
||||
|
||||
renders
|
||||
With `docker run`
|
||||
|
||||
-e MOTD="A §l§cMinecraft§r §nserver"
|
||||
|
||||
or within a compose file
|
||||
|
||||
environment:
|
||||
MOTD: "A §l§cMinecraft§r §nserver"
|
||||
|
||||

|
||||
renders
|
||||
|
||||

|
||||
|
||||
To produce a multi-line MOTD, you will need to double escape the newline such as
|
||||
To produce a multi-line MOTD, embed a newline character as `\n` in the string, such as
|
||||
|
||||
-e MOTD="Line one\\nLine two"
|
||||
-e MOTD="Line one\nLine two"
|
||||
|
||||
!!! tip
|
||||
|
||||
You can also embed configured and resolved environment variables using [placeholders](#placeholders).
|
||||
|
||||
### Difficulty
|
||||
|
||||
@@ -40,6 +82,8 @@ Valid values are: `peaceful`, `easy`, `normal`, and `hard`, and an
|
||||
error message will be output in the logs if it's not one of these
|
||||
values.
|
||||
|
||||
Refer to [the Minecraft wiki](https://minecraft.wiki/w/Difficulty)
|
||||
|
||||
### Whitelist Players
|
||||
|
||||
!!! warning "For public servers"
|
||||
@@ -303,7 +347,43 @@ environment variable set to `false`, such as
|
||||
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
|
||||
be configured by setting `LEVEL_TYPE` to [an expected type listed here](https://minecraft.wiki/w/Server.properties#level-type).
|
||||
|
||||
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation [as described here](https://minecraft.wiki/w/Server.properties#generator-settings).
|
||||
For some of the level types, `GENERATOR_SETTINGS` can be used to further customize the world generation.
|
||||
|
||||
To configure the `GENERATOR_SEETINGS` you need to add the appropriate `GeneratorOptions` JSON configuration. In the case of a superflat world, you may omit the `flat_world_options`.
|
||||
|
||||
The layers are applied from -64 and up and are added in the order of the list
|
||||
|
||||
Example for a superflat world:
|
||||
|
||||
- 1x bedrock
|
||||
- 2x stone
|
||||
- 15x sandstone
|
||||
- Desert biome
|
||||
|
||||
```yaml
|
||||
LEVEL_TYPE: FLAT
|
||||
GENERATOR_SETTINGS: >-4
|
||||
{
|
||||
"layers": [
|
||||
{
|
||||
"block": "minecraft:bedrock",
|
||||
"height": 1
|
||||
},
|
||||
{
|
||||
"block": "minecraft:stone",
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"block": "minecraft:sandstone",
|
||||
"height": 15
|
||||
}
|
||||
],
|
||||
"biome": "minecraft:desert"
|
||||
}
|
||||
|
||||
|
||||
```
|
||||
For more details, check the [official wiki](https://minecraft.wiki/w/Java_Edition_level_format#generatorOptions_tag_format).
|
||||
|
||||
### Custom Server Resource Pack
|
||||
|
||||
@@ -353,10 +433,28 @@ If you must, the server port can be set like:
|
||||
|
||||
**however**, be sure to change your port mapping accordingly and be prepared for some features to break.
|
||||
|
||||
### Custom server properties
|
||||
|
||||
Some mods/plugins utilize custom `server.properties` entries which can be declared via the `CUSTOM_SERVER_PROPERTIES` environment variable. The contents must be newline delimited `name=value` pairs.
|
||||
|
||||
Within a compose file, newline delimited entries can be declared as shown here:
|
||||
|
||||
```yaml
|
||||
CUSTOM_SERVER_PROPERTIES: |
|
||||
custom1=value1
|
||||
defaultworldgenerator-port=f8c04631-f744-11ec-b260-f02f74b094e0
|
||||
```
|
||||
|
||||
When using `docker run` from a bash shell, the entries must be quoted with the `$'` syntax, such as
|
||||
|
||||
```
|
||||
-e CUSTOM_SERVER_PROPERTIES=$'k1=v1\nk2=v2'
|
||||
```
|
||||
|
||||
### Other server property mappings
|
||||
|
||||
| Environment Variable | Server Property |
|
||||
| --------------------------------- | --------------------------------- |
|
||||
|-----------------------------------|-----------------------------------|
|
||||
| BROADCAST_CONSOLE_TO_OPS | broadcast-console-to-ops |
|
||||
| BROADCAST_RCON_TO_OPS | broadcast-rcon-to-ops |
|
||||
| ENABLE_STATUS | enable-status |
|
||||
|
||||
@@ -65,32 +65,38 @@ VERSION=1.12.2 /scripts/start-magma
|
||||
|
||||
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
|
||||
|
||||
## Using development copy of mc-image-helper
|
||||
## Using development copy of tools
|
||||
|
||||
In the cloned copy of [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
|
||||
In the cloned repo, such as [`mc-image-helper`](https://github.com/itzg/mc-image-helper), create an up-to-date snapshot build of the tgz distribution using:
|
||||
|
||||
```shell
|
||||
./gradlew distTar
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
The distribution's version will be `0.0.0-<branch>-SNAPSHOT`
|
||||
|
||||
Assuming Java 18 or newer:
|
||||
For Go base tools, run
|
||||
|
||||
```shell
|
||||
cd build/distributions
|
||||
jwebserver -b 0.0.0.0 -p 8008
|
||||
goreleaser release --snapshot --clean
|
||||
```
|
||||
|
||||
If `jwebserver` is not available, try `java -m jdk.httpserver`
|
||||
Clone [itzg/github-releases-proxy](https://github.com/itzg/github-releases-proxy) and run it according to the instructions shown there.
|
||||
|
||||
In the Docker build, configure the following
|
||||
|
||||
```shell
|
||||
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
|
||||
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
|
||||
--build-arg GITHUB_BASEURL=http://host.docker.internal:8080 \
|
||||
--build-arg APPS_REV=1
|
||||
```
|
||||
|
||||
Now the image can be built like normal, and it will install mc-image-helper from the locally built copy.
|
||||
and declare one or more version overrides, such as
|
||||
|
||||
```
|
||||
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT
|
||||
```
|
||||
|
||||
## Generating release notes
|
||||
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
# More Deployment Info
|
||||
|
||||
## Using Helm
|
||||
## On Kubernetes
|
||||
|
||||
### Using Helm
|
||||
|
||||
- itzg Helm Chart:
|
||||
- [GitHub repo](https://github.com/itzg/minecraft-server-charts)
|
||||
- [Helm Chart repo](https://itzg.github.io/minecraft-server-charts/)
|
||||
- [mcsh/server-deployment](https://github.com/mcserverhosting-net/charts)
|
||||
|
||||
### Using Shulker
|
||||
|
||||
[Shulker](https://github.com/jeremylvln/Shulker) is a Kubernetes operator for managing complex and dynamic Minecraft infrastructures, including game servers and proxies. It uses the docker-minecraft-server and docker-bungeecord images under-the-hood.
|
||||
|
||||
## On CloudFormation (AWS)
|
||||
|
||||
If you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the [Minecraft Server Deployment (CloudFormation) repository](https://github.com/vatertime/minecraft-spot-pricing). This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use.
|
||||
|
||||
## Supporting Articles
|
||||
|
||||
Below are supporting articles for server deployment.
|
||||
@@ -16,7 +26,3 @@ Below are supporting articles for server deployment.
|
||||
https://dev.to/rela-v/zero-to-minecraft-server-with-docker-desktop-and-compose-500a
|
||||
|
||||
- This is a reference guide/tutorial on how to set up a vanilla Minecraft server using this project, including step-by-step instructions, and information on topics such as port-forwarding.
|
||||
|
||||
## Deploying onto AWS
|
||||
|
||||
If you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the [Minecraft Server Deployment (CloudFormation) repository](https://github.com/vatertime/minecraft-spot-pricing). This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use.
|
||||
|
||||
@@ -10,6 +10,10 @@ A specific file can be omitted from each reference to allow for auto-selecting t
|
||||
|
||||
## Project-file references
|
||||
|
||||
!!! tip
|
||||
|
||||
Individual project files typically represent a version of the mod/plugin, but CurseForge refers to these items broadly as "files" rather than "versions".
|
||||
|
||||
The following formats are supported in the list of project-file references:
|
||||
|
||||
- A project page URL, such as `https://www.curseforge.com/minecraft/mc-mods/jei`. _The newest applicable file will be automatically selected._
|
||||
@@ -17,7 +21,7 @@ The following formats are supported in the list of project-file references:
|
||||
- Project slug, such as `jei`. _The newest applicable file will be automatically selected._
|
||||
- Project ID, such as `238222`. _The newest applicable file will be automatically selected._
|
||||
- Project slug or ID, `:`, and a file ID, such as `jei:4593548` or `238222:4593548`
|
||||
- Project slug or ID, `@`, and a partial filename, such as `jei@10.2.1.1005`
|
||||
- Project slug or ID, `@`, and a partial filename, such as `jei@10.2.1.1005`. This option is useful to refer to a version of the mod/plugin rather than looking up the file ID.
|
||||
|
||||
An `@` followed by the container path to a listing file can also be provided as a project-file reference. Each line is processed as a reference where blank lines and comments that start with `#` are ignored.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
mkdocs == 1.5.3
|
||||
mkdocs-material-extensions == 1.2
|
||||
mkdocs-material == 9.4.3
|
||||
mkdocs-material-extensions == 1.3.1
|
||||
mkdocs-material == 9.4.14
|
||||
mkdocs-autorefs == 0.5.0
|
||||
mkdocstrings == 0.23.0
|
||||
mkdocstrings == 0.24.0
|
||||
mkdocs-literate-nav == 0.6.1
|
||||
mdx-gh-links == 0.3.1
|
||||
mkdocs-click == 0.8.1
|
||||
mkdocs-static-i18n == 1.0.6
|
||||
mkdocs-static-i18n == 1.2.0
|
||||
@@ -8,7 +8,7 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
||||
|
||||
A CurseForge API key is **required** to use this feature. Go to their [developer console](https://console.curseforge.com/), generate an API key, and set the environment variable `CF_API_KEY`.
|
||||
|
||||
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`.
|
||||
When entering your API Key in a docker compose file you will need to escape any `$` character with a second `$`. Refer to [this compose file reference section](https://docs.docker.com/compose/compose-file/compose-file-v3/#variable-substitution) for more information.
|
||||
|
||||
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
|
||||
```yaml
|
||||
@@ -56,13 +56,6 @@ For example:
|
||||
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
|
||||
```
|
||||
|
||||
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
|
||||
|
||||
!!! note "Mods need download report"
|
||||
A file called `MODS_NEED_DOWNLOAD.txt` will be created in the `/data` directory that lists the mods that need to be manually downloaded and where to get them.
|
||||
|
||||
If you wish to use a unpublished modpack zip, set the container path to the file in `CF_MODPACK_ZIP`. Similarly, the container path to a modpack manifest JSON can be passed to `CF_MODPACK_MANIFEST`. In either case, **the modpack slug or page URL must still be provided**.
|
||||
|
||||
The latest file will be located and used by default, but if a specific version is desired you can use one of the following options. With any of these options **do not select a server file** -- they lack the required manifest and defeat the ability to consistently automate startup.
|
||||
|
||||
- Use `CF_PAGE_URL`, but include the full URL to a specific file
|
||||
@@ -75,17 +68,45 @@ The following shows where to get the URL to the specific file and also shows whe
|
||||
|
||||
The following examples all refer to version 1.0.7 of ATM8:
|
||||
|
||||
```
|
||||
-e CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390
|
||||
```yaml
|
||||
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8/files/4248390
|
||||
```
|
||||
|
||||
```
|
||||
-e CF_SLUG=all-the-mods-8 -e CF_FILE_ID=4248390
|
||||
```yaml
|
||||
CF_SLUG: all-the-mods-8
|
||||
CF_FILE_ID: "4248390"
|
||||
```
|
||||
|
||||
```yaml
|
||||
CF_SLUG: all-the-mods-8
|
||||
CF_FILENAME_MATCHER: 1.0.7
|
||||
```
|
||||
-e CF_SLUG=all-the-mods-8 -e CF_FILENAME_MATCHER=1.0.7
|
||||
```
|
||||
|
||||
## Manual Downloads
|
||||
|
||||
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
|
||||
|
||||
!!! note "Mods need download report"
|
||||
|
||||
A file called `MODS_NEED_DOWNLOAD.txt` will be created in the `/data` directory that lists the mods that need to be manually downloaded and where to get them.
|
||||
|
||||
!!! example
|
||||
|
||||
Assuming Docker compose is being used:
|
||||
|
||||
1. Create a directory next to the `docker-compose.yml` file. The name doesn't matter, but "downloads" is the common convention
|
||||
2. From the "Mods Need Download" output, visit the download page of each, click on the file download and save that file into the directory created in the previous step
|
||||
3. Add a host directory mount to the volumes section where the container path **must be** `/downloads`. The snippet below shows how that will look
|
||||
4. Re-run `docker composwe up -d` to apply the changes
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
./downloads:/downloads
|
||||
```
|
||||
|
||||
## Unpublished Modpacks
|
||||
|
||||
If you wish to use a unpublished modpack zip, set the container path to the file in `CF_MODPACK_ZIP`. Similarly, the container path to a modpack manifest JSON can be passed to `CF_MODPACK_MANIFEST`. In either case, **the modpack slug or page URL must still be provided**.
|
||||
|
||||
## Exclude client mods
|
||||
|
||||
@@ -103,12 +124,44 @@ If needing to iterate on the options above, set `CF_FORCE_SYNCHRONIZE` to "true"
|
||||
!!! important
|
||||
These options are provided to empower you to get your server up and running quickly. Please help out by reporting an issue with the respective mod project. Ideally mod developers should [use correct registrations for one-sided client mods](https://docs.minecraftforge.net/en/latest/concepts/sides/#writing-one-sided-mods). Understandably, those code changes may be non-trivial, so mod authors can also add "Client" to the game versions when publishing.
|
||||
|
||||
## Extra options
|
||||
## Excluding Overrides Files
|
||||
|
||||
Modpack zip files typically include an `overrides` subdirectory that may contain config files, world data, and extra mod files. All of those files will be extracted into the `/data` path of the container. If any of those files, such as incompatible mods, need to be excluded from extraction, then the `CF_OVERRIDES_EXCLUSIONS` variable can be set with a comma or newline delimited list of ant-style paths ([see below](#ant-style-paths)) to exclude, relative to the overrides (or `/data`) directory.
|
||||
|
||||
### Ant-style paths
|
||||
|
||||
Ant-style paths can include the following globbing/wildcard symbols:
|
||||
|
||||
| Symbol | Behavior |
|
||||
|--------|---------------------------------------------------------|
|
||||
| `*` | Matches zero, one, or many characters except a slash |
|
||||
| `**` | Matches zero, one, or many characters including slashes |
|
||||
| `?` | Matches one character |
|
||||
|
||||
!!! example
|
||||
|
||||
The following compose `environment` entries show how to exclude Iris and Sodium mods from the overrides
|
||||
|
||||
```yaml
|
||||
CF_OVERRIDES_EXCLUSIONS: mods/iris*.jar,mods/sodium*.jar
|
||||
```
|
||||
|
||||
or using newline delimiter, which improves maintainability
|
||||
|
||||
```yaml
|
||||
CF_OVERRIDES_EXCLUSIONS: |
|
||||
mods/iris*.jar
|
||||
mods/sodium*.jar
|
||||
```
|
||||
|
||||
## World/Level Data
|
||||
|
||||
Some modpacks come with world/save data via a worlds file and/or the overrides provided with the modpack. Either approach can be selected to set the `LEVEL` to the resulting saves directory by setting `CF_SET_LEVEL_FROM` to either:
|
||||
- `WORLD_FILE`
|
||||
- `OVERRIDES`
|
||||
|
||||
## Extra options
|
||||
|
||||
Other configuration available:
|
||||
- `CF_PARALLEL_DOWNLOADS` (default is 4): specify how many parallel mod downloads to perform
|
||||
- `CF_OVERRIDES_SKIP_EXISTING` (default is false): if set, files in the overrides that already exist in the data directory are skipped. **NOTE** world data is always skipped, if present.
|
||||
|
||||
@@ -41,3 +41,16 @@ Some mods, such as [MCInstance Loader](https://modrinth.com/mod/mcinstance-loade
|
||||
config/mcinstanceloader/pack.mcinstance
|
||||
```
|
||||
|
||||
## Excluding files
|
||||
|
||||
To exclude client mods that are incorrectly declared by the modpack as server-compatible, set `MODRINTH_EXCLUDE_FILES` to a comma or newline delimited list of partial file names to exclude. You may need to set `MODRINTH_FORCE_SYNCHRONIZE` to "true" while iterating on a compatible set of mods to use.
|
||||
|
||||
!!! example
|
||||
|
||||
In a Compose file:
|
||||
```yaml
|
||||
MODRINTH_EXCLUDE_FILES: |
|
||||
notenoughanimations
|
||||
lambdynamiclights
|
||||
euphoriapatcher
|
||||
```
|
||||
@@ -35,3 +35,23 @@ In both of the cases above, there is no need for the `VERSION` or `FORGE_VERSION
|
||||
!!! note
|
||||
|
||||
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
|
||||
|
||||
## Alternatives
|
||||
|
||||
### NeoForge
|
||||
|
||||
Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge server can be automatically managed by setting `TYPE` to "NEOFORGE". `VERSION` specifies the Minecraft version and `NEOFORGE_VERSION` can be set to select a specific sub-version. By default, the latest NeoForge version available for the requested Minecraft version will be used.
|
||||
|
||||
!!! example
|
||||
|
||||
```
|
||||
docker run -e TYPE=NEOFORGE -e VERSION=1.20.1 -e NEOFORGE_VERSION=47.1.79 ...
|
||||
```
|
||||
|
||||
or in a compose file
|
||||
```yaml
|
||||
environment:
|
||||
TYPE: NEOFORGE
|
||||
VERSION: "1.20.1"
|
||||
NEOFORGE_VERSION: "47.1.79"
|
||||
```
|
||||
|
||||
@@ -8,9 +8,26 @@ A [Magma](https://magmafoundation.org/) server, which is a combination of Forge
|
||||
|
||||
!!! note
|
||||
|
||||
The Magma project [has benn terminated](https://git.magmafoundation.org/magmafoundation/magma-1-20-x/-/commit/4e7abe37403c47d09b74b77bcfc26a19b18f5891). Please use Ketting for 1.20.2+.
|
||||
|
||||
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2", "1.16.5", etc.
|
||||
|
||||
|
||||
### Ketting
|
||||
|
||||
A [Ketting](https://github.com/kettingpowered/Ketting-1-20-x) server, which is a alternative project of Magma 1.20+, can be used with
|
||||
|
||||
-e TYPE=KETTING
|
||||
|
||||
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.20.2" or later.
|
||||
|
||||
In addition, `FORGE_VERSION` and `KETTING_VERSION` must be specified. You can find the supported `FORGE_VERSION` in the [project page](https://github.com/kettingpowered/Ketting-1-20-x), and `KETTING_VERSION` in the [release page](https://github.com/kettingpowered/Ketting-1-20-x/releases).
|
||||
|
||||
!!! note
|
||||
|
||||
The length of `KETTING_VERSION` is 8, not 7 since it is taken from an abbreviated git commit hash. The value can be found in a jar file link on an Assets section for each releases.
|
||||
|
||||
|
||||
### Mohist
|
||||
|
||||
A [Mohist](https://github.com/MohistMC/Mohist) server can be used with
|
||||
|
||||
@@ -30,9 +30,9 @@ When using the image `itzg/minecraft-server` without a tag, the `latest` image t
|
||||
| java17-openj9 | 17 | Debian | OpenJ9 | amd64 |
|
||||
| java17-graalvm | 17 | Oracle | Oracle GraalVM | amd64,arm64 |
|
||||
| java17-alpine | 17 | Alpine | Hotspot | amd64 |
|
||||
| java20-alpine | 20 | Alpine | Hotspot | amd64 |
|
||||
| java20 | 20 | Ubuntu | Hotspot | amd64,arm64 |
|
||||
| java20-graalvm | 20 | Oracle | Oracle GraalVM | amd64,arm64 |
|
||||
| java21-alpine | 21 | Alpine | Hotspot | amd64 |
|
||||
| java21 | 21 | Ubuntu | Hotspot | amd64,arm64 |
|
||||
| java21-graalvm | 21 | Oracle | Oracle GraalVM | amd64,arm64 |
|
||||
|
||||
For example, to use Java version 8 on any supported architecture:
|
||||
|
||||
@@ -55,3 +55,4 @@ The following image tags have been deprecated and are no longer receiving update
|
||||
- multiarch-latest
|
||||
- java16/java16-openj9
|
||||
- java17-graalvm-ce
|
||||
- java20-graalvm, java20, java20-alpine
|
||||
|
||||
@@ -19,6 +19,7 @@ spec:
|
||||
containers:
|
||||
- name: mc
|
||||
image: itzg/minecraft-server
|
||||
imagePullPolicy: Always
|
||||
env:
|
||||
- name: EULA
|
||||
value: "TRUE"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"defensive-measures",
|
||||
"ding",
|
||||
"dynamiclights-reforged",
|
||||
"embeddium",
|
||||
"enchantment-descriptions",
|
||||
"entity-texture-features-fabric",
|
||||
"entityculling",
|
||||
|
||||
58
files/property-definitions.json
Normal file
58
files/property-definitions.json
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"motd": {"env": "MOTD"},
|
||||
"gamemode": {"env": "MODE"},
|
||||
"difficulty": {"env": "DIFFICULTY"},
|
||||
"white-list": {"env": "WHITELIST_PROP"},
|
||||
"enforce-whitelist": {"env": "ENFORCE_WHITELIST"},
|
||||
"level-type": {"env": "LEVEL_TYPE"},
|
||||
"server-name": {"env": "SERVER_NAME"},
|
||||
"server-ip": {"env": "SERVER_IP"},
|
||||
"server-port": {"env": "SERVER_PORT"},
|
||||
"allow-nether": {"env": "ALLOW_NETHER"},
|
||||
"announce-player-achievements": {"env": "ANNOUNCE_PLAYER_ACHIEVEMENTS"},
|
||||
"enable-command-block": {"env": "ENABLE_COMMAND_BLOCK"},
|
||||
"spawn-animals": {"env": "SPAWN_ANIMALS"},
|
||||
"spawn-monsters": {"env": "SPAWN_MONSTERS"},
|
||||
"spawn-npcs": {"env": "SPAWN_NPCS"},
|
||||
"spawn-protection": {"env": "SPAWN_PROTECTION"},
|
||||
"generate-structures": {"env": "GENERATE_STRUCTURES"},
|
||||
"view-distance": {"env": "VIEW_DISTANCE"},
|
||||
"hardcore": {"env": "HARDCORE"},
|
||||
"snooper-enabled": {"env": "SNOOPER_ENABLED"},
|
||||
"max-build-height": {"env": "MAX_BUILD_HEIGHT"},
|
||||
"force-gamemode": {"env": "FORCE_GAMEMODE"},
|
||||
"max-tick-time": {"env": "MAX_TICK_TIME"},
|
||||
"enable-query": {"env": "ENABLE_QUERY"},
|
||||
"query.port": {"env": "QUERY_PORT"},
|
||||
"enable-rcon": {"env": "ENABLE_RCON"},
|
||||
"rcon.password": {"env": "RCON_PASSWORD"},
|
||||
"rcon.port": {"env": "RCON_PORT"},
|
||||
"max-players": {"env": "MAX_PLAYERS"},
|
||||
"max-world-size": {"env": "MAX_WORLD_SIZE"},
|
||||
"level-name": {"env": "LEVEL"},
|
||||
"level-seed": {"env": "SEED"},
|
||||
"pvp": {"env": "PVP"},
|
||||
"generator-settings": {"env": "GENERATOR_SETTINGS"},
|
||||
"online-mode": {"env": "ONLINE_MODE"},
|
||||
"allow-flight": {"env": "ALLOW_FLIGHT"},
|
||||
"resource-pack": {"env": "RESOURCE_PACK"},
|
||||
"resource-pack-sha1": {"env": "RESOURCE_PACK_SHA1"},
|
||||
"require-resource-pack": {"env": "RESOURCE_PACK_ENFORCE"},
|
||||
"player-idle-timeout": {"env": "PLAYER_IDLE_TIMEOUT"},
|
||||
"broadcast-console-to-ops": {"env": "BROADCAST_CONSOLE_TO_OPS"},
|
||||
"broadcast-rcon-to-ops": {"env": "BROADCAST_RCON_TO_OPS"},
|
||||
"enable-jmx-monitoring": {"env": "ENABLE_JMX"},
|
||||
"sync-chunk-writes": {"env": "SYNC_CHUNK_WRITES"},
|
||||
"enable-status": {"env": "ENABLE_STATUS"},
|
||||
"entity-broadcast-range-percentage": {"env": "ENTITY_BROADCAST_RANGE_PERCENTAGE"},
|
||||
"function-permission-level": {"env": "FUNCTION_PERMISSION_LEVEL"},
|
||||
"network-compression-threshold": {"env": "NETWORK_COMPRESSION_THRESHOLD"},
|
||||
"op-permission-level": {"env": "OP_PERMISSION_LEVEL"},
|
||||
"prevent-proxy-connections": {"env": "PREVENT_PROXY_CONNECTIONS"},
|
||||
"use-native-transport": {"env": "USE_NATIVE_TRANSPORT"},
|
||||
"simulation-distance": {"env": "SIMULATION_DISTANCE"},
|
||||
"previews-chat": {"env": "PREVIEWS_CHAT"},
|
||||
"enforce-secure-profile": {"env": "ENFORCE_SECURE_PROFILE"},
|
||||
"initial-enabled-packs": {"env": "INITIAL_ENABLED_PACKS"},
|
||||
"initial-disabled-packs": {"env": "INITIAL_DISABLED_PACKS"}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 83 KiB |
@@ -9,18 +9,13 @@
|
||||
|
||||
umask 0002
|
||||
|
||||
if isTrue "${ENABLE_RCON:-true}" && ! [ -v RCON_PASSWORD ] && ! [ -v RCON_PASSWORD_FILE ]; then
|
||||
RCON_PASSWORD=$(openssl rand -hex 12)
|
||||
export RCON_PASSWORD
|
||||
fi
|
||||
# Remove from previous run and do this as elevated user since file used to be created before demoting
|
||||
rm -f "$HOME/.rcon-cli.env"
|
||||
|
||||
if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then
|
||||
runAsUser=minecraft
|
||||
runAsGroup=minecraft
|
||||
|
||||
# For rcon-cli access running via exec, which by default is running as root
|
||||
echo "password=${RCON_PASSWORD}" > "$HOME/.rcon-cli.env"
|
||||
|
||||
if [[ -v UID ]]; then
|
||||
if [[ $UID != 0 ]]; then
|
||||
if [[ $UID != $(id -u minecraft) ]]; then
|
||||
|
||||
@@ -15,11 +15,9 @@ IFS=$'\n\t'
|
||||
: "${RCON_CMDS_FIRST_CONNECT:=}"
|
||||
: "${RCON_CMDS_LAST_DISCONNECT:=}"
|
||||
: "${RCON_CMDS_PERIOD:=10}"
|
||||
: "${RCON_PASSWORD_FILE:=}"
|
||||
: "${ENABLE_RCON:=true}"
|
||||
: "${RCON_PASSWORD:=minecraft}"
|
||||
: "${RCON_PORT:=25575}"
|
||||
export ENABLE_RCON RCON_PASSWORD RCON_PORT
|
||||
export ENABLE_RCON RCON_PORT
|
||||
|
||||
: "${MEMORY=1G}"
|
||||
: "${INIT_MEMORY=${MEMORY}}"
|
||||
@@ -49,6 +47,45 @@ if [ ! -e /data/eula.txt ]; then
|
||||
writeEula
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY:-false}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
free -m
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# Setup RCON password
|
||||
|
||||
if isTrue "${ENABLE_RCON:-true}"; then
|
||||
if [[ -v RCON_PASSWORD_FILE ]]; then
|
||||
if [ ! -e "${RCON_PASSWORD_FILE}" ]; then
|
||||
log ""
|
||||
log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist."
|
||||
log "Please ensure your configuration."
|
||||
log "If you are using Docker Secrets feature, please check this for further information: "
|
||||
log " https://docs.docker.com/engine/swarm/secrets"
|
||||
log ""
|
||||
exit 1
|
||||
else
|
||||
RCON_PASSWORD=$(cat "${RCON_PASSWORD_FILE}")
|
||||
export RCON_PASSWORD
|
||||
fi
|
||||
elif ! [[ -v RCON_PASSWORD ]]; then
|
||||
RCON_PASSWORD=$(openssl rand -hex 12)
|
||||
export RCON_PASSWORD
|
||||
fi
|
||||
|
||||
# For rcon-cli access running via exec, which by default is running as root
|
||||
echo "password=${RCON_PASSWORD}" > "$HOME/.rcon-cli.env"
|
||||
echo "password: \"${RCON_PASSWORD}\"" > "$HOME/.rcon-cli.yaml"
|
||||
else
|
||||
rm -f "$HOME/.rcon-cli.env" "$HOME/.rcon-cli.yaml"
|
||||
fi
|
||||
|
||||
|
||||
##########################################
|
||||
# Auto-pause/stop
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}" && isTrue "${EXEC_DIRECTLY:-false}"; then
|
||||
log "EXEC_DIRECTLY=true is incompatible with ENABLE_AUTOPAUSE=true"
|
||||
exit 1
|
||||
@@ -67,25 +104,6 @@ if [[ $PROXY ]]; then
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
if [[ $RCON_PASSWORD_FILE ]]; then
|
||||
log ""
|
||||
if [ ! -e ${RCON_PASSWORD_FILE} ]; then
|
||||
log "Initial RCON password file ${RCON_PASSWORD_FILE} does not seems to exist."
|
||||
log "Please ensure your configuration."
|
||||
log "If you are using Docker Secrets feature, please check this for further information: "
|
||||
log " https://docs.docker.com/engine/swarm/secrets"
|
||||
log ""
|
||||
exit 1
|
||||
else
|
||||
RCON_PASSWORD=$(cat ${RCON_PASSWORD_FILE})
|
||||
export RCON_PASSWORD
|
||||
fi
|
||||
log ""
|
||||
fi
|
||||
|
||||
# For rcon-cli access
|
||||
echo "password=${RCON_PASSWORD}" > "$HOME/.rcon-cli.env"
|
||||
|
||||
function fixJavaPath() {
|
||||
# Some Docker management UIs grab all the image declared variables and present them for configuration.
|
||||
# When upgrading images across Java versions, that creates a mismatch in PATH's expected by base image.
|
||||
@@ -113,7 +131,8 @@ fi
|
||||
|
||||
cd /data || exit 1
|
||||
|
||||
export ORIGINAL_TYPE=${TYPE^^}
|
||||
export DECLARED_TYPE=${TYPE^^}
|
||||
export DECLARED_VERSION="$VERSION"
|
||||
|
||||
if isTrue "${ENABLE_AUTOPAUSE}"; then
|
||||
"${SCRIPTS:-/}start-autopause"
|
||||
@@ -185,6 +204,10 @@ case "${TYPE^^}" in
|
||||
exec "${SCRIPTS:-/}start-deployForge" "$@"
|
||||
;;
|
||||
|
||||
NEOFORGE|NEOFORGED)
|
||||
exec "${SCRIPTS:-/}start-deployNeoForge" "$@"
|
||||
;;
|
||||
|
||||
FABRIC)
|
||||
exec "${SCRIPTS:-/}start-deployFabric" "$@"
|
||||
;;
|
||||
@@ -211,6 +234,11 @@ case "${TYPE^^}" in
|
||||
exec "${SCRIPTS:-/}start-deployMagma" "$@"
|
||||
;;
|
||||
|
||||
KETTING)
|
||||
evaluateJavaCompatibilityForForge
|
||||
exec "${SCRIPTS:-/}start-deployKetting" "$@"
|
||||
;;
|
||||
|
||||
MOHIST)
|
||||
evaluateJavaCompatibilityForForge
|
||||
exec "${SCRIPTS:-/}start-deployMohist" "$@"
|
||||
|
||||
@@ -15,6 +15,7 @@ set -eu
|
||||
: "${CF_FORCE_INCLUDE_MODS:=}"
|
||||
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
|
||||
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
|
||||
: "${CF_OVERRIDES_EXCLUSIONS:=}" # --overrides-exclusions
|
||||
: "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}"
|
||||
: "${CF_MODPACK_MANIFEST:=}"
|
||||
|
||||
@@ -43,6 +44,9 @@ fi
|
||||
if [[ ${CF_SET_LEVEL_FROM} ]]; then
|
||||
args+=(--set-level-from="$CF_SET_LEVEL_FROM")
|
||||
fi
|
||||
if [[ ${CF_OVERRIDES_EXCLUSIONS} ]]; then
|
||||
args+=(--overrides-exclusions="$CF_OVERRIDES_EXCLUSIONS")
|
||||
fi
|
||||
args+=(
|
||||
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
|
||||
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
|
||||
|
||||
@@ -12,7 +12,7 @@ if isURL "${CUSTOM_SERVER}"; then
|
||||
filename=$(basename "${CUSTOM_SERVER}")
|
||||
export SERVER=/data/${filename}
|
||||
|
||||
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||
if [[ -f ${SERVER} ]] && ! isTrue "$FORCE_REDOWNLOAD"; then
|
||||
log "Using previously downloaded jar at ${SERVER}"
|
||||
else
|
||||
log "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
||||
|
||||
31
scripts/start-deployKetting
Executable file
31
scripts/start-deployKetting
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
: "${FORGE_VERSION:=${FORGEVERSION:-RECOMMENDED}}"
|
||||
: "${KETTING_VERSION:=}"
|
||||
: "${KETTING_TAG:=${KETTING_VERSION:0:7}}"
|
||||
|
||||
resolveVersion
|
||||
|
||||
if ! downloadUrl="https://github.com/kettingpowered/Ketting-1-20-x/releases/download/${KETTING_TAG}/ketting-${VERSION}-${FORGE_VERSION}-${KETTING_VERSION}-server.jar"; then
|
||||
log "ERROR failed to locate latest Ketting download for ${VERSION}. Is that version supported?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $downloadUrl == null ]]; then
|
||||
log "ERROR Ketting does not seem to be available for $VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
|
||||
log "ERROR: failed to download Ketting server jar from $downloadUrl"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export SERVER
|
||||
export FAMILY=HYBRID
|
||||
|
||||
exec "${SCRIPTS:-/}start-spiget" "$@"
|
||||
@@ -10,6 +10,7 @@ resultsFile=/data/.install-modrinth.env
|
||||
: "${MODRINTH_LOADER:=}"
|
||||
: "${MODRINTH_VERSION:=${MODRINTH_VERSION_ID:-}}"
|
||||
: "${MODRINTH_IGNORE_MISSING_FILES:=}"
|
||||
: "${MODRINTH_EXCLUDE_FILES:=}"
|
||||
|
||||
if [[ ! $MODRINTH_MODPACK ]]; then
|
||||
log "ERROR: MODRINTH_MODPACK must be set when using TYPE/MOD_PLATFORM of MODRINTH"
|
||||
@@ -52,6 +53,7 @@ setArg() {
|
||||
setArg --loader MODRINTH_LOADER
|
||||
setArg --version MODRINTH_VERSION
|
||||
setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE
|
||||
setArg --exclude-files MODRINTH_EXCLUDE_FILES
|
||||
|
||||
if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
|
||||
log "ERROR failed to install Modrinth modpack"
|
||||
|
||||
30
scripts/start-deployNeoForge
Normal file
30
scripts/start-deployNeoForge
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
: "${NEOFORGE_VERSION:=latest}"
|
||||
: "${NEOFORGE_FORCE_REINSTALL:=false}}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
resultsFile=/data/.run-neoforge.env
|
||||
|
||||
if ! mc-image-helper install-neoforge \
|
||||
--output-directory=/data \
|
||||
--results-file=${resultsFile} \
|
||||
--minecraft-version="${VERSION}" \
|
||||
--neoforge-version="${NEOFORGE_VERSION}" \
|
||||
--force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then
|
||||
log "ERROR failed to install Forge"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# grab SERVER and export it
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source ${resultsFile}
|
||||
set +a
|
||||
|
||||
export FAMILY=FORGE
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||
@@ -192,12 +192,6 @@ if isTrue "${USE_SIMD_FLAGS}"; then
|
||||
"
|
||||
fi
|
||||
|
||||
if isTrue "${DEBUG_MEMORY}"; then
|
||||
log "Memory usage and availability (in MB)"
|
||||
uname -a
|
||||
free -m
|
||||
fi
|
||||
|
||||
if [[ ${INIT_MEMORY} || ${MAX_MEMORY} ]]; then
|
||||
log "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
||||
if [[ ${INIT_MEMORY} ]]; then
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
|
||||
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
||||
if [[ "$MODCONFIG" ]]; then
|
||||
case "X$MODCONFIG" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
log "Downloading mod/plugin configs via HTTP"
|
||||
log " from $MODCONFIG ..."
|
||||
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
||||
if [ "$FAMILY" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modconfig.zip
|
||||
else
|
||||
mkdir -p /data/config
|
||||
unzip -o -d /data/config /tmp/modconfig.zip
|
||||
fi
|
||||
rm -f /tmp/modconfig.zip
|
||||
;;
|
||||
*)
|
||||
log "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupMounts" "$@"
|
||||
@@ -239,10 +239,7 @@ function handleModrinthProjects() {
|
||||
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
|
||||
if isFamily HYBRID FORGE; then
|
||||
loader=forge
|
||||
elif isFamily FABRIC; then
|
||||
loader=fabric
|
||||
else
|
||||
# we're left with Bukkit/Spigot down-lines where plugins seem to be
|
||||
loader="${TYPE,,}"
|
||||
fi
|
||||
mc-image-helper modrinth \
|
||||
@@ -302,4 +299,26 @@ if usesMods || usesPlugins; then
|
||||
handleCurseForgeFiles
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupModconfig" "$@"
|
||||
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
||||
if [[ "$MODCONFIG" ]]; then
|
||||
case "X$MODCONFIG" in
|
||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||
log "Downloading mod/plugin configs via HTTP"
|
||||
log " from $MODCONFIG ..."
|
||||
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
||||
if [ "$FAMILY" = "SPIGOT" ]; then
|
||||
mkdir -p /data/plugins
|
||||
unzip -o -d /data/plugins /tmp/modconfig.zip
|
||||
else
|
||||
mkdir -p /data/config
|
||||
unzip -o -d /data/config /tmp/modconfig.zip
|
||||
fi
|
||||
rm -f /tmp/modconfig.zip
|
||||
;;
|
||||
*)
|
||||
log "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exec "${SCRIPTS:-/}start-setupMounts" "$@"
|
||||
|
||||
@@ -5,6 +5,10 @@ IFS=$'\n\t'
|
||||
: "${EXISTING_OPS_FILE:=SKIP}"
|
||||
: "${EXISTING_WHITELIST_FILE:=SKIP}"
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
if [[ -v APPEND_OPS ]] && isTrue "${APPEND_OPS}"; then
|
||||
EXISTING_OPS_FILE=MERGE
|
||||
elif [[ -v OVERRIDE_OPS ]] && isTrue "${OVERRIDE_OPS}"; then
|
||||
@@ -17,14 +21,7 @@ elif [[ -v OVERRIDE_WHITELIST ]] && isTrue "${OVERRIDE_WHITELIST}"; then
|
||||
EXISTING_WHITELIST_FILE=SYNCHRONIZE
|
||||
fi
|
||||
|
||||
# shellcheck source=start-utils
|
||||
. "${SCRIPTS:-/}start-utils"
|
||||
isDebugging && set -x
|
||||
|
||||
sharedArgs=(--version="$VERSION")
|
||||
if isFalse "${ONLINE_MODE:-true}"; then
|
||||
sharedArgs+=( --offline )
|
||||
fi
|
||||
|
||||
if [[ -v OPS_FILE ]]; then
|
||||
existing="$EXISTING_OPS_FILE"
|
||||
|
||||
@@ -8,152 +8,29 @@
|
||||
: "${SKIP_SERVER_PROPERTIES:=false}"
|
||||
: "${ENABLE_WHITELIST:=}"
|
||||
|
||||
# FUNCTIONS
|
||||
function setServerPropValue {
|
||||
local prop=$1
|
||||
local value=$2
|
||||
# normalize booleans
|
||||
case ${value^^} in
|
||||
TRUE|FALSE)
|
||||
value=${value,,} ;;
|
||||
esac
|
||||
if [[ $prop =~ password ]]; then
|
||||
showValue="*****"
|
||||
else
|
||||
showValue="$value"
|
||||
fi
|
||||
if [ -f "$SERVER_PROPERTIES" ] && grep "${prop}" "$SERVER_PROPERTIES" > /dev/null; then
|
||||
debug "Setting ${prop} to '${showValue}' in ${SERVER_PROPERTIES}"
|
||||
sed -i "/^${prop}\s*=/ c ${prop}=${value//\\/\\\\}" "$SERVER_PROPERTIES"
|
||||
else
|
||||
debug "Adding ${prop} with '${showValue}' in ${SERVER_PROPERTIES}"
|
||||
echo "${prop}=${value}" >> "$SERVER_PROPERTIES"
|
||||
fi
|
||||
}
|
||||
|
||||
function setServerProp {
|
||||
local prop=$1
|
||||
local varName=$2
|
||||
|
||||
if [ -v $varName ]; then
|
||||
setServerPropValue "$prop" "${!varName}"
|
||||
fi
|
||||
}
|
||||
|
||||
function customizeServerProps {
|
||||
local firstSetup=$1
|
||||
# Whitelist processing
|
||||
if [ -n "$WHITELIST" ] || [ -n "$WHITELIST_FILE" ] || isTrue "${ENABLE_WHITELIST}"; then
|
||||
log "Enabling whitelist functionality"
|
||||
setServerPropValue "white-list" "true"
|
||||
setServerPropValue "enforce-whitelist" "true"
|
||||
WHITELIST_PROP=true
|
||||
ENFORCE_WHITELIST=true
|
||||
export WHITELIST_PROP ENFORCE_WHITELIST
|
||||
elif isTrue "$firstSetup" || isFalse "${ENABLE_WHITELIST}"; then
|
||||
log "Disabling whitelist functionality"
|
||||
setServerPropValue "white-list" "false"
|
||||
setServerProp "enforce-whitelist" ENFORCE_WHITELIST
|
||||
WHITELIST_PROP=false
|
||||
export WHITELIST_PROP
|
||||
fi
|
||||
|
||||
# normalize MOTD
|
||||
if [[ ${TYPE^^} = LIMBO ]]; then
|
||||
if [[ $MOTD ]] && ! [[ $MOTD =~ ^{ ]]; then
|
||||
# shellcheck disable=SC2089
|
||||
MOTD="{\"text\":\"${MOTD}\"}"
|
||||
fi
|
||||
fi
|
||||
|
||||
setServerProp "server-name" SERVER_NAME
|
||||
setServerProp "server-ip" SERVER_IP
|
||||
setServerProp "server-port" SERVER_PORT
|
||||
setServerProp "allow-nether" ALLOW_NETHER
|
||||
setServerProp "announce-player-achievements" ANNOUNCE_PLAYER_ACHIEVEMENTS
|
||||
setServerProp "enable-command-block" ENABLE_COMMAND_BLOCK
|
||||
setServerProp "spawn-animals" SPAWN_ANIMALS
|
||||
setServerProp "spawn-monsters" SPAWN_MONSTERS
|
||||
setServerProp "spawn-npcs" SPAWN_NPCS
|
||||
setServerProp "spawn-protection" SPAWN_PROTECTION
|
||||
setServerProp "generate-structures" GENERATE_STRUCTURES
|
||||
setServerProp "view-distance" VIEW_DISTANCE
|
||||
setServerProp "hardcore" HARDCORE
|
||||
setServerProp "snooper-enabled" SNOOPER_ENABLED
|
||||
setServerProp "max-build-height" MAX_BUILD_HEIGHT
|
||||
setServerProp "force-gamemode" FORCE_GAMEMODE
|
||||
setServerProp "max-tick-time" MAX_TICK_TIME
|
||||
setServerProp "enable-query" ENABLE_QUERY
|
||||
setServerProp "query.port" QUERY_PORT
|
||||
setServerProp "enable-rcon" ENABLE_RCON
|
||||
setServerProp "rcon.password" RCON_PASSWORD
|
||||
setServerProp "rcon.port" RCON_PORT
|
||||
setServerProp "max-players" MAX_PLAYERS
|
||||
setServerProp "max-world-size" MAX_WORLD_SIZE
|
||||
setServerProp "level-name" LEVEL
|
||||
setServerProp "level-seed" SEED
|
||||
setServerProp "pvp" PVP
|
||||
setServerProp "generator-settings" GENERATOR_SETTINGS
|
||||
setServerProp "online-mode" ONLINE_MODE
|
||||
setServerProp "allow-flight" ALLOW_FLIGHT
|
||||
setServerProp "resource-pack" RESOURCE_PACK
|
||||
setServerProp "resource-pack-sha1" RESOURCE_PACK_SHA1
|
||||
setServerProp "require-resource-pack" RESOURCE_PACK_ENFORCE
|
||||
setServerProp "player-idle-timeout" PLAYER_IDLE_TIMEOUT
|
||||
setServerProp "broadcast-console-to-ops" BROADCAST_CONSOLE_TO_OPS
|
||||
setServerProp "broadcast-rcon-to-ops" BROADCAST_RCON_TO_OPS
|
||||
setServerProp "enable-jmx-monitoring" ENABLE_JMX
|
||||
setServerProp "sync-chunk-writes" SYNC_CHUNK_WRITES
|
||||
setServerProp "enable-status" ENABLE_STATUS
|
||||
setServerProp "entity-broadcast-range-percentage" ENTITY_BROADCAST_RANGE_PERCENTAGE
|
||||
setServerProp "function-permission-level" FUNCTION_PERMISSION_LEVEL
|
||||
setServerProp "network-compression-threshold" NETWORK_COMPRESSION_THRESHOLD
|
||||
setServerProp "op-permission-level" OP_PERMISSION_LEVEL
|
||||
setServerProp "prevent-proxy-connections" PREVENT_PROXY_CONNECTIONS
|
||||
setServerProp "use-native-transport" USE_NATIVE_TRANSPORT
|
||||
setServerProp "simulation-distance" SIMULATION_DISTANCE
|
||||
setServerProp "previews-chat" PREVIEWS_CHAT
|
||||
setServerProp "enforce-secure-profile" ENFORCE_SECURE_PROFILE
|
||||
setServerProp "initial-enabled-packs" INITIAL_ENABLED_PACKS
|
||||
setServerProp "initial-disabled-packs" INITIAL_DISABLED_PACKS
|
||||
if [[ $MOTD ]]; then
|
||||
setServerPropValue "motd" "$(echo "$MOTD" | mc-image-helper asciify)"
|
||||
fi
|
||||
[[ $LEVEL_TYPE ]] && setServerPropValue "level-type" "${LEVEL_TYPE^^}"
|
||||
|
||||
if [ -n "$DIFFICULTY" ]; then
|
||||
case ${DIFFICULTY,,} in
|
||||
peaceful|0)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=0
|
||||
else
|
||||
DIFFICULTY=peaceful
|
||||
fi
|
||||
;;
|
||||
easy|1)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=1
|
||||
else
|
||||
DIFFICULTY=easy
|
||||
fi
|
||||
;;
|
||||
normal|2)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=2
|
||||
else
|
||||
DIFFICULTY=normal
|
||||
fi
|
||||
;;
|
||||
hard|3)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=3
|
||||
else
|
||||
DIFFICULTY=hard
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log "DIFFICULTY must be peaceful, easy, normal, or hard."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
setServerPropValue "difficulty" "$DIFFICULTY"
|
||||
fi
|
||||
|
||||
if [ -n "$MODE" ]; then
|
||||
if [[ -v MODE ]]; then
|
||||
log "Setting mode"
|
||||
case ${MODE,,} in
|
||||
su*|0)
|
||||
@@ -189,8 +66,69 @@ function customizeServerProps {
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
setServerPropValue "gamemode" "$MODE"
|
||||
fi
|
||||
|
||||
if [[ -v DIFFICULTY ]]; then
|
||||
case ${DIFFICULTY,,} in
|
||||
peaceful|0)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=0
|
||||
else
|
||||
DIFFICULTY=peaceful
|
||||
fi
|
||||
;;
|
||||
easy|1)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=1
|
||||
else
|
||||
DIFFICULTY=easy
|
||||
fi
|
||||
;;
|
||||
normal|2)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=2
|
||||
else
|
||||
DIFFICULTY=normal
|
||||
fi
|
||||
;;
|
||||
hard|3)
|
||||
if versionLessThan 1.13; then
|
||||
DIFFICULTY=3
|
||||
else
|
||||
DIFFICULTY=hard
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log "DIFFICULTY must be peaceful, easy, normal, or hard."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ -v LEVEL_TYPE ]]; then
|
||||
LEVEL_TYPE="${LEVEL_TYPE^^}"
|
||||
fi
|
||||
|
||||
setPropertiesArgs=(
|
||||
--definitions "/image/property-definitions.json"
|
||||
)
|
||||
if [[ -v CUSTOM_SERVER_PROPERTIES ]]; then
|
||||
setPropertiesArgs+=(--custom-properties "$CUSTOM_SERVER_PROPERTIES")
|
||||
fi
|
||||
if [[ -v SERVER_PROPERTIES_ESCAPE_UNICODE ]]; then
|
||||
if isTrue "$SERVER_PROPERTIES_ESCAPE_UNICODE"; then
|
||||
setPropertiesArgs+=(--escape-unicode)
|
||||
fi
|
||||
elif versionLessThan '1.20'; then
|
||||
setPropertiesArgs+=(--escape-unicode)
|
||||
fi
|
||||
|
||||
handleDebugMode
|
||||
if ! mc-image-helper set-properties "${setPropertiesArgs[@]}" "$SERVER_PROPERTIES"; then
|
||||
log "ERROR: failed to update server.properties"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Deploy server.properties file
|
||||
@@ -207,10 +145,10 @@ if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
|
||||
# which shows up in the server listing in the client
|
||||
if ! [ -v MOTD ]; then
|
||||
# snapshot is the odd case where we have to look at version to identify that label
|
||||
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||
if [[ ${DECLARED_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||
label=SNAPSHOT
|
||||
else
|
||||
label=${ORIGINAL_TYPE}
|
||||
label=${DECLARED_TYPE}
|
||||
fi
|
||||
|
||||
# Convert label to title-case
|
||||
|
||||
0
tests/setuponlytests/cf_files/require.sh
Normal file → Executable file
0
tests/setuponlytests/cf_files/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/conflicting_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/curseforge/require.sh
Normal file → Executable file
0
tests/setuponlytests/curseforge/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-file-exact/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-file-exact/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-gif-multiframe/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-gif-multiframe/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-png-atscale/require.sh
Normal file → Executable file
0
tests/setuponlytests/icon-png-atscale/require.sh
Normal file → Executable file
0
tests/setuponlytests/pufferfish/require.sh
Normal file → Executable file
0
tests/setuponlytests/pufferfish/require.sh
Normal file → Executable file
0
tests/setuponlytests/quilt/require.sh
Normal file → Executable file
0
tests/setuponlytests/quilt/require.sh
Normal file → Executable file
1
tests/setuponlytests/spiget/require.sh
Executable file
1
tests/setuponlytests/spiget/require.sh
Executable file
@@ -0,0 +1 @@
|
||||
[[ $EXTENDED_TESTS ]] || exit 1
|
||||
0
tests/setuponlytests/spigot_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/spigot_world_for_vanilla_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/spongevanilla_version_compare/require.sh
Normal file → Executable file
0
tests/setuponlytests/spongevanilla_version_compare/require.sh
Normal file → Executable file
0
tests/setuponlytests/test.sh
Normal file → Executable file
0
tests/setuponlytests/test.sh
Normal file → Executable file
0
tests/setuponlytests/vanilla_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/vanilla_world_for_spigot_server/require.sh
Normal file → Executable file
0
tests/setuponlytests/vanillatweaks_sharecode/require.sh
Normal file → Executable file
0
tests/setuponlytests/vanillatweaks_sharecode/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tar/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tar/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarbz2/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarbz2/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarzst/require.sh
Normal file → Executable file
0
tests/setuponlytests/world_from_tarzst/require.sh
Normal file → Executable file
Reference in New Issue
Block a user