1.0.0.20082501

添加更新程序
添加checksum计算程序


Former-commit-id: 0ee9c27994b303dfe94cc83c03727db7ad7b4a70
Former-commit-id: 516cc339fe395271ba4ea4b8edb73f372da89e08
TSXN
wanggang 5 years ago
parent 28c9a3815d
commit 6fb2dc5a6e

@ -0,0 +1,18 @@
*.bak
*.suo
*.db
*.db-shm
*.db-wal
*.user
.vs
obj
Obj
bin
Bin
debug
Debug
release
Release
Logs
logs
node_modules

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>

@ -0,0 +1,35 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace CheckSum
{
internal class Program
{
private static void Main(string[] args)
{
Console.InputEncoding = Encoding.UTF8;
Console.OutputEncoding = Encoding.UTF8;
using var sha = SHA512.Create();
while (true)
{
Console.WriteLine("input file name:");
var file = Console.ReadLine();
if (File.Exists(file))
{
Console.WriteLine(BitConverter.ToString(sha.ComputeHash(File.ReadAllBytes(file))).Replace("-", "").ToLower());
}
else
{
Console.WriteLine($"file {file} does not Exist");
}
var key = Console.ReadKey().Key;
if (key == ConsoleKey.Enter || key == ConsoleKey.Escape)
{
break;
}
}
}
}
}

@ -8,7 +8,6 @@ using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Linq;
namespace Infrastructure.Data
@ -18,6 +17,7 @@ namespace Infrastructure.Data
public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder =>
{
builder.AddDebug();
builder.AddConsole();
});
private readonly ILogger<EfDbContext> _logger;

@ -368,17 +368,14 @@ namespace Infrastructure.Web
var context = services.GetService<DbContext>();
if (context.Database.EnsureCreated())
{
if (!Env.IsDevelopment())
var sql = context.GetService<IRelationalDatabaseCreator>().GenerateCreateScript();
var file = "db.sql";
if (File.Exists(file))
{
var sql = context.GetService<IRelationalDatabaseCreator>().GenerateCreateScript();
var file = "db.sql";
if (File.Exists(file))
{
File.Delete(file);
}
using var fs = File.CreateText(file);
fs.Write(sql);
File.Delete(file);
}
using var fs = File.CreateText(file);
fs.Write(sql);
using var scope = services.CreateScope();
scope.ServiceProvider.GetService<IDbConfig>().Seed(context);
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<app>
<version>1.0.0.20082401</version>
<checksum></checksum>
</app>

@ -1,6 +1,5 @@
using CookComputing.XmlRpc;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Net;
using System.Net.Http;
using System.Reflection;
@ -16,13 +15,30 @@ namespace IoTDameon.Controllers
_httpClientFactory = httpClientFactory;
}
//public IActionResult Index()
//{
// var proxy = XmlRpcProxyGen.Create<ISupervisor>();
// proxy.Credentials = new NetworkCredential("usr", "pwd");
// var result = ""proxy.SystemListMethods();
// return Content(result);
//}
public IActionResult Index()
{
this.Process();
return Content("");
}
private void Process(bool stop = false)
{
try
{
var proxy = XmlRpcProxyGen.Create<ISupervisorService>();
proxy.Url = "http://192.168.1.3:9001/RPC2";
proxy.Credentials = new NetworkCredential("usr", "pwd");
var result = stop ? proxy.stopProcess("iotnode") : proxy.startProcess("iotnode");
}
catch (XmlRpcFaultException ex)
{
//start:60 stop:70
if (ex.FaultCode != 60 && ex.FaultCode != 70)
{
throw ex;
}
}
}
public IActionResult GetVersion()
{

@ -0,0 +1,19 @@
using CookComputing.XmlRpc;
namespace IoTDameon.Controllers
{
public interface ISupervisorService : IXmlRpcProxy
{
[XmlRpcMethod("supervisor.getAllProcessInfo")]
XmlRpcStruct getAllProcessInfo();
[XmlRpcMethod("supervisor.getProcessInfo")]//result["statename"]: "RUNNING" or "STOPPED"
XmlRpcStruct getProcessInfo(string name);
[XmlRpcMethod("supervisor.startProcess")]
bool startProcess(string name);
[XmlRpcMethod("supervisor.stopProcess")]
bool stopProcess(string name);
}
}

@ -1,11 +0,0 @@
using CookComputing.XmlRpc;
namespace IoTDameon
{
[XmlRpcUrl("http://192.168.1.3:9001/RPC2")]
public interface ISupervisor
{
[XmlRpcMethod("system.listMethods")]
string SystemListMethods();
}
}

@ -9,9 +9,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Kveer.XmlRPC" Version="1.1.1" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Kveer.XmlRPC" Version="1.1.1" />
</ItemGroup>
</Project>

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0824d3")]
[assembly: AssemblyInformationalVersion("1.0.0.20082501")]

@ -42,7 +42,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSPA", "WebSPA\WebSPA.csp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JobServer", "JobServer\JobServer.csproj", "{6E2766D8-9ECF-469E-8662-A20F673E52CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTDameon", "IoTDameon\IoTDameon.csproj", "{60596088-3C4E-4EA2-933A-B66CD269845B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTDameon", "IoTDameon\IoTDameon.csproj", "{60596088-3C4E-4EA2-933A-B66CD269845B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckSum", "CheckSum\CheckSum.csproj", "{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -174,6 +176,18 @@ Global
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhone.Build.0 = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{60596088-3C4E-4EA2-933A-B66CD269845B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Debug|iPhone.Build.0 = Debug|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Release|Any CPU.Build.0 = Release|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Release|iPhone.ActiveCfg = Release|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Release|iPhone.Build.0 = Release|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{EE34BB0E-41F3-4F2A-853E-FBFBCF421A5B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -191,7 +205,7 @@ Global
{60596088-3C4E-4EA2-933A-B66CD269845B} = {AE34E06D-C5C7-44BC-B168-85808318516C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
BuildVersion_StartDate = 2000/1/1
SolutionGuid = {0B7095FB-5E70-4EF8-805A-CB4A91AE4B0A}
BuildVersion_StartDate = 2000/1/1
EndGlobalSection
EndGlobal

@ -17,4 +17,7 @@ Copy-Item ../projects/WebSPA/wwwroot/* ./dist/linux-x64/publish/apps/WebSPA/www
dotnet publish ../projects/UserCenter/UserCenter.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/UserCenter
dotnet publish ../projects/JobServer/JobServer.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/JobServer
dotnet publish ../projects/IoTCenter/IoTCenter.csproj -c Release -r linux-x64 -o ../publish/dist/linux-x64/publish/apps/IoTCenter
dotnet publish ../projects/IoTNode/IoTNode.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/IoTNode
dotnet publish ../projects/IoTNode/IoTNode.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/IoTNode
dotnet publish ../projects/IoTDameon/IoTDameon.csproj -c Release -r linux-arm64 -o ../publish/dist/linux-arm64/publish/apps/IoTDameon

@ -0,0 +1,6 @@
[program:iotdameon]
directory=/root/publish/apps/IoTDameon/
command=/root/publish/apps/IoTDameon/IoTDameon
autostart=true
autorestart=true
user=root
Loading…
Cancel
Save