Strip quotes from .env values that have a trailing comment
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- backend
Research direction
Read server/env.mjs:13-24 and the .env parsing test in test/core.test.mjs:104-106. Run npm test to see the current behavior, then add the two quoted values with trailing comments to the existing test. Done means both values parse without their quotes and npm test passes.
Written by the indexing model from the issue text.
Description
parseEnv() only removes surrounding quotes when the whole value both starts and ends with a quote. A quoted value followed by an inline comment, which is the style .env.example itself uses, keeps its quotes:
parseEnv('A="abc" # note\nB=\'x y\' # c')
// → { A: '"abc"', B: "'x y'" } expected { A: 'abc', B: 'x y' }
The value starts with " but ends with e, so it falls through to the comment-stripping branch. That branch removes # note and leaves the quotes. Someone who writes OPENAI_API_KEY="sk-…" # work account sends the literal quotes in the Authorization header and gets a 401 "check the API key".
Task: when the value opens with a quote, take everything up to the matching closing quote and ignore the rest of the line. Add both cases above to the existing .env parsing test.
Where: server/env.mjs:13-24 (parseEnv), test at test/core.test.mjs:104-106.
Done when: parseEnv('A="abc" # note\nB=\'x y\' # c') returns { A: 'abc', B: 'x y' }, both cases are in the .env parsing test, and npm test passes.
Getting started: Node 22, no npm install needed: git clone, then npm test and npm run check. Comment here to claim it. Questions → Discord.
- Dominant language
- JavaScript
- Stars
- 42
- Forks
- 6
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blixvip/GenMotion
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
accessibility good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
All issues in blixvip/GenMotion
Similar issues
-
🐛 bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LibreChat-AI/LibreChat#17887 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
liveshowy/webauthn_components#118 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
showdownjs/showdown#1113 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dependents/node-precinct#167 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
volumio/volumio-plugins-sources-bookworm#279 · 1 comment ·
Maintainers usually reply within 1 day