Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kasefuchs/lazygate
https://github.com/kasefuchs/lazygate
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kasefuchs/lazygate
- Owner: kasefuchs
- License: mit
- Created: 2024-10-24T10:58:51.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-27T19:45:48.000Z (3 months ago)
- Last Synced: 2024-10-27T23:14:20.468Z (3 months ago)
- Language: Go
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LazyGate
## Table of Contents
- [About](#about)
- [Getting Started](#getting_started)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.### 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 mainimport (
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.