diff --git a/LicenseServer/Config.cs b/LicenseServer/Config.cs index 25cf0f9..6c4a90d 100644 --- a/LicenseServer/Config.cs +++ b/LicenseServer/Config.cs @@ -48,6 +48,8 @@ public class LicenseServerConfiguration public string PathToCacheFolder { get; set; } [Key(9)] public string WebAPILogAccessToken { get; set; } + [Key(10)] + public string PathToConfigFile { get; set; } } diff --git a/LicenseServer/Program.cs b/LicenseServer/Program.cs index 97fcfba..b2c1665 100644 --- a/LicenseServer/Program.cs +++ b/LicenseServer/Program.cs @@ -29,7 +29,7 @@ namespace LicenseServer { class Program { - public const string versionInfo = "v2.11 (2023-03-02)" ; + public const string versionInfo = "v2.11 (2023-03-09)" ; public const string ServiceName = "license-server"; @@ -134,6 +134,22 @@ public static void Initialization(string[] args, bool runAsService = false) } ConfigurationExpires = config.ValidUntil; + + if (!string.IsNullOrWhiteSpace(config.PathToConfigFile)) + { + try + { + var configData = Newtonsoft.Json.JsonConvert.DeserializeObject(System.IO.File.ReadAllText(config.PathToConfigFile)); + + port = configData.Port; + WriteMessage($"Port changed to {port}"); + + } + catch (Exception ex) + { + WriteMessage($"Config file {config.PathToConfigFile} could not be read. Detailed error message {ex.Message}"); + } + } } else {