Skip to content

docs: TOTP_CLIENT_NAME and TOTP_ENVIRONMENT omit rules whose violation stops the backend (first character, empty value) #4427

Closed

Description

@yannickmonney

Summary

The environment reference (en, de and fr) and the v0.5.74 upgrade notes describe TOTP_CLIENT_NAME and TOTP_ENVIRONMENT by their allowed characters only. Both leave out two rules the backend enforces at startup:

  • The first character must be a letter or digit.
  • An empty value is invalid, unlike an unset one.

An operator who follows the documentation can therefore write a value the backend refuses, for example TOTP_CLIENT_NAME=& Co or an empty TOTP_CLIENT_NAME= line in .env. The documents themselves say "Invalid names prevent backend startup".

Source and environment

  • main at 890de6258945af5c86521dd9846dc8955cffb112.
  • Found by reading the schemas and the documents. No deployment was started.

Evidence

  • The schemas (services/platform/lib/shared/authenticator-name.ts):
    • TOTP_CLIENT_NAME is trimmed, inner whitespace collapsed to one space (:29), then matched against /^[\p{L}\p{N}][\p{L}\p{N} &'.+-]{0,39}$/u (:34). The first character must be a letter or digit, and "" doesn't match.
    • TOTP_ENVIRONMENT is trimmed (:43), then matched against /^[a-z0-9][a-z0-9_-]{0,31}$/i (:45). Same first-character rule; "" doesn't match.
  • The backend parses both at startup (services/platform/backend/env.ts:64–65). An invalid value fails the environment schema.
    • The web tier only warns and ignores an invalid value (services/platform/lib/authenticator-env.ts:24–38), so the two roles behave differently on the same value.
  • The documents:
    • docs/en/self-hosted/configuration/environment-reference.md:27–28 (and the same rows in de and fr) say "1–40 letters, digits, spaces or & ' . + -, trimmed" and "1–32 letters, digits, underscores or hyphens, trimmed and uppercased".
    • .github/release-notes/v0.5.74.md:107 repeats the character list.
    • None of them states the first-character rule, that an empty value counts as invalid, or that inner spaces collapse.
    • For comparison, the v0.5.73 notes did warn about TOTP_ENVIRONMENT: "Leave it unset rather than empty: an empty or invalid value stops the backend from starting."
  • Compose passes neither setting explicitly. backend-api and backend-worker load .env, so a TOTP_CLIENT_NAME= line with no value reaches the backend as "".

Expected and observed

  • Expected: the reference rows, and the upgrade note, state every rule whose violation stops the backend.
    • The first character must be a letter or digit.
    • An empty value is invalid: leave the variable unset rather than empty.
    • For TOTP_CLIENT_NAME, inner spaces collapse to one.
  • Observed: only the character set is listed.

Impact and severity

  • Severity: low. Client names rarely start with a symbol, but an empty line in .env is a common pattern.
  • Consequence: either case stops the backend from starting after an upgrade that otherwise followed the documentation.

Acceptance checks

  1. The TOTP_CLIENT_NAME and TOTP_ENVIRONMENT rows in docs/{en,de,fr}/self-hosted/configuration/environment-reference.md state:
    • the first-character rule;
    • that an empty value is invalid (leave the variable unset);
    • for the client name, that inner whitespace collapses.
  2. The v0.5.74 upgrade note says the same, or links to the reference row, if the notes can still change before the release.
  3. Optional: a docs check, or a test that asserts the documented rules against the schemas' regexes, so they can't drift apart again.

Limits

  • Static only: read from the schemas, environment parsing, Compose and documents at the SHA above. No backend was started with these values.
  • Not judged: whether the web tier should also refuse invalid values instead of ignoring them. That's a design choice for the owner.

Found by TALE-358 Review A (product and experience, DOCS): occurrence 2026-10-06 08:15 Europe/Zurich, run 844c1971-1269-4696-8e56-a46d0b51ee95.

Activity

  1. added
    bug
    docs
    service: platform
    on Oct 6, 2026
  2. added
    agent-ready
    on Oct 29, 2026
  3. added a commit that references this issue on Oct 30, 2026
    c600bc2
  4. added a commit that references this issue on Oct 30, 2026
    75ba7a5
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

    agent-readybugdocsservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions