Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4: Apprise for notifications - feedback wanted! #215

Open
marklagendijk opened this issue Mar 3, 2023 · 11 comments
Open

Version 4: Apprise for notifications - feedback wanted! #215

marklagendijk opened this issue Mar 3, 2023 · 11 comments

Comments

@marklagendijk
Copy link
Owner

marklagendijk commented Mar 3, 2023

With version 4 I implemented Apprise support.
Apprise is a system for sending notifications to any of the many services that it supports.
It can be run as a Docker container.

Considerations:

  1. I cannot maintain all the notification integrations that people would want.
  2. With this change we get an enormous amount of supported notification integrations at once.
  3. The notification integrations are well documented.
  4. The downside is the extra complexity cost for the user.

I need help to test this and possibly improve some things.
Please try to use it with the some notification services that you have / like, and report your findings.

Documentation is still missing, we can add that later when we know that things are working properly.

Example config:

		"apprise": {
			"enabled": true,
			"host": "apprise:8080",
			"services": [
				{
					"url": "mqtt://mosquitto:myPassword@192.168.2.123:1883/apprise-test",
					"format": "text"
				}
			]
		}

docker-compose.yaml:

version: "3"
services:
  toogoodtogo-watcher:
    image: marklagendijk/toogoodtogo-watcher
    restart: unless-stopped
    environment:
      - TZ=Europe/Amsterdam
    volumes:
      - ./toogoodtogo-watcher:/home/node/.config/toogoodtogo-watcher-nodejs

  apprise:
    image: caronc/apprise:latest
@marklagendijk
Copy link
Owner Author

I just tested it with MQTT as shown above and that works.

@marklagendijk
Copy link
Owner Author

Added some documentation and added logging to Apprise implementation: 4.0.1.

@zeus24
Copy link

zeus24 commented Mar 4, 2023

Hi,
is it possible, that something with the normal telegram notification got broken? When a store increases the stock I get a telegram a notification with a list of all stores I am watching, instead of only the store with the increases stock.
On the top there is the store with the increases bags and all the other stores have a "0".

@marklagendijk
Copy link
Owner Author

@zeus24 yes. Fixed in 4.0.2.

@zeus24
Copy link

zeus24 commented Mar 5, 2023

Thanks solved, but now I found another bug. It seems the watcher has a problem, if a store only has a stock of "1". I just got 15 notifications for the same store and bags. The notifications were sent every 2 minutes and they don't stop, although it is already sold :-(

@marklagendijk
Copy link
Owner Author

@zeus24 you probably messed up your messageFilter config, it determines when messages are sent. The defaults are to only send when the stock increases from 0 to another value:

  "messageFilter": {
    "showUnchanged": false,
    "showDecrease": false,
    "showDecreaseToZero": false,
    "showIncrease": false,
    "showIncreaseFromZero": true
  }

@Jolpar
Copy link

Jolpar commented Mar 9, 2023

Hi ! Thanks for the interesting work. I was trying to configure apprise & tgtg-watcher with docker-compose. I would just use "dbus://" as url. Nothing complicated. However, I immediately get the following error (see last line of the output).
When I use apprise in command-line, no pb with dbus notifications. So access to dbus is probably limited by the docker-compose env (?). No idea how to fix it (I'm absolutely not acquainted with these docker questions).
I'm under manjaro KDE. Same pb with kde://, qt://... But with mailto:// it seems to work (except that I had a passwd error to fix, but it's another problem)

Output

docker-compose up                                                                                                                                                                             
[+] Running 2/2
⠿ Container docker-apprise-1              Recreated                                                                                                                                                                                   0.1s
⠿ Container docker-toogoodtogo-watcher-1  Recreated                                                                                                                                                                                   0.1s
Attaching to docker-apprise-1, docker-toogoodtogo-watcher-1
docker-apprise-1              | 2023-03-09 18:26:28,955 INFO Set uid to user 33 succeeded
docker-apprise-1              | 2023-03-09 18:26:28,958 INFO supervisord started with pid 1
docker-apprise-1              | 2023-03-09 18:26:29,963 INFO spawned: 'gunicorn' with pid 7
docker-apprise-1              | 2023-03-09 18:26:29,968 INFO spawned: 'nginx' with pid 8
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [7] [INFO] Starting gunicorn 20.1.0
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [7] [INFO] Listening at: http://0.0.0.0:8080 (7)
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [7] [INFO] Using worker: sync
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [13] [INFO] Booting worker with pid: 13
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [14] [INFO] Booting worker with pid: 14
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [15] [INFO] Booting worker with pid: 15
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [16] [INFO] Booting worker with pid: 16
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [17] [INFO] Booting worker with pid: 17
docker-apprise-1              | 2023-03-09 18:26:30,976 INFO success: gunicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)UFFS
docker-apprise-1              | 2023-03-09 18:26:30,976 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
docker-apprise-1              | [2023-03-09 18:26:30 +0000] [18] [INFO] Booting worker with pid: 18
docker-apprise-1              | [2023-03-09 18:26:31 +0000] [19] [INFO] Booting worker with pid: 19
docker-apprise-1              | [2023-03-09 18:26:31 +0000] [20] [INFO] Booting worker with pid: 20
docker-apprise-1              | [2023-03-09 18:26:31 +0000] [21] [INFO] Booting worker with pid: 21
docker-toogoodtogo-watcher-1  | ----HERE AS EXPECTED THE TooGoodToGo DATA-----
docker-apprise-1              | 2023-03-09 12:26:32,106 [ERROR] apprise: dbus:// is disabled on this system.

@marklagendijk
Copy link
Owner Author

marklagendijk commented Mar 9, 2023

The idea of Docker is that every container lives it its own little world (well it can be in the same network as other containers, which is automatically the case for Docker Compose siblings).
So whenever you want a container to access something (port, interface, directory, device etc) from the host you have to bridge it in one way, or another.
In this case you can do that by mounting dbus as a volume:

  apprise:
    image: caronc/apprise:latest
    volumes:
      - /var/run/dbus:/var/run/dbus

If you need access to something else just Google something else Docker.

@Jolpar
Copy link

Jolpar commented Mar 9, 2023

Thanks for the answer. It still doesn't work. I also tried different volumes (like /run/user/1000/bus), based on some comments here and there... That's not so important anyway.

@marklagendijk
Copy link
Owner Author

marklagendijk commented Mar 11, 2023

Might be a rights issue (caused by AppArmor or SELinux). You could try to verify that by running the container in privileged mode (this gives the container access to everything on the host, and bypasses AppArmor or SELinux).

  apprise:
    image: caronc/apprise:latest
    privileged: true

@Mcgive2003
Copy link

hello
Apprise it 's good idea.
i try to notification apprise with IFTT it's good but no link in the notifications.
i try text and html .
thanks for your job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants