Reference YAML File

# OMDB_API_KEY
omdb_api_key: "mykey" # REQUIRED, see note above for generation.

# CONFIG_DIR
config_dir: "$HOME/.config/thea/" # Optional

# CACHE_DIR
cache_dir: "$HOME/.cache/thea/" # Optional

formatter:
  # FORMAT_IMPORT_PATH
  import_path: "dir_to_ingest_from" # REQUIRED
  # FORMAT_DEFAULT_OUTPUT_DIR
  default_output_dir: "dir_to_output_to" # REQUIRED

  # FORMAT_TARGET_FORMAT
  target_format: "mp4" # Optional
  # FORMAT_FFMPEG_BINARY_PATH
  ffmpeg_binary: "/usr/bin/ffmpeg" # Optional
  # FORMAT_FFPROBE_BINARY_PATH
  ffprobe_binary: "/usr/bin/ffprobe" # Optional
  # FORMAT_IMPORT_POLLING_DELAY
  import_polling_delay: 3600 # Optional

concurrency:
  # CONCURRENCY_TITLE_THREADS
  title_threads: 1 # Optional
  # CONCURRENCY_OMDB_THREADS
  omdb_threads: 1 # Optional
  # CONCURRENCY_FFMPEG_THREADS
  ffmpeg_threads: 8 # Optional

database:
  # DB_USERNAME
  username: "foo" # REQUIRED
  # DB_PASSWORD
  password: "bar" # REQUIRED

  # DB_NAME
  name: "THEA_DB" # Optional
  # DB_HOST
  host: "0.0.0.0" # Optional
  # DB_PORT
  port: "5432" # Optional

docker_services:
  # SERVICE_ENABLE_POSTGRES
  enable_postgres: true # Optional
  # SERVICE_ENABLE_PG_ADMIN
  enable_pg_admin: false # Optional
  # SERVICE_ENABLE_UI
  enable_frontend: false # Optional

ALL config options are found here, along with the corresponding environment variable for each - check the config index for documentation of each.

You can change the config from its default by either providing an alternative value in your YAML config file, or by setting the corresponding environment (which override any values in the YAML file).

For each configuration marked # REQUIRED, a value MUST be provided - else Thea will refuse to start. For each configuration marked # Optional, the value provided is the default that Thea will use if a value is not expressly provided.

Required configuration values can be provided using the YAML file, or the corresponding environment variable, it does not matter which, as long as they are provided somehow.


Config Value Index

Below is a brief documentation of each of the environment variables. You can of course set these via the YAML file by matching the environment variable name to the comment above the associated YAML field.

Basic Configuration

Environment Variable Default? Description
CONFIG_DIR $HOME/.config/thea/ This path is relative to the users $HOME directory and is used by Thea to store any relevant configuration (mainly created profiles and targets). Files will be created in this directory and it's intended to be persistent storage.
CACHE_DIR $HOME/.cache/thea/ This path is relative to the users $HOME directory and is used by Thea to store cache information. This is not intended to be permanent and the program will gracefully handle data loss in this directory.
OMDB_API_KEY Mandatory - No Default The OMDB API key to use when querying OMDB for information about a file being imported.
HOST_ADDR 0.0.0.0 The address to host the data server on; this is used by clients (web front end, CLI, scripts) to access data from Thea via the provided HTTP endpoints and websocket commands.
HOST_PORT 8080 The port to host the data server on; similar to "Host Address" above.

Format Config

Environment Variable Default? Description
FORMAT_IMPORT_PATH Mandatory - No Default The path to scrape for new files to import. This path is checked frequently (based on "Import Polling Frequency") for new files.
FORMAT_DEFAULT_OUTPUT_DIR Mandatory - No Default This path is used by Thea if the transcode target used to transcode a file has no output set, OR it's invalid. Additionally, targets can use this path to compose their own output paths - this value is considered to be the desired output directory and targets may (and should) use this path as the base of their composed output paths.
FORMAT_TARGET_FORMAT mp4 The default format to use when transcoding files via FFmpeg if the [[profile
FORMAT_FFMPEG_BINARY_PATH /usr/bin/ffmpeg The location to look for the FFmpeg executable binary.
FORMAT_FFPROBE_BINARY_PATH /usr/bin/ffprobe The location to look for the FFprobe executable binary.
FORMAT_IMPORT_POLLING_DELAY 3600 The amount of time (in seconds) between each poll of the import directory.

This variable is deprecated as Thea is removing directory polling in favor of a file system directory watcher. |

Concurrency Configuration

Environment Variable Default? Description
CONCURRENCY_TITLE_THREADS 1 The amount of go-threads assigned to processing the title information of newly found files. This is stage 2 of the pipeline.

This variable is deprecated as Thea is removing workers, in favor of services. See ‣ for more information. | | CONCURRENCY_OMDB_THREADS | 1 | The amount of workers assigned to querying OMDB for information. This is stage 3 of the pipeline.

This variable is deprecated as Thea is removing workers, in favor of services. See ‣ for more information. | | CONCURRENCY_FFMPEG_THREADS | 8 | The maximum amount of system threads that can be used by FFmpeg execution. This thread count will be observed by Thea, and will not be exceeded when starting ffmpeg commands. This is managed automatically via the -threads flag to ffmpeg. When this limit is reached no more FFmpeg instances will be spawned until the running instances finish their work. |

Docker Service Configuration

Setting any of these to true requires that Docker Engine is installed and setup on the host system!

Environment Variable Default? Description
SERVICE_ENABLE_POSTGRES true Whether to use Thea's Docker integration to pull, create and manage a Docker container running Postgres for Thea's persistent data storage. If you wish to provide your own Postgres database, refer to the above section.
SERVICE_ENABLE_PG_ADMIN false Whether to use Thea's Docker integration to pull, create and manage a Docker container running PgAdmin to allow for inspection, debugging and manual data management. Most useful when using the Thea-managed Postgres instance.

Database Configuration

Note: The following configuration is used when connecting to the database, but it's also used when Thea creates a database when using the Thea-managed embedded database (which is the default behavior). Therefore, the HOST, PORT and NAME for the DB can be left to their defaults unless you're providing your own Postgres instance.

Environment Variable Default? Description
DB_USERNAME Mandatory - No Default The username Thea will use to create (if using Docker integration to run DB), or connect to, the PostgreSQL instance
DB_PASSWORD Mandatory - No Default The password Thea will use to create (if using Docker integration to run DB), or connect to, the PostgreSQL instance
DB_HOST 0.0.0.0 The host address Thea will use when serving (if using Docker integration to run DB), or connecting to, the PostgreSQL instance
DB_PORT 5432 The port Thea will use when serving (if using Docker integration to run DB), or connecting to, the PostgreSQL instance
DB_NAME THEA_DB The DB name Thea will use when creating (if using Docker integration to run DB), or connecting to, the PostgreSQL instance