An open API service indexing awesome lists of open source software.

https://github.com/kasefuchs/lazygate

Gate proxy plugin that shuts down your Minecraft server when it's idle and wakes it up when players connect.
https://github.com/kasefuchs/lazygate

docker gate-extension go golang minecraft minekube nomad plugin

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# LazyGate

## Table of Contents

- [About](#about)
- [Getting Started](#getting_started)

## About

LazyGate is a [Gate proxy](https://github.com/minekube/gate) 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:

```sh
go get github.com/kasefuchs/lazygate
```

Include the plugin in your list of proxy plugins:

```go
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:

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

### Usage

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

**Docker Compose:**

```yaml
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:**

```yaml
---
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.