Overview

Date: 2026-05-11

Time: 15:54

Overview

This is a NeoForge Minecraft server provisioning script built on FTL2's automation framework. It handles the full lifecycle of a Minecraft server on Linode infrastructure: provisioning a VM, installing Java and NeoForge, configuring security (SSH hardening, fail2ban), setting up DNS, and managing the running server (start, stop, backup, restore, destroy). It was ported from an earlier hardcoded script, with all constants replaced by a ServerConfig object and progress reported via a log() callback.

Usage Patterns

The module exposes several top-level async functions, each taking an ftl automation handle, a ServerConfig, and a log callback:


# Full provision from scratch
await provision(ftl, config, log)

# Server lifecycle
await start_server(ftl, config, log)
alive = await verify_server(ftl, config, log)
await save_and_stop(ftl, config)

# World management
await restore_world(ftl, config, backup_path, log)
local_path = await backup_world(ftl, config, log)

# Player monitoring
count = await get_player_count(ftl, config)  # returns int or None

# Teardown
await destroy(ftl, config, log)

The provision() function orchestrates seven sequential steps (infrastructure, minecraft install, utilities, security, swap, ownership, DDNS) plus an optional NeoForge install. Each step is idempotent — infrastructure checks ftl.state before creating a new Linode.

API and Configuration

ServerConfig attributes used:

Constants: TMUX_SESSION = "minecraft" — the tmux session name used for the server process.

Config files copied to remote: eula.txt, server.properties, whitelist.json, ops.json, userjvmargs.txt, and conditionally run.sh (only when not using NeoForge).

Key Behaviors

Relationships