You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Syfaro 723160fc49 Fix mistake in Drone file. 5 months ago
client Use stringcmap, reformatting, lowercase serverAddr. 1 year ago
files Ability to render images. 1 year ago
scripts Update homepage. 1 year ago
templates Use server favicon image if available. 1 year ago
types Use server favicon image if available. 1 year ago
.drone.yml Fix mistake in Drone file. 5 months ago
.gitignore Option to disable fetching. 1 year ago
Dockerfile Build Docker image. 5 months ago
LICENSE.txt Add license. 6 months ago
README.md Approved IP list. 5 months ago
go.mod Add config info to README, ratelimiting settings. 5 months ago
go.sum Add config info to README, ratelimiting settings. 5 months ago
images.go Rate limit per IP for bad requests. 1 year ago
mcapi.go Build Docker image. 5 months ago
ratelimit.go Approved IP list. 5 months ago
serverquery.go Starting new approach, display count for testing. 7 months ago
statusping.go Starting new approach, display count for testing. 7 months ago

README.md

MCApi

An API for fetching the status of and querying Minecraft servers.

It is running at mcapi.us.

Configuration

go build
./mcapi -gencfg

Options in config.json:

  • HTTPAppHost — host and port to listen on
  • RedisHost — host of redis server
  • StaticFiles — path to static files
  • TemplateFile — path to index file
  • SentryDSN — optional sentry dsn to report errors to
  • AdminKey — secret token used to get list of servers or clear the list

Rate limiting with Cloudflare requires setting the following environment variables:

  • CLOUDFLARE_EMAIL — your Cloudflare account email address
  • CLOUDFLARE_AUTH — your Cloudflare authentication token

Disable ratelimiting generally or with Cloudflare by using built-time variables to update rateLimitEnabled and cloudflareEnabled or modifying the code in ratelimit.go#16-17.

Setting APPROVED_IPS to a comma separated list of IP addresses will prevent the rate limits from applying to those addresses.