From fc25a71cb8e3d5cbf6fe5e720086921e8005b799 Mon Sep 17 00:00:00 2001 From: Tonoxis Date: Sun, 5 Feb 2023 07:14:48 -0500 Subject: [PATCH] Initial commit of webservice host for the update server service. --- .gitmodules | 3 + tononixPC.UpdateServer | 1 + tononixPC.UpdateServer.Server/Program.cs | 59 +++ .../Properties/launchSettings.json | 22 + .../tononixPC.UpdateServer.Server.csproj | 23 + .../tononixPC.UpdateServer.Server.csproj.user | 9 + ...72c7631303d66aca14ef0ac1c0e5a90b84a72c.php | 395 ++++++++++++++++++ .../wwwroot/manifests/os/tononixOS.xml | 61 +++ .../wwwroot/manifests/recovery.xml | 23 + .../wwwroot/repository.xml | 26 ++ .../wwwroot/templates/serverstatus.tpl | 301 +++++++++++++ tononixPC.UpdateServer.sln | 31 ++ 12 files changed, 954 insertions(+) create mode 100644 .gitmodules create mode 160000 tononixPC.UpdateServer create mode 100755 tononixPC.UpdateServer.Server/Program.cs create mode 100755 tononixPC.UpdateServer.Server/Properties/launchSettings.json create mode 100755 tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj create mode 100755 tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj.user create mode 100755 tononixPC.UpdateServer.Server/wwwroot/.templates_c/bd/bdf88505b832970ebff96f1ada72c7631303d66aca14ef0ac1c0e5a90b84a72c.php create mode 100755 tononixPC.UpdateServer.Server/wwwroot/manifests/os/tononixOS.xml create mode 100755 tononixPC.UpdateServer.Server/wwwroot/manifests/recovery.xml create mode 100755 tononixPC.UpdateServer.Server/wwwroot/repository.xml create mode 100755 tononixPC.UpdateServer.Server/wwwroot/templates/serverstatus.tpl create mode 100755 tononixPC.UpdateServer.sln diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..29b86d9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tononixPC.UpdateServer"] + path = tononixPC.UpdateServer + url = https://tonoxisisle.services/git/TononixOS/tononixOS_webservice_update-service diff --git a/tononixPC.UpdateServer b/tononixPC.UpdateServer new file mode 160000 index 0000000..266f991 --- /dev/null +++ b/tononixPC.UpdateServer @@ -0,0 +1 @@ +Subproject commit 266f9910b770ad696426d74ba85732b85fa30960 diff --git a/tononixPC.UpdateServer.Server/Program.cs b/tononixPC.UpdateServer.Server/Program.cs new file mode 100755 index 0000000..c8e5a74 --- /dev/null +++ b/tononixPC.UpdateServer.Server/Program.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Rewrite; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using System; + +namespace tononixPC.UpdateServer.Server +{ + internal class Program + { + static void Main(string[] args) + { + var host = WebHost.CreateDefaultBuilder(args) + .UseStartup() + .Build(); + + host.Run(); + } + } + + internal class Startup + { + public void ConfigureServices(IServiceCollection services) + { + // Adds a default in-memory implementation of IDistributedCache. + services.AddDistributedMemoryCache(); + + services.AddSession(options => + { + options.IdleTimeout = TimeSpan.FromMinutes(30); + options.Cookie.HttpOnly = true; + }); + + services.AddPhp(options => + { + + }); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseSession(); + // Make the server rewrite to update.php + var options = new RewriteOptions() + .AddRewrite(@"^(.*)$", "update.php/$1", skipRemainingRules: true); + app.UseRewriter(options); + app.UsePhp(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + } + } +} diff --git a/tononixPC.UpdateServer.Server/Properties/launchSettings.json b/tononixPC.UpdateServer.Server/Properties/launchSettings.json new file mode 100755 index 0000000..0f51f92 --- /dev/null +++ b/tononixPC.UpdateServer.Server/Properties/launchSettings.json @@ -0,0 +1,22 @@ +{ + "profiles": { + "tononixPC.UpdateServer.Server": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:60225" + }, + "WSL": { + "commandName": "WSL2", + "launchBrowser": true, + "launchUrl": "http://localhost:60225", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "http://localhost:60225" + }, + "distributionName": "" + } + } +} \ No newline at end of file diff --git a/tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj b/tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj new file mode 100755 index 0000000..b384f46 --- /dev/null +++ b/tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj @@ -0,0 +1,23 @@ + + + + Exe + netcoreapp6.0 + win-x64;linux-x64 + + + + + + + + + + + + + None + + + + diff --git a/tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj.user b/tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj.user new file mode 100755 index 0000000..666a857 --- /dev/null +++ b/tononixPC.UpdateServer.Server/tononixPC.UpdateServer.Server.csproj.user @@ -0,0 +1,9 @@ + + + + ProjectDebugger + + + tononixPC.UpdateServer.Server + + \ No newline at end of file diff --git a/tononixPC.UpdateServer.Server/wwwroot/.templates_c/bd/bdf88505b832970ebff96f1ada72c7631303d66aca14ef0ac1c0e5a90b84a72c.php b/tononixPC.UpdateServer.Server/wwwroot/.templates_c/bd/bdf88505b832970ebff96f1ada72c7631303d66aca14ef0ac1c0e5a90b84a72c.php new file mode 100755 index 0000000..2623297 --- /dev/null +++ b/tononixPC.UpdateServer.Server/wwwroot/.templates_c/bd/bdf88505b832970ebff96f1ada72c7631303d66aca14ef0ac1c0e5a90b84a72c.php @@ -0,0 +1,395 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + + + tononixOS Update Service: Status Dashboard + + +"; + // line 254 + echo " + +"; + echo " + + + +
+

