mirror of
https://github.com/azaion/admin.git
synced 2026-06-21 14:31:09 +00:00
refactor: remove deploy.cmd and update Dockerfile for health checks
- Deleted the deploy.cmd script as it was no longer needed. - Updated Dockerfile to include curl for health checks and added a non-root user for improved security. - Modified health check command to use curl for better reliability. - Adjusted docker-compose.test.yml to reflect changes in health check configuration. - Cleaned up appsettings.json and removed unused configuration properties. - Removed Resource entity and related requests from the codebase as part of the architectural shift. - Updated documentation to reflect the removal of hardware binding and related endpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentValidation" Version="11.10.0" />
|
||||
<PackageReference Include="linq2db" Version="5.4.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="Npgsql" Version="10.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -5,11 +5,4 @@ public class ResourcesConfig
|
||||
public string ResourcesFolder { get; set; } = null!;
|
||||
public string SuiteInstallerFolder { get; set; } = null!;
|
||||
public string SuiteStageInstallerFolder { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Master key used to AES-encrypt the per-resource <c>encryption_key</c> column at rest.
|
||||
/// Required by AZ-183 constraint "encryption_key must be stored securely (... or via
|
||||
/// application-level encryption)". Configure via <c>ResourcesConfig__EncryptionMasterKey</c>.
|
||||
/// </summary>
|
||||
public string EncryptionMasterKey { get; set; } = null!;
|
||||
}
|
||||
@@ -8,5 +8,4 @@ public class AzaionDb(DataOptions dataOptions) : DataConnection(dataOptions)
|
||||
{
|
||||
public ITable<User> Users => this.GetTable<User>();
|
||||
public ITable<DetectionClass> DetectionClasses => this.GetTable<DetectionClass>();
|
||||
public ITable<Resource> Resources => this.GetTable<Resource>();
|
||||
}
|
||||
@@ -42,12 +42,6 @@ public static class AzaionDbSchemaHolder
|
||||
.IsPrimaryKey()
|
||||
.IsIdentity();
|
||||
|
||||
builder.Entity<Resource>()
|
||||
.HasTableName("resources")
|
||||
.Property(x => x.Id)
|
||||
.IsPrimaryKey()
|
||||
.HasDataType(DataType.Guid);
|
||||
|
||||
builder.Build();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace Azaion.Common.Entities;
|
||||
|
||||
public class Resource
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string ResourceName { get; set; } = null!;
|
||||
public string DevStage { get; set; } = null!;
|
||||
public string Architecture { get; set; } = null!;
|
||||
public string Version { get; set; } = null!;
|
||||
public string CdnUrl { get; set; } = null!;
|
||||
public string Sha256 { get; set; } = null!;
|
||||
public string EncryptionKey { get; set; } = null!;
|
||||
public long SizeBytes { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Azaion.Common.Requests;
|
||||
|
||||
public class GetUpdateRequest
|
||||
{
|
||||
public string Architecture { get; set; } = null!;
|
||||
public string DevStage { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Map of <c>resource_name → currently-installed-version</c>. Resources missing
|
||||
/// from the map are treated as "device has no version of this resource yet" and
|
||||
/// will be returned in the response if any version exists server-side.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> CurrentVersions { get; set; } = new();
|
||||
}
|
||||
|
||||
public class GetUpdateValidator : AbstractValidator<GetUpdateRequest>
|
||||
{
|
||||
public GetUpdateValidator()
|
||||
{
|
||||
RuleFor(r => r.Architecture).NotEmpty().MaximumLength(40);
|
||||
RuleFor(r => r.DevStage).NotEmpty().MaximumLength(40);
|
||||
}
|
||||
}
|
||||
|
||||
public class ResourceUpdateItem
|
||||
{
|
||||
public string ResourceName { get; set; } = null!;
|
||||
public string Version { get; set; } = null!;
|
||||
public string CdnUrl { get; set; } = null!;
|
||||
public string Sha256 { get; set; } = null!;
|
||||
public string EncryptionKey { get; set; } = null!;
|
||||
public long SizeBytes { get; set; }
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Azaion.Common.Requests;
|
||||
|
||||
public class PublishResourceRequest
|
||||
{
|
||||
public string ResourceName { get; set; } = null!;
|
||||
public string DevStage { get; set; } = null!;
|
||||
public string Architecture { get; set; } = null!;
|
||||
public string Version { get; set; } = null!;
|
||||
public string CdnUrl { get; set; } = null!;
|
||||
public string Sha256 { get; set; } = null!;
|
||||
public string EncryptionKey { get; set; } = null!;
|
||||
public long SizeBytes { get; set; }
|
||||
}
|
||||
|
||||
public class PublishResourceValidator : AbstractValidator<PublishResourceRequest>
|
||||
{
|
||||
public PublishResourceValidator()
|
||||
{
|
||||
RuleFor(r => r.ResourceName).NotEmpty().MaximumLength(120);
|
||||
RuleFor(r => r.DevStage).NotEmpty().MaximumLength(40);
|
||||
RuleFor(r => r.Architecture).NotEmpty().MaximumLength(40);
|
||||
RuleFor(r => r.Version).NotEmpty().MaximumLength(40);
|
||||
RuleFor(r => r.CdnUrl).NotEmpty().MaximumLength(500);
|
||||
RuleFor(r => r.Sha256).NotEmpty().MaximumLength(128);
|
||||
RuleFor(r => r.EncryptionKey).NotEmpty();
|
||||
RuleFor(r => r.SizeBytes).GreaterThan(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user