Updates to point to certificate inside botdata folder

This commit is contained in:
Zontreck 2020-09-09 10:50:00 -07:00
parent 828813ae2d
commit 2f0d6848b5
4 changed files with 23 additions and 10 deletions

View file

@ -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

View file

@ -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; } = "";

View file

@ -12,16 +12,27 @@ namespace Bot.WebHookServer
[WebhookAttribs("/NewVersionAvailable", HTTPMethod = "POST")]
public WebhookRegistry.HTTPResponseData a_new_version_is_available(List<string> 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;
}
}
}
}

View file

@ -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");