Skip to main content

Secrets

Secrets can be used to hide sensitive information, when sharing configuration files. Much like environment variables, they are used to replace configuration properties in-place.

Secrets are defined in secrets.yaml, located in the same directory as fetcharr.yaml. If you don't use secrets, this file is completely optional.

Defining secrets

You define secrets in secrets.yaml as key-value pairs.

secret_key: Secret Value

where secret_key is the name of the secret. The key can be anything, as long as it's unique within the file and complies with the YAML spec. Likewise, the value can be any type that YAML allows for.

Using secrets

To use a secret in a configuration file, you use the !secret YAML tag:

!secret secret_key

Example

Given this sample secrets.yaml file:

secrets.yaml
sonarr_api_key: 5aec487a70b5417e880d3923e4786d18

A configuration file like this:

sonarr:
default:
base_url: http://localhost:7878
api_key: !secret sonarr_api_key

would effectively be replaced with:

sonarr:
default:
base_url: http://localhost:7878
api_key: 5aec487a70b5417e880d3923e4786d18