- Implemented input validation for binary paths, hostnames, and ports to enhance security - Added winston-based advanced logging with debug, info, warn, and error levels - Configured logging to output to both console and server.log file - Included request context and unique request IDs in logs - Fixed binary path validation to allow /home/go/status and added existence checks
Minecraft Server Status Checker
A web application to check the status of Minecraft Java and Bedrock Edition servers. Built with Node.js, Express, and Tailwind CSS, it provides a sleek, modern interface with particle animations and confetti effects for a delightful user experience.
Features
- Check status for Minecraft Java and Bedrock Edition servers.
- Displays server details like version, player count, MOTD, and more.
- Responsive design with Tailwind CSS.
- Interactive particle background using tsParticles.
- Confetti celebration on successful server status checks.
- URL-based server checks for direct access.
- Environment variable support for configuration.
Prerequisites
- Node.js (v16 or higher)
- npm (v7 or higher)
- Status check binaries (configured via environment variables) https://git.ssh.surf/hypermc/mc-status
Installation
-
Clone the repository:
git clone https://git.ssh.surf/hypermc/status-check.git cd status-check
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and configure the paths to your status check binaries:STATUS_CHECK_PATH=/path/to/java-status-check GEYSER_STATUS_CHECK_PATH=/path/to/bedrock-status-check
Ensure the binaries are executable and return JSON output as expected by the application.
-
Build CSS (if modifying
style.css
):Ensure Tailwind CSS is set up. If you have
tailwindcss
installed globally:npx tailwindcss -i public/css/style.css -o public/css/style.min.css --minify
Alternatively, use the provided
style.min.css
for production. -
Run the application:
node status_site.js
The server will start at
http://localhost:3066
.
Usage
- Open
http://localhost:3066
in your browser. - Select the server edition (Java or Bedrock).
- Enter the connection string in the format
host:port
(e.g.,example.com:25565
). - Click "Check Status" to view the server status.
- Alternatively, use a direct URL like
http://localhost:3066/java/example.com/25565
to check a server.
Project Structure
minecraft-server-status-checker/
├── public/
│ ├── css/
│ │ ├── style.css # Tailwind CSS source
│ │ └── style.min.css # Minified CSS output
│ ├── js/
│ │ └── app.js # Client-side JavaScript
│ ├── favicon/ # Favicon assets
│ └── index.html # Main HTML page
├── .env # Environment variables (not tracked)
├── status_site.js # Express server
├── package.json # Node.js dependencies
└── README.md # This file
Dependencies
-
Backend:
- express - Web framework
- dotenv - Environment variable management
- child_process - For executing status check binaries
-
Frontend:
- Tailwind CSS - Styling
- tsParticles - Particle animations
- canvas-confetti - Confetti effects
Configuration
The application relies on two environment variables:
STATUS_CHECK_PATH
: Path to the Java Edition status check binary.GEYSER_STATUS_CHECK_PATH
: Path to the Bedrock Edition status check binary.
These binaries should accept -host
and -port
arguments and output JSON data.