Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: status place holder #208

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/infrared/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func initLogger() {
log.Debug().
Str("level", logLevel).
Msg("Log level set")

ir.Log = log.Logger
}

func main() {
Expand Down Expand Up @@ -104,7 +106,6 @@ func run() error {
ConfigPath: configPath,
ProxiesPath: proxiesDir,
})
srv.Logger = log.Logger

errChan := make(chan error, 1)
go func() {
Expand Down
35 changes: 34 additions & 1 deletion configs/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,37 @@ filters:

# Windows Length is the time frame for the Request Limit.
#
windowLength: 1s
windowLength: 1s

# Reponse that the player sees when there is no server for that domain.
#
notFoundResponse:
# The status response that should be displayed to the players
#
status:

# The name of the version.
# This is displayed on the client side when the version is incompatible.
#
versionName: "Infrared 1.20.6"

# The protocol version number determens if the version of the client is compatible with the server.
# A list of protocol versions can be found here: https://wiki.vg/Protocol_version_numbers
# Set this to -1 to mirror the client version back.
#
protocolNumber: -1
maxPlayerCount: 0
playerCount: 0
playerSamples: []

# Server icon can be provided as base64 or path to a file.
#
icon: ""

# MOTD can be just a string or a JSON Text Component.
#
motd: "Server not found"

# Reason why the player was disconnected during login.
#
message: "Server not found"
28 changes: 27 additions & 1 deletion configs/proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,30 @@ addresses:
# Send a PROXY Protocol Header to the server to
# forward the players IP address
#
#sendProxyProtocol: true
#sendProxyProtocol: true

# Reponse that the player sees when the connection to the backend server
# times out during status or login request.
#
dialTimeoutResponse:
status:
versionName: "Infrared 1.20.6"
protocolNumber: 766
maxPlayerCount: 20
playerCount: 0
playerSamples: []
icon: ""
motd: "Unable to reach backend server"
message: "Unable to reach backend server"

# Override Status is similar to the dial timeout response status
# but instead you just can override some fields in the status.
#
overrideStatus:
versionName: "1.20.6"
protocolNumber: 766
maxPlayerCount: 20
playerCount: 0
playerSamples: []
icon: ""
motd: "Unable to reach backend server"
3 changes: 1 addition & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { defineConfig} from 'vitepress'
export default defineConfig({
lang: 'en-US',
title: 'Infrared',
titleTemplate: ':title | Minecraft Proxy',
description: 'Minecraft Proxy',
description: 'The Minecraft Reverse Proxy',
cleanUrls: true,
head: [
[
Expand Down
4 changes: 2 additions & 2 deletions docs/community-projects.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Community Projects

> [!NOTE]
> These projects are managed by the Infrared Community.
> These projects are managed by the Community.
> We do **not** provide official support for these projects.
> Please use their dedicated issue trackers or support channels provided by the respective project.
> Thanks for understanding.

## Infrared for Pterodactyl
## Pterodactyl Egg

An egg to run Infrared in Pterodactyl. \
Repo: [Shadowner/Infrared-Pterodactyl-egg](https://github.com/Shadowner/Infrared-Pterodactyl-egg) \
Expand Down
4 changes: 4 additions & 0 deletions docs/config/server-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Server Status

The server status is what the server sends to clients to display in the server list.

6 changes: 6 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# FAQ

## Will you add (Query)[https://wiki.vg/Query]?

No, it is fundamentally not compatibale with reverse proxies.

10 changes: 10 additions & 0 deletions docs/features/status-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Status Cache

The status cache aims to reduces the ping frequency and the general load on your backend servers and Infrared.
It is implemented by via a double hash map to reduce it's memory footprint.

## Enable Status Caching

```yaml

```
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ The URL of your download should look something like this:
```
https://github.com/haveachin/infrared/releases/download/{version}/infrared_{architecture}.tar.gz
```
For example:
For latest:
```
https://github.com/haveachin/infrared/releases/download/v1.3.4/infrared_Linux_x86_64.tar.gz
https://github.com/haveachin/infrared/releases/latest/download/infrared_Linux_x86_64.tar.gz
```

::: tip
Expand All @@ -43,7 +43,7 @@ curl -LO https://github.com/haveachin/infrared/releases/download/{version}/infra

Downloading by using Powershell on Windows:
```Powershell
Invoke-WebRequest -Uri https://github.com/haveachin/infrared/releases/download/v1.3.4/infrared_Windows_x86_64.zip -OutFile c:\infrared.zip
Invoke-WebRequest -Uri https://github.com/haveachin/infrared/releases/latest/download/infrared_Windows_x86_64.zip -OutFile c:\infrared.zip
```

### Extracting the binary
Expand Down
Loading
Loading