Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

r15ch13/live-minecraft-overviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Live Minecraft Overviewer

Show live player positions on Minecraft Overviewer (Demo)

Requirements

Installation

Follow to instructions on how to install the Web-API and move with these steps:

Configure Minecraft Overviewer

Copy index.html and dist to the webassets directory, so Overviewer will use them on the next update.

λ cp index.html <minecraft>/webassets
λ cp -r dist/ <minecraft>/webassets

Add customwebassets option to you Overviewer config file

customwebassets = "<minecraft>/webassets"

Add your Web-API URL and the overviewer API key to index.html.

window.settings = {
    webapi: {
        url: 'http://<minecraft-webapi-url>',
        key: 'overviewer'
    }
}

Configure Web-API

Apply the following changes to <minecraft>/config/webapi/permissions.conf.

Disable the whitelist because the API has to be accessible for everyone.

useWhitelist=false

Add an overviewer key with the following permissions.

keys {
    overviewer {
        permissions {
            info {
                "*"=false
                info {
                    "*"=false
                    motd=true
                    players=true
                    maxPlayers=true
                    minecraftVersion=true
                }
            }
            player {
                list {
                    "*"=false
                    location="*"
                    name=true
                    uuid=true
                }
                one {
                    boots="*"
                    chestplate="*"
                    experience="*"
                    food="*"
                    gameMode="*"
                    health="*"
                    helmet="*"
                    latency=true
                    leggings="*"
                    location="*"
                    name=true
                    uuid=true
                }
            }
        }
        # disable rate limit
        rateLimit=0
    }
}

Configure Webserver

Add proxy settings for the Web-API endpoints to allow the X-WEBAPI-KEY header.

Nginx

location /api {
    proxy_pass http://localhost:<webapi-port>/api;
    proxy_http_version 1.1;

    # allow authentication header
    add_header 'Access-Control-Allow-Headers' 'X-WEBAPI-KEY';

    # pre-flight info is valid for 20 days
    add_header 'Access-Control-Max-Age' 1728000;

    # only allow GET and OPTIONS methods
    add_header 'Allow' 'GET, OPTIONS';

    # disable logs
    access_log off;
    error_log off;
}

Caddy

proxy /api localhost:<webapi-port> {
    # allow authentication header
    header_downstream Access-Control-Allow-Headers "X-WEBAPI-KEY"

    # pre-flight info is valid for 20 days
    header_downstream Access-Control-Max-Age 1728000

    # only allow GET and OPTIONS methods
    header_downstream Allow "GET, OPTIONS"
}

Build from Source

# install dependencies
npm install

# let webpack proxy all traffic to a running Minecraft Overviewer
export WEBPACK_PROXY_MINECRAFT_API='<minecraft-overviewer>'

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For a detailed explanation of how things work, consult the docs for vue-loader.

License

The MIT License (MIT)

Releases

No releases published

Packages

No packages published