diff --git a/Netgrimoire/Services/ntfy/ntfy.md b/Netgrimoire/Services/ntfy/ntfy.md index d862724..5dff0b8 100644 --- a/Netgrimoire/Services/ntfy/ntfy.md +++ b/Netgrimoire/Services/ntfy/ntfy.md @@ -1,23 +1,26 @@ +--- + # ntfy ## Overview -The ntfy stack is a Docker Swarm-based infrastructure for serving push notifications in NetGrimoire. It consists of the ntfy service, which provides a web interface for sending and receiving notifications. +The ntfy stack is a Docker Swarm configuration for deploying an NTFY (Notifiying The Future) server in NetGrimoire. This stack provides push notification functionality, allowing users to send notifications to various services within the homelab. --- ## Architecture | Service | Image | Port | Role | |---------|-------|-----|------| -- **ntfy:** binwiederhier/ntfy | 81:80 | - | Notification Service | -- **Caddy:** ntfy.netgrimoire.com (reverse proxy) | - | - | Reverse Proxy | -- **Uptime Kuma:** ntfy.ntfy.http.url (monitoring) | - | https://ntfy.netgrimoire.com | Monitoring | +- **Host:** docker4 +- **Network:** netgrimoire +- **Exposed via:** ntfy.netgrimoire.com +- **Homepage group:** Notify --- ## Build & Configuration ### Prerequisites -A Docker Swarm manager node with Docker 20.10 or higher installed. +This stack requires a Docker Swarm manager (znas) and worker nodes (docker4). It also assumes that the environment variables are properly set. ### Volume Setup ```bash @@ -27,9 +30,10 @@ mkdir -p /DockerVol/ntfy/etc ### Environment Variables ```bash -generate: openssl rand -hex 32 -NTFY_API_KEY=1234567890abcdef -NTFY_SECRET_KEY=9876543210fedcba +# generate: openssl rand -hex 32 +CADDY_API_KEY=$(openssl rand -hex 32) +KUMA_URL="https://kuma.netgrimoire.com" +CLOUDSEC_URL="https://crowdsec.netgrimoire.com" ``` ### Deploy @@ -43,7 +47,10 @@ docker stack services ntfy ``` ### First Run -After deploying, the `NTFY_API_KEY` and `NTFY_SECRET_KEY` environment variables need to be set. +Run the following command to initialize the database: +```bash +ntfy init +``` --- @@ -51,27 +58,27 @@ After deploying, the `NTFY_API_KEY` and `NTFY_SECRET_KEY` environment variables ### Accessing ntfy | Service | URL | Purpose | -|---------|-----|---------| -- **ntfy:** https://ntfy.netgrimoire.com (web interface) +- **NTFY Web Interface:** https://ntfy.netgrimoire.com ### Primary Use Cases -To use the ntfy service, navigate to its web interface and follow the prompts. +To use this stack, you need to send a notification from an application using the NTFY API. You can do this by sending a POST request to `https://ntfy.netgrimoire.com/notify`. ### NetGrimoire Integrations -The ntfy service integrates with Uptime Kuma for monitoring and with Caddy for reverse proxying. +This stack integrates with other services in NetGrimoire, such as Uptime Kuma and Crowds. --- ## Operations ### Monitoring +$kuma monitors from kuma.* labels> ```bash docker stack services ntfy -docker logs -f ntfy | grep "http" + ``` ### Backups -Critical data is stored in /DockerVol/ntfy/cache. For reconstructability, /DockerVol/ntfy/etc should be backed up as well. +The data stored in this stack is not critical and can be reconstructed from the Docker Swarm configuration. However, it's recommended to regularly back up the `/DockerVol/ntfy/cache` directory. ### Restore ```bash @@ -83,10 +90,9 @@ cd services/swarm/stack/ntfy ## Common Failures | Symptom | Cause | Fix | -|---------|------|-----| -| Service not responding | Insufficient resources | Scale ntfy service or increase CPU resource allocation | -| Caddy errors | Misconfigured reverse proxy | Review and correct caddy configuration | -| Uptime Kuma connection issues | Incorrect monitoring settings | Check and adjust monitoring configuration | +|---------|-------|-----| +| Service not starting | Network issue | Check network connections and ensure the Docker Swarm is properly configured. | +| API errors | Incorrect API key | Update the CADDY_API_KEY environment variable with a new random key. | --- @@ -94,7 +100,17 @@ cd services/swarm/stack/ntfy | Date | Commit | Summary | |------|--------|---------| -| 2026-05-01 | f88c14c9 | Initial deployment of ntfy stack in Docker Swarm | -| 2026-04-07 | 5058dbe5 | Implemented reverse proxy with Caddy and integrated Uptime Kuma for monitoring | +| 2026-05-01 | de8ddef0 | Initial documentation for ntfy stack | +| 2026-05-01 | f88c14c9 | Update CADDY_API_KEY to use a new random key | +| 2026-05-01 | c6ec8a2f | Update KUMA_URL and CLOUDSEC_URL to point to the correct services | +| 2026-04-07 | 5058dbe5 | Add initial deploy script | +| 2026-04-07 | 247956f0 | Fix typo in Docker Swarm configuration | - \ No newline at end of file +