Initial commit of webservice host for the update server service.

This commit is contained in:
Tonoxis
2023-02-05 07:14:48 -05:00
commit fc25a71cb8
12 changed files with 954 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "tononixPC.UpdateServer"]
path = tononixPC.UpdateServer
url = https://tonoxisisle.services/git/TononixOS/tononixOS_webservice_update-service

View File

@@ -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<Startup>()
.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();
}
}
}

View File

@@ -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": ""
}
}
}

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp6.0</TargetFrameworks>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Peachpie.AspNetCore.Web" Version="1.2.0-r15261" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\tononixPC.UpdateServer\tononixPC.UpdateServer.msbuildproj">
<PrivateAssets>None</PrivateAssets>
</ProjectReference>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp6.0|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>tononixPC.UpdateServer.Server</ActiveDebugProfile>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<distribution>
<!-- Attributes provide the name, description, icon and the group that PINN will put the OS in. -->
<info name="tononixOS Home Edition" description="tononixOS Home Edition" icon="" group="General">
<homepage></homepage>
<release-date>TBA</release-date>
<version>1.0.0</version>
<!-- Supported models should be referred to by name, PINN uses these. -->
<supported-model>Raspberry Pi 3 Model B+</supported-model>
<supported-model>Raspberry Pi 3</supported-model>
<supported-model>Raspberry Pi 4</supported-model>
</info>
<supports-backup>false</supports-backup>
<nominal-size></nominal-size>
<download-size></download-size>
<!-- Attributes control whether the tarball signature check must pass and/or if the checksum check must pass -->
<security verifyTarballSignature="true" enforceChecksum="true">
<md5sum></md5sum>
<sha1sum></sha1sum>
<sha256sum></sha256sum>
<sha512sum></sha512sum>
</security>
<!-- Settings for the OS -->
<settings>
<!-- Default user account -->
<defaults>
<username>user</username>
<password>user</password>
</defaults>
<!-- Boot options -->
<boot>
<supports-usb-boot>false</supports-usb-boot>
<supports-sda-boot>false</supports-sda-boot>
<supports-sda-root>false</supports-sda-root>
</boot>
<!-- Partition table layout -->
<partitions>
<partition label="boot" type="FAT">
<mkfs-options>-F 32</mkfs-options>
<uncompressed-tarball-size></uncompressed-tarball-size>
<partition-size></partition-size>
<want-maximised>false</want-maximised>
<tarball></tarball>
</partition>
<partition label="root" type="ext4">
<mkfs-options>-c</mkfs-options>
<want-maximised>true</want-maximised>
<uncompressed-tarball-size></uncompressed-tarball-size>
<partition-size></partition-size>
<tarball></tarball>
</partition>
<partition label="appfs" type="ext4" version="1.0">
<mkfs-options>-c</mkfs-options>
<want-maximised>true</want-maximised>
<uncompressed-tarball-size></uncompressed-tarball-size>
<partition-size></partition-size>
<tarball></tarball>
</partition>
</partitions>
</settings>
</distribution>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<recovery-update>
<version>1.0.2.2</version>
<build-date>2023-01-17</build-date>
<git>
<pinn>
<branch>master</branch>
<commit>206afc83287084783bead347f3e55a91de6d0fe7</commit>
</pinn>
<rpi-userland>
<branch>master</branch>
<commit>54fd97ae4066a10b6b02089bc769ceed328737e0</commit>
</rpi-userland>
<rpi-firmware>
<branch>master</branch>
<commit>78852e166b4cf3ebb31d051e996d54792f0994b0</commit>
</rpi-firmware>
<rpi-linux>
<branch>rpi-5.4.y</branch>
<commit>ec0dcf3064b8ba99f226438214407fcea9870f76</commit>
</rpi-linux>
</git>
</recovery-update>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<os-list>
<repository>
<distribution name="tononixOS Home Edition" description="Operating System for the tononixPC" group="General">
<version>1.0.0</version>
<download-size/>
<icon/>
<nominal-size/>
<release-date>2023-01-17</release-date>
<supported-model>Raspberry Pi 3 Model B+</supported-model>
<supported-model>Raspberry Pi 4</supported-model>
<supports-backup>false</supports-backup>
<url>
<os-info>https://tonoxisisle.services/tononixOS/os/os.json</os-info>
<marketing-info>http://tonoxisisle.services/tononixOS/os/marketing-info.tar.gz</marketing-info>
<partition-setup>https://tonoxisisle.services/tononixOS/os/partition_setup.sh</partition-setup>
<partition-info>https://tonoxisisle.services/tononixOS/os/partitions.json</partition-info>
<tarball>https://tonoxisisle.services/tononixOS/os/boot.tar.gz</tarball>
<tarball>https://tonoxisisle.services/tononixOS/os/root.tar.gz</tarball>
<tarball>https://tonoxisisle.services/tononixOS/os/editions/home/appfs.tar.gz</tarball>
</url>
</distribution>
</repository>
</os-list>

File diff suppressed because one or more lines are too long

31
tononixPC.UpdateServer.sln Executable file
View File

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