Aller au contenu

Configuration

Ce contenu n’est pas encore disponible dans votre langue.

Configuration allows you to identify all of your notification services in one place, while supporting grouping, tagging, and keeping secrets out of your shell history.

Apprise configuration is portable. The same configuration file can be used by the CLI, the API server, and the Python library without modification.

Consider using configuration files when:

  • You want to reuse the same notification setup across scripts or systems
  • You want to keep credentials out of your shell history
  • You want to group services or simplify references to your Apprise URLs with tags
  • You want the same configuration to work with the CLI, API, and Python library

If you only need a one-off notification, inline URLs are sufficient. For anything beyond that, configuration files are recommended.

Apprise supports two configuration formats. Both describe the same information, but YAML can express more structure.

  • TEXT: Simple, line-based, and easy to read. Best for small or manual setups.
  • YAML: Structured and standardised. Better suited for larger configurations and automation tools.

TEXT configuration is line-based.

  • Blank lines are ignored
  • Comments start with # or ;
  • Each URL can optionally be prefixed with one or more tags
  • You can define tag groups
  • You can include other configuration sources

TEXT configuration is ideal when:

  • You want the simplest possible setup
  • You are managing only a few services
  • You prefer minimal syntax
# Email notifications
mailto://user:password@gmail.com
# Discord notifications
discord://webhook_id/webhook_token

Tags let you organize notification services into logical groups such as personal, ops, or critical. You can then target groups without changing your destination URLs.

You can categorize services by placing tags before the URL, separated by an equals sign (=).

# Syntax: tag=url
# Associates the 'desktop' tag with this notification
desktop=gnome://
# You can assign multiple tags using commas or spaces
# This URL is part of 'tv' AND 'kitchen'
tv,kitchen=kodi://user:pass@kitchen.host

You can include other configuration files to keep your setup clean. This is excellent for separating secrets from general logic.

# 1. Define your base services
user1=mailto://credentials
user2=mailto://credentials
# 2. Define a group
# Notifying 'friends' will notify 'user1' and 'user2'
friends = user1, user2

You can import other configuration files (local or remote) using the include keyword.

# Read from another Apprise configuation file on the local server
include /etc/apprise/secrets.conf
# Read from an Apprise API server
include https://my-config-server.com/get/my-key/

Tag filtering is consistent across tools. For example, with the CLI you can target a group by tag:

General filter expressions follow:

FilterSelected services
--tag TagAHas TagA
--tag TagA,TagBHas TagA AND TagB
--tag 'TagA' --tag 'TagBHas TagA OR TagB
--tag 'TagA,TagC --tag TagBHas ( TagA AND TagC) OR TagB

Example:

Terminal window
apprise --tag="ops,critical" \
--body="Notify services that have the tag ops AND critical associated with it"
apprise --tag="ops" --tag "critical" \
--body="Notify all services that have either 'ops' AND/OR 'critical' associated with it"

Whether you use TEXT or YAML, you load your configuration into the CLI or Library the same way.

You can load a file using the --config (or -c) flag. You can specify this flag multiple times to load multiple files.

Terminal window
# Load a local file
apprise --config=/etc/apprise/config.yml --body="test"
# Load from a URL
apprise --config=https://myserver.com/cfg/apprise --body="test"

If you do not specify a configuration file via the CLI (--config), Apprise automatically checks these default locations (in order):

  1. ~/.apprise
  2. ~/.apprise.yaml
  3. ~/.config/apprise
  4. ~/.config/apprise.yaml
  5. /etc/apprise (and /etc/apprise.yaml)

There are two special tags you can use to control notification behavior.

TagDescription
alwaysIf you assign the tag always to a URL in your config, it will ALWAYS trigger, even if you are filtering for a different tag via the CLI.
allUsed when sending a notification (e.g. apprise --tag=all). This tells Apprise to ignore all filters and notify every service defined in your configuration.

If you are hosting your configuration on a private web server, Apprise detects the format based on the Content-Type header returned by the server, or by an explicit URL parameter.

FormatHTTP Content-TypeURL Force Override
YAMLtext/yaml, application/x-yamlhttp://...?format=yaml
TEXTtext/plainhttp://...?format=text