Skip to content

Commit 5bb0671

Browse files
authored
Pass token via environment variable. (#33)
1 parent 81df198 commit 5bb0671

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

SS14.Watchdog/Components/ServerManagement/ServerInstance.Actor.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,10 @@ private async Task StartServer(CancellationToken cancel)
329329
var args = new List<string>
330330
{
331331
// Watchdog comms config.
332-
"--cvar", $"watchdog.token={Secret}",
333332
"--cvar", $"watchdog.key={Key}",
334333
"--cvar", $"watchdog.baseUrl={_baseServerAddress}",
334+
// watchdog.token provided through ENV vars, as this does not show up in process listings
335+
// like `ps -aux` or `htop`.
335336

336337
"--config-file", Path.Combine(InstanceDir, "config.toml"),
337338
"--data-dir", Path.Combine(InstanceDir, "data"),
@@ -343,7 +344,11 @@ private async Task StartServer(CancellationToken cancel)
343344
args.Add(arg);
344345
}
345346

346-
var env = new List<(string, string)>();
347+
var env = new List<(string, string)>
348+
{
349+
// __ is replaced by a . when parsing CVars from an environment variable.
350+
("ROBUST_CVAR_watchdog__token", $"{Secret}")
351+
};
347352

348353
foreach (var (envVar, value) in _instanceConfig.EnvironmentVariables)
349354
{

0 commit comments

Comments
 (0)