namespace MeterVault.Infrastructure.Options; /// /// Root application options, bound from the "MeterVault" configuration section. /// Secrets (broker tokens etc.) live on individual endpoints by reference, not here. /// public sealed class MeterVaultOptions { public const string SectionName = "MeterVault"; /// IANA timezone used for local-midnight bucketing and display (SDD §10). public string TimeZone { get; set; } = "Europe/Berlin"; public string Currency { get; set; } = "EUR"; /// Default UI locale: 'en' (OSS default) or 'de'. public string Locale { get; set; } = "en"; /// Run EF migrations on startup. Disable for tests that migrate out-of-band. public bool RunMigrationsAtStartup { get; set; } = true; /// /// Load the bundled Energiebilanz reference dataset on startup if the database has none yet /// (idempotent — guarded by a marker meter). Off by default; set MeterVault__SeedReferenceData=true /// for a one-command populated demo/test instance. /// public bool SeedReferenceData { get; set; } /// Start the MQTT/Home Assistant ingestion workers. Disable for tests. public bool EnableLiveIngestion { get; set; } = true; /// How long full-resolution raw readings are retained (SDD §5.5, default 3 years). public int RawRetentionDays { get; set; } = 1095; /// /// Compare the running build against the newest published release and show a banner when behind. /// Set false for an air-gapped instance, or one that should make no outbound requests at all. /// public bool UpdateCheckEnabled { get; set; } = true; /// /// Tag listing consulted by the update check. Points at the project's own Gitea, not a vendor /// endpoint — nothing about the instance is sent, it is a plain GET of a public tag list. /// Repoint it at a fork, or blank it to disable the check as surely as the flag above. /// public string UpdateCheckUrl { get; set; } = "https://git.finalfactory.de/api/v1/repos/FinalFactory/MeterVault/tags?limit=50"; /// /// API keys accepted on the X-Api-Key header for the REST API (SDD §9). Provide via env /// (e.g. MeterVault__ApiKeys__0=...). Empty means the API is open (dev only). /// public IList ApiKeys { get; set; } = []; /// Honour X-Forwarded-User/Remote-User from a trusted reverse proxy (SDD §10). public bool ReverseProxyTrust { get; set; } /// /// Allow the REST API without any API key. Off by default: with no keys configured the API is /// closed (401) rather than open, so an unconfigured deployment doesn't expose export/import. /// public bool AllowAnonymousApi { get; set; } }