Improve .env parser handling for quoted values

Open
#3,018 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
tooling

Research direction

Start by locating the Console's .env parser and reviewing the related PR #3015, which already adds coverage for the described behavior. Check the parser tests for separators, whitespace, wrapping quotes, embedded quotes, embedded separators, line endings, comments, malformed lines, and empty values; done means those cases preserve values correctly while still removing wrapping quotes.

Written by the indexing model from the issue text.

Description

🔖 Enhancement description

The Console's .env parser should only remove wrapping single or double quotes from imported environment variable values, while preserving quotes
that are part of the actual value.

Currently, quote characters inside values can be removed unintentionally. For example:

AUTHOR=O'Brien
MESSAGE=Say "hello"

These values should be parsed as:

{
    AUTHOR: "O'Brien",
    MESSAGE: 'Say "hello"'
}

The parser should still support existing behavior for wrapped values:

NAME='Appwrite'
MESSAGE="Hello world"

🎤 Pitch

Environment variable imports should preserve the exact value users provide, except for common .env wrapping quotes. Quotes can be meaningful in
secrets, connection strings, messages, and other configuration values.

This improves reliability for users importing .env files into Console and prevents accidental value changes during parsing.

The related PR adds coverage for .env parser behavior, including:

  • = and : separators
  • whitespace trimming
  • wrapped single and double quotes
  • quotes inside values
  • values containing = or :
  • CRLF line endings
  • comments, malformed lines, and empty values

Related PR: https://github.com/appwrite/console/pull/3015

👀 Have you spent some time to check if this issue has been raised before?
  • I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
Dominant language
Svelte
Stars
394
Forks
259
Avg merge
5h 52m
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from appwrite/console

All issues in appwrite/console

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.