Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ ENV RENDER_SIGNS_JOINER "<br />"

ENV CONFIG_LOCATION /home/minecraft/config.py

# Install rcon-cli (https://github.com/itzg/rcon-cli). Perform a checksum check
# to make sure it hasn't changed from underneath us.
ENV RCON_CLI_URL "https://github.com/itzg/rcon-cli/releases/download/1.4.7/rcon-cli_1.4.7_linux_amd64.tar.gz"
ENV RCON_CLI_SHA256 "cae03daceb3c463f0979ed0586778fb236cfbb83585413a9a06b1e83bceefa20"
ENV RCON_CLI_ARGS_PRE_RENDER ""
ENV RCON_CLI_ARGS_POST_RENDER ""

RUN apt-get update && \
apt-get install -y wget gnupg optipng && \
echo "deb http://overviewer.org/debian ./" >> /etc/apt/sources.list && \
Expand All @@ -36,6 +43,12 @@ RUN apt-get update && \
useradd -m minecraft -u 1000 -g 1000 && \
mkdir -p /home/minecraft/render /home/minecraft/server

# Install rcon-cli to support issuing RCON commands before/after the render
RUN wget "${RCON_CLI_URL}" -O "/tmp/rcon-cli.tgz" && \
echo "${RCON_CLI_SHA256} /tmp/rcon-cli.tgz" | sha256sum -c - && \
tar -xf /tmp/rcon-cli.tgz -C /usr/local/bin rcon-cli && \
rm /tmp/rcon-cli.tgz

COPY config/config.py /home/minecraft/config.py
COPY entrypoint.sh /home/minecraft/entrypoint.sh
COPY download_url.py /home/minecraft/download_url.py
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ docker run \
- `CONFIG_LOCATION`
Default Value: `/home/minecraft/config.py`. Set to a different path to override the provided configuration. This only makes sense if you have a different configuration in a volume.

- `RCON_CLI_ARGS_POST_RENDER`
Default Value: _null_. Set to contain any [Minecraft RCON](https://wiki.vg/RCON) command you'd like to have run after the render completes. This uses [`itzg/rcon-cli`](https://github.com/itzg/rcon-cli), so please refer to that project for full list of available options. Could be used to issue `save on` to re-enable file writes once done rendering.

- `RCON_CLI_ARGS_PRE_RENDER`
Default Value: _null_. Set to contain any [Minecraft RCON](https://wiki.vg/RCON) command you'd like to have run before the render starts. This uses [`itzg/rcon-cli`](https://github.com/itzg/rcon-cli), so please refer to that project for full list of available options. Could be used to issue `save off` to prevent file changes while rendering.

- `RENDER_MAP`
Default Value: `true`. Set to `false` if you do not want to render the map. This is useful for POI only-updates.

Expand Down
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ if grep -q "texturepath" "${CONFIG_LOCATION}"; then
cp "${NEW_LOCATION}" "${OLD_LOCATION}"
fi

if [ -n "$RCON_CLI_ARGS_PRE_RENDER" ]; then
echo "Running rcon-cli before starting render..."
# shellcheck disable=SC2086
rcon-cli $RCON_CLI_ARGS_PRE_RENDER
fi

# Render the Map
if [ "$RENDER_MAP" == "true" ]; then
overviewer.py --config "$CONFIG_LOCATION" $ADDITIONAL_ARGS
Expand All @@ -48,3 +54,9 @@ fi
if [ "$RENDER_POI" == "true" ]; then
overviewer.py --config "$CONFIG_LOCATION" --genpoi $ADDITIONAL_ARGS_POI
fi

if [ -n "$RCON_CLI_ARGS_POST_RENDER" ]; then
echo "Running rcon-cli after finishing render..."
# shellcheck disable=SC2086
rcon-cli $RCON_CLI_ARGS_POST_RENDER
fi