mirror of
https://github.com/g3rv4/GetMoarFediverse.git
synced 2024-11-22 07:33:20 +01:00
Add ability to take the fake relay api key from env variable
This commit is contained in:
parent
f757ce4818
commit
082d261116
@ -33,14 +33,15 @@ public class Config
|
||||
var data = JSON.Deserialize<ConfigData>(File.ReadAllText(path));
|
||||
|
||||
var importedPath = Path.Join(Path.GetDirectoryName(path), "imported.txt");
|
||||
var apiKey = data.FakeRelayApiKey ?? Environment.GetEnvironmentVariable("FAKERELAY_APIKEY");
|
||||
|
||||
Instance = new Config(importedPath, data.FakeRelayUrl, data.FakeRelayApiKey, data.Tags.ToImmutableArray(), data.ImmutableSites);
|
||||
Instance = new Config(importedPath, data.FakeRelayUrl, apiKey, data.Tags.ToImmutableArray(), data.ImmutableSites);
|
||||
}
|
||||
|
||||
private class ConfigData
|
||||
{
|
||||
public string FakeRelayUrl { get; set; }
|
||||
public string FakeRelayApiKey { get; set; }
|
||||
public string? FakeRelayApiKey { get; set; }
|
||||
public string[] Tags { get; set; }
|
||||
public InternalSiteData[]? Sites { get; set; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user