From d5eb3420848a1337384d80f803037d2deed2bb7e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Apr 2026 01:37:49 +0000 Subject: [PATCH] docs: Add Dify app configuration via database procedure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FFG-DEP-DIFY-001 — how to configure Dify apps without UI Covers: rename, link KB, update dataset config, get API tokens Includes current state for The Forge and Awakened Concierge Key insight: direct DB manipulation avoids UI publish problem --- docs/deployment/dify-app-configuration.md | 104 ++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 docs/deployment/dify-app-configuration.md diff --git a/docs/deployment/dify-app-configuration.md b/docs/deployment/dify-app-configuration.md new file mode 100644 index 0000000..0d41f6b --- /dev/null +++ b/docs/deployment/dify-app-configuration.md @@ -0,0 +1,104 @@ +# Dify App Configuration via Database + +**Document ID:** FFG-DEP-DIFY-001 +**Created:** April 12, 2026 (Chronicler #84 — The Meridian) +**Purpose:** How to configure Dify apps without using the UI (avoids "everything disappears if you don't publish" problem) + +--- + +## Why This Exists + +Dify's web UI loses unsaved changes if you navigate away before publishing. The API uses session-based auth that's not easily accessible. The cleanest approach is direct database manipulation via the Dify PostgreSQL container. + +--- + +## Key Database Info + +- **Container:** `firefrost-codex-db-1` on TX1 Dallas (38.68.14.26) +- **Database:** `dify` +- **User:** `postgres` +- **Access:** `docker exec firefrost-codex-db-1 psql -U postgres -d dify -c "..."` + +--- + +## Key Tables + +| Table | Purpose | +|-------|---------| +| `apps` | App name, mode, config ID | +| `app_model_configs` | Model, system prompt, dataset config | +| `app_dataset_joins` | Links apps to knowledge bases | +| `api_tokens` | API keys per app | +| `datasets` | Knowledge bases | + +--- + +## Common Operations + +### Rename an app +```sql +UPDATE apps SET name = 'The Forge' WHERE id = ''; +``` + +### Find app ID by name +```sql +SELECT id, name, mode FROM apps ORDER BY created_at DESC LIMIT 10; +``` + +### Get app API token +```sql +SELECT token FROM api_tokens WHERE app_id = ''; +``` + +### Link KB to app +```sql +INSERT INTO app_dataset_joins (app_id, dataset_id) +VALUES ('', ''); +``` + +### Update dataset config (enable hybrid search) +```sql +UPDATE app_model_configs +SET dataset_configs = '{ + "retrieval_model": "multiple", + "datasets": { + "datasets": [{ + "dataset": { + "enabled": true, + "id": "" + } + }] + } +}'::jsonb +WHERE id = ''; +``` + +### Get config ID for an app +```sql +SELECT app_model_config_id FROM apps WHERE name = 'The Forge'; +``` + +--- + +## The Forge — Current State (April 12, 2026) + +| Property | Value | +|----------|-------| +| App ID | `faf87e2a-1e98-4a0b-af14-b997ad1d3482` | +| Config ID | `805eae6e-4cfd-43da-9e8b-3bc979a736b2` | +| API Token | `app-forge-trinity-console-key` | +| Model | `gemma4:26b-a4b-it-q8_0` | +| KB (v2) | `3776b10b-918d-48d8-933b-e3dd0655838a` | + +## Awakened Concierge — Current State (April 12, 2026) + +| Property | Value | +|----------|-------| +| App ID | `329a6bdb-5b19-45ce-a003-1861a5473d39` | +| API Token | `app-pwucQuDCos5VXlVTQHnXPZAD` | +| Model | `gemma4:26b-a4b-it-q8_0` | +| KB | None (prompt-only) | + +--- + +**Fire + Frost + Foundation = Where Love Builds Legacy** 💙🔥❄️