2023-02-18 08:52:17 +01:00
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
2023-02-19 00:43:43 +01:00
|
|
|
using PrivaPub.Models;
|
2023-02-18 08:52:17 +01:00
|
|
|
|
2023-02-19 00:43:43 +01:00
|
|
|
namespace PrivaPub.Services
|
2023-02-18 08:52:17 +01:00
|
|
|
{
|
2026-10-17 03:13:16 +02:00
|
|
|
// The configuration as appsettings has it now. Builds before 2026-10-17 copied it into Mongo on first boot and read that
|
|
|
|
|
// copy forever after, so a changed SMTP account or language list never took; the copy is no longer read.
|
2023-02-18 08:52:17 +01:00
|
|
|
public class AppConfigurationService
|
|
|
|
|
{
|
2026-10-17 03:13:16 +02:00
|
|
|
readonly IOptionsMonitor<AppConfiguration> _appConfiguration;
|
|
|
|
|
|
|
|
|
|
public AppConfigurationService(IOptionsMonitor<AppConfiguration> appConfiguration) => _appConfiguration = appConfiguration;
|
2023-02-18 08:52:17 +01:00
|
|
|
|
2026-10-17 03:13:16 +02:00
|
|
|
public AppConfiguration AppConfiguration => _appConfiguration.CurrentValue;
|
2023-02-18 08:52:17 +01:00
|
|
|
|
2026-10-17 03:13:16 +02:00
|
|
|
public Task Init() => Task.CompletedTask;
|
2023-02-18 08:52:17 +01:00
|
|
|
}
|
|
|
|
|
}
|