The env setting only picks the log format, and the image sets an ENV the console never reads #251

Open
opened 2026-10-23 07:09:49 +00:00 by cgalo5758 · 0 comments
Owner

What a contributor runs into

env (MC_ENV) is named like an environment mode, but it selects text or JSON logs and nothing else (internal/logging/logging.go:33); it is also printed as a label in two log lines. The docs have to add "Nothing security-relevant hangs off it" (docs/environment-reference.md). The Dockerfile sets ENV=production (Dockerfile:43-44), which nothing reads, since the console reads MC_ENV, so the image writes text logs unless the host sets MC_ENV.

Why it costs

A setting named for a mode invites behaviour to hang off it again, as the session cookie's Secure flag once did, and #23 first proposed exempting a "development mode" from its check for the same reason. A host reading the Dockerfile believes the image runs in a production mode.

Where

  • cmd/start.go (the env flag and its default)
  • internal/logging/logging.go
  • cmd/seed_demo.go
  • Dockerfile:43-44
  • docs/environment-reference.md, docs/production-deployment.md

Done when

The setting is named for what it does (log-format: text or json), the Dockerfile sets no variable that nothing reads, and the docs state the image's default log format.

### What a contributor runs into `env` (`MC_ENV`) is named like an environment mode, but it selects text or JSON logs and nothing else (`internal/logging/logging.go:33`); it is also printed as a label in two log lines. The docs have to add "Nothing security-relevant hangs off it" (`docs/environment-reference.md`). The Dockerfile sets `ENV=production` (`Dockerfile:43-44`), which nothing reads, since the console reads `MC_ENV`, so the image writes text logs unless the host sets `MC_ENV`. ### Why it costs A setting named for a mode invites behaviour to hang off it again, as the session cookie's `Secure` flag once did, and #23 first proposed exempting a "development mode" from its check for the same reason. A host reading the Dockerfile believes the image runs in a production mode. ### Where - `cmd/start.go` (the `env` flag and its default) - `internal/logging/logging.go` - `cmd/seed_demo.go` - `Dockerfile:43-44` - `docs/environment-reference.md`, `docs/production-deployment.md` ### Done when The setting is named for what it does (`log-format`: `text` or `json`), the Dockerfile sets no variable that nothing reads, and the docs state the image's default log format.
cgalo5758 added the
kind
debt
area/ops
labels 2026-10-23 07:09:49 +00:00
Sign in to join this conversation.
No labels area/ops
kind
debt
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#251