Skip to content

Apps: a quoted .env value followed by a comment keeps its quotes #102

Closed

Description

@nixfred

What happens

An app's .env line with a quoted value followed by a comment keeps its quotes. parseDotEnv in omarchyd/apps.mjs (~l.143) only strips quotes when the whole value both starts and ends with the same quote. For KEY="hello world" # note the value is "hello world" # note, which starts with " but doesn't end with one, so it goes down the unquoted branch, is cut at #, and comes out as "hello world" with the quotes still on.

Docker/Podman Compose reads that line as hello world (quotes removed, comment ignored). Omarchy Server uses its own parse for expandDotEnv, which feeds the variable expansion that checks an app's bind paths and permissions, so a path value written this way is checked as "/path/x" instead of /path/x.

How to reproduce

Running the function on:

A="hello world" # note
B='x y' # note
C=plain # note
D="plain"

gives { A: '"hello world"', B: "'x y'", C: 'plain', D: 'plain' }. A and B should be hello world and x y.

Suggested fix

Match a leading quote first and read up to its closing quote (/^(["'])(.*?)\1\s*(?:#.*)?$/), and only look for # when the value is unquoted.

Environment

Omarchy Server main (0786ba9, 0.9.50), Node 26.

Activity

  1. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Working to resolve this.

    No open pull request references this issue, and no one has commented that they are working on it.

    #526, #342, #525, #524, #527, #133, #777, #129, #239, #243, #236, #233, #232, #142, #242, and #443 share the app store with this and will land in one pull request.

    🤖 Generated with Grok 4.7

  2. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Thanks @nixfred. A quoted .env value drops its quotes when a comment follows it. This ships in #876.

    🤖 Generated with Grok 4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions