Skip to content

Gate proxy plugin that shuts down your Minecraft server when it's idle and wakes it up when players connect.

License

Notifications You must be signed in to change notification settings

kasefuchs/lazygate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LazyGate

Table of Contents

About

LazyGate is a Gate proxy plugin that shuts down your Minecraft server when it's idle and wakes it up when players connect.

Getting Started

Installing

Add the lazygate module to your project:

go get github.com/kasefuchs/lazygate

Include the plugin in your list of proxy plugins:

package main

import (
	lazygate "github.com/kasefuchs/lazygate/pkg/plugin"
	"go.minekube.com/gate/cmd/gate"
	"go.minekube.com/gate/pkg/edition/java/proxy"
)

func main() {
	proxy.Plugins = append(proxy.Plugins, lazygate.NewProxyPlugin())

	gate.Execute()
}

Configuring

Configure the plugin using environment variables:

# Provider to use. Currently available nomad & docker.
LAZYGATE_PROVIDER="nomad"

Usage

LazyGate matches registered Gate servers with provider's allocations using labels:

Docker Compose:

services:
  minecraft-server-random:
    labels:
      lazygate.server: random_name
      lazygate.time.minimumOnline: 2m
      lazygate.time.inactivityThreshold: 5m
      lazygate.queue.try: wait,kick
      lazygate.queue.wait.timeout: 10s
      lazygate.queue.wait.pingInterval: 2s
      lazygate.queue.kick.starting: random_name is currently starting!

Gate config:

---
config:
  servers:
    random_name: minecraft-server-random:25565
  try:
    - random_name

In this example, the random_name server will correspond to the minecraft-server1 service.

About

Gate proxy plugin that shuts down your Minecraft server when it's idle and wakes it up when players connect.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages