Configuring Buildarr#

Buildarr uses YAML as its configuration file format. By default, Buildarr looks for buildarr.yml in the current directory.

It contains not only the settings for Buildarr itself, but also the application instances to be managed. When an update run of the managed instances is performed, Buildarr will check the remote instances against this configuration, and if there are any differences, Buildarr will update the instance to match the configuration.

Here is an abbreviated example of a buildarr.yml where Buildarr is managing a single Sonarr instance.

---

buildarr:
  watch_config: true
  update_days:
    - "monday"
    - "tuesday"
    - "wednesday"
    - "thursday"
    - "friday"
    - "saturday"
    - "sunday"
  update_times:
    - "03:00"

sonarr:
  hostname: "sonarr.example.com"
  port: 8989
  protocol: "http"
  settings:
    ...

Multiple configuration files#

Using the includes block, multiple configuration files can be included and read from one buildarr.yml file.

This is useful for logical seperation of configuration structures, for example:

  • By instance type (Sonarr, Radarr, and so on)
  • Defining secrets (API keys and passwords) in separate, encrypted configuration files (e.g. for secrets management in Kubernetes)

Nested inclusion is allowed (included files can include other files). All the loaded configuration files are combined into a single structure using depth-first search.

Each configuration file will be combined according to the following rules:

  • If there are any overlapping configuration attributes defined in multiple files, the value in the last-read file will take precedence.
  • Overlapping list-type attributes will be overwritten, rather than combined.
  • If a local path attribute defined in the configuration file is a relative path, that path will be resolved relative to the parent directory of the configuration file it is defined in. If they are not defined in any file, the default value will be resolved relative to the parent directory of the first configuration file loaded.

Note

To make troubleshooting easier and to ensure readability, overly complicated include structures in configuration files should be avoided, if possible.

Separating by instance type#

Here is an example where Sonarr and Radarr instances are configured in separate files.

buildarr.yml:

---

includes:
  - sonarr.yml
  - radarr.yml

buildarr:
  watch_config: true
  update_days:
    - "monday"
    - "tuesday"
    - "wednesday"
    - "thursday"
    - "friday"
    - "saturday"
    - "sunday"
  update_times:
    - "03:00"

sonarr.yml:

---

sonarr:
  hostname: "sonarr.example.com"
  port: 8989
  protocol: "http"
  settings:
    ...

radarr.yml:

---

radarr:
  hostname: "radarr.example.com"
  port: 7878
  protocol: "http"
  settings:
    ...

Separating secret and non-secret configuration#

Here is an example where Sonarr instance API keys are configured in a separate file from the standard (non-secret) settings.

buildarr.yml:

---

includes:
  - buildarr-secret.yml

buildarr:
  watch_config: true
  update_days:
    - "monday"
    - "tuesday"
    - "wednesday"
    - "thursday"
    - "friday"
    - "saturday"
    - "sunday"
  update_times:
    - "03:00"

sonarr:
  hostname: "sonarr.example.com"
  port: 8989
  protocol: "http"
  settings:
    ...

buildarr-secret.yml:

---

sonarr:
  api_key: 1a2b3c4d5e1a2b3c4d5e1a

Multiple instances of the same type#

Using the instances attribute, multiple instances of the same type can be administered using a single Buildarr instance. Globally set configuration will apply to all defined instances, and settings defined under a single instance only apply to that instance.

sonarr:
  # Configuration common to all Sonarr instances.
  settings:
    ...

  instances:
    # Sonarr instance 1 connection information and configuration.
    sonarr1:
      hostname: "sonarr1.example.com"
      port: 8989
      protocol: "http"
      settings:
        ...

    # Sonarr instance 1 connection information and configuration.
    sonarr2:
      hostname: "sonarr2.example.com"
      port: 8989
      protocol: "http"
      settings:
        ...

How does configuration get pushed to instances?#

Buildarr operates on a principle of "don't touch what is not explicitly defined", and idempotent operation.

  1. Buildarr downloads the active configuration of a remote instance, and compares it to the configuration file.
  2. If a configuration value is not explicitly defined in the Buildarr configuration, it is not updated.
  3. If the explicitly set local configuration value matches the remote instance, it is not updated (unless other parameters set using the same API command have been changed).
  4. Only if a configuration update is available will it be pushed to the remote instance.

Buildarr Settings#

The buildarr configuration section is used to configure the behaviour of Buildarr itself.

Some of the configuration options set here may be overridden on the command line.

Note that the log level cannot be set within buildarr.yml, as logging starts before the configuration is loaded. The log level can be set using the $BUILDARR_LOG_LEVEL environment variable, or using the --log-level command line argument.

---

buildarr:
  watch_config: true
  update_days:
    - "monday"
    - "tuesday"
    - "wednesday"
    - "thursday"
    - "friday"
    - "saturday"
    - "sunday"
  update_times:
    - "03:00"
watch_config: bool = False class-attribute instance-attribute #

When set to true, the Buildarr daemon will watch the loaded configuration files for changes, and reload them and update remote instances if they are changed.

Sending SIGHUP to the Buildarr daemon process on supported operating systems will also perform this operation, whether watch_config is enabled or not.

This configuration option can be overridden using the --watch-config command line argument.

update_days: Set[DayOfWeek] = set(day for day in DayOfWeek) class-attribute instance-attribute #

The days Buildarr daemon will run update operations on.

By default, updates are scheduled to run every day.

Days are specified as a list of case-insensitive strings, in English. The days do not need to be in order.

buildarr:
  update_days:
    - "monday"
    - "wednesday"
    - "friday"

This configuration option can be overridden using the --update-days command line argument.

update_times: Set[time] = {time(hour=3)} class-attribute instance-attribute #

The times Buildarr daemon will run update operations on each scheduled day.

By default, updates are scheduled to run at 3:00am local time.

Times are specified in the HH:MM format, in 24-hour time. The times do not need to be in order.

Days are specified as a list of case-insensitive strings, in English. The days do not need to be in order.

buildarr:
  update_times:
    - "06:00"
    - "12:00"
    - "18:00"
    - "00:00"

This configuration option can be overridden using the --update-times command line argument.

request_timeout: PositiveFloat = 30 class-attribute instance-attribute #

The timeout for any API requests Buildarr makes (in seconds).

If the timeout is reached, an error will occur and Buildarr will stop the update process.

New in version 0.3.0.

trash_metadata_download_url: AnyHttpUrl = 'https://github.com/TRaSH-/Guides/archive/refs/heads/master.zip' class-attribute instance-attribute #

URL to download the latest TRaSH-Guides metadata from.

trash_metadata_dir_prefix: Path = 'Guides-master' class-attribute instance-attribute #

Metadata directory name within the downloaded ZIP file.

docker_image_uri: NonEmptyStr = os.environ.get('BUILDARR_DOCKER_IMAGE_URI', 'callum027/buildarr') class-attribute instance-attribute #

Default image URI to use for the Buildarr service when generating Docker Compose files.

If undefined in the configuration file, use the value defined in the $BUILDARR_DOCKER_IMAGE_URI environment variable. This allows third-party Docker images to customise the version of Buildarr used in the command.

If no environment variable is found, use callum027/buildarr (the official Docker image).

New in version 0.4.0.