From b714e2895b3ea00d07c685796ed35ecee57fa1e6 Mon Sep 17 00:00:00 2001 From: Matthew Tran Date: Mon, 16 Sep 2024 05:44:19 +0000 Subject: [PATCH] add minecraft bedrock server --- .gitignore | 3 +++ README.md | 28 ++++++++++++++-------- backup | 1 + compose.yml | 11 +++++++++ minecraft_bedrock/.dockerignore | 1 + minecraft_bedrock/Dockerfile | 16 +++++++++++++ minecraft_bedrock/entry.sh | 5 ++++ minecraft_bedrock/permissions.json | 7 ++++++ minecraft_bedrock/server.properties | 36 +++++++++++++++++++++++++++++ monerod/Dockerfile | 4 ++-- wireguard/{setup => setup.py} | 0 11 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 minecraft_bedrock/.dockerignore create mode 100644 minecraft_bedrock/Dockerfile create mode 100644 minecraft_bedrock/entry.sh create mode 100644 minecraft_bedrock/permissions.json create mode 100644 minecraft_bedrock/server.properties rename wireguard/{setup => setup.py} (100%) diff --git a/.gitignore b/.gitignore index f839d81..d7f5e82 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ p2pool/cache # minecraft minecraft/world* +# minecraft_bedrock +minecraft_bedrock/worlds* + # terraria terraria/worlds terraria/password.txt diff --git a/README.md b/README.md index 712c423..1a55613 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,11 @@ Stuff that's deployed on [matthewtran.com](http://matthewtran.com). Tested on Ubuntu Server 22.04.3 LTS. Currently running the following services. - website -- gitea ([git.matthewtran.com](http://git.matthewtran.com)) +- gitea ([git.matthewtran.com](https://git.matthewtran.com)) - monerod - p2pool (`xmrig -o matthewtran.com:3333`) - minecraft +- minecraft bedrock - ~~terraria~~ - wireguard @@ -14,15 +15,16 @@ Stuff that's deployed on [matthewtran.com](http://matthewtran.com). Tested on Ub Forward the following ports to the server. -| service | port | -|-----------|--------------------| -| website | 80, 443 | -| gitea | 2222 | -| monerod | 18080 | -| p2pool | 3333, 37888, 37889 | -| minecraft | 25565 | -| terraria | 7777 | -| wireguard | 51820 | +| service | port | +|-------------------|--------------------| +| website | 80, 443 | +| gitea | 2222 | +| monerod | 18080 | +| p2pool | 3333, 37888, 37889 | +| minecraft | 25565 | +| minecraft bedrock | 19132, 19133 | +| terraria | 7777 | +| wireguard | 51820 | Make sure IPv6 is enabled in Docker by modifying `/etc/docker/daemon.json`. For example: @@ -47,3 +49,9 @@ Note for first start you'll need to configure Gitea. You may also need to `chown ## backup Run `./backup` and save the resultant `data.zip` somewhere. I should probably automate this. + +## TODO + +- full setup script +- correct volume mounting w/o need `chown`/`chmod` +- better backup and restore diff --git a/backup b/backup index d5b9599..72dfc0e 100755 --- a/backup +++ b/backup @@ -2,6 +2,7 @@ zip -FS -r data.zip \ minecraft/world \ + minecraft_bedrock/worlds \ terraria/worlds \ terraria/password.txt \ website/gitea \ diff --git a/compose.yml b/compose.yml index fe61b41..29ac1fe 100644 --- a/compose.yml +++ b/compose.yml @@ -65,6 +65,17 @@ services: - default6 volumes: - ./minecraft/world:/home/matt/world + minecraft_bedrock: + restart: always + build: minecraft_bedrock/. + entrypoint: ["/bin/sh", "/home/matt/entry.sh"] + ports: + - "19132:19132/udp" + - "19133:19133/udp" + networks: + - default6 + volumes: + - ./minecraft_bedrock/worlds:/home/matt/worlds # terraria: # restart: always # build: terraria/. diff --git a/minecraft_bedrock/.dockerignore b/minecraft_bedrock/.dockerignore new file mode 100644 index 0000000..6a2fdbd --- /dev/null +++ b/minecraft_bedrock/.dockerignore @@ -0,0 +1 @@ +worlds/ diff --git a/minecraft_bedrock/Dockerfile b/minecraft_bedrock/Dockerfile new file mode 100644 index 0000000..cba37f2 --- /dev/null +++ b/minecraft_bedrock/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:24.04 + +RUN apt-get update && apt-get -y upgrade +RUN apt-get install -y wget unzip curl + +RUN useradd -m matt +USER matt +WORKDIR /home/matt + +# from https://www.minecraft.net/en-us/download/server/bedrock (currently 1.21.23.01) +RUN wget -O server.zip https://minecraft.azureedge.net/bin-linux/bedrock-server-1.21.23.01.zip +RUN unzip server.zip && rm server.zip + +COPY --chown=matt:matt entry.sh ./ +COPY --chown=matt:matt server.properties ./ +COPY --chown=matt:matt permissions.json ./ diff --git a/minecraft_bedrock/entry.sh b/minecraft_bedrock/entry.sh new file mode 100644 index 0000000..e2a6513 --- /dev/null +++ b/minecraft_bedrock/entry.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# TODO graceful exit + +LD_LIBRARY_PATH=. ./bedrock_server diff --git a/minecraft_bedrock/permissions.json b/minecraft_bedrock/permissions.json new file mode 100644 index 0000000..ff04ca5 --- /dev/null +++ b/minecraft_bedrock/permissions.json @@ -0,0 +1,7 @@ +[ + { + "permission": "operator", + "name": "dragonlock2", + "xuid": "2535438419596262" + } +] diff --git a/minecraft_bedrock/server.properties b/minecraft_bedrock/server.properties new file mode 100644 index 0000000..4d1ba3b --- /dev/null +++ b/minecraft_bedrock/server.properties @@ -0,0 +1,36 @@ +server-name=poopy +gamemode=survival +force-gamemode=false +difficulty=hard +allow-cheats=true +max-players=20 +online-mode=true +allow-list=false +server-port=19132 +server-portv6=19133 +enable-lan-visibility=true +view-distance=32 +tick-distance=4 +player-idle-timeout=0 +max-threads=4 +level-name=test +level-seed= +default-player-permission-level=visitor +texturepack-required=false +content-log-file-enabled=false +compression-threshold=1 +compression-algorithm=zlib +server-authoritative-movement=server-auth +player-position-acceptance-threshold=0.5 +player-movement-action-direction-threshold=0.85 +server-authoritative-block-breaking-pick-range-scalar=1.5 +chat-restriction=None +disable-player-interaction=false +client-side-chunk-generation-enabled=true +block-network-ids-are-hashes=true +disable-persona=false +disable-custom-skins=false +server-build-radius-ratio=Disabled +allow-outbound-script-debugging=false +allow-inbound-script-debugging=false +script-debugger-auto-attach=disabled diff --git a/monerod/Dockerfile b/monerod/Dockerfile index c6c75eb..6cf62e5 100644 --- a/monerod/Dockerfile +++ b/monerod/Dockerfile @@ -7,8 +7,8 @@ RUN useradd -m matt USER matt WORKDIR /home/matt -RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.3.3.tar.bz2 -O monerod.tar.bz2 +RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.3.4.tar.bz2 -O monerod.tar.bz2 RUN tar xvf monerod.tar.bz2 && rm monerod.tar.bz2 -RUN mv monero-x86_64-linux-gnu-v0.18.3.3 monero +RUN mv monero-x86_64-linux-gnu-v0.18.3.4 monero COPY --chown=matt:matt entry.sh ./ diff --git a/wireguard/setup b/wireguard/setup.py similarity index 100% rename from wireguard/setup rename to wireguard/setup.py