- Added properties for managing container logs, including log entries, service filters, and auto-refresh options. - Introduced commands for refreshing logs, toggling auto-refresh, and closing the logs panel. - Implemented log fetching logic with error handling and status messages. - Integrated log display in the InstancesView with a dedicated logs panel. feat: Enhance navigation to Instances page with auto-selection - Added method to navigate to the Instances page and auto-select an instance based on abbreviation. feat: Update SettingsViewModel to load and save Bitwarden configuration - Integrated Bitwarden configuration loading from IOptions and saving to appsettings.json. - Added properties for Bitwarden instance project ID and connection status. - Updated UI to reflect Bitwarden settings and connection status. feat: Add advanced options for instance creation - Introduced a new expander in CreateInstanceView for advanced options, including purging stale volumes. feat: Improve InstanceDetailsWindow with pending setup banner - Added a banner to indicate pending setup for Xibo OAuth credentials, with editable fields for client ID and secret. fix: Update appsettings.json to include Bitwarden configuration structure - Added Bitwarden section to appsettings.json for storing configuration values. chore: Update Docker Compose template with health checks - Added health check configuration for web service in template.yml to ensure service availability. refactor: Drop AppSettings table from database - Removed AppSettings table and related migration files as part of database cleanup. feat: Create ServiceLogEntry DTO for log management - Added ServiceLogEntry class to represent individual log entries from Docker services.
103 lines
3.9 KiB
C#
103 lines
3.9 KiB
C#
namespace OTSSignsOrchestrator.Core.Configuration;
|
|
|
|
public class FileLoggingOptions
|
|
{
|
|
public const string SectionName = "FileLogging";
|
|
public bool Enabled { get; set; } = true;
|
|
public string Path { get; set; } = "logs";
|
|
public string RollingInterval { get; set; } = "Day";
|
|
public int RetentionDays { get; set; } = 30;
|
|
public long FileSizeLimitBytes { get; set; } = 100 * 1024 * 1024; // 100MB
|
|
}
|
|
|
|
public class GitOptions
|
|
{
|
|
public const string SectionName = "Git";
|
|
public string CacheDir { get; set; } = ".template-cache";
|
|
public int CacheTtlMinutes { get; set; } = 60;
|
|
public int ShallowCloneDepth { get; set; } = 1;
|
|
}
|
|
|
|
public class DockerOptions
|
|
{
|
|
public const string SectionName = "Docker";
|
|
public List<string> DefaultConstraints { get; set; } = new() { "node.labels.xibo==true" };
|
|
public int DeployTimeoutSeconds { get; set; } = 30;
|
|
public bool ValidateBeforeDeploy { get; set; } = true;
|
|
}
|
|
|
|
public class XiboDefaultImages
|
|
{
|
|
public string Cms { get; set; } = "ghcr.io/xibosignage/xibo-cms:release-4.4.0";
|
|
public string Mysql { get; set; } = "mysql:8.4";
|
|
public string Memcached { get; set; } = "memcached:alpine";
|
|
public string QuickChart { get; set; } = "ianw/quickchart";
|
|
}
|
|
|
|
public class XiboOptions
|
|
{
|
|
public const string SectionName = "Xibo";
|
|
public XiboDefaultImages DefaultImages { get; set; } = new();
|
|
public int TestConnectionTimeoutSeconds { get; set; } = 10;
|
|
}
|
|
|
|
public class DatabaseOptions
|
|
{
|
|
public const string SectionName = "Database";
|
|
public string Provider { get; set; } = "Sqlite";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Bitwarden Secrets Manager connection settings.
|
|
/// Stored in appsettings.json so they can bootstrap the connection before any other settings are loaded.
|
|
/// </summary>
|
|
public class BitwardenOptions
|
|
{
|
|
public const string SectionName = "Bitwarden";
|
|
|
|
public string IdentityUrl { get; set; } = "https://identity.bitwarden.com";
|
|
public string ApiUrl { get; set; } = "https://api.bitwarden.com";
|
|
|
|
/// <summary>Machine account access token (sensitive — may be set via environment variable).</summary>
|
|
public string AccessToken { get; set; } = string.Empty;
|
|
|
|
public string OrganizationId { get; set; } = string.Empty;
|
|
|
|
/// <summary>Project where config secrets are created/listed. Required.</summary>
|
|
public string ProjectId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Optional separate project for instance-level secrets (DB passwords, Newt credentials, etc.).
|
|
/// When empty, instance secrets are stored in the default <see cref="ProjectId"/>.
|
|
/// </summary>
|
|
public string InstanceProjectId { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class InstanceDefaultsOptions
|
|
{
|
|
public const string SectionName = "InstanceDefaults";
|
|
|
|
/// <summary>Default template repo URL if not overridden per-instance.</summary>
|
|
public string? TemplateRepoUrl { get; set; }
|
|
public string? TemplateRepoPat { get; set; }
|
|
|
|
/// <summary>Template for CMS server hostname. Use {abbrev} as placeholder.</summary>
|
|
public string CmsServerNameTemplate { get; set; } = "{abbrev}.ots-signs.com";
|
|
|
|
public string SmtpServer { get; set; } = string.Empty;
|
|
public string SmtpUsername { get; set; } = string.Empty;
|
|
public string SmtpPassword { get; set; } = string.Empty;
|
|
|
|
public int BaseHostHttpPort { get; set; } = 8080;
|
|
|
|
/// <summary>Template for theme path. Use {abbrev} as placeholder.</summary>
|
|
/// <summary>Static host path for the theme volume mount. Overridable per-instance.</summary>
|
|
public string ThemeHostPath { get; set; } = "/cms/ots-theme";
|
|
|
|
/// <summary>Subfolder name on CIFS share for the library volume. Use {abbrev} as placeholder.</summary>
|
|
public string LibraryShareSubPath { get; set; } = "{abbrev}-cms-library";
|
|
|
|
public string MySqlDatabaseTemplate { get; set; } = "{abbrev}_cms_db";
|
|
public string MySqlUserTemplate { get; set; } = "{abbrev}_cms_user";
|
|
}
|