Skip to content

docs(env): slim .env.example to essentials and fill env-var doc gaps - #624

Merged
Ahmath-Gadji merged 11 commits into
refactor/hexagonalfrom
docs/simplify-env-example
Jul 7, 2026
Merged

docs(env): slim .env.example to essentials and fill env-var doc gaps#624
Ahmath-Gadji merged 11 commits into
refactor/hexagonalfrom
docs/simplify-env-example

Conversation

@Ahmath-Gadji

@Ahmath-Gadji Ahmath-Gadji commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Draft — more commits (API endpoint docs) to follow.

Simplifies infra/compose/.env.example down to only the variables needed to boot the default compose stack, and closes the gaps where variables shipped in .env.example but weren't documented anywhere.

Changes

infra/compose/.env.example (228 → ~65 lines)

  • Keeps only must-set-to-boot vars: LLM, VLM, embedder, required secrets (MinIO / Postgres), API + Chainlit auth, admin/indexer UI port, and the Ray operational block.
  • Header points to the env vars reference for every other knob.
  • The 4 RAY_* lines are kept deliberately: they're supplied only via .env (not baked into images/compose/entrypoint), and RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 is flagged critical for recent uv.

docs/assets/env_example.env (quickstart-displayed snippet)

  • Synced to match — it previously omitted the required MinIO/Postgres secrets, so anyone copying from the quickstart display would have missed them.

docs/.../env_vars.md

  • Documents vars that existed in .env.example but nowhere in the docs: MinIO credentials, rate limiting (RATE_LIMIT_*), the MCP server (OPENRAG_MCP_*), MAX_PARTITIONS_PER_USER, MAX_UPLOAD_SIZE_MB, UVICORN_FORWARDED_ALLOW_IPS, APP_UID.
  • Adds a same-origin reverse-proxy mermaid diagram to the Admin UI section, explaining why VITE_API_BASE_URL is empty by default.
  • All defaults verified against source (mcp.py, rate_limit.py, partition_limits.py, files.py, main.py, compose).

Still TODO (later commits)

  • New API endpoints missing from the API docs.

Notes

  • GRAFANA_ADMIN_PASSWORD is ${...:?}-required by the monitoring profile but is neither in .env.example nor documented — flagged, out of scope for this pass.

Summary by CodeRabbit

  • New Features
    • Expanded API documentation and endpoint coverage, including extracts, pipeline presets, model endpoint management, and more detailed partition/file controls.
  • Documentation
    • Updated deployment/quickstart to align with the current infra/compose workflow and streamlined compose commands.
    • Refreshed environment templates and config docs, including PDFLOADER (PyMuPDF default with scanned/OCR guidance via MarkerLoader), rate limiting, storage, access control, and MCP settings.
    • Removed outdated quick-start, MacOS, usage, and deprecated compose assets.
  • Bug Fixes
    • Corrected shared environment file mounting behavior for compose-based setups.
  • Tests
    • Updated unit tests to reflect the revised compose/admin UI configuration.

Reduce infra/compose/.env.example to only the variables required to boot
the default compose stack (LLM, VLM, embedder, required secrets, auth,
Ray), with a header pointing to the env-vars reference for everything
else. Sync the quickstart-displayed snippet (docs/assets/env_example.env)
so it no longer omits the required MinIO/Postgres secrets.

Document variables that existed in .env.example but nowhere in the docs:
MinIO credentials, rate limiting (RATE_LIMIT_*), the MCP server
(OPENRAG_MCP_*), MAX_PARTITIONS_PER_USER, MAX_UPLOAD_SIZE_MB,
UVICORN_FORWARDED_ALLOW_IPS and APP_UID. Add a same-origin reverse-proxy
diagram to the Admin UI section explaining why VITE_API_BASE_URL is empty
by default.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca510325-056a-4b43-b226-0b7e10427e3b

📥 Commits

Reviewing files that changed from the base of the PR and between 9547618 and 753e3e3.

📒 Files selected for processing (5)
  • docs/assets/env_example.env
  • docs/content/docs/documentation/env_vars.md
  • docs/content/docs/getting_started/quickstart.mdx
  • infra/compose/.env.example
  • infra/compose/docker-compose.yaml
