Skip to content

Secrets

Secrets don’t go in config.yaml. It refers to them, so you can share or commit the file.

In config.yamlWhere the value comes from
${NAME}The environment variable NAME.
${NAME}, with NAME_FILE setThe file NAME_FILE points at. This is the Docker convention.
${secret:name}The file /run/secrets/name, for Docker and Kubernetes secrets.
${file:/path}Any file.

Names are capitals, digits and underscores. File values have their surrounding whitespace trimmed. The environment wins over NAME_FILE.

config.yaml
integrations:
downloads:
type: qbittorrent
url: http://qbittorrent:8080
username: ${QBIT_USER}
password: ${secret:qbit_password}

A ${NAME} that isn’t set, or a file that can’t be read, stops the config from loading with an error that names it. Write \${NAME} for a literal ${NAME}.

This works anywhere in the file, not only for keys. An .env file holds the values when you use env_file in Compose. Keep it private with chmod 600 .env.

Services sometimes echo a key back, in an error message or a URL. So every value a ${...} stood for goes on a list, and that list is cut out of what leaves the server. It becomes •••.

It runs over:

  • Widget errors and live updates.
  • Action results and errors.
  • Assistant tool results, before the model sees them.
  • MCP results.
  • The activity log, before it’s written.
  • The approval card’s words.
  • Your own CSS, when it’s served, and config print.

Plain ${NAME} values whose name contains USER, LOGIN, URL, HOST, PORT or ADDR aren’t on the list. They aren’t secrets, and blanking one mangles real text: sam inside samantha. The file forms always count.

  • It only knows values that came through ${...}. A key typed straight into config.yaml isn’t redacted. That’s one more reason not to.
  • Values under 4 characters are skipped. Values under 8 match only as whole words, so a short password doesn’t punch holes in ordinary text.
  • It matches the value exactly. If a service base64-encodes or truncates your key, the result won’t match.
  • Other sensitive things in a document or log, such as a name or an address, aren’t secrets to Valet, and pass through.
The browserThe model
Keys in ${...}NeverNever
Service URLsIn a card’s link, if you set href, or the url by defaultIf a tool returns them
Card dataYesWhat the tools return

A card’s title links to href, or to url when there’s no href. So set href when the address Valet uses is internal and you’d like the link to go elsewhere.

Terminal window
docker exec valet node dist/server.js config print

config print shows what Valet made of your config, with secrets redacted. config check names every problem. See the plugin tools for the rest of the commands.