DuplicatiConsoleCommon 1.0.1
dotnet add package DuplicatiConsoleCommon --version 1.0.1
NuGet\Install-Package DuplicatiConsoleCommon -Version 1.0.1
<PackageReference Include="DuplicatiConsoleCommon" Version="1.0.1" />
<PackageVersion Include="DuplicatiConsoleCommon" Version="1.0.1" />
<PackageReference Include="DuplicatiConsoleCommon" />
paket add DuplicatiConsoleCommon --version 1.0.1
#r "nuget: DuplicatiConsoleCommon, 1.0.1"
#:package DuplicatiConsoleCommon@1.0.1
#addin nuget:?package=DuplicatiConsoleCommon&version=1.0.1
#tool nuget:?package=DuplicatiConsoleCommon&version=1.0.1
Console Common
Common functions for Duplicati console applications.
This library provides shared functionality used across Duplicati's console-based applications, including license validation, logging configuration, security filtering, and development configuration setup.
Components
License Checker
Provides functionality to validate licenses for the ConsoleCommon library. Supports obtaining licenses from remote servers, local files, or base64-encoded data, with RSA-SHA256 signature verification.
Key features:
- License validation with cryptographic signatures
- Support for multiple license sources (HTTP, file system, base64)
- Automatic expiration checking with grace period
- Feature-based license validation
- Custom exception handling
Common Logging Config
Shared logging configuration across Duplicati console projects using Serilog.
Features:
- Standardized logging setup for console applications
- Integration with ASP.NET Core hosting
- Environment-specific configuration options
Simple Security Filter
Basic security filter for publicly available endpoints in ASP.NET Core applications.
Features:
- Pattern matching to prevent vulnerability scanning
- Rate limiting with simplified API
- Custom error responses for blocked requests
Config Setup
Configuration setup for development environments, including loading environment variables from local files and 1Password vaults.
Key features:
- Development-specific configuration loading
- 1Password vault integration for secrets
- Local environment variable file support
Installation
dotnet add package DuplicatiConsoleCommon
Usage
License Validation
using ConsoleCommon;
// Obtain a license from the server
var license = await LicenseChecker.ObtainLicenseAsync("your-license-key", CancellationToken.None);
// Check for required features
license.EnsureFeatures(ConsoleLicenseFeatures.GatewayMachineServer);
// Use the license data
Console.WriteLine($"License valid until: {license.ValidTo}");
Logging Configuration
using CommonLoggingConfig;
var builder = WebApplication.CreateBuilder(args);
var serilogConfig = builder.Configuration.GetSection("Serilog").Get<SerilogConfig>();
var extras = new LoggingExtras() { IsProd = false };
builder.AddCommonLogging(serilogConfig, extras);
var app = builder.Build();
app.UseCommonLogging();
Security Filtering
using SimpleSecurityFilter;
var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration.GetSection("SimpleSecurity").Get<SimpleSecurityOptions>();
builder.AddSimpleSecurityFilter(config);
var app = builder.Build();
app.UseSimpleSecurityFilter(config);
Configuration Setup
using ConsoleCommon;
var builder = WebApplication.CreateBuilder(args);
// Configure for development
builder = builder.ConfigureForDevelopment();
var app = builder.Build();
Requirements
- .NET 8.0 or later
- ASP.NET Core for web-related components
License
MIT License - see LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- BetterStack.Logs.Serilog (>= 1.1.0)
- JsonSignature (>= 1.0.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Http.Features (>= 5.0.17)
- Microsoft.AspNetCore.RateLimiting (>= 7.0.0-rc.2.22476.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.9)
- Serilog.AspNetCore (>= 8.0.1)
- Serilog.Enrichers.AspNetCore.HttpContext (>= 1.0.1)
- Serilog.Enrichers.ClientInfo (>= 2.1.2)
- Serilog.Extensions.Logging (>= 9.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added 1Password integration