diff --git a/Oxide.Ext.GamingApi/GamingApiNats.cs b/Oxide.Ext.GamingApi/GamingApiNats.cs index 2131f97..cb96bbc 100644 --- a/Oxide.Ext.GamingApi/GamingApiNats.cs +++ b/Oxide.Ext.GamingApi/GamingApiNats.cs @@ -8,6 +8,8 @@ using System.Threading; using Asyncapi.Nats.Client; using NATS.Client.JetStream; +using System.Configuration; +using System.IO; namespace Oxide.Ext.GamingApi { @@ -162,6 +164,16 @@ private string GetNatsNkeyUser() private string GetNatsNkeySeed() { var envName = $"GAMINGAPI_NATS_NKEY_SEED"; + var envFileName = envName + "_FILE"; + + + var fileName = Environment.GetEnvironmentVariable(envFileName); + if (fileName != null) + { + string contents = File.ReadAllText(@fileName); + return contents; + } + var value = Environment.GetEnvironmentVariable(envName); if (value == null) { @@ -174,7 +186,18 @@ private string GetNatsNkeySeed() private string GetNatsJwtUser() { + var envName = $"GAMINGAPI_NATS_JWT_USER"; + var envFileName = envName + "_FILE"; + + + var fileName = Environment.GetEnvironmentVariable(envFileName); + if (fileName != null) + { + string contents = File.ReadAllText(@fileName); + return contents; + } + var value = Environment.GetEnvironmentVariable(envName); if (value == null) {