Update: Disco Online Services Update Checking
Migrates Disco Update checking to new services at https://services.discoict.com.au.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace Disco.Data.Configuration
|
||||
{
|
||||
public static class CommunityHelpers
|
||||
{
|
||||
public static string CommunityUrl()
|
||||
{
|
||||
// Special case for DiscoCommunity Hosting Network
|
||||
try
|
||||
{
|
||||
var ip = (from addr in Dns.GetHostEntry(Dns.GetHostName()).AddressList
|
||||
where addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork
|
||||
&& addr.ToString().StartsWith("10.131.200.")
|
||||
select addr).FirstOrDefault();
|
||||
if (ip != null)
|
||||
{
|
||||
return "http://hades3:9393/base/";
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{ } // Ignore Errors
|
||||
|
||||
return "https://discoict.com.au/base/";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.BI.Interop.Community;
|
||||
using Disco.Models.Services.Interop.DiscoServices;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
@@ -269,11 +269,18 @@ namespace Disco.Data.Configuration
|
||||
return this.Get<string>(null);
|
||||
}
|
||||
}
|
||||
public UpdateResponse UpdateLastCheck
|
||||
public string DeploymentSecret
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Get<UpdateResponse>(null);
|
||||
return this.Get<string>(null);
|
||||
}
|
||||
}
|
||||
public UpdateResponseV2 UpdateLastCheckResponse
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Get<UpdateResponseV2>(null);
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Configuration\CommunityHelpers.cs" />
|
||||
<Compile Include="Configuration\ConfigurationBase.cs" />
|
||||
<Compile Include="Configuration\ConfigurationCache.cs" />
|
||||
<Compile Include="Configuration\Modules\ActiveDirectoryConfiguration.cs" />
|
||||
@@ -220,7 +219,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2014/6/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2014/6/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace Disco.Data.Migrations
|
||||
public override void Up()
|
||||
{
|
||||
AddColumn("dbo.DeviceModels", "DefaultRepairProvider", c => c.String(maxLength: 40));
|
||||
|
||||
// Clear UpdateLastCheck due to Update Protocol v2
|
||||
Sql("DELETE [Configuration] WHERE [Scope]='System' AND [Key]='UpdateLastCheck'");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
|
||||
@@ -34,6 +34,11 @@ namespace Disco.Data.Repository
|
||||
var deploymentId = Guid.NewGuid().ToString("D");
|
||||
Database.ConfigurationItems.Add(new ConfigurationItem { Scope = "System", Key = "DeploymentId", Value = deploymentId });
|
||||
}
|
||||
if (Database.ConfigurationItems.Count(ci => ci.Scope == "System" && ci.Key == "DeploymentSecret") == 0)
|
||||
{
|
||||
var deploymentId = Guid.NewGuid().ToString("N");
|
||||
Database.ConfigurationItems.Add(new ConfigurationItem { Scope = "System", Key = "DeploymentSecret", Value = deploymentId });
|
||||
}
|
||||
}
|
||||
public static void SeedJobTypes(this DiscoDataContext Database)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user