Move file distribution to Gitea, deploy server on mivanchenko.de
Drops the standalone fileserver systemd unit from setup-server.sh in favor of Gitea's already-public raw-file serving. Adds VR (Vivecraft) and quest (FTB Quests) mod docs, the DH/Chunky server-side crash warning, and documents the real deployment target (always-on homelab box, not a venue-local machine).
This commit is contained in:
+9
-29
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# One-time setup for the LAN party's dedicated box: installs a Forge 1.20.1
|
||||
# Minecraft server, wraps it in lazymc (auto-sleep when empty / auto-wake on
|
||||
# connect), and serves the client install scripts + modpack.zip over HTTP —
|
||||
# all as systemd services so the box can run unattended for the 3 days.
|
||||
# Minecraft server and wraps it in lazymc (auto-sleep when empty / auto-wake
|
||||
# on connect), as a systemd service so it runs unattended for the 3 days.
|
||||
#
|
||||
# File distribution (install.sh/install.ps1/modpack.zip) is NOT handled by
|
||||
# this script — see HOSTING.md, it's served from Gitea instead.
|
||||
#
|
||||
# Target: a Linux machine (Debian/Ubuntu/etc with systemd) at the venue.
|
||||
# Run as a normal user with sudo rights: ./setup-server.sh
|
||||
@@ -13,7 +15,6 @@ FORGE_MC_VERSION="1.20.1"
|
||||
FORGE_BUILD="47.4.28" # current recommended build for 1.20.1 — check files.minecraftforge.net if this is stale
|
||||
MC_PUBLIC_PORT=25565 # what players connect to (lazymc listens here)
|
||||
MC_INTERNAL_PORT=25566 # real server listens here, lazymc proxies to it
|
||||
FILESERVER_PORT=8000 # install.sh / install.ps1 / modpack.zip served from here
|
||||
SLEEP_AFTER="5m" # idle time before lazymc stops the real server
|
||||
MIN_RAM="2G"
|
||||
MAX_RAM="6G" # 5-8 players; see ../HOSTING.md sizing table — bump to 8G (9-12p) or 10-12G (13-15p)
|
||||
@@ -21,13 +22,10 @@ MAX_RAM="6G" # 5-8 players; see ../HOSTING.md sizing ta
|
||||
|
||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SERVER_DIR="$BASE_DIR/mcserver"
|
||||
DIST_DIR="$BASE_DIR/dist"
|
||||
FORGE_VERSION="${FORGE_MC_VERSION}-${FORGE_BUILD}"
|
||||
|
||||
command -v java >/dev/null || { echo "Java not found. Install a Java 17+ JDK (e.g. 'sudo apt install -y openjdk-17-jre-headless') then re-run."; exit 1; }
|
||||
command -v python3 >/dev/null || { echo "python3 not found. Install it (e.g. 'sudo apt install -y python3') then re-run."; exit 1; }
|
||||
|
||||
mkdir -p "$SERVER_DIR" "$DIST_DIR"
|
||||
mkdir -p "$SERVER_DIR"
|
||||
|
||||
# ---- 1. Install the Forge server ----
|
||||
if [[ ! -f "$SERVER_DIR/run.sh" ]]; then
|
||||
@@ -114,32 +112,14 @@ User=${USER}
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo tee /etc/systemd/system/mc-fileserver.service >/dev/null <<EOF
|
||||
[Unit]
|
||||
Description=LAN party modpack/install-script file server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=${DIST_DIR}
|
||||
ExecStart=/usr/bin/python3 -m http.server ${FILESERVER_PORT}
|
||||
Restart=on-failure
|
||||
User=${USER}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now mc-lazymc.service mc-fileserver.service
|
||||
sudo systemctl enable --now mc-lazymc.service
|
||||
|
||||
echo "==> Done."
|
||||
echo " - Minecraft server: public port ${MC_PUBLIC_PORT}, sleeps after ${SLEEP_AFTER} idle, wakes on connect."
|
||||
echo " - File server: http://<this-box-lan-ip>:${FILESERVER_PORT}/ serving ${DIST_DIR}/"
|
||||
echo " - Put install.sh, install.ps1 and modpack.zip into ${DIST_DIR}/ (see ../HOSTING.md)."
|
||||
echo " - Install scripts + modpack.zip are served from Gitea, not this box — see ../HOSTING.md."
|
||||
echo " - Copy your client mod jars into ${SERVER_DIR}/mods/ if you haven't yet, then: sudo systemctl restart mc-lazymc"
|
||||
if command -v ufw >/dev/null && sudo ufw status | grep -q "Status: active"; then
|
||||
echo "==> ufw is active — opening ${MC_PUBLIC_PORT}/tcp and ${FILESERVER_PORT}/tcp"
|
||||
echo "==> ufw is active — opening ${MC_PUBLIC_PORT}/tcp"
|
||||
sudo ufw allow "${MC_PUBLIC_PORT}/tcp"
|
||||
sudo ufw allow "${FILESERVER_PORT}/tcp"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user