Class DaemonControlPlane
- Namespace
- AppHealthMonitor
- Assembly
- AppHealthMonitor.dll
Connects this daemon to the database-backed control plane: reports what it supervises, and executes the commands an operator queued for this host.
public sealed class DaemonControlPlane
- Inheritance
-
DaemonControlPlane
- Inherited Members
Remarks
The security model, and the reason this class is shaped the way it is. A command row
carries a verb from a closed enumeration and the name of an application this daemon
already supervises. It carries no path, no arguments, no working directory and no shell.
The name is resolved against ConfiguredApplications — the
list loaded from this host's own appsettings.json — and a name that is not in that
list is refused and reported as a failure. Nothing from the database is ever passed to
Process, concatenated into a command line, or used to derive an executable.
What that buys: somebody who can write to the database can restart a FishMMO process. They cannot make a game host run something new. Any change here that lets a row describe what to run, rather than which already-known thing to act on, turns a database password into remote code execution.
Optional by construction. A deployment with no database credentials gets no control plane: TryCreate(DaemonOrchestrator, IConfiguration?) returns null, one line is logged, and the daemon supervises exactly as it always has. A database that disappears mid-run costs a log line and a backoff, never the supervisor.
Methods
RunAsync(CancellationToken)
Runs the heartbeat/command loop until the daemon shuts down.
public Task RunAsync(CancellationToken token)
Parameters
tokenCancellationTokenThe daemon-wide shutdown token.
Returns
- Task
A task that completes when the loop stops.
TryCreate(DaemonOrchestrator, IConfiguration?)
public static DaemonControlPlane? TryCreate(DaemonOrchestrator orchestrator, IConfiguration? configuration)
Parameters
orchestratorDaemonOrchestratorconfigurationIConfiguration
Returns
TryCreateBoardService(IConfiguration?)
Builds a control plane when this deployment has a database, and returns null when it does not.
public static IServerBoardService? TryCreateBoardService(IConfiguration? configuration)
Parameters
configurationIConfigurationThe daemon's configuration, or null.
Returns
- IServerBoardService
A control plane, or null when it is disabled or could not be constructed.
Remarks
Credentials are resolved the way every other FishMMO process resolves them — the
FISHMMO_DB_* environment variables, falling back to /etc/fishmmo/db-secrets.env
(%ProgramData%\FishMMO\db-secrets.env on Windows) — never from the daemon's own
configuration file. No credentials means no control plane, which is a supported deployment
and not an error. ControlPlane:Enabled=false turns it off even where credentials exist.