Skip to content

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 05:46
· 228 commits to main since this release
2700c79

evnx v0.12.0

Why 0.12.0 and not 0.11.1: new commands (evnx parse, update --list),
and output that scripts read changes: doctor's syntax messages,
validate --format json's "location", and cloud pull exiting 4 when
declined. In 0.x either one is a minor bump.

⚠️ doctor's syntax messages are the parser's (B1). doctor checked
syntax with its own pattern, which passed files validate fails on
(P="a"junk, an undefined ${NOPE}); it now reports exactly what the parser
refuses, so the two agree. The wording changes —
Line 2: invalid syntax '!!bad' is now
Line 2: Invalid format: missing '=' separator — and the line's text is no
longer printed, since a line without = is sometimes a pasted secret.
Migrate: anything matching invalid syntax or the quote is never closed
in doctor's output should match .env: Line N: instead.

Added

  • evnx update --list: every copy of evnx on this machine (B5, RM-42).
    An older copy earlier on PATH runs instead of a new install, silently; it
    happened on the maintainer's own machines. --list walks PATH in order,
    then the folders installers use (cargo, npm, pipx, Homebrew, ~/.local/bin),
    counts a symlink and its target once, marks the copy that runs, and gives each
    copy's version and the command that removes it. It recommends keeping the
    newest, and says when the copy that runs is older. Versions come from what the
    installer left (Homebrew's Cellar, pip's dist-info, npm's package.json, the
    install script's receipt); a copy with none is run with --version, killed
    after two seconds, and the output says so (D7). No network; exit 0 however
    many copies (D8). --json gives count and copies.

  • Plain update and --check mention other copies in one line, and
    update --check --json gains other_copies. Plain update also says how
    old this build's source is, from the commit date compiled in by build.rs
    (SOURCE_DATE_EPOCH wins, for reproducible builds).

  • The install script leaves a receipt, install-receipt.json beside evnx's
    settings, naming the file it wrote and its version. update reads it before
    guessing a channel from the path.

  • npm and Homebrew warn about a shadowing copy. A global npm install warns
    when another evnx comes first on PATH; Homebrew's caveats say how to check.

  • EVNX_MASTER_PASSWORD unlocks vaults without a prompt (B4, D4), for a
    machine with no terminal that cannot use an API token. Every use prints a
    warning to stderr (never the value). It is a variable of its own:
    EVNX_PASSWORD, which opens backup files, never unlocks a vault, so one
    leaked variable cannot open both. --password-stdin still takes precedence,
    and changing or undoing a master password always asks. In CI, prefer
    EVNX_TOKEN.

  • template reads a template once, left to right (B3, RM-39). A value
    is never read again as a template: with A={{B|upper}} and B=bee,
    {{A|json}} rendered "BEE" in one key order and the literal text in the
    other; it is now "{{B|upper}}" in every order (I-133). 2,000 keys over
    3,000 lines took 4.2 s; it is now a single pass (I-143).

    • Filters chain left to right: {{PORT|default:8080|int}},
      {{NAME|upper|json}}. Chains were an error. Each default: uses its own
      text (I-134).
    • A backslash makes a reference literal: \${NAME}, \{{NAME}} and
      \$NAME render without the backslash, and \\ before a reference is one
      backslash (DEC-T5). Every other backslash is text, so "C:\\dir" and
      \n in a JSON or YAML template stay as written. ⚠️ \$NAME rendered
      \value; it now renders $NAME.
    • New filters |yaml, |toml, |sh: a double-quoted YAML scalar, a
      TOML basic string, and one single-quoted shell word (DEC-T10).
    • ${NAME:-x} and the other shell expansions are still written through
      as they are, now with a warning naming the line, instead of silently
      (I-136).
  • validate and doctor warn about a carriage return inside a value (B2).
    A \r that ends no CRLF line — a classic Mac line ending, or a paste — is
    kept in the value by evnx and Docker Compose, while python-dotenv and Node
    dotenv end the line there and read what follows as another variable. The
    reading is unchanged. New issue type lone_carriage_return (a warning; JSON
    output gains it, nothing is removed).

  • validate and doctor report a NUL byte in a value as an error (B2).
    The file parses, but no process can receive the value: exec refuses it, and
    Docker Compose's container fails with contains nul byte. So the exit code
    changes only for a file that already fails wherever it is loaded. New issue
    type nul_byte.

  • validate and doctor warn about a value Docker Compose reads differently
    because of the order of the file
    (B2). Compose and python-dotenv expand
    ${VAR} top to bottom, against what is assigned above the reference; evnx
    expands against each key's last value. So B=1 / A=${B} / B=2 is A=1
    there and A=2 here, silently. The warning names the variable and the line
    it is assigned on below. New issue type expansion_order. ⚠️ evnx's value
    is unchanged in this release, and changes in 0.13.0
    , when evnx expands top
    to bottom as well.

  • evnx parse: what evnx reads from a .env (B2, RM-36, RM-88). One row
    per entry: line, key, and whether the value is empty, a placeholder or a
    secret, never the value. Every problem in the file is listed, and the
    exit code is 1 when there is one. --env - reads stdin. --format json
    (schema_version: 1) is what validate --input-format json reads back.
    --values adds the values, and refuses a terminal unless --yes, where they
    would stay in the scrollback.

  • validate --env - reads stdin, and --input-format json reads JSON
    (B2). JSON is a flat {"KEY": "value"} object or what
    evnx parse --format json --values prints; the format is never guessed,
    since .env text may start with {. A finding on input with no lines
    reads <stdin>:—. --fix refuses both, since there is no file to rewrite,
    and an empty pipe is an error rather than a pass.

  • validate warns about $$ in a project Docker Compose reads (B2).
    Compose reads $$ as one $, unquoted and in double quotes; evnx keeps both
    dollars, as python-dotenv and Node dotenv do. A random password holding $$
    is far more common than a $$ meant as one dollar, so evnx's value does not
    change: the reader_mismatch warning now covers it, and suggests single
    quotes, which Compose reads as written. Measured into dialects.json, whose
    script now reads Compose's real value: docker compose config prints each
    $ as $$.

Changed

  • ⚠️ One way to name a file: ./.env (B4, RM-32). diff, validate and
    restore printed .env while scan and cloud pull printed ./.env for
    the same file; all five now say ./.env, on Windows too (except cloud pull, which keeps .\.env there). The ./ also keeps a name starting with
    - from reading as a flag when copied into a shell.
    validate --format json reports "location": "./.env", so a
    script matching ".env" needs updating. GitHub annotations keep
    file=.env, and diff --format patch keeps a/.env, because programs read
    those as repository paths. doctor is unchanged: it names files relative to
    the project it checks, not the current folder.
  • cloud pull and restore ask the same question the same way (B4,
    RM-34). One prompt, "Overwrite ./.env? (the current file is kept as a .bak
    copy)"; declining prints "Cancelled; ./.env was not changed." and exits 4
    in both
    (cloud pull exited 0, so a script could not tell that nothing was
    written). cloud pull takes --yes/-y, with --force kept as an alias;
    restore already took both.
  • Library: Issue.severity is a Severity enum and Issue.issue_type an
    IssueType
    (B2), not strings. validate --format json is byte-identical;
    only Rust code using evnx as a library sees the change.
  • A refused key says why (B2). my.key, my-key and 1FOO are still
    refused, since a shell cannot hold them, and the message now says so and
    that Docker Compose and python-dotenv accept them (measured). Other names
    state the rule, and strict mode says it requires uppercase. Accepting these
    keys is planned for 0.13.0.
  • validate lists every problem in a file that does not parse (B1). It
    named only the first, so a file with three problems took three runs. It
    still exits 2; a file with one problem prints exactly what it did before.

For contributors (B6, RM-38, RM-44)

  • A classifier corpus, tests/fixtures/classify-corpus.tsv: 152
    name=value pairs with the verdict each shared question gives (holds a
    secret, placeholder at the Strict and Lenient levels, masked text).
    tests/classify_corpus.rs reports every row that disagrees, not the first;
    UPDATE_CORPUS=1 refills it for review. It found one inconsistency, pinned as
    known_strict_placeholders_lenient_does_not_share: RFC 2606 documentation
    hosts (https://api.example.com/v1) are placeholders to validate but not to
    scan and diff.
  • scripts/run-doc-examples.py <evnx> <evnx-web> runs every evnx … line
    in the guides against a seeded project, offline, and sorts each into ran,
    needs-context, error or skipped. Not in CI yet. First run: 577 examples, 197
    ran, 7 errors (one is a stale convert --to k8s-secret).
  • Cloud tests against a real server. tests/e2e_cloud.rs drives the CLI
    through register, verify, login, vault create, push, a byte-identical pull,
    share, revoke and a refused pull, on a real evnx-server; it is skipped unless
    EVNX_E2E_SERVER is set. Its first check is I-313: a second share sent
    straight to the API is a 409 and changes nothing. Verified both ways: it
    passes on the server production runs (d2663fa) and fails on one from before
    the fix (8ffdf10, which answers 201). .github/workflows/cloud-e2e.yml
    runs it nightly against that image, never on pull requests.

Fixed

  • validate on stdin or JSON no longer offers --fix. Findings said
    "fixable with --fix" and the next steps "Run with --fix", for input --fix
    refuses; auto_fixable is now false there in --format json too. A missing
    variable's suggestion said "Add DEBUG= to "; it now says
    "Add DEBUG=".
  • restore names every path the same way. One run said "Kept the previous
    ./.env as .env.bak" and then "Restored 5 variable(s) to .env"; the kept copy,
    the restored file, the fallback warning and the next-step commands now all
    read ./.env (RM-32).
  • parse --format json reports "file": "./.env", as validate reports
    "location": "./.env" for the same file. <stdin> is unchanged.
  • ⚠️ A key that starts with export keeps its whole name (B2). export
    was stripped as a bare prefix, so exporter=1 was read as er=1 and
    exports_dir as s_dir, with no warning. It is now a keyword only when
    whitespace follows it, as in Docker Compose and python-dotenv. This changes
    a reading:
    a file with such a key now gives it its full name, which is what
    every other reader gave it. Only lowercase names were affected.
  • export =v and a bare export say `export` is followed by no key
    (B2), instead of Invalid key: '' and "missing '=' separator".
  • Text after a closing quote is counted, not quoted, in the error (B2).
    A="value" rest was refused with the stray text in the message, and that
    text is often the rest of a secret, printed to a terminal or a CI log. The
    message now says how many characters follow the quote.
  • ${VAR:-default} and its siblings are read as Docker Compose reads them
    (B2). :-, -, :+, +, :? and ? were all refused as an undefined
    variable named VAR:-default. A default is itself expanded (${A:-$B}), and
    ${VAR:?message} refuses the file with your message, as Compose does. Single
    quotes still keep the text as written. One difference remains: a ${...}
    inside a default (${A:-${B}}) is still an error in evnx.
  • A .env that starts with a UTF-8 byte-order mark is read (B2). Some
    Windows editors save one. evnx read it into the first key's name and refused
    the file with Invalid key '\u{feff}K', a fault no one could see. It is now skipped,
    as Docker Compose, Node dotenv and docker run skip it. validate warns
    where python-dotenv is a reader, since python-dotenv keeps the mark in the
    key and leaves the variable unset. --fix keeps the mark.
  • A line inside a multiline value is no longer read as an assignment (B1).
    Ten readers in six commands read a .env line by line beside the parser,
    and each misread the inside of a quoted value. Now one reading serves them
    all. On 0.11.0, with X=… or A=x on a line inside another key's value:
    • validate --fix wrote a missing variable inside another key's value,
      corrupting it and leaving the variable missing, and a fixed multiline value
      kept its old continuation lines;
    • diff --format patch replaced that inner line instead of the real one;
    • validate reported it as a duplicate key, pointed a GitHub annotation at
      it, and warned that another reader would read it differently;
    • restore --inspect on a backup that does not parse listed a base64 line
      ending in = as a variable name: part of a key body, under "values never
      shown";
    • add, on a .env with a syntax error elsewhere, took it as a variable
      already set and did not add it;
    • scan, on a .env with a syntax error elsewhere, named the key on the
      inner line instead of the variable holding the secret.
  • doctor and validate name three or more readers in one list. They
    printed "read by evnx and python-dotenv and Node dotenv"; now
    "read by evnx, python-dotenv and Node dotenv".

Installation

Linux / macOS (shell script)

curl -sSL https://raw.githubusercontent.com/urwithajit9/evnx/main/scripts/install.sh | bash

Homebrew (macOS and Linux)

brew install urwithajit9/evnx/evnx

Scoop (Windows, user-local)

scoop bucket add evnx https://github.com/urwithajit9/scoop-evnx
scoop install evnx

Winget (Windows, system-wide)

winget install urwithajit9.evnx

npm / Node.js

npm install -g @evnx/cli

Python (pipx)

pipx install evnx

Cargo

cargo install evnx --all-features

cargo install compiles from source with default = [], so plain
cargo install evnx gives you a binary without the auth,
vault and cloud commands. Every other channel above ships them
already — the binaries are built with --all-features.

Checksums

SHA256 checksums are provided for each binary. Verify after download:

sha256sum -c evnx-*.tar.gz.sha256

Provenance

Every archive has a signed build provenance attestation, which ties it
to the workflow run and commit that built it. Verify one with the
GitHub CLI (signed in with gh auth login):

gh attestation verify evnx-x86_64-unknown-linux-musl.tar.gz -R urwithajit9/evnx

What's Changed

  • fix(doctor,validate): name three readers in one list (v0.12.0 B0) by @urwithajit9 in #247
  • B1: one reading of a .env, shared by every command (v0.12.0) by @urwithajit9 in #248
  • v0.12.0 B2: parser fixes, validate on any input, and evnx parse by @urwithajit9 in #254
  • v0.12.0 B3: template engine reads a template once, left to right, with chained filters by @urwithajit9 in #255
  • v0.12.0 B4: one overwrite prompt, ./ path labels, EVNX_MASTER_PASSWORD by @urwithajit9 in #256
  • v0.12.0 B5: update --list, install receipt, release age by @urwithajit9 in #257
  • v0.12.0 B6: classifier corpus, docs runner, real-server cloud tests by @urwithajit9 in #258
  • fix: one path label in restore and parse, no --fix hints for stdin; README synced, SLSA badge by @urwithajit9 in #259
  • Release v0.12.0 by @urwithajit9 in #260

Full Changelog: v0.11.0...v0.12.0

npm / Node.js

npm install -g @evnx/cli          # global install
npx @evnx/cli --version           # zero-install usage
npm install --save-dev @evnx/cli  # project dev dependency