updated readme for v0.1 release
Security / security (push) Successful in 58s
Security / security (pull_request) Successful in 53s

This commit is contained in:
2026-06-02 20:45:52 -05:00
parent 075c6079c3
commit 2d45156a08
+53 -29
View File
@@ -1,18 +1,33 @@
# donetick-notifier # donetick-notifier
A small PowerShell notifier for [Donetick](https://github.com/donetick/donetick) chores. > AI disclaimer: AI was used solely for creating this README, the Gitea pipelines, and the base of the webhook consumer.
The notifier checks the Donetick external API for chores, groups tasks that are overdue or due today, and sends summary notifications through an Apprise-compatible webhook. A PowerShell-based notifier and webhook consumer for [Donetick](https://github.com/donetick/donetick) chores.
## What it does The project now has two runtime paths:
- A scheduled notifier that checks the Donetick external API for chores and sends Apprise-compatible summary notifications for overdue and due-today tasks.
- A webhook consumer that listens on port `8080`, accepts Donetick webhook payloads, and turns them into Apprise notifications.
## Features
- Fetches chores from `https://<DONETICKHOST>:<DONETICKPORT>/eapi/v1/chore`. - Fetches chores from `https://<DONETICKHOST>:<DONETICKPORT>/eapi/v1/chore`.
- Authenticates to Donetick with the `secretkey` header. - Authenticates to Donetick with the `secretkey` header.
- Sends one Apprise notification for overdue tasks, when any exist. - Sends one notification for overdue chores when any exist.
- Sends one Apprise notification for tasks due today, when any exist. - Sends one notification for chores due today when any exist.
- Runs continuously and sleeps until the next configured notification hour. - Accepts webhook events for `task.completed`, `task.reminder`, and `task.created`.
- Falls back to a generic notification for unknown webhook event types.
- Runs the scheduler and webhook listener together in the Docker container.
- Includes Gitea pipelines for Docker image publishing and security scanning.
The container is intended to stay running. Configure the notification hours with `NOTIFICATIONTIMES`; the script wakes up at those hours, checks chores, sends any needed notifications, then sleeps until the next configured hour. ## How It Runs
The container entrypoint is `main.sh`.
- `supercronic` runs `Start-DoneTickNotifier.ps1` on the schedule defined by `JOB_SCHEDULE`.
- `Start-DoneTickConsumer.ps1` runs in the foreground and listens on `http://+:8080/`.
The notifier and consumer both use `AppriseNotification.psm1` to send messages to the configured Apprise webhook.
## Configuration ## Configuration
@@ -25,28 +40,25 @@ All configuration is provided through environment variables.
| `DONETICKAPIKEY` | Yes | Donetick external API key. Sent as the `secretkey` header. | | `DONETICKAPIKEY` | Yes | Donetick external API key. Sent as the `secretkey` header. |
| `APPRISEWEBHOOKURL` | Yes | Apprise webhook URL that accepts notification posts. | | `APPRISEWEBHOOKURL` | Yes | Apprise webhook URL that accepts notification posts. |
| `APPRISEWEBHOOKTAG` | Yes | Apprise tag value to include with each notification. | | `APPRISEWEBHOOKTAG` | Yes | Apprise tag value to include with each notification. |
| `NOTIFICATIONTIMES` | No | Comma-separated list of 24-hour clock hours when notifications should be sent, such as `8,12,17`. Defaults to `8` when unset. | | `JOB_SCHEDULE` | Yes for Docker | Cron expression used by the container scheduler, such as `0 8,17 * * *`. |
| `TZ` | No | Container timezone, such as `America/Chicago`. Recommended so notification hours match your local time. | | `TZ` | No | Container timezone, such as `America/Chicago`. Recommended so notification hours match your local time. |
## Docker ## Docker
The published image is: The published image is `docker.io/blinkfink182/donetick-notifier`.
```text
docker.io/blinkfink182/donetick-notifier
```
### Run ### Run
```sh ```sh
docker run -d \ docker run -d \
--name donetick-notifier \ --name donetick-notifier \
-p 8080:8080 \
-e DONETICKHOST=host.docker.internal \ -e DONETICKHOST=host.docker.internal \
-e DONETICKPORT=8787 \ -e DONETICKPORT=8787 \
-e DONETICKAPIKEY=your-donetick-api-key \ -e DONETICKAPIKEY=your-donetick-api-key \
-e APPRISEWEBHOOKURL=https://apprise.example.com/notify/config \ -e APPRISEWEBHOOKURL=https://apprise.example.com/notify/config \
-e APPRISEWEBHOOKTAG=all \ -e APPRISEWEBHOOKTAG=all \
-e NOTIFICATIONTIMES=8,12,17 \ -e JOB_SCHEDULE="0 8,17 * * *" \
-e TZ=America/Chicago \ -e TZ=America/Chicago \
docker.io/blinkfink182/donetick-notifier docker.io/blinkfink182/donetick-notifier
``` ```
@@ -58,13 +70,15 @@ services:
donetick-notifier: donetick-notifier:
container_name: donetick-notifier container_name: donetick-notifier
image: docker.io/blinkfink182/donetick-notifier image: docker.io/blinkfink182/donetick-notifier
ports:
- 8080:8080
environment: environment:
- DONETICKHOST=host.docker.internal - DONETICKHOST=host.docker.internal
- DONETICKPORT=8787 - DONETICKPORT=8787
- DONETICKAPIKEY=your-donetick-api-key - DONETICKAPIKEY=your-donetick-api-key
- APPRISEWEBHOOKURL=https://apprise.example.com/notify/config - APPRISEWEBHOOKURL=https://apprise.example.com/notify/config
- APPRISEWEBHOOKTAG=all - APPRISEWEBHOOKTAG=all
- NOTIFICATIONTIMES=8,12,17 - JOB_SCHEDULE=0 8,17 * * *
- TZ=America/Chicago - TZ=America/Chicago
``` ```
@@ -74,19 +88,21 @@ Run it with:
docker compose up -d docker compose up -d
``` ```
If Donetick and Apprise are running on the same Docker network, use the service names instead of `host.docker.internal`. If Donetick and Apprise are on the same Docker network, use service names instead of `host.docker.internal`.
```yaml ```yaml
services: services:
donetick-notifier: donetick-notifier:
image: docker.io/blinkfink182/donetick-notifier image: docker.io/blinkfink182/donetick-notifier
ports:
- 8080:8080
environment: environment:
- DONETICKHOST=donetick - DONETICKHOST=donetick
- DONETICKPORT=8787 - DONETICKPORT=8787
- DONETICKAPIKEY=your-donetick-api-key - DONETICKAPIKEY=your-donetick-api-key
- APPRISEWEBHOOKURL=http://apprise:8000/notify/config - APPRISEWEBHOOKURL=http://apprise:8000/notify/config
- APPRISEWEBHOOKTAG=all - APPRISEWEBHOOKTAG=all
- NOTIFICATIONTIMES=8,12,17 - JOB_SCHEDULE=0 8,17 * * *
- TZ=America/Chicago - TZ=America/Chicago
``` ```
@@ -99,12 +115,13 @@ docker build -t donetick-notifier .
```sh ```sh
docker run -d \ docker run -d \
--name donetick-notifier \ --name donetick-notifier \
-p 8080:8080 \
-e DONETICKHOST=host.docker.internal \ -e DONETICKHOST=host.docker.internal \
-e DONETICKPORT=8787 \ -e DONETICKPORT=8787 \
-e DONETICKAPIKEY=your-donetick-api-key \ -e DONETICKAPIKEY=your-donetick-api-key \
-e APPRISEWEBHOOKURL=https://apprise.example.com/notify/config \ -e APPRISEWEBHOOKURL=https://apprise.example.com/notify/config \
-e APPRISEWEBHOOKTAG=all \ -e APPRISEWEBHOOKTAG=all \
-e NOTIFICATIONTIMES=8,12,17 \ -e JOB_SCHEDULE="0 8,17 * * *" \
-e TZ=America/Chicago \ -e TZ=America/Chicago \
donetick-notifier donetick-notifier
``` ```
@@ -113,34 +130,41 @@ docker run -d \
PowerShell 7 or newer is recommended. PowerShell 7 or newer is recommended.
Scheduled notifier:
```powershell ```powershell
$env:DONETICKHOST = "donetick.example.com" $env:DONETICKHOST = "donetick.example.com"
$env:DONETICKPORT = "8787" $env:DONETICKPORT = "8787"
$env:DONETICKAPIKEY = "your-donetick-api-key" $env:DONETICKAPIKEY = "your-donetick-api-key"
$env:APPRISEWEBHOOKURL = "https://apprise.example.com/notify/config" $env:APPRISEWEBHOOKURL = "https://apprise.example.com/notify/config"
$env:APPRISEWEBHOOKTAG = "all" $env:APPRISEWEBHOOKTAG = "all"
$env:NOTIFICATIONTIMES = "8,12,17"
pwsh ./Start-DoneTickNotifier.ps1 pwsh ./Start-DoneTickNotifier.ps1
``` ```
The script runs continuously. Stop it with `Ctrl+C` when running interactively. Webhook consumer:
```powershell
$env:APPRISEWEBHOOKURL = "https://apprise.example.com/notify/config"
$env:APPRISEWEBHOOKTAG = "all"
pwsh ./Start-DoneTickConsumer.ps1
```
The consumer listens on port `8080` by default. Stop either script with `Ctrl+C` when running interactively.
## CI/CD ## CI/CD
This repository includes Gitea workflows for: This repository includes Gitea workflows for:
- Building and pushing the Docker image on demand. - Building and pushing the Docker image on manual dispatch.
- Tagging images as `latest` for `main`, as the ref name for `v*` tags, and as `test` for everything else.
- Running security checks with Gitleaks, Semgrep, and Trivy. - Running security checks with Gitleaks, Semgrep, and Trivy.
- Creating Gitea issues for security findings when configured with a `GITEA_TOKEN`. - Creating Gitea issues for security findings when `GITEA_TOKEN` is configured.
- Sending Apprise notifications for Docker build success or failure. - Sending Apprise notifications for Docker build success or failure.
The security workflow runs on pushes, pull requests, and manual dispatch. On pushes, it also pushes the scanned Docker image when all checks pass. The security workflow runs on pushes, pull requests, and manual dispatch. On push, it also builds the image so Trivy can scan the resulting container.
Docker images are tagged as: ## API References
| Branch or ref | Image tag | The `Donetick/` directory contains request examples and collection metadata used to document and exercise the Donetick API while developing the notifier.
| --- | --- |
| `main` | `latest` |
| refs beginning with `v` | matching ref name, such as `v1.0.0` |
| all other refs | `test` |