Updated config_yaml (markdown)

Chris Caron 2020-09-04 10:30:19 -04:00
parent 3f73b21c9e
commit ea7cc764f3

@ -79,7 +79,7 @@ asset:
# urls below. # urls below.
tag: admin, devops tag: admin, devops
# Define your URLs (Mandatory!) # Define your URLs
urls: urls:
# One-liner (no colon at the end); just the url as you'd expect it: # One-liner (no colon at the end); just the url as you'd expect it:
- json://localhost - json://localhost
@ -112,6 +112,54 @@ urls:
tag: chris, customer tag: chris, customer
``` ```
## Expanding Configuration Sources
The YAML based configuration also supports the keyword `include` which allows you to pull more configuration down from other locations. For example:
```yaml
# Perhaps this is your default configuration that is always read
# stored in ~/.config/apprise.yml (or ~/.apprise.yml)
include:
# The following could import all of the configuration located on your
# Apprise API:
- http://localhost:8080/get/apprise
```
From there you can easily use the CLI tool from the command line while managing your configuration remotely:
```bash
# automatically reads our above configuration
# Which further imports our additional configuration entries:
apprise -vv -t "my title" -b "my message body"
```
You can freely mix/match include statements and Apprise URLs as well, for example:
```yaml
# Our config file located in ~/.config/apprise.yml (or ~/.apprise.yml)
# Our imports
include:
# web based include (use https:// too if you like)
- http://localhost:8080/get/apprise
# A relative config file import (relative to 'this' configuration file)
- more_configuration.cfg
# Absolute path inclusion works well too:
- /etc/apprise/cfg
# you can still include your other URLs here too if you want:
# Define your URLs
urls:
- json://localhost
# It's recommended you tag everything and then just
# use the --tag (or -g) switch to access the entries. This
# is especially important if you're going to start storing your
# configuration elsewhere too!
- slack://tokenA/tokenB/TokenC:
- tag: devops
```
All loaded configuration files can also contain the `include` keyword as well. But by default they `include` recursion only happens at 1 level. If you want to allow more files to be included, you need to specify `--recursion-depth` (`-R`) and set it to the number of recursive levels you will allow the include to occur for. By default this is set to 1 with the `apprise` tool.
**Note:** For security reasons, an `http://` configuration source can NOT `include` a `file://` source.
## Web Hosted YAML Configuration ## Web Hosted YAML Configuration
Apprise can retrieve configuration files from over a network as well using the HTTP protocol. Apprise can retrieve configuration files from over a network as well using the HTTP protocol.
For HTTP requests, the **Content-Type** HTTP Header (_which defines Mime Type_) is very important. Apprise will parse remote network hosted configuration files as YAML so long as you're using one of the following **Content-Type** entries: For HTTP requests, the **Content-Type** HTTP Header (_which defines Mime Type_) is very important. Apprise will parse remote network hosted configuration files as YAML so long as you're using one of the following **Content-Type** entries: