caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
11.7k stars 410 forks source link

Default config file is not accepted #1076

Closed ostasevych closed 6 months ago

ostasevych commented 7 months ago

Hi! I have created

/etc/apprise/configuration.yaml:
# inside your configuration.yaml file:
notify:
  name: apprise
  platform: apprise
  # use the 'config' keyword
  # configuration file:
  config: /etc/apprise/apprise.yaml

/etc/apprise/apprise.yaml
version: 1
urls:
    - "signal://localhost:9922/*********/group.en************=":
      - tag: test

However when I start apprise without indicating path to the config file it reports

2024-03-06 09:15:42,139 - ERROR - You must specify at least one server URL or populated configuration file.
Usage:  [OPTIONS] SERVER_URL [SERVER_URL2 [SERVER_URL3]]

Where this file should be placed in order not to provide it as an attribute to the command?

mattpackwood commented 6 months ago

I don't have access to my home system to check but have you tried the -signal line without the quotes?

caronc commented 6 months ago

You specified a tag, so when you call Apprise, are you using --tag test?

If you only have 1 URL, you don't need to define a tag either.

ostasevych commented 6 months ago

You specified a tag, so when you call Apprise, are you using --tag test?

If you only have 1 URL, you don't need to define a tag either.

Sorry, I haven't mentioned, there are several tags there, they are just cut:

version: 1
urls:
    - "signal://localhost:9922/*********/**********":
      - tag: testme

    - "signal://localhost:9922/*********/group.**************=":
      - tag: test
ostasevych commented 6 months ago

I don't have access to my home system to check but have you tried the -signal line without the quotes?

The same error.

caronc commented 6 months ago

Just looking at your config and the docs,... /etc/apprise/configuration.yaml is not valid.

See here

ostasevych commented 6 months ago

Just looking at your config and the docs,... /etc/apprise/configuration.yaml is not valid.

See here

what do you mean, it is not valid? It works with the "-c" option. And it is located in the directory /etc/apprise image

mattpackwood commented 6 months ago

@ostasevych I think I see the confusion

The list you have snipped and pasted are locations for YAML files (that have a .yaml suffix) or TEXT files (that have no suffix)

So the entry for /etc/apprise is if you have a text file for your configuration named apprise, that is in /etc/

If you move your file up one folder and rename it to be /etc/apprise.yamlit should work for you.

caronc commented 6 months ago

I don't see the harm in adding an update to the CLI tool scan certain directories during startup if you see value. It would need to extend beyond /etc/apprise though. It would need to look in ~/.config/apprise too if it were a directory in addition to Microsoft windows support. Thinking back, i guess there would have been lest confusion if the TEXT file were to just be /etc/apprise.conf instead of /etc/apprise.

I can do a pull request to make this a bit more obvious

caronc commented 6 months ago

The PR i just created will not fix your request (no scanning of an /etc/apprise directory). However it should make it a bit more clear how the files should be placed. You just need to do the following and your file will work today:

mv /etc/apprise/configuration.yaml /etc/apprise.yaml
# Possibly tidy up too:
# rm -rf /etc/apprise

In the future I have removed obvious documentation of /etc/apprise and alike reference, but still explaining that a file placed as such would work.

caronc commented 6 months ago

A new release (v1.7.4) just release which includes this fix. :rocket: Closing issue off.