-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
420 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM --platform=$BUILDPLATFORM golang:alpine AS builder | ||
ARG TARGETARCH | ||
WORKDIR /tmp/build | ||
COPY . /tmp/build | ||
ENV GO111MODULE=on | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -ldflags "-s -w" -o ./out/infrared ./cmd/infrared | ||
RUN chmod +x ./out/infrared | ||
|
||
FROM alpine:latest | ||
COPY --from=builder /tmp/build/out/infrared /usr/bin/ | ||
WORKDIR /etc/infrared | ||
ENTRYPOINT [ "/usr/bin/infrared" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM alpine:latest | ||
COPY infrared /usr/bin/infrared | ||
WORKDIR /etc/infrared | ||
ENTRYPOINT [ "/usr/bin/infrared" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: "3.8" | ||
|
||
services: | ||
infrared: | ||
image: haveachin/infrared:latest | ||
container_name: infrared | ||
restart: always | ||
ports: | ||
- 25565:25565/tcp | ||
volumes: | ||
- ./data/infrared:/etc/infrared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Filters | ||
|
||
Filter are hooks that trigger befor a connection is processed. | ||
They are used as preconditions to validate a connection. | ||
|
||
## Use Filters | ||
|
||
To use filters you just need to a this to your [**global config**](../config/index.md): | ||
|
||
```yml | ||
# Filter are hooks that trigger befor a connection is processed. | ||
# They are used as preconditions to validate a connection. | ||
# | ||
filters: | ||
``` | ||
Now you actually need to add filters to your config. | ||
This is a list of all the filters that currently exist: | ||
- [Rate Limiter](rate-limit-ips) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Forward Player IPs | ||
|
||
You can forward the player IPs via proxy protocol. | ||
To enable it in Infrared you just have to change this in you [**proxy config**](../config/proxies.md): | ||
```yml | ||
# Send a Proxy Protocol v2 Header to the server to | ||
# forward the players IP address. | ||
# | ||
#sendProxyProtocol: true // [!code --] | ||
sendProxyProtocol: true // [!code ++] | ||
``` | ||
## Paper | ||
In Paper you have to enable it also to work. | ||
See [the Paper documentation on Proxy Protocol](https://docs.papermc.io/paper/reference/global-configuration#proxies_proxy_protocol) for more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Rate Limit IPs | ||
|
||
You can rate limit by IP address using the `rateLimit` filter. | ||
This can be easily activated in your [**global config**](../config/index.md) by adding this: | ||
|
||
```yml{2-16} | ||
filters: | ||
# Rate Limiter will only allow an IP address to connect a specified | ||
# amount of times in a given time frame. | ||
# | ||
rateLimiter: | ||
# Request Limit is the amount of times an IP address can create | ||
# a new connection before it gets blocked. | ||
# | ||
requestLimit: 10 | ||
# Windows Length is the time frame for the Request Limit. | ||
# | ||
windowLength: 1s | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,5 +75,5 @@ services: | |
ports: | ||
- 25565:25565/tcp | ||
volumes: | ||
- ./data/infrared:/infrared | ||
- ./data/infrared:/etc/infrared | ||
``` |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.