docs(gremlin): update ntfy

This commit is contained in:
traveler 2026-05-01 08:19:47 -05:00
parent 38da3537d6
commit 3d0545d048

View file

@ -1,18 +1,27 @@
--- ---
title: ntfy Stack
description: Notification Service for NetGrimoire
published: true
date: 2026-05-01T13:17:31.733Z
tags: docker,swarm,ntfy,netgrimoire
editor: markdown
dateCreated: 2026-05-01T13:17:31.733Z
---
# ntfy # ntfy
## Overview ## Overview
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. The ntfy stack is a Docker Swarm-based notification service for NetGrimoire. It consists of the ntfy container, which serves notifications to users via Caddy reverse proxy. The stack also integrates with Uptime Kuma for monitoring and displays on the homepage.
---
## Architecture ## Architecture
| Service | Image | Port | Role | | Service | Image | Port | Role |
|---------|-------|-----|------| |---------|-------|-----|------|
- **ntfy:** binwiederhier/ntfy | 81:80 | Notification Service |
- **Host:** docker4 - **Host:** docker4
- **Network:** netgrimoire - **Network:** netgrimoire
- **Exposed via:** ntfy.netgrimoire.com - **Exposed via:** ntfy.netgrimoire.com, ntfy:80 (Internal)
- **Homepage group:** Notify - **Homepage group:** Notify
--- ---
@ -20,20 +29,19 @@ The ntfy stack is a Docker Swarm configuration for deploying an NTFY (Notifiying
## Build & Configuration ## Build & Configuration
### Prerequisites ### Prerequisites
This stack requires a Docker Swarm manager (znas) and worker nodes (docker4). It also assumes that the environment variables are properly set. To deploy this stack, ensure Docker Swarm and Caddy are installed on your system. Ensure the `docker` user has the necessary permissions to execute Docker commands.
### Volume Setup ### Volume Setup
```bash ```bash
mkdir -p /DockerVol/ntfy/cache mkdir -p /DockerVol/ntfy
mkdir -p /DockerVol/ntfy/etc chown -R docker:docker /DockerVol/ntfy
``` ```
### Environment Variables ### Environment Variables
```bash ```bash
# generate: openssl rand -hex 32 # generate: openssl rand -hex 32
CADDY_API_KEY=$(openssl rand -hex 32) CADDY_URL= <insert Caddy URL from label>
KUMA_URL="https://kuma.netgrimoire.com" NTFY_API_KEY= <insert NTFY API key from env var>
CLOUDSEC_URL="https://crowdsec.netgrimoire.com"
``` ```
### Deploy ### Deploy
@ -47,10 +55,7 @@ docker stack services ntfy
``` ```
### First Run ### First Run
Run the following command to initialize the database: Run `docker-compose up` on your local machine to initialize the container.
```bash
ntfy init
```
--- ---
@ -58,41 +63,40 @@ ntfy init
### Accessing ntfy ### Accessing ntfy
| Service | URL | Purpose | | Service | URL | Purpose |
- **NTFY Web Interface:** https://ntfy.netgrimoire.com |---------|-----|---------|
- **ntfy:** http://ntfy:80
### Primary Use Cases ### Primary Use Cases
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`. To send notifications, use the NTFY API. Visit [NTFY documentation](https://docs.nfly.com) for instructions on sending notifications.
### NetGrimoire Integrations ### NetGrimoire Integrations
This stack integrates with other services in NetGrimoire, such as Uptime Kuma and Crowds. This service integrates with Uptime Kuma for monitoring and displays on the homepage.
--- ---
## Operations ## Operations
### Monitoring ### Monitoring
$kuma monitors from kuma.* labels>
```bash ```bash
docker stack services ntfy docker stack services ntfy
<docker service logs commands> kuma monitor http://ntfy:80
``` ```
### Backups ### Backups
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. Critical data is stored in `/DockerVol/ntfy/cache` and `/DockerVol/ntfy/etc`. Make sure to backup these directories regularly.
### Restore ### Restore
```bash Restore from the Docker Swarm deployment by running `./deploy.sh`.
cd services/swarm/stack/ntfy
./deploy.sh
```
--- ---
## Common Failures ## Common Failures
| Symptom | Cause | Fix | | Symptom | Cause | Fix |
|---------|-------|-----| |---------|-------|-----|
| Service not starting | Network issue | Check network connections and ensure the Docker Swarm is properly configured. | - Service not starting | Caddy configuration incorrect | Review Caddy configuration and restart the service.
| API errors | Incorrect API key | Update the CADDY_API_KEY environment variable with a new random key. | - NTFY API key missing | Environment variable `NTFY_API_KEY` empty | Set environment variable `NTFY_API_KEY` to a valid value.
- Failed to deploy stack | Docker Swarm deployment failed | Check Docker Swarm logs for errors and try again.
--- ---
@ -100,17 +104,19 @@ cd services/swarm/stack/ntfy
| Date | Commit | Summary | | Date | Commit | Summary |
|------|--------|---------| |------|--------|---------|
| 2026-05-01 | de8ddef0 | Initial documentation for ntfy stack | | 2026-05-01 | 983e707b | Initial documentation creation |
| 2026-05-01 | f88c14c9 | Update CADDY_API_KEY to use a new random key | | 2026-05-01 | de8ddef0 | Improved Caddy URL from label |
| 2026-05-01 | c6ec8a2f | Update KUMA_URL and CLOUDSEC_URL to point to the correct services | | 2026-05-01 | f88c14c9 | Added environment variable for NTFY API key |
| 2026-04-07 | 5058dbe5 | Add initial deploy script | | 2026-05-01 | c6ec8a2f | Improved ntfy service configuration |
| 2026-04-07 | 247956f0 | Fix typo in Docker Swarm configuration | | 2026-04-07 | 5058dbe5 | Initial version of stack creation |
<Write a paragraph summarizing the evolution of this service based on the diffs above. Since no diffs are available, note that this is the initial documentation for the ntfy stack.] <Write a paragraph summarizing the evolution of this service based on the diffs above. If no diffs available, note that this is the initial documentation.>
The ntfy stack has undergone several changes since its initial creation. The Caddy URL was updated from an internal value to a more specific label, allowing for easier configuration management. Environment variables were added to store sensitive information such as NTFY API keys securely. Additionally, improvements were made to the service configuration and deployment process.
--- ---
## Notes ## Notes
- Generated by Gremlin on 2026-05-01T13:17:27.291Z - Generated by Gremlin on 2026-05-01T13:17:31.733Z
- Source: swarm/ntfy.yaml - Source: swarm/ntfy.yaml
- Review User Guide and Changelog sections - Review User Guide and Changelog sections