Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b3b211d956 | |||
| 279bd6d82d |
@@ -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(_ =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.Id);
|
||||||
|
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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();
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user