feat(services): env doctor — surface empty vars, bad refs, unreadable secrets

GET /services/:id/env-check (read scope) reports, without exposing values:
- unresolved: ${{service.KEY}} refs that don't match a sibling service/env
- empty: variables with blank values
- unreadable: secrets whose ciphertext fails decryption (key rotation)

install.sh now generates SECRETS_KEY explicitly (was falling back to
JWT_SECRET — a rotation would orphan ciphertext). .env.example documents it.

Surfaces: CLI `services env-check`, MCP containr_services_env_check
(90 tools), OpenAPI path, and a warning banner in the service Variables
panel listing each issue.

Verified live: injected a bogus ${{nosuchservice.PORT}} var plus an
unreadable ciphertext row; the endpoint flagged both, ok=false.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-10-09 00:27:23 +02:00
1 parent dbc87bf34c
commit d135e5fd4b
13 files changed
+269 -3

No files matched your search

+35
View File
@@ -685,6 +685,41 @@ paths:
'202':
description: Wake initiated
/services/{id}/env-check:
get:
tags:
- Services
summary: Environment diagnostics
description: Reports empty variables, unresolved ${{service.KEY}} references, and secrets whose stored ciphertext fails to decrypt. Values are never returned.
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Diagnostic result
content:
application/json:
schema:
type: object
properties:
ok:
type: boolean
unresolved:
type: array
items:
type: string
empty:
type: array
items:
type: string
unreadable:
type: array
items:
type: string
/internal/wake/{id}:
get:
tags: