askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
app_settings.json · 1.8 KB · 52 lines
| 1 | { |
| 2 | "name": "app_settings", |
| 3 | "title": "App Settings", |
| 4 | "version": 3, |
| 5 | "description": "Server-wide, admin-managed configuration for app packages: one key/value per row, keys namespaced by app (payments.overpayment_policy). The settings sibling of user_prefs (per-user) and feature_flags (on/off switches); operator/infra config stays in env. Hooks and the daemon read these with code-side defaults, so an absent row always means the documented default. The key is declared unique, enforced inside the write lock for every writer (docs/validation-and-logic.md). Readers take the first row that matches a key, so a second row is not an override, it is silently ignored. v3 removed the pre-write hook that also refused one: it ran before the lock, so two overlapping creates of one key both landed, and the declaration is the guard.", |
| 6 | "fields": [ |
| 7 | { |
| 8 | "name": "id" |
| 9 | }, |
| 10 | { |
| 11 | "name": "key", |
| 12 | "type": "text", |
| 13 | "required": true, |
| 14 | "label": "Key", |
| 15 | "validation": { |
| 16 | "max_length": 120, |
| 17 | "pattern": "^[a-z0-9_]+(\\.[a-z0-9_]+)+$" |
| 18 | } |
| 19 | }, |
| 20 | { |
| 21 | "name": "value", |
| 22 | "type": "text", |
| 23 | "required": true, |
| 24 | "label": "Value", |
| 25 | "validation": { |
| 26 | "max_length": 500 |
| 27 | } |
| 28 | }, |
| 29 | { |
| 30 | "name": "description", |
| 31 | "type": "text", |
| 32 | "label": "Description", |
| 33 | "validation": { |
| 34 | "max_length": 300 |
| 35 | } |
| 36 | } |
| 37 | ], |
| 38 | "views": { |
| 39 | "list_mode": "table", |
| 40 | "list_fields": [ |
| 41 | "key", |
| 42 | "value", |
| 43 | "description" |
| 44 | ] |
| 45 | }, |
| 46 | "unique": [ |
| 47 | { |
| 48 | "fields": ["key"], |
| 49 | "message": "This setting key is already configured. A key is configured once: readers take the first row that matches, so a second row would be silently ignored. Filter the settings list by this key to find the record that holds it, and edit that record instead." |
| 50 | } |
| 51 | ] |
| 52 | } |