Skip to content

Stop searching the working directory for config; reject bad edge values - #42

Merged
archlemon merged 1 commit into
mainfrom
fix/config-edges
Nov 14, 2026
Merged

archlemon merged 1 commit into
mainfrom
fix/config-edges

Conversation

@archlemon

Copy link
Copy Markdown
Member

Fixes #37 (approved: drop cwd), fixes #36. Breaking (fine per owner): implicit ./noty.yaml is gone.

  • Config search: --config → $NOTY_CONFIG → ~/.config/noty/config.{yaml,yml} → /etc/noty/config.yaml. The reviewer showed a repo-supplied ./noty.yaml with an exec channel capturing 108 env vars from the shell. README explains and points to -c ./noty.yaml; flag help updated.
  • Timeout: timeout must be positive, got 0s for defaults.timeout: 0/0s/negative or negative --timeout (--timeout 0 still means "use config/default").
  • Env null: plain ${X} with X=NULL/null/~ stays the string instead of decoding as null → "". Empty values still decode as null so ${X:-} leaves optional fields unset.

Tests: each fails without the change.

- Config discovery no longer tries ./noty.yaml and ./noty.yml. A config
  can run exec commands with the full environment, so running noty in an
  untrusted checkout must not pick up that repo's file. Use -c for a
  project-local config.
- Reject non-positive --timeout / defaults.timeout. 0 gave every attempt
  an already-expired context, so all sends failed.
- An env value that YAML reads as null (null, NULL, ~) substituted into a
  plain scalar decoded as empty; keep it a string.

Fixes #36
Fixes #37
@archlemon archlemon added bug Something isn't working security Security-relevant fix or hardening labels Nov 14, 2026
@archlemon
archlemon merged commit 73bc732 into main Nov 14, 2026
2 checks passed
@archlemon
archlemon deleted the fix/config-edges branch November 14, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security Security-relevant fix or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not auto-load noty.yaml from the current directory Config edge cases: non-positive timeout, env value "null"

1 participant