Skip to content

Commit

Permalink
Pass token via environment variable. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
TsjipTsjip authored Nov 8, 2024
1 parent 81df198 commit 5bb0671
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,10 @@ private async Task StartServer(CancellationToken cancel)
var args = new List<string>
{
// Watchdog comms config.
"--cvar", $"watchdog.token={Secret}",
"--cvar", $"watchdog.key={Key}",
"--cvar", $"watchdog.baseUrl={_baseServerAddress}",
// watchdog.token provided through ENV vars, as this does not show up in process listings
// like `ps -aux` or `htop`.

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

var env = new List<(string, string)>();
var env = new List<(string, string)>
{
// __ is replaced by a . when parsing CVars from an environment variable.
("ROBUST_CVAR_watchdog__token", $"{Secret}")
};

foreach (var (envVar, value) in _instanceConfig.EnvironmentVariables)
{
Expand Down

0 comments on commit 5bb0671

Please sign in to comment.