Compare commits

...

39 Commits

Author SHA1 Message Date
Geoff Bourne
f4634c3fd9 docs: add service annotation patching to example kustomization (#3020) 2024-07-28 13:28:42 -05:00
ruskington
46ee2331bf Add itemphysic-lite to global exclude (#3014)
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2024-07-27 11:05:37 -05:00
Geoff Bourne
edffc58589 build: remove pre-installed ubuntu user for consistency (#3016) 2024-07-26 21:26:36 -05:00
dependabot[bot]
be846dd369 build(deps): bump docker/build-push-action from 6.3.0 to 6.4.1 in the updates group (#3010) 2024-07-23 14:14:19 -05:00
Josh
de1d7f422c Updated and Improved install scripts. (#3006) 2024-07-21 15:40:59 -05:00
Miika Kankare
b393b22136 Interpret backslash escapes for RCON_CMDS (#3008) 2024-07-21 10:29:41 -05:00
Geoff Bourne
d7c6a7d2b6 paper: download default configs before patching (#3004) 2024-07-20 13:15:16 -05:00
Geoff Bourne
0ff8e68f01 auto-cf: added blur-forge to global excludes (#3003) 2024-07-19 21:11:25 -05:00
Geoff Bourne
a71c5384b4 paper: suggest other release channel when build not found (#3000) 2024-07-17 21:12:12 -05:00
Geoff Bourne
379cef3c7e Re-download Modrinth projects based on modified time rather than filename existence (#2999) 2024-07-17 10:50:22 -05:00
dependabot[bot]
163a268770 build(deps): bump mkdocs-material from 9.5.28 to 9.5.29 in /docs in the patches group (#2996) 2024-07-15 07:21:00 -05:00
Pawel
f84ae66af3 Fix typo in reference to REMOVE_OLD_MODS variable (#2988) 2024-07-14 09:59:07 -05:00
Geoff Bourne
58face9c1b Avoid logging userinfo from MODS/PLUGINS URLs (#2993) 2024-07-14 09:58:39 -05:00
Geoff Bourne
b8e6eea265 auto-cf: remove necronomicon from global exclusions (#2991) 2024-07-14 09:35:16 -05:00
Geoff Bourne
78b55df635 mcopy: support basic auth via URL (#2989) 2024-07-13 21:51:34 -05:00
Geoff Bourne
0f9941373b cf: copy files found in downloads repo (#2986) 2024-07-13 13:38:43 -05:00
Geoff Bourne
6ac313ae71 cf: check downloads repo before attempting download of mod in modpack (#2985) 2024-07-13 10:36:57 -05:00
Geoff Bourne
bc0a87cc53 modrinth: add default exclusions discovered for prominence 2 (#2982) 2024-07-12 15:00:19 -05:00
Felipe Paschoal Bergamo
5baf398af3 Optimize startup on versionLessThan function (#2979) 2024-07-11 14:24:02 -05:00
dependabot[bot]
8dac5d1428 build(deps): bump docker/build-push-action from 5.4.0 to 6.3.0 (#2975) 2024-07-11 08:18:04 -05:00
Jeff Sandberg
4232a981e8 Update the autopause server listener to be proxy aware (#2978) 2024-07-08 14:14:10 -05:00
dependabot[bot]
b89c698676 build(deps): bump the updates group with 2 updates (#2974) 2024-07-08 07:44:38 -05:00
dependabot[bot]
8a5b5bbe70 build(deps): bump mkdocs-material from 9.5.27 to 9.5.28 in /docs in the patches group (#2976) 2024-07-08 07:31:56 -05:00
Jeff Sandberg
11d8d917f2 Add use-proxy support to health extra args (#2973) 2024-07-08 07:30:37 -05:00
Akashi_SN
2023f5aa31 Remove JEI from exclusion list to fix ATM9 launch issue (#2971) 2024-07-07 08:13:04 -05:00
Geoff Bourne
bcd8db1306 Fixed exclusion of no-night-vision-flashing (#2970) 2024-07-06 22:59:23 -05:00
bobpattison123
62ce504da3 Changed foamfix mod name (#2969) 2024-07-06 22:51:33 -05:00
KrosTheProto
c87145a5e4 More Client-side mods to exclude (#2967) 2024-07-06 19:29:48 -05:00
Geoff Bourne
c4f69bf577 Clarify MODRINTH_ALLOWED_VERSION_TYPE inclusion (#2966) 2024-07-06 13:15:06 -05:00
Geoff Bourne
67b790dfed build: fully remove java17-jdk variant from build (#2904) 2024-07-06 12:22:02 -05:00
Geoff Bourne
a55d575375 Corrected "Updated mod exclusion list" (#2965)
Co-authored-by: KrosTheProto <billyds132@gmail.com>
2024-07-06 09:48:47 -05:00
KrosTheProto
70cc1298c2 Updated mod exclusion list (#2964) 2024-07-06 08:25:28 -05:00
Geoff Bourne
b9a61c8852 Add ryoamiclights to CF global excludes (#2948) 2024-07-04 11:57:16 -05:00
Geoff Bourne
75496d6e0b cf: add support for modpacks that use NeoForge (#2943) 2024-07-01 14:18:33 -05:00
Connor
50caaf98ef add check for absolute directories to world copy script (#2939) 2024-07-01 07:47:42 -05:00
Geoff Bourne
14a8f903ae docs: updating AUTO_CURSEFORGE examples that no longer need /downloads (#2938) 2024-06-30 21:56:44 -05:00
Geoff Bourne
c70f9c3fff modrinth: add support for default excludes/includes (#2937) 2024-06-30 15:15:44 -05:00
Geoff Bourne
a933e92460 neoforge: correctly handle versioning that drops the ".0" (#2935) 2024-06-28 22:05:54 -05:00
LeaderbotX400
4c42a3e46c Update cf-exclude-include.json with Apple Skin, etc (#2932) 2024-06-27 13:45:55 -05:00
35 changed files with 445 additions and 126 deletions

View File

@@ -11,6 +11,7 @@ on:
- "docs/**"
- "examples/**"
- "notes/**"
- "kustomize/**"
jobs:
build:
@@ -60,10 +61,6 @@ jobs:
baseImage: container-registry.oracle.com/graalvm/jdk:17-ol8
platforms: linux/amd64,linux/arm64
mcVersion: 1.20.4
- variant: java17-jdk
baseImage: eclipse-temurin:17-focal
platforms: linux/amd64,linux/arm/v7,linux/arm64
mcVersion: 1.20.4
- variant: java17-alpine
baseImage: eclipse-temurin:17-jre-alpine
platforms: linux/amd64
@@ -136,13 +133,13 @@ jobs:
org.opencontainers.image.authors=Geoff Bourne <itzgeoff@gmail.com>
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
uses: docker/setup-buildx-action@v3.4.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
uses: docker/setup-qemu-action@v3.1.0
- name: Build for test
uses: docker/build-push-action@v5.4.0
uses: docker/build-push-action@v6.4.1
with:
platforms: linux/amd64
tags: ${{ env.IMAGE_TO_TEST }}
@@ -180,7 +177,7 @@ jobs:
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v5.4.0
uses: docker/build-push-action@v6.4.1
if: github.actor == github.repository_owner
with:
platforms: ${{ matrix.platforms }}

View File

@@ -8,6 +8,7 @@ on:
- "docs/**"
- "examples/**"
- "notes/**"
- "kustomize/**"
- "docker-compose*.yml"
- "mkdocs.yml"
@@ -52,10 +53,10 @@ jobs:
fetch-depth: 0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
uses: docker/setup-buildx-action@v3.4.0
- name: Confirm multi-arch build
uses: docker/build-push-action@v5.4.0
uses: docker/build-push-action@v6.4.1
with:
platforms: ${{ matrix.platforms }}
# ensure latest base image is used
@@ -65,7 +66,7 @@ jobs:
cache-from: type=gha,scope=${{ matrix.variant }}
- name: Build for test
uses: docker/build-push-action@v5.4.0
uses: docker/build-push-action@v6.4.1
with:
# Only build single platform since loading multi-arch image into daemon fails with
# "docker exporter does not currently support exporting manifest lists"

View File

@@ -23,11 +23,11 @@ EXPOSE 25565
ARG APPS_REV=1
ARG GITHUB_BASEURL=https://github.com
ARG EASY_ADD_VERSION=0.8.6
ARG EASY_ADD_VERSION=0.8.7
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.3
ARG RESTIFY_VERSION=1.7.4
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${RESTIFY_VERSION} --var app=restify --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
@@ -37,7 +37,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--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.12
ARG MC_MONITOR_VERSION=0.12.13
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--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
@@ -47,7 +47,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--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.39.0
ARG MC_HELPER_VERSION=1.39.9
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

View File

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

View File

@@ -3,6 +3,7 @@
set -e
set -o pipefail
# Install necessary packages
apk add --no-cache -U \
openssl \
imagemagick \
@@ -14,7 +15,8 @@ apk add --no-cache -U \
procps \
shadow \
bash \
curl iputils \
curl \
iputils \
git \
jq \
mysql-client \
@@ -29,11 +31,15 @@ apk add --no-cache -U \
libwebp \
libcap
# Patched knockd
# Download and install patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd
# Set git credentials
echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
# Set Git credentials globally
cat <<EOF >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -26,5 +26,5 @@
: Can be set to `none` (the default), `required`, or `optional` to download required and/or optional dependencies.
`MODRINTH_ALLOWED_VERSION_TYPE`
: The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`.
: The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`. Setting to `beta` will pick up both release and beta versions. Setting to `alpha` will pick up release, beta, and alpha versions.

View File

@@ -1,4 +1,4 @@
mkdocs-material == 9.5.27
mkdocs-material == 9.5.29
mkdocs-autorefs == 1.0.1
mkdocstrings == 0.25.1
mkdocs-literate-nav == 0.6.1

View File

@@ -73,6 +73,10 @@ To force include client mods, set `MODRINTH_FORCE_INCLUDE_FILES` to a comma or n
yet-another-config-lib
```
## Default exclude/includes
The image comes with a default set of exclude/includes, maintained [in the repo files area](https://github.com/itzg/docker-minecraft-server/blob/master/files/modrinth-exclude-include.json) and uses the same [JSON schema](https://github.com/itzg/mc-image-helper?tab=readme-ov-file#excludeinclude-file-schema) as Auto CurseForge. Those defaults can be disabled by setting the env var `MODRINTH_DEFAULT_EXCLUDE_INCLUDES` to an empty string.
## Excluding Overrides Files
Modrinth mrpack/zip files may include an `overrides` subdirectory that contains 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 `MODRINTH_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.

View File

@@ -16,6 +16,14 @@ To allow for the selection of experimental builds, set `PAPER_CHANNEL` to "exper
docker run ... -e TYPE=PAPER -e PAPER_CHANNEL=experimental ...
```
!!! tip
If you see the following error, it likely means you need to set the env var `PAPER_CHANNEL` to "experimental"
```
No build found for version 1.21 with channel 'default'
```
If you are hosting your own copy of Paper you can override the download URL with `PAPER_DOWNLOAD_URL=<url>`.
If you have attached a host directory to the `/data` volume, then you can install plugins via the `plugins` subdirectory. You can also [attach a `/plugins` volume](../../mods-and-plugins/index.md#optional-plugins-mods-and-config-attach-points). If you add plugins while the container is running, you'll need to restart it to pick those up.

View File

@@ -16,21 +16,6 @@ services:
- "25565:25565"
volumes:
- mc-data:/data
- ./downloads:/downloads
# Manually download the following and put into the 'downloads' directory next to this compose file
#
# Mod Filename Download page
# =========================== ========================================= ====================================================================================
# Fish of Thieves [Fabric 1.20.1] Fish of Thieves v3.0.3 https://www.curseforge.com/minecraft/mc-mods/fish-of-thieves/files/4958329
# Only Hammers [FORGE/FABRIC] OnlyHammers-1.20.1-0.6-Fabric https://www.curseforge.com/minecraft/mc-mods/only-hammers-forge-fabric/files/4832068
# Sprinklerz sprinklerz-0.5_fabric.jar https://www.curseforge.com/minecraft/mc-mods/sprinklerz/files/4835664
# Frog Legs (Fabric/Forge) FrogLegs-v2.0.0-1.20.1-Fabric.jar https://www.curseforge.com/minecraft/mc-mods/froglegs/files/4917818
# TrimsEffects [FABRIC] TrimsEffects - MC 1.20.X - 1.1.0 https://www.curseforge.com/minecraft/mc-mods/trimseffects/files/4954156
# Display Case Display Case-fabric-1.20-1.0.8.jar https://www.curseforge.com/minecraft/mc-mods/displaycase/files/4921333
# Structory: Towers Structory Towers 1.20.4 v1.0.6 https://www.curseforge.com/minecraft/mc-mods/structory-towers/files/4937875
# Packet Fixer Packet Fixer Fabric 1.2.1 https://www.curseforge.com/minecraft/mc-mods/packet-fixer/files/4884316
# Perfect Plushies Perfect Plushies 1.9.0 [Fabric] https://www.curseforge.com/minecraft/mc-mods/perfect-plushies/files/4985767
# Structory Structory 1.20.2 v1.3.4 https://www.curseforge.com/minecraft/mc-mods/structory/files/4937872
volumes:
mc-data: {}

View File

@@ -1,6 +1,6 @@
services:
mc:
image: itzg/minecraft-server
image: itzg/minecraft-server:java17
ports:
- "25565:25565"
environment:
@@ -9,11 +9,10 @@ services:
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
CF_FILENAME_MATCHER: "1.0.6"
# CF_FILENAME_MATCHER: "1.1.0"
MEMORY: 4G
volumes:
- mc-data:/data
- ../downloads:/downloads
# Since Docker's default volume driver creates volumes owned by root, this
# init container will change ownership to match final UID of mc service, above
init-filebrowser:

View File

@@ -14,7 +14,6 @@ services:
MEMORY: 4G
volumes:
- mc-data:/data
- ./downloads:/downloads
volumes:
mc-data: {}

View File

@@ -1,6 +1,6 @@
services:
mc:
image: itzg/minecraft-server:java8-multiarch
image: itzg/minecraft-server:java8
ports:
- "25565:25565"
environment:
@@ -43,7 +43,6 @@ services:
MEMORY: 4G
volumes:
- mc-data:/data
- ./downloads:/downloads
volumes:
mc-data: {}

View File

@@ -7,11 +7,10 @@ services:
# Set CF_API_KEY=... in a .env file next to this compose file and don't source control that file
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: better-mc-fabric-bmc1
CF_FILENAME_MATCHER: v18.5
# CF_FILENAME_MATCHER: v18.5
MEMORY: 4G
volumes:
- mc:/data
- ../downloads:/downloads
ports:
- "25565:25565"

View File

@@ -2,22 +2,14 @@ services:
mc:
image: itzg/minecraft-server:java17
environment:
DEBUG: true
SETUP_ONLY: true
EULA: true
TYPE: MODRINTH
VERSION: 1.20.1
MEMORY: 4G
MODRINTH_MODPACK: better-mc-forge-bmc4
MODRINTH_VERSION: v26
MODRINTH_EXCLUDE_FILES: |
citresewn
oculus
yungsmenutweaks
notenoughanimations
ryoamiclights
euphoriapatcher
entity_model_features
entity_texture_features
3dskinlayers
connector
MODRINTH_VERSION: v28
MODRINTH_OVERRIDES_EXCLUSIONS: |
mods/NekosEnchantedBooks-*.jar
mods/citresewn-*.jar

View File

@@ -0,0 +1,18 @@
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "true"
MOD_PLATFORM: AUTO_CURSEFORGE
# allocate from https://console.curseforge.com/ and set in .env file
CF_API_KEY: ${CF_API_KEY}
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/prominence-2-rpg
CF_FILENAME_MATCHER: "2.8.7"
MEMORY: 4G
volumes:
- mc-data:/data
volumes:
mc-data: {}

View File

@@ -13,38 +13,21 @@ services:
# Optional: select a specific version/file
#CF_FILENAME_MATCHER: "0.2.34"
CF_EXCLUDE_MODS: |
auudio-forge
betterf3
better-third-person
clickable-advancements
controlling
craftpresence
creative-core
default-options
drippy-loading-screen
embeddium
embeddium-extension
embeddium-extras
equipment-compare
ezzoom
fading-night-vision
fancymenu
item-borders
itemphysic-lite
just-enough-resources-jer
konkrete
legendary-tooltips
mouse-tweaks
oauth
oculus
sound-filters
textrues-embeddium-options
toast-control
CF_FORCE_SYNCHRONIZE: "true"
MEMORY: 4G
volumes:
- mc-data:/data
- ./downloads:/downloads
volumes:
mc-data: {}

View File

@@ -16,10 +16,6 @@ services:
ENABLE_COMMAND_BLOCK: true
DIFFICULTY: hard
volumes:
# Need to place non-distributable mods in ./downloads/mods
# As of Update-10.0.0
# - Neon Craft 2 v2.2: https://www.curseforge.com/minecraft/mc-mods/neon-craft-2-mod/files/3726051
- ./downloads:/downloads
- mc-data:/data
volumes:

View File

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

View File

@@ -1,30 +1,66 @@
{
"globalExcludes": [
"ambientsounds",
"auudio-forge",
"ambience-music-mod",
"appleskin",
"armor-chroma",
"armor-toughness-bar",
"beehivetooltips",
"better-advancements",
"betterf3",
"betterfps",
"better-foliage",
"better-placement",
"better-sprinting",
"better-tips-nbt-tag",
"better-third-person",
"biomeinfo",
"block-drops-jei-addon",
"blur-forge",
"cherished-worlds",
"chunk-animator",
"clickable-advancements",
"configured",
"controlling",
"ctm",
"custom-main-menu",
"defensive-measures",
"ding",
"drippy-loading-screen",
"dynamiclights-reforged",
"dynamic-surroundings",
"easiervillagertrading",
"effective-forge",
"embeddium",
"embeddium-extension",
"embeddium-extras",
"enchantment-descriptions",
"entity-collision-fps-fix",
"entity-texture-features-fabric",
"entityculling",
"extreme-sound-muffler",
"ezzoom",
"fading-night-vision",
"falling-leaves-forge",
"fancymenu",
"faster-ladder-climbing",
"foamfix-optimization-mod",
"free-cam",
"ftb-backups-2",
"fullscreen-windowed-borderless-for-minecraft",
"hwyla",
"ignitioncoil",
"inmisaddon",
"irisshaders",
"iris-flywheel-compat",
"itemphysic-lite",
"item-obliterator",
"itemzoom",
"just-enough-harvestcraft",
"just-enough-resources-jer",
"legendary-tooltips",
"lootbeams",
"loot-capacitor-tooltips",
"magnesium-extras",
"menumobs",
@@ -34,6 +70,7 @@
"neat",
"nekos-enchanted-books",
"no-recipe-book",
"no-nv-flash",
"not-enough-animations",
"oculus",
"oldjavawarning",
@@ -43,13 +80,28 @@
"resource-reloader",
"rubidium",
"rubidium-extra",
"ryoamiclights",
"schematica",
"searchables",
"shulkerboxviewer",
"skin-layers-3d",
"smart-hud",
"smooth-font",
"smoothwater",
"sodium",
"sound-filters",
"sound-physics-remastered",
"stellar-sky",
"swingthroughgrass",
"textrues-embeddium-options",
"textrues-rubidium-options",
"thaumic-jei",
"tips",
"torohealth-damage-indicators",
"true-darkness",
"ungrab-mouse-mod",
"vanillafix",
"visuality",
"waila-harvestability",
"zume"
],

View File

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

View File

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

View File

@@ -12,7 +12,7 @@ set -eu
: "${CF_FORCE_SYNCHRONIZE:=false}"
: "${CF_FORCE_REINSTALL_MODLOADER:=false}"
: "${CF_IGNORE_MISSING_FILES:=}"
: "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
: "${CF_EXCLUDE_INCLUDE_FILE=/image/cf-exclude-include.json}"
: "${CF_EXCLUDE_MODS:=}"
: "${CF_FORCE_INCLUDE_MODS:=}"
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from

View File

@@ -9,10 +9,11 @@ resultsFile=/data/.install-modrinth.env
: "${MODRINTH_MODPACK:=${MODRINTH_PROJECT:-}}"
: "${MODRINTH_LOADER:=}"
: "${MODRINTH_VERSION:=${MODRINTH_VERSION_ID:-}}"
: "${MODRINTH_IGNORE_MISSING_FILES:=}"
: "${MODRINTH_EXCLUDE_FILES:=}"
: "${MODRINTH_FORCE_INCLUDE_FILES:=}"
: "${MODRINTH_OVERRIDES_EXCLUSIONS:=}"
: "${MODRINTH_IGNORE_MISSING_FILES=}"
: "${MODRINTH_EXCLUDE_FILES=}"
: "${MODRINTH_FORCE_INCLUDE_FILES=}"
: "${MODRINTH_OVERRIDES_EXCLUSIONS=}"
: "${MODRINTH_DEFAULT_EXCLUDE_INCLUDES=/image/modrinth-exclude-include.json}"
if [[ ! $MODRINTH_MODPACK ]]; then
log "ERROR: MODRINTH_MODPACK must be set when using TYPE/MOD_PLATFORM of MODRINTH"
@@ -60,6 +61,7 @@ setArg --default-version-type MODRINTH_DEFAULT_VERSION_TYPE
setArg --exclude-files MODRINTH_EXCLUDE_FILES
setArg --force-include-files MODRINTH_FORCE_INCLUDE_FILES
setArg --overrides-exclusions MODRINTH_OVERRIDES_EXCLUSIONS
setArg --default-exclude-includes MODRINTH_DEFAULT_EXCLUDE_INCLUDES
if ! mc-image-helper install-modrinth-modpack "${args[@]}"; then
log "ERROR failed to install Modrinth modpack"

View File

@@ -52,6 +52,12 @@ else
fi
# Download default configs to allow for consistent patching
for c in paper-global.yml paper-world-defaults.yml spigot.yml; do
DOWNLOAD_DEFAULT_CONFIGS+=",${PAPER_CONFIG_DEFAULTS_REPO}/${VERSION}/$c"
done
export DOWNLOAD_DEFAULT_CONFIGS
# Normalize on Spigot for downstream operations
export FAMILY=SPIGOT

View File

@@ -64,6 +64,9 @@ patchLog4jConfig() {
canUseRollingLogs=false
}
# Temporarily disable debugging output
oldState=$(shopt -po xtrace || true)
shopt -u -o xtrace
# Patch Log4j remote code execution vulnerability
# See https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition
if versionLessThan 1.7; then
@@ -80,6 +83,7 @@ elif isType PURPUR && versionLessThan 1.18.1; then
elif versionLessThan 1.18.1; then
useFallbackJvmFlag=true
fi
eval "$oldState"
if ${useFallbackJvmFlag}; then
JVM_OPTS="-Dlog4j2.formatMsgNoLookups=true ${JVM_OPTS}"
@@ -227,6 +231,12 @@ MC_HEALTH_EXTRA_ARGS=(
--use-server-list-ping
)
" > /data/.mc-health.env
elif isTrue "$USES_PROXY_PROTOCOL"; then
echo "
MC_HEALTH_EXTRA_ARGS=(
--use-proxy
)
" > /data/.mc-health.env
else
rm -f /data/.mc-health.env
fi

View File

@@ -4,6 +4,7 @@
. "${SCRIPTS:-/}start-utils"
set -e
handleDebugMode
: "${REPLACE_ENV_IN_PLACE:=${REPLACE_ENV_VARIABLES:-false}}"
: "${REPLACE_ENV_PATHS:=/data}"
@@ -13,6 +14,7 @@ set -e
: "${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=}"
: "${PATCH_DEFINITIONS:=}"
: "${DEBUG:=false}"
: "${DOWNLOAD_DEFAULT_CONFIGS:=}"
if isTrue "${REPLACE_ENV_IN_PLACE}"; then
log "Replacing env variables in ${REPLACE_ENV_PATHS} that match the prefix '$REPLACE_ENV_VARIABLE_PREFIX' ..."
@@ -25,6 +27,16 @@ if isTrue "${REPLACE_ENV_IN_PLACE}"; then
"${REPLACE_ENV_PATHS[@]}"
fi
if [[ $DOWNLOAD_DEFAULT_CONFIGS ]]; then
log "Downloading default configs, if needed"
if ! mc-image-helper mcopy \
--to /data/config \
--skip-existing --skip-up-to-date=false \
"$DOWNLOAD_DEFAULT_CONFIGS" 2> /dev/null; then
log "WARN: one or more default config files were not available from $DOWNLOAD_DEFAULT_CONFIGS"
fi
fi
if [[ ${PATCH_DEFINITIONS} ]]; then
log "Applying patch definitions from ${PATCH_DEFINITIONS}"
mc-image-helper patch \

View File

@@ -5,10 +5,15 @@
set -e
isDebugging && set -x
if [ "$TYPE" = "CURSEFORGE" ]; then
worldDest=$FTB_DIR/${LEVEL:-world}
# support absolute directories
if [[ "${LEVEL:-world}" =~ ^\/.*$ ]]; then
worldDest=${LEVEL}
else
worldDest=/data/${LEVEL:-world}
if [ "$TYPE" = "CURSEFORGE" ]; then
worldDest=$FTB_DIR/${LEVEL:-world}
else
worldDest=/data/${LEVEL:-world}
fi
fi
if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then

View File

@@ -161,11 +161,121 @@ function normalizeMemSize() {
echo $((val * scale))
}
function compare_version() {
local left_version=$1
local comparison=$2
local right_version=$3
if [[ -z "$left_version" ]]; then
echo "Left version is required"
return 1
fi
if [[ -z "$right_version" ]]; then
echo "Right version is required"
return 1
fi
# Handle version channels ('a', 'b', or numeric)
if [[ $left_version == a* || $left_version == b* ]]; then
left_version=${left_version:1}
fi
if [[ $right_version == a* || $right_version == b* ]]; then
right_version=${right_version:1}
fi
local left_version_channel=${left_version:0:1}
if [[ $left_version_channel =~ [0-9] ]]; then
left_version_channel='r'
fi
local right_version_channel=${right_version:0:1}
if [[ $right_version_channel =~ [0-9] ]]; then
right_version_channel='r'
fi
if [[ $comparison == "lt" && $left_version_channel < $right_version_channel ]]; then
return 0
elif [[ $comparison == "lt" && $left_version_channel > $right_version_channel ]]; then
return 1
elif [[ $comparison == "gt" && $left_version_channel > $right_version_channel ]]; then
return 0
elif [[ $comparison == "gt" && $left_version_channel < $right_version_channel ]]; then
return 1
elif [[ $comparison == "le" && $left_version_channel < $right_version_channel ]]; then
return 0
elif [[ $comparison == "le" && $left_version_channel == $right_version_channel ]]; then
return 0
elif [[ $comparison == "ge" && $left_version_channel > $right_version_channel ]]; then
return 0
elif [[ $comparison == "ge" && $left_version_channel == $right_version_channel ]]; then
return 0
elif [[ $comparison == "eq" && $left_version_channel == $right_version_channel ]]; then
return 0
fi
# Compare the versions using sort -V
local result
case $comparison in
"lt")
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
result=0
else
result=1
fi
;;
"le")
if [[ $(echo -e "$left_version\n$right_version" | sort -V | head -n1) == "$left_version" ]]; then
result=0
else
result=1
fi
;;
"eq")
if [[ "$left_version" == "$right_version" ]]; then
result=0
else
result=1
fi
;;
"ge")
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" ]]; then
result=0
else
result=1
fi
;;
"gt")
if [[ $(echo -e "$left_version\n$right_version" | sort -V | tail -n1) == "$left_version" && "$left_version" != "$right_version" ]]; then
result=0
else
result=1
fi
;;
*)
echo "Unsupported comparison operator: $comparison"
return 1
;;
esac
return $result
}
function versionLessThan() {
local oldState
# The return status when listing options is zero if all optnames are enabled, non- zero otherwise.
oldState=$(shopt -po xtrace || true)
shopt -u -o xtrace
# Use if-else since strict mode might be enabled
if mc-image-helper compare-versions "${VERSION}" lt "${1?}"; then
if compare_version "${VERSION}" "lt" "${1?}"; then
eval "$oldState"
return 0
else
eval "$oldState"
return 1
fi
}
@@ -342,7 +452,7 @@ function ensureRemoveAllModsOff() {
reason=${1?}
if isTrue "${REMOVE_OLD_MODS:-false}"; then
log "WARNING using REMOVE_OLDS_MODS interferes with $reason -- it is now disabled"
log "WARNING using REMOVE_OLD_MODS interferes with $reason -- it is now disabled"
REMOVE_OLD_MODS=false
fi
}

View File

@@ -2,6 +2,8 @@
set -euo pipefail
IFS=$'\n\t'
: "${IMAGE_TO_TEST:=itzg/minecraft-server}"
# go to script root directory
cd "$(dirname "$0")" || exit 1
@@ -46,7 +48,7 @@ setupOnlyMinecraftTest(){
outputContainerLog "$logs"
result=1
elif [ -f verify.sh ]; then
if ! docker run --rm --entrypoint bash -v "${PWD}/data":/data -v "${PWD}/verify.sh":/verify "${IMAGE_TO_TEST:-itzg/minecraft-server}" -e /verify; then
if ! docker run --rm --entrypoint bash -v "${PWD}/data":/data -v "${PWD}/verify.sh":/verify "${IMAGE_TO_TEST}" -e /verify; then
endTime=$(date +%s)
echo "${folder} FAILED verify in $(delta start)"
outputContainerLog "$logs"
@@ -74,7 +76,7 @@ if (( $# > 0 )); then
else
readarray -t folders < <(find . -maxdepth 2 -mindepth 2 -name docker-compose.yml -printf '%h\n')
for folder in "${folders[@]}"; do
echo "Starting Tests in ${folder}"
echo "Starting Tests in ${folder} using $IMAGE_TO_TEST"
setupOnlyMinecraftTest "$folder"
done
fi