Skip to content

fix(helm): use CNPG-generated secrets for DB passwords#10

Merged
charlie83Gs merged 1 commit intomainfrom
fix/helm-use-cnpg-secrets
Mar 23, 2026
Merged

fix(helm): use CNPG-generated secrets for DB passwords#10
charlie83Gs merged 1 commit intomainfrom
fix/helm-use-cnpg-secrets

Conversation

@charlie83Gs
Copy link
Copy Markdown
Contributor

Problem

The Helm chart reads DB passwords from the app secret (knowledge-tree-secrets), requiring users to manually synchronize passwords between CNPG and the app secret. This is error-prone and unnecessary since CNPG auto-generates credentials.

Fix

Read DB passwords directly from CNPG-generated credential secrets:

  • GRAPH_DB_PASSWORD<fullname>-graph-db-credentialspassword
  • WRITE_DB_PASSWORD<fullname>-write-db-credentialspassword
  • HATCHET_DB_PASSWORD<fullname>-hatchet-db-credentialspassword

The app secret (knowledge-tree-secrets) now only needs:

  • openrouter-api-key, openai-api-key, brave-key, serper-key
  • jwt-secret-key
  • google-oauth-client-id, google-oauth-client-secret
  • hatchet-client-token

🤖 Generated with Claude Code

Read DB passwords from CNPG credential secrets by default, with
configurable override via credentialsSecret field per database.

Each DB section (graphDb, writeDb, hatchetDb) now accepts:
  credentialsSecret: ""  # empty = use CNPG-generated <name>-credentials
  credentialsSecret: "my-custom-secret"  # use custom secret (key: password)

Remove DB password keys from the chart-managed app secret. The app
secret now only contains API keys, JWT, OAuth, and Hatchet token.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@charlie83Gs charlie83Gs force-pushed the fix/helm-use-cnpg-secrets branch from c2bce94 to 1c9a170 Compare March 23, 2026 17:55
@charlie83Gs charlie83Gs merged commit 55b301e into main Mar 23, 2026
3 checks passed
@charlie83Gs charlie83Gs deleted the fix/helm-use-cnpg-secrets branch March 23, 2026 17:55
charlie83Gs added a commit that referenced this pull request Mar 27, 2026
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
charlie83Gs added a commit that referenced this pull request Apr 5, 2026
Critical:
- #1: Validate schema names with strict ^[a-z0-9_]+$ regex before DDL
- #2: Escape ILIKE special chars (%, _, \) in graph_nodes search
- #3: Replace cached Graph ORM instances with frozen GraphInfo dataclass
  to prevent DetachedInstanceError

High:
- #4: Reuse system session factories for default graph (no duplicate pools)
  via default_graph_session_factory/default_write_session_factory params
- #5: Add 23 unit tests — GraphInfo, GraphSessions, GraphSessionResolver,
  slug/schema validation, CreateGraphRequest, role validation
- #6: Scope sync watermarks by graph_slug — SyncEngine now passes
  graph_slug to _get_watermark/_set_watermark, composite PK on
  (table_name, graph_slug)

Medium:
- #7: Replace N+1 member count queries with batch GROUP BY
- #8: Replace catch { // ignore } with console.error in frontend
- #9: Engine pool disposal on GraphSessionResolver.invalidate()
- #10: Run Alembic migrations during graph provisioning
- #11: (node_count in list deferred — requires cross-schema queries)

Low:
- #13: Replace "Cycle Role" button with role dropdown
- #14: require_writer/require_graph_admin kept for future endpoints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
charlie83Gs added a commit that referenced this pull request Apr 5, 2026
- #2/#14: Fix MCP scope check — empty scopes = unrestricted access
  (graph_slugs=null tokens and SKIP_AUTH both work again). Only tokens
  with explicit graph:* scopes are restricted to those graphs.
- #3: Block reserved PG schema names (public, pg_catalog, pg_toast,
  pg_temp, information_schema, pg_*) in validate_schema_name()
- #4: Fix scalar_one() → scalar_one_or_none() in resolve_by_slug
  (introduced by session-release refactor in prior commit)
- #10: Sync raises RuntimeError instead of returning error dict when
  graph_resolver is unavailable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant