From 237460522016d5321b6303bc7944efb772d28999 Mon Sep 17 00:00:00 2001 From: Tobias Grosse-Puppendahl Date: Fri, 5 Jun 2026 09:42:27 +0200 Subject: [PATCH 1/9] feat(federation): allow env-gated unsigned DuckDB extension installs Add an opt-in DUCKDB_ALLOW_UNSIGNED_EXTENSIONS env var. When enabled, project DuckDB instances are created with allow_unsigned_extensions and the federation console accepts `INSTALL FROM ''` for custom repositories or paths. Default-off preserves current behavior (signed core and community extensions only). Includes the OpenSpec change `add-unsigned-duckdb-extensions`. Co-authored-by: Cursor --- .env.example | 8 ++++ .../src/content/docs/reference/docker.mdx | 12 +++++ .../add-unsigned-duckdb-extensions/design.md | 37 ++++++++++++++++ .../proposal.md | 22 ++++++++++ .../specs/deployment/spec.md | 27 ++++++++++++ .../specs/duckdb-console/spec.md | 44 +++++++++++++++++++ .../add-unsigned-duckdb-extensions/tasks.md | 25 +++++++++++ packages/core/src/config/env.ts | 15 +++++++ .../core/src/services/duckdb-console.test.ts | 36 +++++++++++++++ packages/core/src/services/duckdb-console.ts | 28 +++++++++++- packages/core/src/services/duckdb.ts | 38 ++++++++++++---- 11 files changed, 282 insertions(+), 10 deletions(-) create mode 100644 openspec/changes/add-unsigned-duckdb-extensions/design.md create mode 100644 openspec/changes/add-unsigned-duckdb-extensions/proposal.md create mode 100644 openspec/changes/add-unsigned-duckdb-extensions/specs/deployment/spec.md create mode 100644 openspec/changes/add-unsigned-duckdb-extensions/specs/duckdb-console/spec.md create mode 100644 openspec/changes/add-unsigned-duckdb-extensions/tasks.md diff --git a/.env.example b/.env.example index e4611dd..2681774 100644 --- a/.env.example +++ b/.env.example @@ -55,3 +55,11 @@ AGENT_API_KEY=your-api-key # Limits parallel queries to prevent resource exhaustion. # Additional requests wait up to QUERY_TIMEOUT_MS for a slot. # MAX_CONCURRENT_QUERIES=10 + +# Allow installing unsigned DuckDB extensions from the federation console +# (default: disabled). When set to true, DuckDB instances start with +# allow_unsigned_extensions and the console accepts +# `INSTALL FROM ''` for custom repositories or paths. +# SECURITY: unsigned extensions run arbitrary native code in the app process. +# Only enable this for trusted extension sources. +# DUCKDB_ALLOW_UNSIGNED_EXTENSIONS=false diff --git a/apps/docs/src/content/docs/reference/docker.mdx b/apps/docs/src/content/docs/reference/docker.mdx index 9552294..6182538 100644 --- a/apps/docs/src/content/docs/reference/docker.mdx +++ b/apps/docs/src/content/docs/reference/docker.mdx @@ -74,6 +74,18 @@ If you access archmax through a reverse proxy, load balancer, or custom domain, |----------|---------|-------------| | `ARCHMAX_DATA_DIR` | `/data` | Root data directory for all persistent application data. Normally not changed in Docker. | +### Data Federation (DuckDB) + +| Variable | Default | Description | +|----------|---------|-------------| +| `QUERY_TIMEOUT_MS` | `30000` | Per-query DuckDB timeout in milliseconds. Applies to MCP, agent, data browser, and connection-test queries. On timeout the query is cancelled via `interrupt()`. | +| `MAX_CONCURRENT_QUERIES` | `10` | Max concurrent DuckDB queries per project. Additional requests wait up to `QUERY_TIMEOUT_MS` for a slot. | +| `DUCKDB_ALLOW_UNSIGNED_EXTENSIONS` | `false` | Allow installing unsigned extensions from the federation console. When enabled, DuckDB instances start with `allow_unsigned_extensions` and the console accepts `INSTALL FROM ''` for custom repositories or paths. | + + + ### AI Agent