fix(env): move inline comments off value lines in .env.example#56
Merged
Conversation
systemd's `EnvironmentFile=` parser does NOT strip trailing inline
comments — `KEY=value # note` is read as the literal value
`value # note`. For numeric/enum vars this then fails the app's
zod env-schema at startup with errors like:
ATTACHMENT_MAX_BYTES: Invalid input: expected number, received NaN
Hit this on the first production deploy of mskanban.msk-scripts.de:
the .env had `ATTACHMENT_MAX_BYTES=26214400 # 25 MB` copied
verbatim from this file. Build/migrate/restart all succeeded;
Next.js refused to come up.
Two fields had the foot-gun (`ATTACHMENT_MAX_BYTES` and `LOG_LEVEL`);
moved both comments to the line above the value. Also added a short
note on `ATTACHMENT_MAX_BYTES` explaining why so the next contributor
doesn't reintroduce it.
Next.js' own dotenv loader DOES strip inline comments, so this only
affects deployments where systemd (or any other EnvironmentFile-
based loader) populates the env before the app runs. Docker / `next
start` invocations that go straight through Next's dotenv aren't
affected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Musiker15 <info@musiker15.de>
This was referenced May 25, 2026
Musiker15
added a commit
that referenced
this pull request
May 25, 2026
…#57) Two changes that ship together because they both prepare the upcoming v0.2.0-beta tag: 1. **CHANGELOG**: `[Unreleased]` (190 lines, multiple duplicate Added/Changed sections) is consolidated and renamed to `[0.2.0-beta] — 2026-05-25`. Missing entries for the recent #53–#56 (URL cleanup, auto-deploy + domain fix + env.example inline-comment fix) are added. A fresh `[Unreleased]` placeholder sits above. Link references at the bottom updated: [Unreleased]: ...compare/v0.2.0-beta...HEAD [0.2.0-beta]: ...compare/v0.1.0-beta...v0.2.0-beta 2. **release.yml**: adds an "Extract CHANGELOG section for this release" step before softprops/action-gh-release. It uses awk's `index()` (not regex) so awk-implementation differences over `\[` escaping can't break it, then writes the matching section to `release-body.md`. The action's `body_path:` prepends that to the auto-generated PR list — best of both: hand-curated narrative + complete commit/PR audit trail. The step also logs a `::warning::` and falls through to auto-only if the CHANGELOG has no matching section, so a future tag with no curated notes still produces a release. Verified locally with `awk -v marker="## [0.2.0-beta]" '...' CHANGELOG.md` — 53 lines extracted, no leakage from neighbouring sections. Signed-off-by: Musiker15 <info@musiker15.de> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Discovered live during the first production auto-deploy: the
.env.examplehad two values with inline# commentannotations, whichsystemd EnvironmentFile=does not strip. Result: the app refused to start withbecause
Number("26214400 # 25 MB")is NaN.This PR moves both comments to the line above the value:
ATTACHMENT_MAX_BYTES— also adds a short footnote explaining the foot-gun so the next contributor doesn't reintroduce itLOG_LEVEL— same treatment, comment-aboveWhy only these two
grep -nE '^[A-Za-z_].*=.*#' .env.examplereturns nothing after this PR. The rest of the file either has comments on their own lines already, or empty placeholder values.Affected setups
EnvironmentFile=(bare-metal Debian, the reference deployment): broken — fixed by this PR--env-file: same parsing semantics as systemd — also broken, also fixednext startwith Next.js's built-in dotenv loader: not affected — Next strips inline commentsTest plan
grep -nE '^[A-Za-z_].*=.*#' .env.examplereturns nothing🤖 Generated with Claude Code