Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass Watchdog token via environment variable #33

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading