Add WAL file for database and log instance deployment failures
Some checks failed
Build and Publish Docker Image / build-and-push (push) Has been cancelled

This commit is contained in:
Matt Batchelder
2026-02-19 08:27:54 -05:00
parent 4a903bfd2a
commit adf1a2e4db
41 changed files with 2789 additions and 1297 deletions

View File

@@ -22,24 +22,19 @@ public class CreateInstanceDto
[MaxLength(500)]
public string? NewtSecret { get; set; }
// ── CIFS / SMB credentials (optional — falls back to global settings) ──
// ── NFS volume settings (optional — falls back to global settings) ──
[MaxLength(200)]
public string? CifsServer { get; set; }
public string? NfsServer { get; set; }
/// <summary>NFS export path on the server (e.g. "/srv/nfs").</summary>
[MaxLength(500)]
public string? NfsExport { get; set; }
/// <summary>Optional subfolder within the export (e.g. "ots_cms"). Omit to use the export root.</summary>
[MaxLength(500)]
public string? NfsExportFolder { get; set; }
[MaxLength(500)]
public string? CifsShareName { get; set; }
/// <summary>Optional subfolder within the share (e.g. "ots_cms"). Omit to use the share root.</summary>
[MaxLength(500)]
public string? CifsShareFolder { get; set; }
[MaxLength(200)]
public string? CifsUsername { get; set; }
[MaxLength(500)]
public string? CifsPassword { get; set; }
[MaxLength(500)]
public string? CifsExtraOptions { get; set; }
public string? NfsExtraOptions { get; set; }
}

View File

