2024-08-13 13:08:50 +02:00
|
|
|
using Serilog.Events;
|
|
|
|
|
|
|
|
|
|
namespace Catalogger.Backend;
|
|
|
|
|
|
|
|
|
|
public class Config
|
|
|
|
|
{
|
|
|
|
|
public LoggingConfig Logging { get; init; } = new();
|
|
|
|
|
public DatabaseConfig Database { get; init; } = new();
|
|
|
|
|
public DiscordConfig Discord { get; init; } = new();
|
|
|
|
|
public WebConfig Web { get; init; } = new();
|
2024-08-15 17:23:56 +02:00
|
|
|
|
2024-08-13 13:08:50 +02:00
|
|
|
public class LoggingConfig
|
|
|
|
|
{
|
|
|
|
|
public LogEventLevel LogEventLevel { get; init; } = LogEventLevel.Debug;
|
|
|
|
|
public bool LogQueries { get; init; } = false;
|
2024-08-20 20:19:24 +02:00
|
|
|
|
|
|
|
|
public int MetricsPort { get; init; } = 5001;
|
|
|
|
|
public bool EnableMetrics { get; init; } = true;
|
2024-08-13 13:08:50 +02:00
|
|
|
}
|
2024-08-15 17:23:56 +02:00
|
|
|
|
2024-08-13 13:08:50 +02:00
|
|
|
public class DatabaseConfig
|
|
|
|
|
{
|
|
|
|
|
public string Url { get; init; } = string.Empty;
|
2024-08-16 22:28:05 +02:00
|
|
|
public string? Redis { get; init; }
|
2024-08-13 13:08:50 +02:00
|
|
|
public int? Timeout { get; init; }
|
|
|
|
|
public int? MaxPoolSize { get; init; }
|
|
|
|
|
public string EncryptionKey { get; init; } = string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class DiscordConfig
|
|
|
|
|
{
|
|
|
|
|
public ulong ApplicationId { get; set; }
|
|
|
|
|
public string Token { get; init; } = string.Empty;
|
|
|
|
|
public bool SyncCommands { get; init; }
|
|
|
|
|
public ulong? CommandsGuildId { get; init; }
|
2024-08-13 16:48:54 +02:00
|
|
|
public ulong? GuildLogId { get; init; }
|
2024-08-13 13:08:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class WebConfig
|
|
|
|
|
{
|
|
|
|
|
public string Host { get; init; } = "localhost";
|
|
|
|
|
public int Port { get; init; } = 5000;
|
|
|
|
|
public string BaseUrl { get; init; } = null!;
|
|
|
|
|
public string Address => $"http://{Host}:{Port}";
|
|
|
|
|
}
|
|
|
|
|
}
|