DuplicatiConsoleCommon 1.0.1

dotnet add package DuplicatiConsoleCommon --version 1.0.1
                    
NuGet\Install-Package DuplicatiConsoleCommon -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DuplicatiConsoleCommon" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DuplicatiConsoleCommon" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="DuplicatiConsoleCommon" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DuplicatiConsoleCommon --version 1.0.1
                    
#r "nuget: DuplicatiConsoleCommon, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DuplicatiConsoleCommon@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DuplicatiConsoleCommon&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=DuplicatiConsoleCommon&version=1.0.1
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 68 10/11/2025
1.0.0 310 10/8/2025

Added 1Password integration