@@ -0,0 +1,16 @@
namespace OTSSignsOrchestrator.Core.Models.DTOs;
/// <summary>
/// Represents a node in the Docker Swarm cluster,
/// parsed from <c>docker node ls</c> output.
/// </summary>
public class NodeInfo
{
public string Id { get; set; } = string.Empty;
public string Hostname { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public string Availability { get; set; } = string.Empty;
public string ManagerStatus { get; set; } = string.Empty;
public string EngineVersion { get; set; } = string.Empty;
public string IpAddress { get; set; } = string.Empty;
}

View File

@@ -4,6 +4,32 @@ namespace OTSSignsOrchestrator.Core.Models.DTOs;
public class UpdateInstanceDto
{
// ── Identity / rendering context (populated from live service inspect) ──
/// <summary>Customer display name (used in log messages and comment header).</summary>
[MaxLength(100)]
public string? CustomerName { get; set; }
/// <summary>
/// 3-letter abbreviation. If null, derived automatically from the stack name
/// by stripping the "-cms-stack" suffix.
/// </summary>
[MaxLength(3)]
public string? CustomerAbbrev { get; set; }
/// <summary>Public hostname for the CMS (e.g. "acm.ots-signs.com").</summary>
[MaxLength(200)]
public string? CmsServerName { get; set; }
/// <summary>Host-side HTTP port (defaults to 80 when null).</summary>
public int? HostHttpPort { get; set; }
/// <summary>Host path bind-mounted as the theme directory.</summary>
[MaxLength(500)]
public string? ThemeHostPath { get; set; }
// ── Optional overrides (null = keep / use global settings) ──
[MaxLength(500)]
public string? TemplateRepoUrl { get; set; }
@@ -18,30 +44,29 @@ public class UpdateInstanceDto
public List<string>? Constraints { get; set; }
[MaxLength(200)]
public string? XiboUsername { get; set; }
// ── NFS volume settings (per-instance) ──
[MaxLength(200)]
public string? XiboPassword { get; set; }
public string? NfsServer { get; set; }
// ── CIFS / SMB credentials (per-instance) ──
/// <summary>NFS export path on the server (e.g. "/srv/nfs").</summary>
[MaxLength(500)]
public string? NfsExport { get; set; }
[MaxLength(200)]
public string? CifsServer { get; set; }
/// <summary>Optional subfolder within the export (e.g. "ots_cms"). Omit to use the export root.</summary>
[MaxLength(500)]
public string? NfsExportFolder { get; set; }
[MaxLength(500)]
public string? CifsShareName { get; set; }
public string? NfsExtraOptions { get; set; }
/// <summary>Optional subfolder within the share (e.g. "ots_cms"). Omit to use the share root.</summary>
// ── Pangolin / Newt tunnel settings ──
/// <summary>Pangolin Newt ID for the tunnel service.</summary>
[MaxLength(500)]
public string? CifsShareFolder { get; set; }
[MaxLength(200)]
public string? CifsUsername { get; set; }
public string? NewtId { get; set; }
/// <summary>Pangolin Newt Secret for the tunnel service.</summary>
[MaxLength(500)]
public string? CifsPassword { get; set; }
[MaxLength(500)]
public string? CifsExtraOptions { get; set; }
public string? NewtSecret { get; set; }
}

View File

@@ -1,121 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace OTSSignsOrchestrator.Core.Models.Entities;
public enum InstanceStatus
{
Deploying,
Active,
Error,
Deleted
}
public enum XiboApiTestStatus
{
Unknown,
Success,
Failed
}
public class CmsInstance
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required, MaxLength(100)]
public string CustomerName { get; set; } = string.Empty;
/// <summary>Exactly 3 lowercase letters used to derive all resource names.</summary>
[MaxLength(3)]
public string CustomerAbbrev { get; set; } = string.Empty;
[Required, MaxLength(100)]
public string StackName { get; set; } = string.Empty;
[Required, MaxLength(200)]
public string CmsServerName { get; set; } = string.Empty;
[Required, Range(1024, 65535)]
public int HostHttpPort { get; set; }
[Required, MaxLength(500)]
public string ThemeHostPath { get; set; } = string.Empty;
[Required, MaxLength(500)]
public string LibraryHostPath { get; set; } = string.Empty;
[Required, MaxLength(200)]
public string SmtpServer { get; set; } = string.Empty;
[Required, MaxLength(200)]
public string SmtpUsername { get; set; } = string.Empty;
/// <summary>
/// JSON array of placement constraints, e.g. ["node.labels.xibo==true"]
/// </summary>
[MaxLength(2000)]
public string? Constraints { get; set; }
[Required, MaxLength(500)]
public string TemplateRepoUrl { get; set; } = string.Empty;
[MaxLength(500)]
public string? TemplateRepoPat { get; set; }
public DateTime? TemplateLastFetch { get; set; }
[MaxLength(100)]
public string? TemplateCacheKey { get; set; }
public InstanceStatus Status { get; set; } = InstanceStatus.Deploying;
/// <summary>Encrypted Xibo admin username for API access.</summary>
[MaxLength(500)]
public string? XiboUsername { get; set; }
/// <summary>Encrypted Xibo admin password. Never logged; encrypted at rest.</summary>
[MaxLength(1000)]
public string? XiboPassword { get; set; }
public XiboApiTestStatus XiboApiTestStatus { get; set; } = XiboApiTestStatus.Unknown;
public DateTime? XiboApiTestedAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
/// <summary>Soft delete marker.</summary>
public DateTime? DeletedAt { get; set; }
// ── CIFS / SMB credentials (per-instance) ─────────────────────────────
[MaxLength(200)]
public string? CifsServer { get; set; }
[MaxLength(500)]
public string? CifsShareName { get; set; }
/// <summary>Optional subfolder within the share (e.g. "ots_cms"). Omit to use the share root.</summary>
[MaxLength(500)]
public string? CifsShareFolder { get; set; }
[MaxLength(200)]
public string? CifsUsername { get; set; }
/// <summary>Encrypted CIFS password. Never logged; encrypted at rest.</summary>
[MaxLength(1000)]
public string? CifsPassword { get; set; }
[MaxLength(500)]
public string? CifsExtraOptions { get; set; }
/// <summary>ID of the SshHost this instance is deployed to.</summary>
public Guid? SshHostId { get; set; }
[ForeignKey(nameof(SshHostId))]
public SshHost? SshHost { get; set; }
public ICollection<OperationLog> OperationLogs { get; set; } = new List<OperationLog>();
}

View File

@@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace OTSSignsOrchestrator.Core.Models.Entities;
@@ -28,10 +27,9 @@ public class OperationLog
public OperationType Operation { get; set; }
public Guid? InstanceId { get; set; }
[ForeignKey(nameof(InstanceId))]
public CmsInstance? Instance { get; set; }
/// <summary>Name of the Docker stack this operation relates to (e.g. "acm-cms-stack").</summary>
[MaxLength(150)]
public string? StackName { get; set; }
[MaxLength(200)]
public string? UserId { get; set; }

View File

@@ -1,21 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace OTSSignsOrchestrator.Core.Models.Entities;
public class SecretMetadata
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required, MaxLength(200)]
public string Name { get; set; } = string.Empty;
public bool IsGlobal { get; set; }
[MaxLength(100)]
public string? CustomerName { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime? LastRotatedAt { get; set; }
}

View File

@@ -54,6 +54,4 @@ public class SshHost
public DateTime? LastTestedAt { get; set; }
public bool? LastTestSuccess { get; set; }
public ICollection<CmsInstance> Instances { get; set; } = new List<CmsInstance>();
}