+ tononixOS Update Service + Server +

+
+

Version "; + // line 266 + echo twig_escape_filter($this->env, ($context["version"] ?? null), "html", null, true); + echo "

+ Application Runtime: "; + // line 267 + echo twig_escape_filter($this->env, ($context["runtime"] ?? null), "html", null, true); + echo "
+ +

Current Version Information

+ +

Server Features

+ + + +"; + } + + public function getTemplateName() + { + return "serverstatus.tpl"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 368 => 298, 363 => 296, 355 => 290, 340 => 281, 332 => 279, 328 => 278, 320 => 273, 311 => 267, 307 => 266, 252 => 254, 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "serverstatus.tpl", "D:\\Shado\\Projects\\tononixOS\\Server\\Update\\Update-Services-Peachpie\\Tononix Update Server\\Tononix_Update_Server.Server\\wwwroot\\templates\\serverstatus.tpl"); + } +} diff --git a/tononixPC.UpdateServer.Server/wwwroot/manifests/os/tononixOS.xml b/tononixPC.UpdateServer.Server/wwwroot/manifests/os/tononixOS.xml new file mode 100755 index 0000000..0c6d10c --- /dev/null +++ b/tononixPC.UpdateServer.Server/wwwroot/manifests/os/tononixOS.xml @@ -0,0 +1,61 @@ + + + + + + TBA + 1.0.0 + + Raspberry Pi 3 Model B+ + Raspberry Pi 3 + Raspberry Pi 4 + + false + + + + + + + + + + + + + + user + user + + + + false + false + false + + + + + -F 32 + + + false + + + + -c + true + + + + + + -c + true + + + + + + + \ No newline at end of file diff --git a/tononixPC.UpdateServer.Server/wwwroot/manifests/recovery.xml b/tononixPC.UpdateServer.Server/wwwroot/manifests/recovery.xml new file mode 100755 index 0000000..f0756d4 --- /dev/null +++ b/tononixPC.UpdateServer.Server/wwwroot/manifests/recovery.xml @@ -0,0 +1,23 @@ + + + 1.0.2.2 + 2023-01-17 + + + master + 206afc83287084783bead347f3e55a91de6d0fe7 + + + master + 54fd97ae4066a10b6b02089bc769ceed328737e0 + + + master + 78852e166b4cf3ebb31d051e996d54792f0994b0 + + + rpi-5.4.y + ec0dcf3064b8ba99f226438214407fcea9870f76 + + + \ No newline at end of file diff --git a/tononixPC.UpdateServer.Server/wwwroot/repository.xml b/tononixPC.UpdateServer.Server/wwwroot/repository.xml new file mode 100755 index 0000000..24d5b0d --- /dev/null +++ b/tononixPC.UpdateServer.Server/wwwroot/repository.xml @@ -0,0 +1,26 @@ + + + + + 1.0.0 + + + + 2023-01-17 + + Raspberry Pi 3 Model B+ + Raspberry Pi 4 + + false + + https://tonoxisisle.services/tononixOS/os/os.json + http://tonoxisisle.services/tononixOS/os/marketing-info.tar.gz + https://tonoxisisle.services/tononixOS/os/partition_setup.sh + https://tonoxisisle.services/tononixOS/os/partitions.json + https://tonoxisisle.services/tononixOS/os/boot.tar.gz + https://tonoxisisle.services/tononixOS/os/root.tar.gz + https://tonoxisisle.services/tononixOS/os/editions/home/appfs.tar.gz + + + + \ No newline at end of file diff --git a/tononixPC.UpdateServer.Server/wwwroot/templates/serverstatus.tpl b/tononixPC.UpdateServer.Server/wwwroot/templates/serverstatus.tpl new file mode 100755 index 0000000..e7731e0 --- /dev/null +++ b/tononixPC.UpdateServer.Server/wwwroot/templates/serverstatus.tpl @@ -0,0 +1,301 @@ + + + + + + tononixOS Update Service: Status Dashboard + + +{% verbatim %} + +{% endverbatim %} + + + +
+

+ tononixOS Update Service + Server +

+
+

Version {{version}}

+ Application Runtime: {{runtime}}
+ +

Current Version Information

+ +

Server Features

+ + + diff --git a/tononixPC.UpdateServer.sln b/tononixPC.UpdateServer.sln new file mode 100755 index 0000000..7cd4c44 --- /dev/null +++ b/tononixPC.UpdateServer.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tononixPC.UpdateServer.Server", "tononixPC.UpdateServer.Server\tononixPC.UpdateServer.Server.csproj", "{E9E0AD13-4D90-4668-8E6C-0B44E98123CF}" +EndProject +Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "tononixPC.UpdateServer", "tononixPC.UpdateServer\tononixPC.UpdateServer.msbuildproj", "{D69D6A6B-2C58-4709-B65D-61B9C2835DDA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E9E0AD13-4D90-4668-8E6C-0B44E98123CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9E0AD13-4D90-4668-8E6C-0B44E98123CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9E0AD13-4D90-4668-8E6C-0B44E98123CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9E0AD13-4D90-4668-8E6C-0B44E98123CF}.Release|Any CPU.Build.0 = Release|Any CPU + {D69D6A6B-2C58-4709-B65D-61B9C2835DDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D69D6A6B-2C58-4709-B65D-61B9C2835DDA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D69D6A6B-2C58-4709-B65D-61B9C2835DDA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D69D6A6B-2C58-4709-B65D-61B9C2835DDA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1F30C333-7049-4401-B99B-67C4BAE03859} + EndGlobalSection +EndGlobal