✅ Files skipped from review due to trivial changes (1)
  • docs/content/docs/getting_started/quickstart.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/content/docs/documentation/env_vars.md
  • infra/compose/.env.example
  • docs/assets/env_example.env

📝 Walkthrough

Walkthrough

Docs, environment templates, and API reference content were updated to match the infra/compose layout, new default PDF loader guidance, minimized .env templates, expanded configuration docs, and additional API endpoint documentation.

Changes

Deployment docs and env template migration

Layer / File(s) Summary
Quick-start removal and compose-based deployment instructions
CLAUDE.md, README.md, docs/content/docs/getting_started/quickstart.mdx, infra/quick_start/*, tests/unit/infra/test_compose_storage.py
Removes the quick_start/ layout reference, rewrites launch/run/inference instructions around infra/compose/, and removes obsolete quick-start compose assets and storage tests.
Default PDF loader guidance
README.md, docs/content/docs/getting_started/quickstart.mdx, docs/content/docs/documentation/env_vars.md, docs/assets/env_example.env, infra/compose/.env.example
Documents PyMuPDFLoader as the default parser with scanned/OCR limitations and adds MarkerLoader switching guidance via PDFLOADER.
Minimal .env templates and compose wiring
docs/assets/env_example.env, infra/compose/.env.example, infra/compose/docker-compose.yaml, docs/assets/compose_ollama_cpu.yaml, docs/assets/env_ollama_cpu.env, tests/unit/infra/test_admin_ui_compose.py
Condenses env templates to the minimal boot set, removes old Ollama quick-start env/compose assets, fixes the shared env mount path, and updates the admin-ui compose test expectations.
Expanded env_vars.md configuration sections
docs/content/docs/documentation/env_vars.md
Adds MinIO storage, rate limiting, expanded Admin UI, and MCP Server sections, and updates Whisper worker default and a Ray Serve port link.

Estimated code review effort: 3 (Moderate) | ~25 minutes

API documentation for extracts, partitions, presets, and model endpoints

Layer / File(s) Summary
New and updated API endpoint documentation
docs/content/docs/documentation/API.mdx
Adds Extracts endpoint docs, rewrites Partitions & files Management with role-based access, updates the file ancestors route, and adds Pipeline Presets and Model Endpoints sections.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • linagora/openrag#616: Updates around admin-ui compose naming and port mapping are directly related to the admin UI compose/test changes here.
  • linagora/openrag#591: The compose .env.example template changes overlap with earlier env-configuration hardening work.

Suggested labels: fix

Suggested reviewers: hedhoud

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: slimming .env.example and filling environment-variable documentation gaps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/simplify-env-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The single-file quick_start compose is superseded by the full stack under
infra/compose/. Drop the folder, the CLAUDE.md layout reference, and the two
unit tests that loaded the now-deleted compose assets
(infra/quick_start/vdb/milvus.yaml and docs/assets/compose_ollama_cpu.yaml).
The bundled vLLM CPU profile is the supported CPU path; drop the parallel
ollama compose asset, its env sample, and infra/compose/.env.ollama.
Collapse the quickstart onto the single supported path (the full stack under
infra/compose/), make PyMuPDFLoader the documented default PDF parser, and drop
the now-redundant mac-specific quickstart and standalone usage pages (their
content is consolidated into the main quickstart).
@Ahmath-Gadji
Ahmath-Gadji marked this pull request as ready for review July 7, 2026 07:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/content/docs/documentation/API.mdx (1)

466-511: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the error behavior for deleting/renaming a default preset.

Line 468 states the default preset of each type cannot be deleted or renamed-style constraint (i.e., "the default preset of each type cannot be deleted or renamed"), but the PUT/DELETE endpoint docs at 503-509 don't mention what response (e.g., 400/403) callers should expect when they attempt this. Adding the error case would make the contract complete for API consumers.

📝 Suggested addition
 `PUT` accepts a partial body (`name` to rename and/or `config`; at least one required) and returns the updated preset. `DELETE` returns `204 No Content`.
+
+Attempting to rename or delete a `default` preset returns `400 Bad Request`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/documentation/API.mdx` around lines 466 - 511, The preset
endpoint docs for the Get / Update / Delete section omit the failure behavior
for protected defaults. Update the `PUT /presets/{preset_type}/{name}` and
`DELETE /presets/{preset_type}/{name}` documentation to explicitly state what
happens when callers try to rename or delete the `default` preset for either
type, including the expected error response and a brief error description. Use
the existing `Preset`/`preset_type` route section as the anchor for where to add
this note so the contract is clear for API consumers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/content/docs/documentation/API.mdx`:
- Around line 466-511: The preset endpoint docs for the Get / Update / Delete
section omit the failure behavior for protected defaults. Update the `PUT
/presets/{preset_type}/{name}` and `DELETE /presets/{preset_type}/{name}`
documentation to explicitly state what happens when callers try to rename or
delete the `default` preset for either type, including the expected error
response and a brief error description. Use the existing `Preset`/`preset_type`
route section as the anchor for where to add this note so the contract is clear
for API consumers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 958bd9e9-77c9-4ae9-b1e1-47ad4ce9da70

📥 Commits

Reviewing files that changed from the base of the PR and between 123607e and ba8b4d6.

📒 Files selected for processing (17)
  • CLAUDE.md
  • README.md
  • docs/assets/compose_ollama_cpu.yaml
  • docs/assets/env_example.env
  • docs/assets/env_ollama_cpu.env
  • docs/content/docs/documentation/API.mdx
  • docs/content/docs/documentation/env_vars.md
  • docs/content/docs/getting_started/quickstart.mdx
  • docs/content/docs/getting_started/quickstart_mac.mdx
  • docs/content/docs/getting_started/usage.mdx
  • infra/compose/.env.example
  • infra/compose/.env.ollama
  • infra/quick_start/docker-compose.yaml
  • infra/quick_start/extern/infinity.yaml
  • infra/quick_start/extern/vllm/Dockerfile.cpu
  • infra/quick_start/vdb/milvus.yaml
  • tests/unit/infra/test_compose_storage.py
💤 Files with no reviewable changes (11)
  • docs/content/docs/getting_started/usage.mdx
  • infra/quick_start/vdb/milvus.yaml
  • infra/quick_start/extern/vllm/Dockerfile.cpu
  • infra/compose/.env.ollama
  • docs/content/docs/getting_started/quickstart_mac.mdx
  • docs/assets/compose_ollama_cpu.yaml
  • infra/quick_start/extern/infinity.yaml
  • docs/assets/env_ollama_cpu.env
  • CLAUDE.md
  • infra/quick_start/docker-compose.yaml
  • tests/unit/infra/test_compose_storage.py

Keep only the must-set variables in .env.example with inline guidance (external
LLM/VLM/embedder/reranker, PDFLOADER, image captioning), ship working dev
defaults for the MinIO/Postgres secrets with a production warning, and document
the PDFLOADER default (PyMuPDFLoader) plus whisper worker count in the env-var
reference. Keep docs/assets/env_example.env in sync as the canonical mirror.
…routes

Add reference sections for the admin pipeline-preset registry (/presets) and
model-endpoint registry (/model-endpoints), enrich the document-extract
endpoint with its real response shape and error cases, and complete the
Partitions & files section (CRUD, chunks, pipeline config, members) with the
correct /partition-prefixed paths.
The ollama quickstart compose asset was removed in this PR, but
test_ollama_compose_admin_ui_honors_port_override still read it and
failed CI with FileNotFoundError.
@Ahmath-Gadji
Ahmath-Gadji force-pushed the docs/simplify-env-example branch from 852241c to 7392252 Compare July 7, 2026 08:33
@Ahmath-Gadji
Ahmath-Gadji marked this pull request as ready for review July 7, 2026 08:49
@Ahmath-Gadji

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

…mplify-env-example

# Conflicts:
#	infra/compose/.env.ollama

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/content/docs/documentation/env_vars.md (1)

25-33: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the PDF loader default mismatch.

This section now says PDFLOADER defaults to PyMuPDFLoader, but the Marker subsection still calls MarkerLoader the default parser. That contradiction will mislead users about the actual startup path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/documentation/env_vars.md` around lines 25 - 33, The PDF
loader documentation is inconsistent about the default parser: the `PDFLOADER`
table says `PyMuPDFLoader` is the default, while the `Marker Loader
Configuration` section still describes `MarkerLoader` as the default. Update the
`MarkerLoader` subsection in the env vars doc to match the actual default set by
`PDFLOADER`, and adjust the wording so only one default is described
consistently across both the `PDFLOADER` entry and the `MarkerLoader` section.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/docs/documentation/API.mdx`:
- Line 358: The in-page backlink for the Pipeline Presets reference points to
the wrong anchor and may not resolve. Update the link target in the API.mdx
content to match the rendered slug for the `### 🧩 Pipeline Presets` heading,
and verify the markdown link text still references the preset section correctly.
- Around line 286-294: The chunk payload schema is inconsistent because the
extract response uses page_content while the chunk-listing response documents
content for the same text field. Update the API docs to use the same field name
as the actual serializer across both responses, and align the chunk-listing
example with page_content so clients see one consistent schema.

---

Outside diff comments:
In `@docs/content/docs/documentation/env_vars.md`:
- Around line 25-33: The PDF loader documentation is inconsistent about the
default parser: the `PDFLOADER` table says `PyMuPDFLoader` is the default, while
the `Marker Loader Configuration` section still describes `MarkerLoader` as the
default. Update the `MarkerLoader` subsection in the env vars doc to match the
actual default set by `PDFLOADER`, and adjust the wording so only one default is
described consistently across both the `PDFLOADER` entry and the `MarkerLoader`
section.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 37a0db98-d76c-4b31-976b-d2a6b7fdac7c

📥 Commits

Reviewing files that changed from the base of the PR and between ba8b4d6 and b10c2f0.

📒 Files selected for processing (5)
  • docs/assets/env_example.env
  • docs/content/docs/documentation/API.mdx
  • docs/content/docs/documentation/env_vars.md
  • infra/compose/.env.example
  • tests/unit/infra/test_admin_ui_compose.py
💤 Files with no reviewable changes (1)
  • tests/unit/infra/test_admin_ui_compose.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/assets/env_example.env

Comment thread docs/content/docs/documentation/API.mdx
Comment thread docs/content/docs/documentation/API.mdx
…tract

The chunk-listing endpoint returns chunk text under `content` while the
single-extract endpoint returns it under `page_content` (they use different
serializers). Document the difference so clients aren't surprised.

@hedhoud hedhoud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup here. I found two setup mismatches that I think should be fixed before approval. The other notes are small docs cleanup.

Comment thread infra/compose/.env.example
Comment thread docs/content/docs/getting_started/quickstart.mdx Outdated
Comment thread docs/content/docs/documentation/env_vars.md
Comment thread infra/compose/.env.example Outdated
The mount was /$SHARED_ENV:/ray_mount/.env with no default, so an unset
SHARED_ENV (the case for the slim .env.example) mounted host / into the
container. Use ${SHARED_ENV:-./.env}, matching the env_file directive below it.
…& whitespace

- quickstart: the bundled embedder (vllm) and reranker DO start by default;
  document how to switch to external endpoints instead of implying external-only.
- env_vars: the Marker section no longer calls MarkerLoader the default.
- drop trailing whitespace in .env.example and its docs mirror.
@coderabbitai coderabbitai Bot added the fix Fix issue label Jul 7, 2026

@hedhoud hedhoud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked the latest update. The setup comments are fixed now: the env mount has a safe fallback, the quickstart matches the compose behavior, the PDF loader wording is consistent, and the whitespace cleanup is done. I also verified the compose config, docs build, and infra tests. LGTM.

@Ahmath-Gadji
Ahmath-Gadji merged commit 13562ad into refactor/hexagonal Jul 7, 2026
6 checks passed
@Ahmath-Gadji
Ahmath-Gadji deleted the docs/simplify-env-example branch July 7, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants