Skip to content

A Spring Boot application for collecting and viewing Minecraft server debug information

Notifications You must be signed in to change notification settings

myth-MC/snapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

snapshot

Latest release Pull requests Issues License
A Spring Boot application for collecting and viewing Minecraft server debug information.

🧲 Quick navigation
  1. πŸ“š Information
  2. πŸ“‹ Requirements
  3. πŸ“₯ Installation
  4. πŸ”¨ Configuration
  5. πŸ’‘ Usage
  6. πŸ”— API Endpoints
  7. β˜•οΈ Development
  8. πŸ“• References

πŸ“š Information

Snapshot is a Spring Boot application for collecting and viewing Minecraft server debug information. It provides a REST API for log uploads and a simple web interface for searching and viewing logs.

Currently, Snapshot supports the following features:

  • Modern Web UI for searching and viewing logs with a debug code
  • REST API for uploading and retrieving server reports
  • Configurable rate limiting to prevent API abuse per-server
  • Automatic cleanup - Logs are automatically deleted after 24 hours

πŸ“‹ Requirements

  • Java 17 or higher
  • Maven 3.6+ if you want to compile the project

πŸ“₯ Installation

Pre-compiled binary file (.jar)

  1. Download the latest pre-compiled binary file from the Releases page
  2. Run the application:
    java -jar snapshot-server.jar
  3. You can access the web UI in localhost:9090 by default

Self-compiled

  1. Clone the repository:
    git clone https://github.com/myth-MC/snapshot.git
    cd snapshot
  2. Build the project:
    mvn clean package
  3. Run the application:
    java -jar target/snapshot-server-0.1.0.jar
  4. You can access the web UI in localhost:9090 by default

πŸ”¨ Configuration

Most options can be configured by editing application.properties:

  • Server port: Change server.port to your desired port
  • Rate limiting:
    • snapshot.rate-limiting.capacity: Maximum requests per window
    • snapshot.rate-limiting.refill-amount: Requests restored per refill
    • snapshot.rate-limiting.refill-minutes: Time window for refill in minutes
  • Web UI:
    • snapshot.web-ui.timestamp-format: Timestamp format

Tip

You can also pass these settings as system properties in the java command:

java -Dserver.port=80 -Dsnapshot.rate-limiting.capacity=10 -jar snapshot-server.jar

πŸ’‘ Usage

You can view logs by entering a debug code in the /search page:

  1. Navigate to /search (e.g., http://localhost:9090/search)
  2. Enter a debug code (e.g., DBG-ABC123) to view the associated log
  3. The result page displays:
    • General information (UUID, timestamp, requester)
    • Server environment (software, version, online mode)
    • Plugin information (name, version)
    • Additional data such as:
      • YAML files
      • Strings
      • Integers
      • Booleans
      • Lists

πŸ”— API Endpoints

The API exposes two endpoints to retrieve and upload data with JSON format.

POST /api/v1/upload

Uploads a log entry.

Field Descriptions

Name Type Description Required?
requester Β  String Name of the report requester βœ…
pluginName String Name of the targeted plugin βœ…
pluginVersion String Version of the targeted plugin βœ…
serverPort Integer Port of the server βœ…
serverVersion String Version of the server βœ…
serverSoftware String Software of the server βœ…
serverOnlineMode Β Boolean Whether the server runs in online mode βœ…
extra JSON structure Additional data ❌

Note

This is how a full valid request body would look like:

{
 "requester": "PlayerName",
 "pluginName": "MyPlugin",
 "pluginVersion": "1.0.0",
 "serverPort": 25565,
 "serverVersion": "1.20.1",
 "serverSoftware": "Paper",
 "serverOnlineMode": true,
 "extra": {
   "serverPlugins": ["Plugin1", "Plugin2"],
   "config.yml": "base64encodedcontent...",
   "bukkit.yml": "base64encodedcontent..."
 }
}

GET /api/v1/log/DBG-XXXXXX

Retrieves a log by its code.

Field Descriptions

Name Type Description
uuid Β  String UUID of the created log
timestamp Β String Creation timestamp of the log
requester Β  String Name of the report requester
pluginName String Name of the targeted plugin
pluginVersion String Version of the targeted plugin
serverVersion String Version of the server
serverSoftware String Software of the server
serverOnlineMode Β Boolean Whether the server runs in online mode
extra JSON structure Additional data

Note

This is how a full response could look like:

{
 "uuid": "abc12345-6789-0123-4567-890123456789",
 "timestamp": "2026-01-18T03:03:44.047833",
 "requester": "PlayerName",
 "pluginName": "MyPlugin",
 "pluginVersion": "1.0.0",
 "serverVersion": "1.20.1",
 "serverSoftware": "Paper",
 "serverOnlineMode": true,
 "extra": {
   "serverPlugins": ["Plugin1", "Plugin2"],
   "config.yml": "base64encodedcontent...",
   "bukkit.yml": "base64encodedcontent..."
 }
}

Extra field structure

The extra field accepts any valid JSON structure and can be used to display additional data.

JSON objects

Most JSON objects (strings, integers, booleans, arrays...) in the extra field will be handled automatically.

{
  "extra": {
    "exampleString": "This is an example string!",
    "exampleInteger": 25565,
    "exampleBoolean": true
  }
}

Text files (YAML, JSON...)

Text files must be properly encoded into Base64.

{
  "extra": {
    "config.yml": "base64encoded...",
    "server.properties": "base64encoded...",
    "settings.json": "base64encoded..."
  }
}

β˜•οΈ Development

You may extend the functionality of the application easily with some basic Java knowledge.

Project Setup

Cloning the repository

git clone https://github.com/myth-MC/snapshot.git
git checkout dev

Building

mvn clean package

Running in Development Mode

mvn spring-boot:run

Project Structure

src/
β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ java/ovh/mythmc/snapshot/server/
β”‚   β”‚   β”œβ”€β”€ controller/      # REST and web controllers
β”‚   β”‚   β”œβ”€β”€ entity/          # JPA entities
β”‚   β”‚   β”œβ”€β”€ repository/      # Data repositories
β”‚   β”‚   β”œβ”€β”€ converter/       # Custom converters
β”‚   β”‚   └── scheduler/       # Scheduled tasks
β”‚   └── resources/
β”‚       β”œβ”€β”€ templates/       # Thymeleaf templates
β”‚       β”œβ”€β”€ static/          # CSS, JS, images
β”‚       └── application.properties
└── pom.xml

πŸ“• References

  • This application is built with Spring Boot
  • H2 is used to provide database functionality
  • Rate limiting is powered by Bucket4J

These are some of the projects we've used as inspiration for the application:

About

A Spring Boot application for collecting and viewing Minecraft server debug information

Resources

Stars

Watchers

Forks