Master data management Β· features 286-305
πŸ›’οΈ SQL Server Β· MasterDataLabDB
βš™οΈ

298System Config

Technical settings per environment. DEV / TEST / PROD rows override the DEFAULT row.

Try it

Effective config

What the application sees in one environment: its own row, otherwise the DEFAULT row
KeyValueFrom
app.base-url https://erp.example.com PROD
feature.new-dashboard false DEFAULT
log.level INFO DEFAULT
mail.smtp.host smtp.example.com PROD
mail.smtp.password deβ€’β€’β€’β€’β€’β€’et πŸ”‘ PROD
mail.smtp.port 587 PROD
report.max-rows 5000 DEFAULT
storage.path ./storage DEFAULT
KeyOld β†’ newWhen
No changes yet - edit a config row.
# Key Environment Value Secret Status
1 app.base-url DEFAULT http://localhost:8184 Active ✏️
2 app.base-url PROD https://erp.example.com Active ✏️
10 feature.new-dashboard DEFAULT false Active ✏️
11 feature.new-dashboard DEV true Active ✏️
12 log.level DEFAULT INFO Active ✏️
13 log.level DEV DEBUG Active ✏️
3 mail.smtp.host DEFAULT localhost Active ✏️
4 mail.smtp.host PROD smtp.example.com Active ✏️
7 mail.smtp.password PROD deβ€’β€’β€’β€’β€’β€’et βœ“ Active ✏️
5 mail.smtp.port DEFAULT 25 Active ✏️
6 mail.smtp.port PROD 587 Active ✏️
8 payment.api-key TEST skβ€’β€’β€’β€’β€’β€’56 βœ“ Active ✏️
14 report.max-rows DEFAULT 5000 Active ✏️
9 storage.path DEFAULT ./storage Active ✏️
Showing 1–14 of 14
πŸŽ“ Learn: how this master is built table system_config
  • Fallback lookup: ConfigService.get(key, env) tries env first, then DEFAULT.
  • Every change is kept in config_history (MasterListeners.configHistory).
Entity
domain/SystemConfig.java
Repository
repo/SystemConfigRepository.java
Definition
MasterRegistry: "config"
Page / form
web/MasterController.java
Try-it panel
templates/tools/config-resolve.html
REST API
GET /api/config/mail.smtp.host?env=PROD
DECLARE @env NVARCHAR(10) = 'PROD';
SELECT k.config_key, COALESCE(e.config_value, d.config_value) AS value
FROM (SELECT DISTINCT config_key FROM system_config) k
LEFT JOIN system_config e ON e.config_key = k.config_key AND e.environment = @env
LEFT JOIN system_config d ON d.config_key = k.config_key AND d.environment = 'DEFAULT';