feat: Update configuration files for storage path and spam protection settings

This commit is contained in:
HueByte
2026-07-17 19:54:30 +02:00
parent 71d82b45fb
commit df1bd0119c
4 changed files with 50 additions and 6 deletions
@@ -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))
{
+8 -2
View File
@@ -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": {