Skip to content

Improvement: Move non-platform env vars out of root .env into web/docs/.env.dev #2800

Description

@yannickmonney

Problem

Root .env / .env.example still document secrets and knobs that are not platform-service configuration. Those belong next to the consumer (services/web/, docs tooling) or in the gitignored .env.dev when they are development-only.

Current behaviour

  • ELEVENLABS_API_KEY is listed in root .env.example (~L363–368) even though the docs-video pipeline already tells authors to keep it in gitignored root .env.dev (services/platform/tests/docs-videos/README.md, doctor.ts, tts.ts).
  • Web Discord form delivery uses WEB_DISCORD_WEBHOOK_URL in services/web/.env.example / services/web/server.ts — correct home — but similar non-platform vars must not accumulate in the root platform env surface (and must stay out of platform service env sync).
  • Root .env.example is the operator-facing platform config contract; putting docs TTS or marketing-form secrets there blurs “required to run the platform” vs “optional tooling / other services”.

Proposed change

  • Audit root .env.example (and any loaders that merge it) for vars unrelated to running platform services.
  • Move each to the right home:
    • Web-onlyservices/web/.env.example (and web README).
    • Docs / docs-videos / other service → that service’s .env.example or docs.
    • Dev-tooling only (e.g. ElevenLabs narration) → document and load from .env.dev only; remove from root .env.example (keep a short pointer comment if useful).
  • Update doctor scripts, README, and any sync paths so nothing still expects the old location.

Acceptance criteria

  • Root .env.example no longer lists ELEVENLABS_API_KEY (or peers) as platform config; .env.dev / docs-videos docs are the source of truth.
  • Web Discord (and any other web-only) vars live only under services/web/ env docs — not duplicated as platform requirements.
  • Sweep finds no other misplaced non-platform keys left in root .env.example without an explicit “pointer comment only” rationale.
  • Docs-videos doctor / README paths still work after the move.

Affected service

Repo-wide env layout (platform docs-videos, web); not a runtime product feature.

Related

#2787 (PostHog epic will replace Discord forms later — still move Discord out of any wrong root surface now). Closed #2389.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions