Files
ai-agent/backend/envfile.py
Gabriel Vidal 2aa2bd196b feat(ai-agent): .env editor on the project page
Key/value editor for a project's .env, split into regular vars and
write-only secrets (everything below a '# --- secrets ---' comment).
Secret values never leave the server: GET lists their keys with a
hasValue flag, PUT diffs (set/unset) so comments, order and untouched
lines survive round trips.

- backend/envfile.py: vendored order/comment-preserving parser from
  account-manager's envfile.py, plus the secrets-section convention
  (new regular keys insert above the marker, secrets below; values
  stored verbatim, no Compose $$-escaping — projects use dotenv/Vite)
- GET/PUT /api/project-env in main.py, slug-scoped via _safe_entry
- EnvEditor widget on the Project page (draft/dirty per Webhooks
  pattern; lock toggle moves a var between sections without retyping)
- openapi.json re-dumped + orval regen (picks up previously undumped
  avatar/diff-blob routes too)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 20:43:39 +02:00

6.4 KiB