diff --git a/Assembly/ASMInfo.cs b/Assembly/ASMInfo.cs index 4c6007a..650b207 100644 --- a/Assembly/ASMInfo.cs +++ b/Assembly/ASMInfo.cs @@ -7,7 +7,7 @@ using LibZNI; [assembly: AssemblyCompany("ZNI")] [assembly: AssemblyAlgorithmId(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)] [assembly: AssemblyCopyright("(C) 2020 Tara Piccari")] -[assembly: AssemblyFileVersion("5.0.5.1252")] +[assembly: AssemblyFileVersion("5.0.5.1253")] [assembly: AssemblyDescription("Second Life Bot - BotCore5")] [assembly: AutoUpdater("/job/ZBotCore/job/BotCore5", "module.tar")] @@ -16,7 +16,7 @@ namespace Bot.Assemble public class ASMInfo { public static string BotName = "ZBotCore"; - public static string BotVer = "5.0.5.1252"; + public static string BotVer = "5.0.5.1253"; public static string GitPassword { get diff --git a/ConfigSystem/MainConfiguration.cs b/ConfigSystem/MainConfiguration.cs index 5e5743f..8dc3af7 100644 --- a/ConfigSystem/MainConfiguration.cs +++ b/ConfigSystem/MainConfiguration.cs @@ -50,6 +50,8 @@ namespace Bot public string last { get; set; } = ""; public string password { get; set; } = ""; + public string SecretNewVerCode { get; set; } = "configure_me"; + //public License LicenseKey { get; set; } public string ActivationCode { get; set; } = ""; diff --git a/WebHookServer/NewVersionWatcher.cs b/WebHookServer/NewVersionWatcher.cs index e589392..6f6b5f0 100644 --- a/WebHookServer/NewVersionWatcher.cs +++ b/WebHookServer/NewVersionWatcher.cs @@ -12,16 +12,27 @@ namespace Bot.WebHookServer [WebhookAttribs("/NewVersionAvailable", HTTPMethod = "POST")] public WebhookRegistry.HTTPResponseData a_new_version_is_available(List args, string body, string method, NameValueCollection headers) { - WebhookRegistry.HTTPResponseData hrd = new WebhookRegistry.HTTPResponseData(); - hrd.ReplyString = "OK"; - hrd.ReturnContentType = "text/plain"; - hrd.Status = 200; + if(MainConfiguration.Instance.SecretNewVerCode == body) + { - BaseCommands.MH(Destinations.DEST_LOCAL, UUID.Zero, "Alert: A new version is available. Restart required"); + WebhookRegistry.HTTPResponseData hrd = new WebhookRegistry.HTTPResponseData(); + hrd.ReplyString = "OK"; + hrd.ReturnContentType = "text/plain"; + hrd.Status = 200; - BotSession.Instance.EnqueueExit = true; + BaseCommands.MH(Destinations.DEST_LOCAL, UUID.Zero, "Alert: A new version is available. Restart required"); - return hrd; + BotSession.Instance.EnqueueExit = true; + + return hrd; + } else + { + WebhookRegistry.HTTPResponseData hrd = new WebhookRegistry.HTTPResponseData(); + hrd.ReplyString = "Not authorized"; + hrd.ReturnContentType = "text/plain"; + hrd.Status = 500; + return hrd; + } } } } diff --git a/WebHookServer/WebHookServer.cs b/WebHookServer/WebHookServer.cs index 979ec51..2a53a0d 100644 --- a/WebHookServer/WebHookServer.cs +++ b/WebHookServer/WebHookServer.cs @@ -63,7 +63,7 @@ namespace Bot.WebHookServer if (MainConfiguration.Instance.UseSSL) { - X509Certificate cert = new X509Certificate2(MainConfiguration.Instance.SSLCertificatePFX, MainConfiguration.Instance.SSLCertificatePWD); + X509Certificate cert = new X509Certificate2("BotData/"+MainConfiguration.Instance.SSLCertificatePFX, MainConfiguration.Instance.SSLCertificatePWD); Type hepmType = Type.GetType("System.Net.HttpEndPointManager, System.Net.HttpListener"); Type heplType = Type.GetType("System.Net.HttpEndPointListener, System.Net.HttpListener");