diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..1c44c923 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ + +#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +custom: + - https://www.buymeacoffee.com/itzg + - https://paypal.me/itzg diff --git a/.github/workflows/generate-toc.yml b/.github/workflows/generate-toc.yml index 19e259e2..684d9a8d 100644 --- a/.github/workflows/generate-toc.yml +++ b/.github/workflows/generate-toc.yml @@ -16,6 +16,6 @@ jobs: curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc chmod a+x gh-md-toc ./gh-md-toc --insert --no-backup README.md - - uses: stefanzweifel/git-auto-commit-action@v4.11.0 + - uses: stefanzweifel/git-auto-commit-action@v4.12.0 with: commit_message: "docs: Auto update markdown TOC" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b03d44cc..07a8928d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,10 @@ 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 ASCIIFY_VERSION=1.0.1 +ADD https://jitpack.io/com/github/itzg/asciify/${ASCIIFY_VERSION}/asciify-${ASCIIFY_VERSION}.jar /usr/share/asciify/asciify.jar +RUN chmod -R a+r /usr/share/asciify + COPY mcstatus /usr/local/bin VOLUME ["/data"] diff --git a/README.md b/README.md index 45d1b375..eec25fa5 100644 --- a/README.md +++ b/README.md @@ -117,19 +117,20 @@ By default, the container will download the latest version of the "vanilla" [Min * [Server Shutdown Options](#server-shutdown-options) * [OpenJ9 Specific Options](#openj9-specific-options) * [Enabling rolling logs](#enabling-rolling-logs) - * [Timezone Configuration](#timezone-configuration) + * [Timezone Configuration](#timezone-configuration) * [Enable Remote JMX for Profiling](#enable-remote-jmx-for-profiling) * [Enable Aikar's Flags](#enable-aikars-flags) * [HTTP Proxy](#http-proxy) * [Using "noconsole" option](#using-noconsole-option) * [Explicitly disable GUI](#explicitly-disable-gui) * [Stop Duration](#stop-duration) + * [Setup only](#setup-only) * [Autopause](#autopause) * [Description](#description) * [Enabling Autopause](#enabling-autopause) * [Running on RaspberryPi](#running-on-raspberrypi) - + @@ -745,6 +746,10 @@ read-only volume attachment to ensure the clone source remains pristine. docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic ``` +The following diagram shows how this option can be used in a compose deployment with a relative directory: + +![](docs/world-copy-compose-project.drawio.png) + ### Overwrite world on start The world will only be downloaded or copied if it doesn't exist already. Set `FORCE_WORLD_COPY=TRUE` to force overwrite the world on every server start. @@ -823,7 +828,7 @@ The server icon which has been set doesn't get overridden by default. It can be ### Rcon -To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables. +To use rcon use the `ENABLE_RCON` and `RCON_PASSWORD` variables. By default rcon port will be `25575` but can easily be changed with the `RCON_PORT` variable. docker run -d -e ENABLE_RCON=true -e RCON_PASSWORD=testing @@ -968,7 +973,7 @@ For example: ### Message of the Day -The message of the day, shown below each server entry in the UI, can be changed with the `MOTD` environment variable, such as +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" @@ -978,6 +983,14 @@ If you leave it off, a default is computed from the server type and version, suc That way you can easily differentiate between several servers you may have started. +The section symbol (§) and other unicode characters are automatically converted to allow [formatting codes](https://minecraft.fandom.com/wiki/Formatting_codes) to be used consistently with all server versions. For example, + + -e MOTD="A §l§cMinecraft§r §nserver" + +renders + +![](docs/motd-example.png) + ### PVP Mode By default, servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP` @@ -1264,7 +1277,7 @@ By default the vanilla log file will grow without limit. The logger can be recon > **NOTE** this will interfere with interactive/color consoles [as described in the section above](#interactive-and-color-console) -## Timezone Configuration +### Timezone Configuration You can configure the timezone to match yours by setting the `TZ` environment variable: @@ -1323,6 +1336,10 @@ disable that by passing `-e GUI=FALSE`. When the container is signalled to stop, the Minecraft process wrapper will attempt to send a "stop" command via RCON or console and waits for the process to gracefully finish. By default it waits 60 seconds, but that duration can be configured by setting the environment variable `STOP_DURATION` to the number of seconds. +### Setup only + +If you are using a host-attached data directory, then you can have the image setup the Minecraft server files and stop prior to launching the server process by setting `SETUP_ONLY` to `true`. + ## Autopause ### Description diff --git a/docs/motd-example.png b/docs/motd-example.png new file mode 100644 index 00000000..265c66a6 Binary files /dev/null and b/docs/motd-example.png differ diff --git a/examples/docker-compose-rlcraft.yml b/examples/docker-compose-rlcraft.yml new file mode 100644 index 00000000..0bda0d9a --- /dev/null +++ b/examples/docker-compose-rlcraft.yml @@ -0,0 +1,27 @@ +version: '3.8' + +services: + rlcraft: + image: itzg/minecraft-server:java8 + container_name: rlcraft + volumes: + - rlcraft-modpack:/modpacks:ro + - rlcraft-data:/data + environment: + EULA: "true" + TYPE: "FORGE" + VERSION: "1.12.2" + FORGEVERSION: "14.23.5.2855" + DIFFICULTY: "hard" + MAX_TICK_TIME: "-1" + VIEW_DISTANCE: "6" + ALLOW_FLIGHT: "true" + MEMORY: "4G" + GENERIC_PACK: "/modpacks/RLCraft_Server_Pack_1.12.2_Beta_v2.8.2.zip" + ports: + - 25565:25565 + restart: unless-stopped + +volumes: + rlcraft-data: + rlcraft-modpack: diff --git a/start-finalSetupServerProperties b/start-finalSetupServerProperties index 33708461..79a45ec6 100644 --- a/start-finalSetupServerProperties +++ b/start-finalSetupServerProperties @@ -56,7 +56,7 @@ function customizeServerProps { setServerProp "server-name" "$SERVER_NAME" setServerProp "server-ip" "$SERVER_IP" setServerProp "server-port" "$SERVER_PORT" - setServerProp "motd" "$MOTD" + setServerProp "motd" "$(echo $MOTD | java -jar /usr/share/asciify/asciify.jar)" setServerProp "allow-nether" "$ALLOW_NETHER" setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS" setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"