serverwatcher 1.dev5__tar.gz → 1.dev7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {serverwatcher-1.dev5/src/serverwatcher.egg-info → serverwatcher-1.dev7}/PKG-INFO +5 -3
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/README.md +4 -2
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/pyproject.toml +1 -1
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/app.py +7 -1
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/connection.py +25 -0
- serverwatcher-1.dev7/src/serverwatcher/settings.py +23 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7/src/serverwatcher.egg-info}/PKG-INFO +5 -3
- serverwatcher-1.dev5/src/serverwatcher/settings.py +0 -18
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/LICENSE +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/setup.cfg +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/__init__.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/__main__.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/actionperformer.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/__init__.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/config.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/discord.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/environment.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/evaluation.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/messages.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configclasses/watcher.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/configmanager.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/evaluator.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/exceptions.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/metricfetcher.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/router.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/targetserver.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/old/watcher.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/__init__.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/__main__.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/actionperformer.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/configclasses/__init__.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/configclasses/config.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/configclasses/evaluation.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/configclasses/logging.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/configclasses/messages.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/configclasses/watcher.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/defaultconfigs/config.yaml +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/defaultconfigs/evaluation.yaml +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/defaultconfigs/messages.yaml +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/defaultconfigs/watcher.yaml +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/evaluator.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/metricfetcher.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/router.py +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher.egg-info/SOURCES.txt +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher.egg-info/dependency_links.txt +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher.egg-info/entry_points.txt +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher.egg-info/requires.txt +0 -0
- {serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: serverwatcher
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.dev7
|
|
4
4
|
Summary: A HungerCore-powered Minecraft server automation engine.
|
|
5
5
|
Author: iFamished
|
|
6
6
|
License: GPL-3.0
|
|
@@ -55,13 +55,15 @@ A highly configurable Minecraft server monitoring and restart engine for HungerB
|
|
|
55
55
|
## Installation
|
|
56
56
|
- Import the [ServerWatcher Pterodactyl egg](https://github.com/HungerNet/ServerWatcher/blob/main/eggs/egg-serverwatcher.json) into your panel and create a server with Python 3.14.
|
|
57
57
|
- Run the installer. It checks out the configured Git branch and installs `uv`; Python dependencies are synced on startup.
|
|
58
|
-
- Start the server once to generate the runtime YAML files in
|
|
58
|
+
- Start the server once to generate the runtime YAML files in `/home/container/config/`. Set the required panel/server credentials in `/home/container/config/config.yaml`, then restart.
|
|
59
59
|
- Missing runtime files are copied from packaged defaults without overwriting existing files. The example panel and API credentials are placeholders, so valid credentials are required before the watcher can connect.
|
|
60
60
|
- Subsequent starts update the checkout when `AUTO_UPDATE` is enabled, sync the Python environment, and run ServerWatcher.
|
|
61
61
|
|
|
62
62
|
The egg defaults to the `main` branch and enables startup auto-updates. Set `AUTO_UPDATE` to `0` to keep the installed checkout fixed, or change `GIT_BRANCH` to use another branch.
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
`HUNGERLIB_DEV`, `MAPRES_DEV`, and `C2E_DEV` each upgrade their package to the latest prerelease with `uv` on every startup; C2E is optional and is not required by ServerWatcher itself. Choose the ServerWatcher source branch with `GIT_BRANCH`.
|
|
65
|
+
|
|
66
|
+
The YAML files in `src/serverwatcher/defaultconfigs/` are the canonical packaged defaults. MapRes copies each one into `/home/container/config/` on first startup; edit these runtime files, which are not committed as a second source of defaults. `config.yaml` contains server/API and logging settings; `evaluation.yaml`, `messages.yaml`, and `watcher.yaml` contain their corresponding settings. `SERVERWATCHER_CONFIG_DIR` can override this path for non-container installs.
|
|
65
67
|
|
|
66
68
|
## HungerNet Bot Webhook
|
|
67
69
|
Set `hungernetbot.enabled` to `True`, `hungernetbot.url` to the Bot's `/webhook` endpoint, and `hungernetbot.token` to the same secret configured as `BRIDGE_WEBHOOK_TOKEN` in HungerNet Bot. For example:
|
|
@@ -24,13 +24,15 @@ A highly configurable Minecraft server monitoring and restart engine for HungerB
|
|
|
24
24
|
## Installation
|
|
25
25
|
- Import the [ServerWatcher Pterodactyl egg](https://github.com/HungerNet/ServerWatcher/blob/main/eggs/egg-serverwatcher.json) into your panel and create a server with Python 3.14.
|
|
26
26
|
- Run the installer. It checks out the configured Git branch and installs `uv`; Python dependencies are synced on startup.
|
|
27
|
-
- Start the server once to generate the runtime YAML files in
|
|
27
|
+
- Start the server once to generate the runtime YAML files in `/home/container/config/`. Set the required panel/server credentials in `/home/container/config/config.yaml`, then restart.
|
|
28
28
|
- Missing runtime files are copied from packaged defaults without overwriting existing files. The example panel and API credentials are placeholders, so valid credentials are required before the watcher can connect.
|
|
29
29
|
- Subsequent starts update the checkout when `AUTO_UPDATE` is enabled, sync the Python environment, and run ServerWatcher.
|
|
30
30
|
|
|
31
31
|
The egg defaults to the `main` branch and enables startup auto-updates. Set `AUTO_UPDATE` to `0` to keep the installed checkout fixed, or change `GIT_BRANCH` to use another branch.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
`HUNGERLIB_DEV`, `MAPRES_DEV`, and `C2E_DEV` each upgrade their package to the latest prerelease with `uv` on every startup; C2E is optional and is not required by ServerWatcher itself. Choose the ServerWatcher source branch with `GIT_BRANCH`.
|
|
34
|
+
|
|
35
|
+
The YAML files in `src/serverwatcher/defaultconfigs/` are the canonical packaged defaults. MapRes copies each one into `/home/container/config/` on first startup; edit these runtime files, which are not committed as a second source of defaults. `config.yaml` contains server/API and logging settings; `evaluation.yaml`, `messages.yaml`, and `watcher.yaml` contain their corresponding settings. `SERVERWATCHER_CONFIG_DIR` can override this path for non-container installs.
|
|
34
36
|
|
|
35
37
|
## HungerNet Bot Webhook
|
|
36
38
|
Set `hungernetbot.enabled` to `True`, `hungernetbot.url` to the Bot's `/webhook` endpoint, and `hungernetbot.token` to the same secret configured as `BRIDGE_WEBHOOK_TOKEN` in HungerNet Bot. For example:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import time
|
|
2
2
|
import logging
|
|
3
3
|
|
|
4
|
+
from calagoapi.utils.exceptions import CalagoAPIError
|
|
4
5
|
from hungercore.webhook import WebhookClient
|
|
5
6
|
|
|
6
7
|
from .connection import setupServer
|
|
@@ -73,7 +74,12 @@ class ServerWatcher:
|
|
|
73
74
|
return 'schedule_restart', settings.watcher.high_gap_minutes
|
|
74
75
|
|
|
75
76
|
def run(self):
|
|
76
|
-
|
|
77
|
+
try:
|
|
78
|
+
self.startup()
|
|
79
|
+
except CalagoAPIError as error:
|
|
80
|
+
logger.error('ServerWatcher startup failed: %s', error)
|
|
81
|
+
logger.error('Update the required values in %s/config.yaml and restart.', settings.config_dir)
|
|
82
|
+
raise SystemExit(1) from None
|
|
77
83
|
|
|
78
84
|
try:
|
|
79
85
|
while True:
|
|
@@ -8,7 +8,32 @@ from .settings import settings
|
|
|
8
8
|
enable('minecraft')
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
def validateConfiguration():
|
|
12
|
+
required = {
|
|
13
|
+
'server.domain': settings.config.server_domain,
|
|
14
|
+
'calagoapi.url': settings.config.panel_url,
|
|
15
|
+
'calagoapi.api_key': settings.config.panel_api_key,
|
|
16
|
+
'calagoapi.server_id': settings.config.server_id,
|
|
17
|
+
'hungerbridge.url': settings.config.bridge_url,
|
|
18
|
+
'hungerbridge.token_id': settings.config.bridge_token_id,
|
|
19
|
+
'hungerbridge.token_secret': settings.config.bridge_token_secret,
|
|
20
|
+
}
|
|
21
|
+
unset = []
|
|
22
|
+
for key, value in required.items():
|
|
23
|
+
normalized = str(value).strip().lower() if value is not None else ''
|
|
24
|
+
if not normalized or normalized == 'change_me' or 'example.com' in normalized:
|
|
25
|
+
unset.append(key)
|
|
26
|
+
|
|
27
|
+
if unset:
|
|
28
|
+
keys = ', '.join(unset)
|
|
29
|
+
config_path = settings.config_dir / 'config.yaml'
|
|
30
|
+
raise CalagoAPIError(
|
|
31
|
+
f'Configuration is incomplete. Set {keys} in {config_path} before starting ServerWatcher.'
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
11
35
|
def setupServer():
|
|
36
|
+
validateConfiguration()
|
|
12
37
|
panel = Panel(
|
|
13
38
|
url=settings.config.panel_url,
|
|
14
39
|
api_key=settings.config.panel_api_key,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from mapres import loadConfig
|
|
5
|
+
|
|
6
|
+
from serverwatcher.configclasses.config import GlobalConfig
|
|
7
|
+
from serverwatcher.configclasses.evaluation import EvaluatorConfig
|
|
8
|
+
from serverwatcher.configclasses.logging import LoggingConfig
|
|
9
|
+
from serverwatcher.configclasses.messages import MessagesConfig
|
|
10
|
+
from serverwatcher.configclasses.watcher import WatcherConfig
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SettingsManager:
|
|
14
|
+
def __init__(self):
|
|
15
|
+
self.config_dir = Path(os.environ.get('SERVERWATCHER_CONFIG_DIR', '/home/container/config'))
|
|
16
|
+
self.config_dir.mkdir(parents=True, exist_ok=True)
|
|
17
|
+
self.config = loadConfig(GlobalConfig, runtime_path=str(self.config_dir / 'config.yaml'))
|
|
18
|
+
self.evaluation = loadConfig(EvaluatorConfig, runtime_path=str(self.config_dir / 'evaluation.yaml'))
|
|
19
|
+
self.logging = loadConfig(LoggingConfig, runtime_path=str(self.config_dir / 'config.yaml'))
|
|
20
|
+
self.messages = loadConfig(MessagesConfig, runtime_path=str(self.config_dir / 'messages.yaml'))
|
|
21
|
+
self.watcher = loadConfig(WatcherConfig, runtime_path=str(self.config_dir / 'watcher.yaml'))
|
|
22
|
+
|
|
23
|
+
settings = SettingsManager()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: serverwatcher
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.dev7
|
|
4
4
|
Summary: A HungerCore-powered Minecraft server automation engine.
|
|
5
5
|
Author: iFamished
|
|
6
6
|
License: GPL-3.0
|
|
@@ -55,13 +55,15 @@ A highly configurable Minecraft server monitoring and restart engine for HungerB
|
|
|
55
55
|
## Installation
|
|
56
56
|
- Import the [ServerWatcher Pterodactyl egg](https://github.com/HungerNet/ServerWatcher/blob/main/eggs/egg-serverwatcher.json) into your panel and create a server with Python 3.14.
|
|
57
57
|
- Run the installer. It checks out the configured Git branch and installs `uv`; Python dependencies are synced on startup.
|
|
58
|
-
- Start the server once to generate the runtime YAML files in
|
|
58
|
+
- Start the server once to generate the runtime YAML files in `/home/container/config/`. Set the required panel/server credentials in `/home/container/config/config.yaml`, then restart.
|
|
59
59
|
- Missing runtime files are copied from packaged defaults without overwriting existing files. The example panel and API credentials are placeholders, so valid credentials are required before the watcher can connect.
|
|
60
60
|
- Subsequent starts update the checkout when `AUTO_UPDATE` is enabled, sync the Python environment, and run ServerWatcher.
|
|
61
61
|
|
|
62
62
|
The egg defaults to the `main` branch and enables startup auto-updates. Set `AUTO_UPDATE` to `0` to keep the installed checkout fixed, or change `GIT_BRANCH` to use another branch.
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
`HUNGERLIB_DEV`, `MAPRES_DEV`, and `C2E_DEV` each upgrade their package to the latest prerelease with `uv` on every startup; C2E is optional and is not required by ServerWatcher itself. Choose the ServerWatcher source branch with `GIT_BRANCH`.
|
|
65
|
+
|
|
66
|
+
The YAML files in `src/serverwatcher/defaultconfigs/` are the canonical packaged defaults. MapRes copies each one into `/home/container/config/` on first startup; edit these runtime files, which are not committed as a second source of defaults. `config.yaml` contains server/API and logging settings; `evaluation.yaml`, `messages.yaml`, and `watcher.yaml` contain their corresponding settings. `SERVERWATCHER_CONFIG_DIR` can override this path for non-container installs.
|
|
65
67
|
|
|
66
68
|
## HungerNet Bot Webhook
|
|
67
69
|
Set `hungernetbot.enabled` to `True`, `hungernetbot.url` to the Bot's `/webhook` endpoint, and `hungernetbot.token` to the same secret configured as `BRIDGE_WEBHOOK_TOKEN` in HungerNet Bot. For example:
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from mapres import loadConfig
|
|
2
|
-
|
|
3
|
-
from serverwatcher.configclasses.config import GlobalConfig
|
|
4
|
-
from serverwatcher.configclasses.evaluation import EvaluatorConfig
|
|
5
|
-
from serverwatcher.configclasses.logging import LoggingConfig
|
|
6
|
-
from serverwatcher.configclasses.messages import MessagesConfig
|
|
7
|
-
from serverwatcher.configclasses.watcher import WatcherConfig
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class SettingsManager:
|
|
11
|
-
def __init__(self):
|
|
12
|
-
self.config = loadConfig(GlobalConfig)
|
|
13
|
-
self.evaluation = loadConfig(EvaluatorConfig)
|
|
14
|
-
self.logging = loadConfig(LoggingConfig)
|
|
15
|
-
self.messages = loadConfig(MessagesConfig)
|
|
16
|
-
self.watcher = loadConfig(WatcherConfig)
|
|
17
|
-
|
|
18
|
-
settings = SettingsManager()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/defaultconfigs/evaluation.yaml
RENAMED
|
File without changes
|
{serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher/defaultconfigs/messages.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{serverwatcher-1.dev5 → serverwatcher-1.dev7}/src/serverwatcher.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|