How stray216/strays-mc-tools works
Project type and purpose
• This is a CLI-driven DevOps/tooling project (a Bash wrapper around an existing Docker image).
• Purpose: provision, configure, and manage a Docker-based Minecraft server via Bash scripts, environment files, and helper libraries.
File structure
• Top-level scripts:
• bin/ (entrypoint scripts)
• update.sh (self-update mechanism)
• Library:
• lib/common.sh (shared helper functions)
• Configuration:
• etc/config.env (user overrides)
• etc/defaults.env (built-in defaults)
• Documentation:
• doc/CONVENTIONS.md (coding/deployment conventions)
• doc/TODO.md
• Supporting files:
• .gitignore, LICENSE, VERSION
README
• Confirms it’s a Bash toolkit for managing the “itzg/docker-minecraft-server” Docker image.
• No built-in GUI or web front end—everything is invoked via shell commands.
Main components
a. User/Administrator (CLI)
b. Bash Wrapper & Entry Scripts (bin/*.sh, update.sh)
c. Shared Library (lib/common.sh)
d. Configuration Layer (etc/defaults.env + etc/config.env)
e. Docker CLI (shell invokes docker commands)
f. Docker Daemon (Docker Engine)
g. Minecraft Server Container (itzg/docker-minecraft-server)
h. Host Volumes (persistent world data, logs, configs)
i. External Clients (players connecting on TCP/UDP ports)
Relationships & data flow
1. Admin runs a wrapper script (e.g., bin/start.sh).
2. Script sources lib/common.sh and etc/config.env/defaults.env.
3. Script builds a docker run command (with environment variables, mounted volumes).
4. Docker CLI calls Docker Daemon.
5. Daemon launches the Minecraft Server Container.
6. Container reads configuration (mapped from host volumes).
7. Minecraft server listens on exposed port; players connect.
8. Server writes logs and world data back to host volumes.
9. update.sh optionally fetches a new version of this toolkit or underlying image.
Architectural patterns & design principles
• Separation of Concerns:
• bin/ for entrypoints, lib/ for code reuse, etc/ for configs, doc/ for documentation.
• Idempotent & Declarative: environment files drive container behavior.
• Single Responsibility: each script does one task (start, stop, update).
• Externalized configuration: defaults vs. user overrides.