Skip to content

Improve .env parser handling for quoted values #3018

@abhay-dev2901

Description

@abhay-dev2901

🔖 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: #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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions