Cyber28 / Mag

Small API to generate filtered minecraft seeds for various purposes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mag

Mag (Hungarian: seed) is a small API to generate filtered seeds for various purposes

Example usage

GET http://localhost:port/powervillage

{
  "cache_size": 5,
  "cache_status": true,
  "seed": -4712597063144166317,
  "took": 26509
}

Response types

/:generator-type

{
  "cache_size": "number, number of seeds in the cache",
  "cache_status": "boolean, true if it was fetched from cache, false if cache was empty and it was generated upon request",
  "seed": "number, the seed",
  "took": "number, time (in milliseconds) it took to generate the seed"
}

/cache

{
  "generator_name": "number, number of seeds cached for this generator"
}

Deployment (without Docker)

Requirements:

  • Some version of Linux, as the generator executables are built for Linux
  • Elixir 11+ (should work, too lazy to run tests)

Deploying

  • Drop your generator executables in /generators (they must be built for Linux)
  • mix deps.get
  • mix run

Deployment (with Docker)

  • docker build . -t mag:latest
  • docker run mag:latest

Extra details

  • You can specify a port with the MAG_PORT environment variable (by default it will listen on 8000)
  • You can specify the number of seeds to keep cached with the MAG_MAX_CACHE environment variable (by default it will cache 10)
  • You can specify the number of generator executables to run at once with the MAG_MAX_GENERATORS environment variable (by default it will run 1)
  • It is HIGHLY recommended to only allow specified hosts to access your deployment

Credits

  • Everyone involved in the filtered seed projects!
  • Cyber28 for writing this junk
  • Ravy for helping with Docker support

About

Small API to generate filtered minecraft seeds for various purposes

License:MIT License


Languages

Language:Elixir 97.6%Language:Dockerfile 2.4%