Compare commits

...

3 Commits

Author SHA1 Message Date
Flaminel 5adbdbd920 Fix weird time zone display name on startup (#70) 2025-02-25 21:32:19 +02:00
Flaminel b3b211d956 Add configurable time zone (#69) 2025-02-24 23:21:44 +02:00
Flaminel 279bd6d82d Fix Deluge timeout not being configurable (#68) 2025-02-24 18:32:44 +02:00
6 changed files with 35 additions and 12 deletions
+1
View File
@@ -140,6 +140,7 @@ services:
volumes: volumes:
- ./cleanuperr/logs:/var/logs - ./cleanuperr/logs:/var/logs
environment: environment:
- TZ=America/New_York
- DRY_RUN=false - DRY_RUN=false
- LOGGING__LOGLEVEL=Information - LOGGING__LOGLEVEL=Information
@@ -62,7 +62,7 @@ public static class MainDI
services services
.AddHttpClient(nameof(DelugeService), x => .AddHttpClient(nameof(DelugeService), x =>
{ {
x.Timeout = TimeSpan.FromSeconds(5); x.Timeout = TimeSpan.FromSeconds(config.Timeout);
}) })
.ConfigurePrimaryHttpMessageHandler(_ => .ConfigurePrimaryHttpMessageHandler(_ =>
{ {
+23
View File
@@ -0,0 +1,23 @@
using System.Reflection;
namespace Executable;
public static class HostExtensions
{
public static IHost Init(this IHost host)
{
ILogger<Program> logger = host.Services.GetRequiredService<ILogger<Program>>();
Version? version = Assembly.GetExecutingAssembly().GetName().Version;
logger.LogInformation(
version is null
? "cleanuperr version not detected"
: $"cleanuperr v{version.Major}.{version.Minor}.{version.Build}"
);
logger.LogInformation("timezone: {tz}", TimeZoneInfo.Local.DisplayName);
return host;
}
}
+2 -11
View File
@@ -1,4 +1,4 @@
using System.Reflection; using Executable;
using Executable.DependencyInjection; using Executable.DependencyInjection;
var builder = Host.CreateApplicationBuilder(args); var builder = Host.CreateApplicationBuilder(args);
@@ -7,15 +7,6 @@ builder.Services.AddInfrastructure(builder.Configuration);
builder.Logging.AddLogging(builder.Configuration); builder.Logging.AddLogging(builder.Configuration);
var host = builder.Build(); var host = builder.Build();
host.Init();
var logger = host.Services.GetRequiredService<ILogger<Program>>();
var version = Assembly.GetExecutingAssembly().GetName().Version;
logger.LogInformation(
version is null
? "cleanuperr version not detected"
: $"cleanuperr v{version.Major}.{version.Minor}.{version.Build}"
);
host.Run(); host.Run();
+1
View File
@@ -175,6 +175,7 @@ services:
image: ghcr.io/flmorg/cleanuperr:latest image: ghcr.io/flmorg/cleanuperr:latest
container_name: cleanuperr container_name: cleanuperr
environment: environment:
- TZ=Europe/Bucharest
- DRY_RUN=false - DRY_RUN=false
- LOGGING__LOGLEVEL=Debug - LOGGING__LOGLEVEL=Debug
+7
View File
@@ -12,6 +12,13 @@
### General settings ### General settings
**`TZ`**
- The time zone to use.
- Type: String.
- Possible values: Any valid timezone.
- Default: `UTC`.
- Required: No.
**`DRY_RUN`** **`DRY_RUN`**
- When enabled, simulates irreversible operations (like deletions and notifications) without making actual changes. - When enabled, simulates irreversible operations (like deletions and notifications) without making actual changes.
- Type: Boolean. - Type: Boolean.