Application Settings¶
This document describes all configurable settings available in appsettings.extra.json.
Configuration File Location
The appsettings.extra.json file is automatically loaded by cv4pve-admin if present in the config/ directory (mounted as /app/config/ in Docker). This optional configuration file allows you to override default settings without modifying the main appsettings.json file. If the file does not exist, the application starts normally with default settings.
Merge behaviour
- Scalar and object properties — merged: only the keys you specify are overridden, the rest keep their default values.
- Duplicate scalar keys — the value in
appsettings.extra.jsonwins (it is loaded last). - JSON arrays — fully replaced: if you override an array property (e.g.
Serilog.WriteTo), the entire default array is discarded and only the values you provide are used. Make sure to include all entries you want to keep.
Connection Strings¶
Show Connection Strings settings
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=cv4pve_admin;Username=postgres;Password=yourpassword"
}
}
| Setting | Description |
|---|---|
DefaultConnection |
PostgreSQL connection string used by Entity Framework, Hangfire, and Serilog |
Cookie Settings¶
Show Cookie settings
| Setting | Default | Description |
|---|---|---|
ExpireDays |
30 | Number of days before authentication cookie expires |
Security Settings¶
Show Password Options
{
"Security": {
"PasswordOptions": {
"RequiredLength": 8,
"RequireNonAlphanumeric": true,
"RequireDigit": true,
"RequireLowercase": true,
"RequireUppercase": true
}
}
}
| Setting | Default | Description |
|---|---|---|
RequiredLength |
6 | Minimum password length |
RequireNonAlphanumeric |
true | Require special characters (!@#$%^&* etc.) |
RequireDigit |
true | Require at least one digit (0-9) |
RequireLowercase |
true | Require at least one lowercase letter |
RequireUppercase |
true | Require at least one uppercase letter |
Show Lockout Options
{
"Security": {
"LockoutOptions": {
"MaxFailedAccessAttempts": 5,
"AllowedForNewUsers": true,
"DefaultLockoutTimeSpan": "00:15:00"
}
}
}
| Setting | Default | Description |
|---|---|---|
MaxFailedAccessAttempts |
5 | Number of failed login attempts before lockout |
AllowedForNewUsers |
true | Enable lockout for new users |
DefaultLockoutTimeSpan |
00:15:00 | Duration of account lockout (format: HH |
Serilog Configuration¶
Show Serilog base configuration
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Warning",
"System": "Warning"
}
},
"Properties": {
"Application": "cv4pve-admin"
},
"WriteTo": [...]
}
}
Log Levels
Verbose- Most detailed loggingDebug- Debugging informationInformation- General information (default)Warning- Warnings and potential issuesError- Errors that need attentionFatal- Critical failures
Show all Serilog sinks (File / PostgreSQL / Console)
File Sink
{
"Name": "File",
"Args": {
"path": "./data/logs/log-.txt",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj} {ClientIp} {UserName}{NewLine}{Exception}",
"rollingInterval": "Day",
"retainedFileCountLimit": 30
}
}
| Setting | Description |
|---|---|
path |
Log file path (supports rolling with date placeholder) |
outputTemplate |
Log message format |
rollingInterval |
Rolling interval (Hour, Day, Month, Year) |
retainedFileCountLimit |
Number of log files to retain |
PostgreSQL Sink
{
"Name": "PostgreSQL",
"Args": {
"connectionString": "DefaultConnection",
"tableName": "Logs",
"schemaName": "serilog",
"needAutoCreateTable": true,
"needAutoCreateSchema": true,
"columnOptionsSection": {
"message": "RenderedMessage",
"message_template": "MessageTemplate",
"level": "Level",
"raise_date": "Timestamp",
"exception": "Exception",
"properties": "LogEventSerialized",
"user_name": {
"Name": "SingleProperty",
"Args": { "propertyName": "UserName" }
},
"client_ip": {
"Name": "SingleProperty",
"Args": { "propertyName": "ClientIp" }
},
"source_context": {
"Name": "SingleProperty",
"Args": { "propertyName": "SourceContext" }
}
}
}
}
| Setting | Description |
|---|---|
connectionString |
Connection string name from ConnectionStrings section |
tableName |
Database table name for logs |
schemaName |
Database schema name |
needAutoCreateTable |
Auto-create table if not exists |
needAutoCreateSchema |
Auto-create schema if not exists |
columnOptionsSection |
Column mapping configuration |
Console Sink
Other Settings¶
Show other settings
| Setting | Default | Description |
|---|---|---|
DetailedErrors |
true | Show detailed error messages (set to false in production for security) |
AllowedHosts |
* | Allowed host headers (* for all) |
Example Complete Configuration¶
Show full appsettings.extra.json example
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=cv4pve_admin;Username=postgres;Password=secret"
},
"CookieSettings": {
"ExpireDays": 30
},
"Security": {
"PasswordOptions": {
"RequiredLength": 12,
"RequireNonAlphanumeric": true,
"RequireDigit": true,
"RequireLowercase": true,
"RequireUppercase": true
},
"LockoutOptions": {
"MaxFailedAccessAttempts": 3,
"AllowedForNewUsers": true,
"DefaultLockoutTimeSpan": "00:30:00"
}
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "./data/logs/log-.txt",
"rollingInterval": "Day",
"retainedFileCountLimit": 30
}
}
]
},
"AllowedHosts": "*"
}