Compare commits

..

46 Commits

Author SHA1 Message Date
Geoff Bourne
8987d2cc81 Disabling packwiz test since maven.packwiz.infra.link unresolvable (#2065) 2023-04-04 22:24:18 -05:00
Geoff Bourne
45d5fd1a97 Fetch connection pool max idle timeout configurable 2023-04-04 22:07:15 -05:00
Geoff Bourne
93c0cead40 Tweak level of new docs link (#2063) 2023-04-04 08:26:44 -05:00
Ryan Conrad
195d35214b updated the readme to include the link to the docs site. (#2061) 2023-04-03 21:37:22 -05:00
Geoff Bourne
2de3efea15 Update CF_API_KEY example for docker run (#2060) 2023-04-03 09:38:17 -05:00
Geoff Bourne
0599fa64c2 With AUTO_CURSEFORGE handle modpacks not allowed for distribution by author (#2059) 2023-04-02 18:19:42 -05:00
Geoff Bourne
94df6cca20 Redacts sensitive headers from debugs like with AUTO_CURSEFORGE (#2058) 2023-04-01 21:34:00 -05:00
Geoff Bourne
6fb34cd256 Downloads handle content disposition filename with RFC 2047 encoding (#2057) 2023-04-01 14:12:56 -05:00
Ryan Conrad
0d5e44a338 Auto CurseForge, added docs to use env file (#2054) 2023-03-30 17:44:30 -05:00
Ryan Conrad
cffe4012aa added information on the escaping of $ in the CF API Key (#2050) 2023-03-30 13:15:51 -05:00
Geoff Bourne
909ea4e214 autocf: determine mod file availability from downloadUrl (#2046) 2023-03-30 08:03:39 -05:00
Geoff Bourne
106996f06f autocf: switch to official CurseForge API, but needs CF_API_KEY (#2043) 2023-03-29 21:00:39 -05:00
Geoff Bourne
d672b3878f autocf: ensure modpack query is not cached too much (#2040) 2023-03-27 21:20:38 -05:00
dependabot[bot]
0d71ace7df build(deps): bump actions/stale from 7 to 8 (#2036) 2023-03-27 08:20:24 -05:00
Geoff Bourne
bee51671bf forge: support version discovery of 1.5, 1.7 installer (#2032) 2023-03-25 14:10:26 -05:00
James Mighion
ab2f77d8ba Adding rootless autopause instructions to the readme. (#2030) 2023-03-24 12:00:11 -05:00
Geoff Bourne
f1aad07804 Fix curl usage for knockd install (#2027) 2023-03-21 20:12:21 -05:00
Metalcape
e7084c233e Fix autopause not working in java8 (#2025) 2023-03-21 13:37:55 -05:00
Geoff Bourne
7f3c3b2d64 autocf: fixed issue where exclude file alone was ignored (#2024) 2023-03-21 08:13:21 -05:00
Geoff Bourne
f6493892e5 autocf: allow for exclude/include file and list (#2019) 2023-03-19 20:00:01 -05:00
Geoff Bourne
0dd3e9e9b7 autocf: adjusted excludes for valhesia-5 (#2018) 2023-03-19 18:42:08 -05:00
Geoff Bourne
db3fbd8cd1 Fixing Modrinth projects support for non-Forge (#2016) 2023-03-17 22:15:01 -05:00
Geoff Bourne
e01fe46645 autocf: improve error message when modpack file is missing manifest (#2015) 2023-03-17 21:29:36 -05:00
Yorick Bosman
f2b3f6ea48 Correcting and extending vanillatweaks example (#2013) 2023-03-17 14:24:16 -05:00
Geoff Bourne
8ae707954b Extract versions from provided Forge installer (#2012) 2023-03-17 08:40:21 -05:00
Geoff Bourne
08d8472579 Allow for latest Forge version to be behind vanilla version (#2006) 2023-03-14 22:10:21 -05:00
Geoff Bourne
0f359dbf82 Verify java compatibility for AUTO_CURSEFORGE (#2005) 2023-03-14 07:59:33 -05:00
Metalcape
e217ac503e Use modified knockd to set a cooldown on port 19132 (#2003) 2023-03-12 13:40:35 -05:00
Geoff Bourne
e43669d792 Clarify in docs to not port forward RCON unless secure (#2004) 2023-03-12 11:58:43 -05:00
Geoff Bourne
cf4fed616a Unzip Modrinth files that are zips (#1992) 2023-03-05 16:22:01 -06:00
Geoff Bourne
6d5b7b4362 Fix Modrinth download when no version files are primary (#1991) 2023-03-05 12:47:20 -06:00
Geoff Bourne
9b538267a1 Ensure Modrinth support specifies paper/purpur loader as needed (#1990) 2023-03-05 08:55:19 -06:00
Geoff Bourne
b7e93e56e5 Revert "modrinth: adapt version lookup to API changes (#1987)" (#1989)
This reverts commit 3624dc02a3.
2023-03-05 08:25:35 -06:00
Geoff Bourne
3624dc02a3 modrinth: adapt version lookup to API changes (#1987) 2023-03-04 09:34:09 -06:00
Geoff Bourne
705e266f76 autocf: modpack fileName included in manifest (#1977) 2023-02-25 10:18:34 -06:00
Geoff Bourne
a18a274c6c autocf: ensure modpack listing API always provides up to date (#1974) 2023-02-23 12:58:12 -06:00
Connor
19c39f8e53 auto_cf: added rubiddium dynamic lights to exclude list (#1971) 2023-02-23 07:59:34 -06:00
Tr4il
b40bd508f8 Update cf-exclude-include.json (#1970) 2023-02-21 16:52:20 -06:00
Geoff Bourne
9dbc210caf autocf: longer default request timeout (#1966) 2023-02-19 15:41:45 -06:00
Geoff Bourne
2cdb7b2da7 Revert "With autopause check for process in stopped or sleep state (#1963)" (#1964)
This reverts commit 4df1db9535.
2023-02-14 21:22:51 -06:00
Geoff Bourne
4df1db9535 With autopause check for process in stopped or sleep state (#1963) 2023-02-14 20:42:11 -06:00
Geoff Bourne
812b64045d auto_cf: allow networking timeouts to be configured (#1961) 2023-02-13 20:51:10 -06:00
Geoff Bourne
f65d51fff8 Adjusted Update Going from docker run to compose.drawio.png 2023-02-11 14:45:47 -06:00
Ryan Hullah
fd2dfe3f0e Add source dir override for /plugins, /mods, and /config (#1957) 2023-02-08 20:30:28 -06:00
Geoff Bourne
d9b738f670 Handle interpolating sync'ed files when value has dollar sign (#1954) 2023-02-05 16:55:03 -06:00
Geoff Bourne
b8a7bf5a1d Use mc-image-helper for checking autopause interface (#1952) 2023-02-04 20:53:46 -06:00
37 changed files with 264 additions and 74 deletions

View File

@@ -12,7 +12,7 @@ jobs:
pull-requests: write
steps:
- name: Process Stale Issues
uses: actions/stale@v7
uses: actions/stale@v8
with:
stale-issue-label: status/stale
stale-pr-label: status/stale

View File

@@ -3,25 +3,25 @@
ARG BASE_IMAGE=eclipse-temurin:17-jre-focal
FROM ${BASE_IMAGE}
# CI system should set this to a hash or git revision of the build directory and it's contents to
# ensure consistent cache updates.
ARG BUILD_FILES_REV=1
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} /build/run.sh install-packages
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} /build/run.sh setup-user
COPY --chmod=644 files/sudoers* /etc/sudoers.d
EXPOSE 25565 25575
# hook into docker BuildKit --platform support
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
# CI system should set this to a hash or git revision of the build directory and it's contents to
# ensure consistent cache updates.
ARG BUILD_FILES_REV=1
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} TARGET=${TARGETARCH}${TARGETVARIANT} /build/run.sh install-packages
RUN --mount=target=/build,source=build \
REV=${BUILD_FILES_REV} /build/run.sh setup-user
COPY --chmod=644 files/sudoers* /etc/sudoers.d
EXPOSE 25565
ARG EASY_ADD_VER=0.7.1
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
RUN chmod +x /usr/bin/easy-add
@@ -46,7 +46,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.24.23
ARG MC_HELPER_VERSION=1.26.2
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
RUN curl -fsSL ${MC_HELPER_BASE_URL}/mc-image-helper-${MC_HELPER_VERSION}.tgz \
| tar -C /usr/share -zxf - \

View File

@@ -5,6 +5,14 @@
[![Build and Publish](https://github.com/itzg/docker-minecraft-server/workflows/Build%20and%20Publish/badge.svg)](https://github.com/itzg/docker-minecraft-server/actions)
[![](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-orange.svg)](https://www.buymeacoffee.com/itzg)
---
## [View the documentation](https://itzg.github.io/docker-minecraft-docs/)
---
## Intro
This docker image provides a Minecraft Server that will automatically download the latest stable
version at startup. You can also run/upgrade to any specific version or the
latest snapshot. See the _Versions_ section below for more information.
@@ -19,12 +27,10 @@ where, in this case, the standard server port 25565, will be exposed on your hos
> Be sure to always include `-e EULA=TRUE` in your commands and container definitions, as Mojang/Microsoft requires EULA acceptance.
> **DO NOT** port forward RCON on 25575 without first setting `RCON_PASSWORD` to a secure value. It is highly recommended to only use RCON within the container, such as with `rcon-cli`.
By default, the container will download the latest version of the "vanilla" [Minecraft: Java Edition server](https://www.minecraft.net/en-us/download/server) provided by Mojang. The [`VERSION`](#versions) and the [`TYPE`](#server-types) can be configured to create many variations of desired Minecraft server.
## Mitigated Log4jShell Vulnerability
**Please ensure you have pulled the latest image** since [all official mitigations](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition) are automatically applied by the container startup process.
## Looking for a Bedrock Dedicated Server
For Minecraft clients running on consoles, mobile, or native Windows, you'll need to
@@ -616,6 +622,33 @@ docker run -d --name mc-ftb -e EULA=TRUE \
To manage a CurseForge modpack automatically with upgrade support, pinned or latest version tracking, set `TYPE` to "AUTO_CURSEFORGE". The appropriate mod loader (Forge / Fabric) version will be automatically installed as declared by the modpack. This mode will also take care of cleaning up unused files installed by previous versions of the modpack, but world data is never auto-removed.
> **NOTES:**
>
> 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 `$`.
>
> Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
> ```yaml
> environment:
> CF_API_KEY: '$$11$$22$$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
> ```
> If you use `docker run` you will need to make sure to use single quotes:
>
> ```shell
> docker run ... -e CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
> ```
>
> To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). `$`'s in the value still need to escaped with a second `$` and the variable needs to be referenced from the compose file, such as:
> ```yaml
> environment:
> CF_API_KEY: ${CF_API_KEY}
> ```
>
> To use the equivalent with `docker run` you need to specify the `.env` file explicitly:
> ```
> docker run --env-file=.env itzg/minecraft-server
> ```
>
> Be sure to use the appropriate [image tag for the Java version compatible with the modpack](#running-minecraft-server-on-different-java-version).
>
> Most modpacks require a good amount of memory, so it best to set `MEMORY` to at least "4G" since the default is only 1 GB.
@@ -637,6 +670,8 @@ For example:
-e TYPE=AUTO_CURSEFORGE -e CF_SLUG=all-the-mods-8
```
If the authors of the modpack have disallowed project distribution, then the desired **client** modpack zip will need to be manually downloaded and made available to the container. The path to that file must be passed to `CF_MODPACK_ZIP`.
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
@@ -663,9 +698,9 @@ The following examples all refer to version 1.0.7 of ATM8:
Quite often there are mods that need to be excluded, such as ones that did not properly declare as a client mod via the file's game versions. Similarly, there are some mods that are incorrectly tagged as client only. The following describes two options to exclude/include mods:
Global and per modpack exclusions can be declared in a JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](files/cf-exclude-include.json) will be used. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema).
Global and per modpack exclusions can be declared in a JSON file and referenced with `CF_EXCLUDE_INCLUDE_FILE`. By default, [the file bundled with the image](files/cf-exclude-include.json) will be used, but can be disabled by setting this to an empty string. The schema of this file [is documented here](https://github.com/itzg/mc-image-helper#excludeinclude-file-schema).
Alternatively, they can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. If either of these are set, then `CF_EXCLUDE_INCLUDE_FILE` will be **disabled**.
Alternatively, they can be excluded by passing a comma or space delimited list of **project** slugs or IDs via `CF_EXCLUDE_MODS`. Similarly, there are some mods that are incorrectly tagged as client only. For those, pass the **project** slugs or IDs via `CF_FORCE_INCLUDE_MODS`. These lists will be combined with the content of the exclude/include file, if given.
A mod's project ID can be obtained from the right hand side of the project page:
![cf-project-id](docs/cf-project-id.png)
@@ -747,13 +782,13 @@ packwiz modpack defitions are processed before other mod definitions (`MODPACK`,
There are optional volume paths that can be attached to supply content to be copied into the data area:
`/plugins`
: contents are synchronized into `/data/plugins` for Bukkit related server types. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
: contents are synchronized into `/data/plugins` for Bukkit related server types. The source can be changed by setting `COPY_PLUGINS_SRC`. The destination can be changed by setting `COPY_PLUGINS_DEST`. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/plugins` to take precedence over newer files in `/data/plugins`.
`/mods`
: contents are synchronized into `/data/mods` for Fabric and Forge related server types. The destination can be changed by setting `COPY_MODS_DEST`.
: contents are synchronized into `/data/mods` for Fabric and Forge related server types. The source can be changed by setting `COPY_MODS_SRC`. The destination can be changed by setting `COPY_MODS_DEST`.
`/config`
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
: contents are synchronized into `/data/config` by default, but can be changed with `COPY_CONFIG_DEST`. The source can be changed by setting `COPY_CONFIG_SRC`. For example, `-v ./config:/config -e COPY_CONFIG_DEST=/data` will allow you to copy over files like `bukkit.yml` and so on directly into the server directory. Set `SYNC_SKIP_NEWER_IN_DESTINATION=false` if you want files from `/config` to take precedence over newer files in `/data/config`.
By default, the [environment variable processing](#replacing-variables-inside-configs) is performed on synchronized files that match the expected suffixes in `REPLACE_ENV_SUFFIXES` (by default "yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml") and are not excluded by `REPLACE_ENV_VARIABLES_EXCLUDES` and `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. This processing can be disabled by setting `REPLACE_ENV_DURING_SYNC` to `false`.
@@ -1870,6 +1905,21 @@ The following environment variables define the behaviour of auto-pausing:
> To troubleshoot, add `DEBUG_AUTOPAUSE=true` to see additional output
### Rootless Autopause
If you're running the container as rootless, you might need to set change the default port forwarder from RootlessKit to slirp4netns.
For Docker, see the following for setup:
* https://docs.docker.com/engine/security/rootless/#networking-errors
* https://rootlesscontaine.rs/getting-started/docker/#changing-the-port-forwarder
For Podman, see the following for setup:
* https://rootlesscontaine.rs/getting-started/podman/#changing-the-port-forwarder
* Run with
```
-e AUTOPAUSE_KNOCK_INTERFACE=tap0 --cap-add=CAP_NET_RAW --network slirp4netns:port_handler=slirp4netns
```
## Autostop
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.
@@ -1902,6 +1952,10 @@ To run this image on a RaspberryPi 3 B+, 4, or newer, use any of the image tags
> If experiencing issues such as "sleep: cannot read realtime clock: Operation not permitted", ensure `libseccomp` is up to date on your host. In some cases adding `:Z` flag to the `/data` mount may be needed, [but use cautiously](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label).
## Mitigated Log4jShell Vulnerability
**Please ensure you have pulled the latest image** since [all official mitigations](https://www.minecraft.net/en-us/article/important-message--security-vulnerability-java-edition) are automatically applied by the container startup process.
## Contributing
See [Development](DEVELOPMENT.md) and [Building](BUILDING.md).

View File

@@ -1,6 +1,7 @@
#!/bin/sh
set -e
set -o pipefail
apk add --no-cache -U \
openssl \
@@ -21,7 +22,12 @@ apk add --no-cache -U \
rsync \
nano \
sudo \
knock \
tar \
zstd \
nfs-utils
nfs-utils \
libpcap
# 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

View File

@@ -1,6 +1,8 @@
#!/bin/bash
set -e
export TARGET
set -euo pipefail
microdnf install dnf -y
@@ -33,6 +35,11 @@ dnf install -y ImageMagick \
unzip \
zstd \
lbzip2 \
knock
libpcap
bash /build/ol/install-gosu.sh
# 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

View File

@@ -1,6 +1,8 @@
#!/bin/sh
#!/bin/bash
set -e
export TARGET
set -euo pipefail
apt-get update
@@ -23,7 +25,13 @@ apt-get install -y \
unzip \
zstd \
lbzip2 \
knockd \
nfs-common
nfs-common \
libpcap0.8
apt-get clean
apt-get clean
# 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
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -8,6 +8,7 @@ services:
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/all-the-mods-8
CF_FILENAME_MATCHER: "1.0.6"
MEMORY: 4G

1
examples/one-block-modded/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/.env

View File

@@ -8,12 +8,19 @@ services:
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/one-block-modded/files/4136487"
# CF_API_KEY=... must be set in .env file or as environment variable
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: one-block-modded
# Modpack client zip must be manually downloaded from
# https://www.curseforge.com/minecraft/modpacks/one-block-modded
# due to authors disallowing project distribution
CF_MODPACK_ZIP: /modpacks/Modded+OneBock.zip
CF_SET_LEVEL_FROM: OVERRIDES
DEBUG: "false"
MEMORY: 4G
volumes:
- mc-data:/data
- ./modpacks:/modpacks:ro
volumes:
mc-data: {}

View File

@@ -8,6 +8,7 @@ services:
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/
CF_SLUG: the-pixelmon-modpack
CF_FILENAME_MATCHER: "9.1.2"
MEMORY: 4G

View File

@@ -0,0 +1,19 @@
version: "3.8"
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/
CF_FORCE_SYNCHRONIZE: "true"
CF_PAGE_URL: https://www.curseforge.com/minecraft/modpacks/valhelsia-5/files/4429560
MEMORY: 4G
volumes:
- data:/data
volumes:
data: {}

View File

@@ -25,3 +25,19 @@ services:
VERSION: ${MINECRAFT_VERSION:-LATEST}
VANILLATWEAKS_SHARECODE: MGr52E
REMOVE_OLD_VANILLATWEAKS: "TRUE"
vanillatweaks_file_datapacks_and_resourcepacks_and_craftingtweaks:
# port is set to 25567 to not conflict with vanillatweaks_file example
restart: "no"
image: itzg/minecraft-server
ports:
- "25567:25565/tcp"
environment:
EULA: "TRUE"
VERSION: ${MINECRAFT_VERSION:-LATEST}
VANILLATWEAKS_FILE: /config/vanillatweaks-datapacks.json,/config/vanillatweaks-resourcepacks.json,/config/vanillatweaks-craftingtweaks.json
REMOVE_OLD_VANILLATWEAKS: "TRUE"
volumes:
- data:/data
- ./vanillatweaks-datapacks.json:/config/vanillatweaks-datapacks.json:ro
- ./vanillatweaks-resourcepacks.json:/config/vanillatweaks-resourcepacks.json:ro
- ./vanillatweaks-craftingtweaks.json:/config/vanillatweaks-craftingtweaks.json:ro

View File

@@ -0,0 +1,12 @@
{
"type": "craftingtweaks",
"version": "1.18",
"packs": {
"quality of life": [
"dropper to dispenser",
"double slabs",
"back to blocks"
]
},
"result": "ok"
}

View File

@@ -1,4 +1,5 @@
{
"type": "datapacks",
"version": "1.18",
"packs": {
"survival": [
@@ -11,5 +12,6 @@
"coordinates hud"
],
"items": ["armored elytra"]
}
},
"result": "ok"
}

View File

@@ -0,0 +1,8 @@
{
"type": "resourcepacks",
"version": "1.18",
"packs": {
"aesthetic": ["CherryPicking", "BlackNetherBricks", "AlternateBlockDestruction"]
},
"result": "ok"
}

View File

@@ -8,6 +8,7 @@ services:
environment:
EULA: "true"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: # allocate from https://console.curseforge.com/
CF_SLUG: vault-hunters-1-18-2
CF_FILENAME_MATCHER: "Update-6H"
MEMORY: 4G

View File

@@ -10,7 +10,7 @@ fi
autopause_error_loop() {
logAutopause "Available interfaces within the docker container:"
logAutopause " $(available_interfaces)"
logAutopause " $(mc-image-helper network-interfaces)"
logAutopause "Please set the environment variable AUTOPAUSE_KNOCK_INTERFACE to the interface that handles incoming connections."
logAutopause "If unsure which interface to choose, run the ifconfig command in the container."
logAutopause "Autopause failed to initialize. This log entry will be printed every 30 minutes."
@@ -35,7 +35,7 @@ if [[ -z "$AUTOPAUSE_KNOCK_INTERFACE" ]] ; then
logAutopause "AUTOPAUSE_KNOCK_INTERFACE variable must not be empty!"
autopause_error_loop
fi
if ! available_interfaces | grep -q "$AUTOPAUSE_KNOCK_INTERFACE" ; then
if ! mc-image-helper network-interfaces --check="$AUTOPAUSE_KNOCK_INTERFACE" ; then
logAutopause "Selected interface \"$AUTOPAUSE_KNOCK_INTERFACE\" does not exist!"
autopause_error_loop
fi
@@ -45,7 +45,7 @@ if isTrue "${DEBUG_AUTOPAUSE}"; then
knockdArgs+=(-D)
fi
sudo /usr/sbin/knockd "${knockdArgs[@]}"
sudo /usr/local/sbin/knockd "${knockdArgs[@]}"
if [ $? -ne 0 ] ; then
logAutopause "Failed to start knockd daemon."
logAutopause "Probable cause: Unable to attach to interface \"$AUTOPAUSE_KNOCK_INTERFACE\"."

View File

@@ -34,8 +34,4 @@ java_clients_connections() {
java_clients_connected() {
(( $(java_clients_connections) > 0 ))
}
available_interfaces() {
ifconfig -s | tail +2 | cut -f1 -d ' '
}
}

View File

@@ -13,3 +13,4 @@
[unpauseMCServer-bedrock]
sequence = 19132:udp
command = /auto/resume.sh %IP%
seq_cooldown = 60

View File

@@ -2,16 +2,19 @@
"globalExcludes": [
"carry-on",
"defensive-measures",
"dynamiclights-reforged",
"entity-texture-features-fabric",
"entityculling",
"extreme-sound-muffler",
"ignitioncoil",
"legendary-tooltips",
"neat",
"nekos-enchanted-books",
"not-enough-animations",
"oculus",
"rubidium",
"rubidium-extra",
"magnesium-extras",
"skin-layers-3d",
"textrues-rubidium-options",
"torohealth-damage-indicators"
@@ -21,6 +24,11 @@
"forceIncludes": [
"revelationary"
]
},
"valhelsia-5": {
"excludes": [
"modernfix"
]
}
}
}
}

View File

@@ -1,2 +1,2 @@
minecraft ALL=(ALL) NOPASSWD:/usr/bin/pkill
minecraft ALL=(ALL) NOPASSWD:/usr/sbin/knockd
minecraft ALL=(ALL) NOPASSWD:/usr/local/sbin/knockd

View File

@@ -84,4 +84,9 @@ elif [[ -z "$MAX_TICK_TIME" ]] ; then
export MAX_TICK_TIME
fi
# seq_cooldown cannot be larger than AUTOPAUSE_TIMEOUT_KN, otherwise the server may
# become paused while knockd is still ignoring packets, preventing players from joining.
let COOLDOWN=$AUTOPAUSE_TIMEOUT_KN/2
sed -i "s/\(seq_cooldown *= *\).*/\1$COOLDOWN/" /tmp/knockd-config.cfg
/auto/autopause-daemon.sh &

View File

@@ -197,6 +197,7 @@ case "${TYPE^^}" in
;;
AUTO_CURSEFORGE)
evaluateJavaCompatibilityForForge
exec "${SCRIPTS:-/}start-deployAutoCF" "$@"
;;

View File

@@ -10,7 +10,7 @@ set -eu
: "${CF_FILENAME_MATCHER:=}"
: "${CF_PARALLEL_DOWNLOADS:=4}"
: "${CF_FORCE_SYNCHRONIZE:=false}"
: "${CF_EXCLUDE_INCLUDE_FILE:=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
: "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
: "${CF_EXCLUDE_MODS:=}"
: "${CF_FORCE_INCLUDE_MODS:=}"
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
@@ -45,17 +45,14 @@ args+=(
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
)
if [[ $CF_EXCLUDE_MODS || $CF_FORCE_INCLUDE_MODS ]]; then
if [[ $CF_EXCLUDE_MODS ]]; then
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
fi
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
fi
else
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
fi
if [[ $CF_EXCLUDE_MODS ]]; then
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
fi
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
fi
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
fi
if ! mc-image-helper install-curseforge "${args[@]}"; then

View File

@@ -7,11 +7,13 @@
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
isDebugging && set -x
# NOTE: VERSION rather than VANILLA_VERSION is specified to allow for latest supported
# Forge version to be selected.
if [[ ${FORGE_INSTALLER} ]]; then
if ! mc-image-helper install-forge \
--output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VANILLA_VERSION}" \
--minecraft-version="${VERSION}" \
--forge-installer="${FORGE_INSTALLER}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install Forge given installer ${FORGE_INSTALLER}"
@@ -22,7 +24,7 @@ else
if ! mc-image-helper install-forge \
--output-directory=/data \
--results-file=/data/.run-forge.env \
--minecraft-version="${VANILLA_VERSION}" \
--minecraft-version="${VERSION}" \
--forge-version="${FORGE_VERSION}" \
--force-reinstall="${FORGE_FORCE_REINSTALL}"; then
log "ERROR failed to install Forge"

View File

@@ -183,7 +183,7 @@ esac
fi
}
function genericPacks() {
function handleGenericPacks() {
: "${GENERIC_PACKS:=${GENERIC_PACK}}"
: "${GENERIC_PACKS_PREFIX:=}"
: "${GENERIC_PACKS_SUFFIX:=}"
@@ -267,7 +267,7 @@ function genericPacks() {
fi
}
function modrinthProjects() {
function handleModrinthProjects() {
: "${MODRINTH_PROJECTS:=}"
: "${MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES:=true}"
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
@@ -275,8 +275,11 @@ function modrinthProjects() {
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
if isFamily HYBRID FORGE; then
loader=forge
elif isFamily FABRIC; then
loader=fabric
else
loader="${FAMILY,,}"
# we're left with Bukkit/Spigot down-lines where plugins seem to be
loader="${TYPE,,}"
fi
mc-image-helper modrinth \
--output-directory=/data \
@@ -294,8 +297,8 @@ handleModpackListOrFile
handleCurseForgeManifest
genericPacks
handleGenericPacks
modrinthProjects
handleModrinthProjects
exec "${SCRIPTS:-/}start-setupModconfig" "$@"

View File

@@ -24,47 +24,52 @@ else
subcommand=sync
fi
if [ -d /plugins ]; then
: "${COPY_PLUGINS_SRC:="/plugins"}"
: "${COPY_PLUGINS_DEST:="/data/plugins"}"
if [ -d "${COPY_PLUGINS_SRC}" ]; then
case ${FAMILY} in
SPIGOT|HYBRID)
mkdir -p /data/plugins
log "Copying plugins over..."
mkdir -p "${COPY_PLUGINS_DEST}"
log "Copying any plugins from ${COPY_PLUGINS_SRC} to ${COPY_PLUGINS_DEST}"
mc-image-helper \
${subcommand} $updateArg \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
/plugins /data/plugins
"${COPY_PLUGINS_SRC}" "${COPY_PLUGINS_DEST}"
;;
esac
fi
# If any modules have been provided, copy them over
: "${COPY_MODS_SRC:="/mods"}"
: "${COPY_MODS_DEST:="/data/mods"}"
if [ -d /mods ]; then
log "Copying any mods over..."
if [ -d "${COPY_MODS_SRC}" ]; then
log "Copying any mods from ${COPY_MODS_SRC} to ${COPY_MODS_DEST}"
mc-image-helper \
${subcommand} $updateArg \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
/mods "${COPY_MODS_DEST}"
"${COPY_MODS_SRC}" "${COPY_MODS_DEST}"
fi
: "${COPY_CONFIG_SRC:="/config"}"
: "${COPY_CONFIG_DEST:="/data/config"}"
if [ -d /config ]; then
log "Copying any configs from /config to ${COPY_CONFIG_DEST}"
if [ -d "${COPY_CONFIG_SRC}" ]; then
log "Copying any configs from ${COPY_CONFIG_SRC} to ${COPY_CONFIG_DEST}"
mc-image-helper \
${subcommand} $updateArg \
--replace-env-file-suffixes="${REPLACE_ENV_SUFFIXES}" \
--replace-env-excludes="${REPLACE_ENV_VARIABLES_EXCLUDES}" \
--replace-env-exclude-paths="${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}" \
--replace-env-prefix="${REPLACE_ENV_VARIABLE_PREFIX}" \
/config "${COPY_CONFIG_DEST}"
"${COPY_CONFIG_SRC}" "${COPY_CONFIG_DEST}"
fi
exec "${SCRIPTS:-/}start-setupServerProperties" "$@"

View File

@@ -7,6 +7,7 @@ services:
EULA: "true"
SETUP_ONLY: "TRUE"
TYPE: AUTO_CURSEFORGE
CF_API_KEY: ${CF_API_KEY}
CF_SLUG: the-pixelmon-modpack
CF_FILENAME_MATCHER: "9.1.2"
# Use the image bundled one to ensure latest is being tested

View File

@@ -0,0 +1 @@
[[ $CF_API_KEY ]] || exit 1

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,21 @@
version: "3"
services:
mc:
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
environment:
EULA: "true"
SETUP_ONLY: "true"
TYPE: CUSTOM
CUSTOM_SERVER: /servers/fake.jar
VERSION: 1.18.1
COPY_PLUGINS_SRC: /custom/plugins
COPY_PLUGINS_DEST: /data/custom-plugins
COPY_MODS_SRC: /custom/mods
COPY_MODS_DEST: /data/custom-mods
COPY_CONFIG_SRC: /custom/config
COPY_CONFIG_DEST: /data/custom-config
volumes:
- ./data:/data
- ./custom:/custom
- ./fake.jar:/servers/fake.jar

View File

@@ -0,0 +1,3 @@
mc-image-helper assert fileExists custom-plugins/plugin.jar
mc-image-helper assert fileExists custom-mods/mod.jar
mc-image-helper assert fileExists custom-config/test.json

View File

@@ -0,0 +1,2 @@
# maven.packwiz.infra.link is not resolvable
exit 1