add velocity

the server now utilizes the velocity proxy for
- domain based connection instead of ports (called forced-hosts in velocity)
- a fancy motd message indicating when only the minecraft server is down, but not the host system
This commit is contained in:
anonoe 2025-12-27 23:31:10 +01:00
parent 3164df2579
commit 1002a471ba
Signed by: anonoe
SSH key fingerprint: SHA256:OnAs6gNQelOnDiY5tBpDYKQiuTgBvnmIdMo5P09cdqg
13 changed files with 79 additions and 29 deletions

View file

@ -1,12 +1,14 @@
[Unit]
Description=Modded Minecraft Server via Podman managed by Systemd
Documentation=https://git.nanody.de/anonoe/MMS
Wants=velocity.service
After=velocity.service
[Container]
Image=git.nanody.de/anonoe/jre-alpine:latest
AutoUpdate=registry
PublishPort=25565:25565/tcp
PublishPort=24454:24454/udp
PublishPort=25566:25565/tcp
PublishPort=24455:24455/udp
UserNS=keep-id
Mount=type=bind,src=/PATH/TO/server,dst=/mnt/server
Mount=type=bind,src=/PATH/TO/rcon,dst=/mnt/rcon

View file

@ -1,14 +0,0 @@
version: '3.8'
services:
jre-hl-mc-MMS:
image: alp-jre-21-hl:latest
volumes:
- ./server:/mnt/server
working_dir: /mnt/server
command: ["java", "-Xmx4G", "-Xms1G", "-jar", "minecraft_server.jar", "--nogui"]
ports:
- "25565:25565/tcp" # minecraft
- "24454:24454/udp" # simple voicechat
tty: true
# restart: unless-stopped

View file

@ -1,12 +0,0 @@
podman run \
--rm \
--name jre-hl-mc-MMS \
--tty \
--interactive \
--publish 25565:25565/tcp \
--publish 24454:24454/udp \
--volume ./server:/mnt/server \
--workdir /mnt/server \
alp-jre-21-hl:latest \
java -Xmx4G -Xms1G -jar minecraft_server.jar --nogui

View file

@ -0,0 +1,4 @@
hackOnlineMode = true
hackEarlySend = false
hackMessageChain = false
secret = "PUT SOMETHING HERE"

View file

@ -6,7 +6,7 @@
# Set this to '-1' to use the same port number that is used by the Minecraft server.
# However, it is strongly recommended NOT to use the same port number because UDP on
# it is also used by default for the server query. Doing so may crash the server!
port=24454
port=24455
# The server IP address to bind the voice chat to
# Leave blank to use the 'server-ip' property from the 'server.properties' config file
# To bind to the wildcard IP address, use '*'

Binary file not shown.

Binary file not shown.

23
server/velocity.container Normal file
View file

@ -0,0 +1,23 @@
[Unit]
Description=Minecraft Proxy Velocity via Podman managed by Systemd
Documentation=https://docs.papermc.io/velocity/
[Container]
Image=git.nanody.de/anonoe/jre-alpine:latest
AutoUpdate=registry
PublishPort=25565:25565/tcp
PublishPort=24454:24454/udp
UserNS=keep-id
Mount=type=bind,src=PATH/TO/velocity,dst=/mnt/server
WorkingDir=/mnt/server
PodmanArgs=--tty --interactive
Exec=java -Xms500M -Xmx500M -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar velocity.jar
[Service]
SuccessExitStatus=0 143
TimeoutStartSec=480
TimeoutStopSec=480
[Install]
# Start by default on boot
WantedBy=default.target

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,7 @@
# Simple Voice Chat proxy config v2.6.4
# The port number to use for the voice chat communication.
# Audio packets are always transmitted via the UDP protocol on the port number
# specified here, independently of other networking used for the game server.
# Set this to '-1' to use the same port number as the one used by the proxy.
port=24454

View file

@ -0,0 +1 @@
velocity-3.4.0-SNAPSHOT-558.jar

View file

@ -0,0 +1,39 @@
# Config version. Do not change this
config-version = "2.7"
# What should be the MOTD? This gets displayed when the player adds your server to
# their server list. Only MiniMessage format is accepted.
motd = "<#09add3>The Server is down (╯°□°)╯︵ ┻━┻"
# Should we forward IP addresses and other data to backend servers?
# Available options:
# - "none": No forwarding will be done. All players will appear to be connecting
# from the proxy and will have offline-mode UUIDs.
# - "legacy": Forward player IPs and UUIDs in a BungeeCord-compatible format. Use this
# if you run servers using Minecraft 1.12 or lower.
# - "bungeeguard": Forward player IPs and UUIDs in a format supported by the BungeeGuard
# plugin. Use this if you run servers using Minecraft 1.12 or lower, and are
# unable to implement network level firewalling (on a shared host).
# - "modern": Forward player IPs and UUIDs as part of the login process using
# Velocity's native forwarding. Only applicable for Minecraft 1.13 or higher.
player-info-forwarding-mode = "modern"
[servers]
# Configure your servers here. Each key represents the server's name, and the value
# represents the IP address of the server to connect to.
#lobby = "127.0.0.1:30066"
#factions = "127.0.0.1:30067"
#minigames = "127.0.0.1:30068"
mms = "host.containers.internal:25566"
# In what order we should try servers when a player logs in or is kicked from a server.
try = [
"mms"
]
[forced-hosts]
"nanody.de" = [
"mms"
]
"mms.nanody.de" = [
"mms"
]