-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Auto config reload on file update (#235)
- Loading branch information
1 parent
add9dec
commit 5af2c7d
Showing
23 changed files
with
620 additions
and
274 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Auto Config Reload | ||
|
||
_Gate watches your file for updates._ | ||
|
||
--- | ||
|
||
Gate supports automatic config reloading without restarting the proxy by watching your config file for changes | ||
without disconnecting players. | ||
|
||
This is useful for example when you want to change **any setting in the config** like servers, the motd or | ||
switch to Lite mode while staying live. | ||
|
||
::: tip | ||
Generally all settings can be changed without disconnecting players, | ||
however some session-related properties like `online-mode` will only apply to newly connected | ||
players that joined after the config update and does not kick players that are already connected with another | ||
online-mode. | ||
::: | ||
|
||
## How it works | ||
|
||
Gate watches your config file for changes and reloads it automatically when it detects a change. | ||
This is seen as a safe operation, as the config is validated before it is applied. | ||
If it is invalid, the reload is aborted and the proxy continues to run with the last valid config. | ||
|
||
## Switching to Lite mode and Connect | ||
|
||
If you want to switch to [Lite mode](/guide/lite) or [Connect](/guide/connect), you can do so without restarting the | ||
proxy. | ||
This is useful if you want to test it out or if you want to switch to Lite mode temporarily for maintenance | ||
or migration purposes. | ||
|
||
## How to enable it | ||
|
||
This feature is always enabled by default, given that you have a config file. | ||
|
||
## How to disable it | ||
|
||
This can not be disabled. | ||
If you feel like you need to disable it, please [open an issue]( | ||
https://github.com/minekube/gate/issues/new?title=Disable%20auto%20config%20reload&body=I%20want%20to%20disable%20auto%20config%20reload%20because%20...). |
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 |
---|---|---|
|
@@ -62,4 +62,4 @@ config: | |
version: | ||
name: §eTry example.com | ||
protocol: -1 | ||
favicon: server-icon.png | ||
#favicon: server-icon.png |
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
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 @@ | ||
package config | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_texts(t *testing.T) { | ||
require.NotNil(t, defaultMotd()) | ||
require.NotNil(t, defaultShutdownReason()) | ||
} |
Oops, something went wrong.