Skip to content

Commit 93d10f1

Browse files
lfnovoclaude
andauthored
docs: align env-var fallback messaging as deprecated across surfaces (#1324)
Reconcile .env.example, ollama.md and environment-reference.md on a single story for AI provider environment variables: they are a deprecated fallback that still works today, with no guarantee it keeps working, and new automation should not be built on it. Settings → API Keys is the supported path; the declarative provisioning contract for headless setups is tracked in Discussion #765. Closes #1135 Claude-Session: https://claude.ai/code/session_01Bd92gaJSdXogEBiRMEQYXQ Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent ab27ff4 commit 93d10f1

3 files changed

Lines changed: 22 additions & 10 deletions

File tree

.env.example

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ SURREAL_NAMESPACE=open_notebook
2323
SURREAL_DATABASE=open_notebook
2424

2525
# =============================================================================
26-
# OPTIONAL: AI Provider API Keys
26+
# DEPRECATED: AI Provider API Keys (environment-variable fallback)
2727
# =============================================================================
28-
# You can configure these via the UI (Settings → API Keys) or set them here
29-
# UI configuration is recommended for better security and flexibility
28+
# Configure AI providers via the UI: Settings → API Keys. Credentials are
29+
# stored encrypted, can be rotated without restarts, and support multiple
30+
# credentials per provider.
31+
#
32+
# The environment variables below are a DEPRECATED fallback. They still work
33+
# today, but there is no guarantee they keep working in future releases, and
34+
# new automation should not be built on them. A declarative provisioning
35+
# contract for headless/CI/Docker setups is being designed in
36+
# https://github.com/lfnovo/open-notebook/discussions/765
3037

3138
# OpenAI
3239
# OPENAI_API_KEY=sk-...
@@ -47,10 +54,11 @@ SURREAL_DATABASE=open_notebook
4754
# External API URL (for webhooks, callbacks, etc.)
4855
# API_URL=http://localhost:5055
4956

50-
# Ollama endpoint (if running locally)
57+
# Ollama endpoint — DEPRECATED fallback, configure via Settings → API Keys instead
5158
# OLLAMA_API_BASE=http://localhost:11434
5259

53-
# oMLX (Apple Silicon) — prefer Settings → API Keys; port 11435 avoids SurrealDB on 8000
60+
# oMLX (Apple Silicon) — DEPRECATED fallback, configure via Settings → API Keys instead
61+
# Port 11435 avoids clashing with SurrealDB on 8000
5462
# OMLX_API_BASE=http://localhost:11435/v1
5563
# OMLX_API_KEY= # optional; only if oMLX was started with --api-key
5664

docs/5-CONFIGURATION/environment-reference.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ env | grep -E "^[A-Z_]+=" | sort
259259
- **Quote values:** Use quotes for values with spaces: `API_URL="http://my server:5055"`
260260
- **Restart required:** Changes take effect after restarting services
261261
- **Secrets:** Don't commit encryption keys or passwords to git
262-
- **AI Providers:** Configure via **Settings → API Keys** in the browser (not via env vars)
262+
- **AI Providers:** Configure via **Settings → API Keys** in the browser. The provider env vars listed under [Legacy](#legacy-ai-provider-environment-variables-deprecated) are a deprecated fallback
263263
- **Migration:** Use Settings UI to migrate existing env vars to the credential system. See [API Configuration](../3-USER-GUIDE/api-configuration.md#migrating-from-environment-variables)
264264

265265
---
@@ -283,7 +283,11 @@ Done!
283283

284284
## Legacy: AI Provider Environment Variables (Deprecated)
285285

286-
> **Deprecated**: The following AI provider API key environment variables are deprecated. Configure providers via the Settings UI instead. These variables may still work as a fallback but are no longer recommended.
286+
> **Deprecated**: The following AI provider environment variables are a deprecated fallback. They still work today (the runtime reads the database first and falls back to the environment), but there is no guarantee they keep working in future releases, and new automation should not be built on them. Configure providers via **Settings → API Keys** instead.
287+
288+
Why the UI is the source of truth: credentials in the database are encrypted at rest (via `OPEN_NOTEBOOK_ENCRYPTION_KEY`), can be added or rotated at runtime without restarts, and support multiple credentials per provider — none of which a single env var can express.
289+
290+
**Headless, CI/CD and Docker deployments:** a declarative provisioning contract over the credentials API (a file describing providers and credentials, with `${VAR}`-style references resolved from the environment) is being designed in [Discussion #765](https://github.com/lfnovo/open-notebook/discussions/765). Until it ships, the env fallback is the only unattended path — use it knowing it is deprecated.
287291

288292
If you have these variables configured from a previous installation, click the **Migrate to Database** button in **Settings → API Keys** to import them into the credential system, then remove them from your configuration.
289293

docs/5-CONFIGURATION/ollama.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ ollama pull mxbai-embed-large # Best embedding model for Ollama
4545
4. Click **Save**, then **Test Connection**
4646
5. Click **Discover Models****Register Models**
4747

48-
**Legacy (Deprecated) — Environment variables:**
48+
**Environment variable fallback (Deprecated):**
4949
```bash
5050
# For local installation:
5151
export OLLAMA_API_BASE=http://localhost:11434
5252
# For Docker installation:
5353
export OLLAMA_API_BASE=http://host.docker.internal:11434
5454
```
5555

56-
> **Note**: The `OLLAMA_API_BASE` environment variable is deprecated. Configure Ollama via Settings → API Keys instead.
56+
> **Deprecated**: `OLLAMA_API_BASE` is a deprecated fallback. It still works today, but there is no guarantee it keeps working in future releases, and new automation should not be built on it. Configure Ollama via **Settings → API Keys** instead. For headless/CI/Docker setups, see the [environment reference](environment-reference.md#legacy-ai-provider-environment-variables-deprecated) and the provisioning discussion in [#765](https://github.com/lfnovo/open-notebook/discussions/765).
5757
5858
## Network Configuration Guide
5959

@@ -543,7 +543,7 @@ export OLLAMA_NUM_PARALLEL=4 # Parallel request handling
543543
export OLLAMA_FLASH_ATTENTION=1 # Enable flash attention (if supported)
544544
545545
# Open Notebook configuration (configure via Settings → API Keys instead)
546-
# OLLAMA_API_BASE=http://localhost:11434 # Deprecated — use Settings UI
546+
# OLLAMA_API_BASE=http://localhost:11434 # Deprecated fallback — works today, no guarantee
547547
```
548548

549549
### SSL Configuration (Self-Signed Certificates)

0 commit comments

Comments
 (0)