Commit Graph
4 Commits
Author SHA1 Message Date
kevinveenbirkenbachandClaude Fable 5 97b1ffddb4 fix(dotenv): quote whitespace values in the swarm env passthrough
The swarm branch passed values through raw, so a value with interior
whitespace (MAIL_FROM_NAME='Infinito.Nexus by ...') landed unquoted in
the rendered .env and broke the env parser: the snipe-it service
crashlooped at 0/3 until the converge wait failed in every variant.

Quote (and escape backslash/double-quote) only when the value contains
space/tab/newline; everything else stays raw, so the swarm invariants
hold: no compose $$-doubling, raw $ and double quotes preserved,
and the playwright --env-file path (docker CLI keeps quotes literal)
is unaffected because no playwright env value can contain whitespace.
Compose quoting is untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 15:34:28 +02:00
kevinveenbirkenbach 3a74897a19 fix(env-templates): make dotenv_quote swarm-aware (compose strips, swarm preserves)
docker stack deploy passes env-file values verbatim, including outer
double quotes - the container reads KEY="value" instead of KEY=value
and DB auth, URL parsers, and int(os.environ['KEY']) consumers break.
Compose keeps stripping the quotes as before.

- plugins/filter/dotenv.py: read DEPLOYMENT_MODE from the render
  context via @jinja2.pass_context. compose mode keeps the old quoting
  (escape $$, \, "). swarm mode passes the value through verbatim.
  Missing or unknown mode falls back to compose quoting so a typo
  never silently leaks unquoted values into compose. Direct Python
  callers without a Jinja context keep the compose-style default.
- tests/unit/plugins/filter/test_dotenv_quote.py: keep the 12
  direct-call cases, add 8 TestDotenvQuoteModeAware cases rendering
  the filter through a real jinja2.Environment.
- 4 OIDC_TITLE templates (bookwyrm, confluence, jira, pretix): replace
  the manual "{{ X | replace('\"','\\\"') }}" Compose-only escape
  with {{ X | dotenv_quote }}.
- 3 env.j2 templates (nextcloud, taiga, wordpress): drop literal
  outer quotes that were Compose-only decoration; keep | dotenv_quote
  on the password / token assignments.
- sys-svc-rdbms/templates/env/mariadb.env.j2: strip literal quotes
  unconditionally - the file name is not env.j2 so the dotenv-quote
  integration test does not require the filter and the generated DB
  passwords are alphanumeric.
2026-06-14 19:08:45 +02:00
kevinveenbirkenbachandClaude Opus 4.7 4c2ce5cc40 chore(plugins): drop stale path-style file header comments
Removed leading `# filter_plugins/...py` / `# lookup_plugins/...py`
comments that referenced the old plugin paths. The plugins now live
under plugins/filter and plugins/lookup, so these headers are both
inaccurate and redundant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:05:45 +02:00
kevinveenbirkenbach c6f5fdea15 refactor plugins layout and migrate uri calls to uri_retry 2026-03-19 01:41:07 +01:00