Date: 2026-05-11
Time: 15:55
This is a Textual-based terminal UI (TUI) dashboard for ftl2-servercraft, a Minecraft server lifecycle manager. It provides a real-time dashboard showing server status, player counts, watchdog state, and grace-period countdowns. Users can launch, stop, backup, verify, and reconfigure Minecraft servers through keyboard shortcuts, with all heavy operations (provisioning, teardown, backup) running in background threads while the UI remains responsive. The TUI uses FTL2's automation context manager to execute infrastructure scripts against Linode cloud instances.
The app is instantiated with a config file path and run as a Textual application:
app = ServerCraftApp(config_path="servers.yaml")
app.run()
Key keyboard bindings drive the interface:
All operations select the currently highlighted row in the DataTable.
Config inputs:
ServerConfig objects loaded via loadconfig(configpath) — each defines: name, label, script, worldname, linodetype, linoderegion, graceperiod, pollinterval, statefile, inventorypath, minecraftversion, ddnshostname, slackchannelgetbackups(), isprovisioned(), get_ip() methodsFTL2 automation parameters (used in every operation):
secretbindings — maps module FQCNs to Vault secret names (LINODETOKEN, LINODEROOTPASS, SLACK_TOKEN)inventory — path from configstate_file — path from config for crash recoveryfailfast=True, autoinstall_deps=Truegate_modules="auto" — used only during provisioning for performanceLogging: Provisioning writes to logs/provision-{name}-{timestamp}.log in addition to the TUI activity log.
runtime_state.runtime_state is a module-level dict of ServerState dataclasses, written by background threads and read by the TUI. No locking — relies on GIL and simple attribute writes.emptysince tracks the timestamp. The dashboard shows a countdown; the watchdog (in watchdog.py) handles the actual teardown after graceperiod seconds.error.stopping → save & stop server → backup world → notify Slack → destroy Linode. Backup failure is caught but doesn't abort teardown.checkexisting_state() reads state files to detect already-provisioned servers, so the dashboard reflects reality on restart.ModalScreen) that return values via callbacks. The provisioning screen can be escaped without canceling the operation.backupactive set; provisioning checks status before allowing re-launch..config.ServerConfig and .config.loadconfig for server definitions; .watchdog.runwatchdog for the player-monitoring loop; .scripts.get_script() for server-type-specific operations (provision, start, stop, backup, verify, restore, destroy)ftl2.automation as an async context manager — the core interface for running infrastructure modulescommunity.general.linode_v4 (Linode provisioning), community.general.slack (notifications)secret_bindings), Slack (stop notifications)Screen, ModalScreen, DataTable, RichLog, Header, Button, Label widgets