Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/kasefuchs/lazygate


https://github.com/kasefuchs/lazygate

Last synced: 2 months ago
JSON representation

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-server1:
labels:
lazygate.server: random_name
```

**Gate config:**

```yaml
---
config:
servers:
random_name: minecraft-server1:25565
try:
- random_name
```

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