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.
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
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
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
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
dotnet add package DuplicatiConsoleCommon
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}");
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();
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);
using ConsoleCommon;
var builder = WebApplication.CreateBuilder(args);
// Configure for development
builder = builder.ConfigureForDevelopment();
var app = builder.Build();
- .NET 8.0 or later
- ASP.NET Core for web-related components
MIT License - see LICENSE file for details.