You are reading the documentation for v2.1.1, which is not the current version. It describes that release and is kept for reference. It is not updated.Go to v3.1.0 β
Configuration
Binacle.Net turns on only what you ask for. Most of it is modules, each with its own files and switches.
This page is the configuration system: where the files are, the ways to override a setting, and which one wins when two disagree. The settings themselves are on the module pages linked at the end.
π Configuration Files
Every configuration file lives under /app/Config_Files. This is the whole tree in v2.1.1:
app
βββ Config_Files
βββ Presets.json
βββ DiagnosticsModule
β βββ HealthChecks.json
β βββ OpenTelemetry.json
β βββ PackingLogs.json
β βββ Serilog.json
βββ UiModule
βββ ConnectionStrings.json
βοΈ Overriding Configuration
There are four ways to change a setting. Which one to use depends on what the setting is:
- πΉ Environment variables - highest priority. Use them for secrets and anything that differs per deployment.
- π Production overrides (
<filename>.Production.json) - a file holding only the settings you change. - π Direct file edits - replace the file itself with a bind mount or a volume.
- π Connection string fallbacks - a dedicated environment variable for each connection string.
The examples below use this Settings.json:
{
"Settings": {
"Enabled": false,
"DataFolderPath": "/data",
"Logs": {
"FileFormat": "dd-MM-yyyy.txt",
"Retention": 4
}
}
}
π Environment Variables
An environment variable beats every file. Name it after the settingβs path, with __ between the levels:
Settings__Enabled=True
Settings__Logs__Retention=5
π Production Overrides
Put a Settings.Production.json next to Settings.json holding only what changes:
{
"Settings": {
"Enabled": true,
"Logs": {
"Retention": 5
}
}
}
The two files are merged, so the rest of Settings.json still applies.
π Direct File Edits
Replace the whole file:
- Docker: a bind mount (
-v /host/path:/container/path) - Kubernetes: a volume (
hostPathor aConfigMap)
The file you mount replaces every default in it, so a key you leave out is gone, not defaulted. Use this only when you mean to own the whole file - which is the normal way to supply
Presets.json.
π Connection String Fallbacks
A connection string can also come from an environment variable named after the connection, uppercased, with
_CONNECTION_STRING on the end. This is the place for a connection string that holds credentials.
DATABASE_CONNECTION_STRING=endpoint=https://localhost:1413
βοΈ Configuration Precedence
When more than one method sets the same value, the highest row wins:
| Order | Method | Setting (Logs.Retention) |
Connection string (ConnectionStrings.Database) |
|---|---|---|---|
| 1 | Environment variable | Settings__Logs__Retention=5 |
ConnectionStrings__Database=endpoint=https://localhost:1413 |
| 2 | Production override | Settings.Production.json |
ConnectionStrings.Production.json |
| 3 | Direct file edit | Settings.json |
ConnectionStrings.json |
| 4 | Connection string fallback | - | DATABASE_CONNECTION_STRING=endpoint=https://localhost:1413 |
π§ Modules
Each module adds something to Binacle.Net. Its page lists its files and switches.
ποΈ Core
The API itself, the presets, and the switches for Swagger UI and Scalar UI.
π Diagnostics Module
Logging, health checks, packing logs and telemetry. Always on; only logging is enabled out of the box.
- π Diagnostics Module
- π Logging
- β€οΈβπ©Ή Health Checks
- π¦ Packing Logs
- π‘ OpenTelemetry
π‘οΈ Service Module
Accounts and subscriptions for callers you do not control. Built for the hosted service and not publicly documented from v2.0.0 onward. A breaking change to it does not force a major version.
π₯οΈ UI Module
Two browser pages: the packing demo and the ViPaq decoder. Off by default.