mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 16:46:08 +02:00
feat: Update configuration files for storage path and spam protection settings
This commit is contained in:
@@ -15,8 +15,10 @@ public sealed class FileCleanupService : BackgroundService
|
||||
{
|
||||
var intervalHours = _configuration.GetValue("Storage:CleanupIntervalHours", 1);
|
||||
var retentionDays = _configuration.GetValue("Storage:RetentionDays", 30);
|
||||
var storagePath = _configuration["Storage:Path"]
|
||||
?? Path.Combine(AppContext.BaseDirectory, "uploads");
|
||||
var configuredPath = _configuration["Storage:Path"];
|
||||
var storagePath = !string.IsNullOrWhiteSpace(configuredPath)
|
||||
? configuredPath
|
||||
: Path.Combine(AppContext.BaseDirectory, "uploads");
|
||||
|
||||
_logger.LogInformation(
|
||||
"File cleanup service started — interval: {Hours}h, retention: {Days}d, path: {Path}",
|
||||
|
||||
@@ -6,8 +6,11 @@ public class FileStorageService
|
||||
|
||||
public FileStorageService(IConfiguration configuration)
|
||||
{
|
||||
_storagePath = configuration["Storage:Path"]
|
||||
?? Path.Combine(AppContext.BaseDirectory, "uploads");
|
||||
// Empty string (example config placeholder) means "unset", same as missing
|
||||
var configured = configuration["Storage:Path"];
|
||||
_storagePath = !string.IsNullOrWhiteSpace(configured)
|
||||
? configured
|
||||
: Path.Combine(AppContext.BaseDirectory, "uploads");
|
||||
|
||||
if (!Directory.Exists(_storagePath))
|
||||
{
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
"PublicHosts": [],
|
||||
"Tags": [],
|
||||
"Admins": [],
|
||||
"Registration": "open"
|
||||
"Registration": "open",
|
||||
"DirectoryClaimPath": ""
|
||||
},
|
||||
"Storage": {
|
||||
"Path": "",
|
||||
"CleanupIntervalHours": 1,
|
||||
"RetentionDays": 30
|
||||
},
|
||||
@@ -53,7 +55,11 @@
|
||||
"TlsCertPath": "",
|
||||
"TlsCertPassword": "",
|
||||
"ServerName": "echohub",
|
||||
"Motd": "Welcome to EchoHub IRC Gateway!"
|
||||
"Motd": "Welcome to EchoHub IRC Gateway!",
|
||||
"PublicBaseUrl": ""
|
||||
},
|
||||
"Cors": {
|
||||
"AllowedOrigins": []
|
||||
},
|
||||
"Serilog": {
|
||||
"MinimumLevel": {
|
||||
|
||||
Reference in New Issue
Block a user