Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Latest commit

History

History
143 lines (110 loc) 路 7.2 KB

README.md

File metadata and controls

143 lines (110 loc) 路 7.2 KB

qnap-pushover 馃敂

Python Code Quality Image Size Docker Hub Pulls
Last Commit GitHub Container Registry Build Status Docker Hub Build Status
License Become a GitHub Sponsor Donate via PayPal

Pushover notifications for QNAP NAS system events via python-pushover

Usage

Docker images are available from both GitHub Container Registry (GHCR) and Docker Hub.

If you would prefer to pull from GHCR, simply replace thecatlady/qnap-pushover with ghcr.io/thecatlady/qnap-pushover in the examples below.

Docker Compose (recommended)

Add the following volume and service definitions to a docker-compose.yml file:

volumes:
  qnap-pushover:
services:
  qnap-pushover:
    image: thecatlady/qnap-pushover
    container_name: qnap-pushover
    environment:
      - TZ=America/New_York #optional
      - LOG_LEVEL=WARN #optional
      - NOTIFY_LEVEL=WARN #optional
      - POLL_INTERVAL=10 #optional
      - INCLUDE= #optional
      - EXCLUDE= #optional
      - TESTING_MODE=false #optional
      - PUSHOVER_TOKEN=<Pushover application API token>
      - PUSHOVER_RECIPIENT=<Pushover user and/or group key(s)>
    volumes:
      - qnap-pushover:/data
      - /etc/logs/event.log:/event.log:ro
    restart: always

Then, run the following command from the directory containing your docker-compose.yml file:

docker-compose up -d

Docker CLI

Run the following command to create the required named volume:

docker volume create qnap-pushover

Then, run the following command to create the container:

docker run -d \
  --name=qnap-pushover \
  -e TZ=America/New_York `#optional` \
  -e LOG_LEVEL=WARN `#optional` \
  -e NOTIFY_LEVEL=WARN `#optional` \
  -e POLL_INTERVAL=10 `#optional` \
  -e INCLUDE= `#optional` \
  -e EXCLUDE= `#optional` \
  -e TESTING_MODE=false `#optional` \
  -e PUSHOVER_TOKEN=<Pushover application API token> \
  -e PUSHOVER_RECIPIENT=<Pushover user and/or group key(s)> \
  -v qnap-pushover:/data \
  -v /etc/logs/event.log:/event.log:ro \
  --restart always \
  thecatlady/qnap-pushover

Updating

The process to update the container when a new image is available is dependent on how you set it up initially.

Docker Compose

Run the following commands from the directory containing your docker-compose.yml file:

docker-compose pull qnap-pushover
docker-compose up -d
docker image prune

Docker CLI

Run the commands below, followed by your original docker run command:

docker stop qnap-pushover
docker rm qnap-pushover
docker pull thecatlady/qnap-pushover
docker image prune

Parameters

The container image is configured using the following parameters passed at runtime:

Parameter Function Default Value Required?
-e TZ= TZ database name of NAS time zone; e.g., America/New_York no
-e LOG_LEVEL= Container logging level; DEBUG < INFO < WARN < ERROR < CRITICAL WARN no
-e NOTIFY_LEVEL= Minimum system event type to generate a notification; INFO < WARN < ERROR WARN no
-e POLL_INTERVAL= Poll interval in seconds 10 no
-e INCLUDE= List of keywords which must be present in the event description to trigger a notification (comma-delimited) no
-e EXCLUDE= List of keywords which must not be present in the event description to trigger a notification (comma-delimited) no
-e TESTING_MODE= Testing mode (true or false); if set to true, will re-queue the last 10 system log events at every container start and result in duplicate notifications false no
-e PUSHOVER_TOKEN= Pushover application API token; e.g., azGDORePK8gMaC0QOYAMyEEuzJnyUi yes
-e PUSHOVER_RECIPIENT= Pushover user and/or group key(s); e.g., uQiRzpo4DXghDmr9QzzfQu27cmVRsG or gznej3rKEVAvPUxu9vvNnqpmZpokzF (up to 50, comma-delimited) yes
-v qnap-pushover:/data Container data volume yes
-v /etc/logs/event.log:/event.log:ro QNAP event logs (mounted as read-only) yes
--restart Container restart policy (always or unless-stopped recommended) no no

Building Locally

If you would like to make modifications to the code, you can build the Docker image yourself instead of pulling the pre-built image available from GitHub Container Registry (GHCR) and Docker Hub.

git clone https://github.com/TheCatLady/docker-qnap-pushover.git
cd docker-qnap-pushover
docker build --no-cache --pull -t thecatlady/qnap-pushover .

Once the image has been built, follow the directions in the "Usage" section above to start the container.

How to Contribute

Show your support by starring this project! 馃専 Pull requests, bug reports, and feature requests are also welcome!

You can also support me by becoming a GitHub sponsor or making a one-time PayPal donation 馃挅