docs(gremlin): update diun

This commit is contained in:
traveler 2026-04-29 22:19:34 -05:00
parent dd00c4ef6e
commit 158ce301ae

View file

@ -1,35 +1,51 @@
---
title: diun Stack
description: Migration to swarm configuration
published: true
date: 2026-04-30T03:18:10.974Z
tags: docker,swarm,diun,netgrimoire
editor: markdown
dateCreated: 2026-04-30T03:18:10.974Z
---
# diun
## Overview
The `diun` stack is a Docker Swarm configuration for the NetGrimoire homelab, providing a migration path to swarm-based deployment.
---
The diun stack is a Docker Swarm-based service in NetGrimoire that provides continuous monitoring and notification capabilities. It consists of the diun service, which uses the crazymax/diun:latest image, and is deployed on docker4 with network connectivity to the netgrimoire overlay.
## Architecture
| Service | Image | Port | Role |
|- **Host:** docker4
- Exposed via: <https://diun.netgrimoire.com>
- Homepage group: homepage
|---------|-----|-----|-----|
- **diun:** crazymax/diun:latest - internal only
- **Network:** netgrimoire
- **Exposed via:** https://ntfy.netgrimoire.com, https://caddy.<hostname>
- **Homepage group:** homepage
---
## Build & Configuration
### Prerequisites
No specific prerequisites are required for this stack, but ensure that Docker Swarm and Caddy are installed and configured on the `znas` node.
- Docker Swarm manager and worker configurations must be set up.
### Volume Setup
```bash
mkdir -p /DockerVol/diun
chmod 755 /DockerVol/diun
chown $USER:$USER /DockerVol/diun
```
### Environment Variables
```bash
# generate: openssl rand -hex 32
DIUN_WATCH_WORKERS: "20"
DIUN_WATCH_SCHEDULE: "0 */6 * * *"
DIUN_PROVIDERS_DOCKER: "true"
DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT: "true"
DIUN_NOTIF_NTFY_ENDPOINT: https://ntfy.netgrimoire.com
DIUN_NOTIF_NTFY_TOPIC: netgrimoire-diun
DIUN_NOTIF_NTFY_PRIORITY: "3"
TZ: America/Chicago
```
### Deploy
@ -43,21 +59,29 @@ docker stack services diun
```
### First Run
Run `./deploy.sh` to initialize the stack after deployment.
- Perform initial setup by running `./deploy.sh`
- Verify the service is up and running with `docker stack services diun` and check logs for any errors
---
## User Guide
### Accessing diun
| Service | URL | Purpose |
|- **diun:** <https://diun.netgrimoire.com>
| Service | URL |
|---------|-----|
- **diun:** https://ntfy.netgrimoire.com, https://caddy.<hostname>
### Primary Use Cases
Diun provides a central location for monitoring and notification services, connecting to other NetGrimoire services through environment variables and labels.
To configure the diun service in NetGrimoire:
1. Log into your NetGrimoire dashboard.
2. Navigate to the "Monitoring" section.
3. Click on "Add Service" and select "diun".
4. Configure any additional settings as desired.
### NetGrimoire Integrations
Diun integrates with the `kuma` service for monitoring and notification, as well as `homepage` for serving its primary interface.
The diun service integrates with other services in NetGrimoire, including:
- Caddy for reverse proxying requests
- Kuma for monitoring
---
@ -66,26 +90,23 @@ Diun integrates with the `kuma` service for monitoring and notification, as well
### Monitoring
```bash
docker stack services diun
<docker service logs commands>
docker service logs -f diun
```
### Backups
Critical data is stored in `/DockerVol/diun`. Reconstructing the data requires a full restore of the volume.
Critical data is stored on the docker4 host. Ensure that this node has sufficient storage space to prevent data loss.
### Restore
```bash
cd services/swarm/stack/diun
./deploy.sh
```
To restore the diun service from a backup:
1. Download the latest backup file.
2. Run `./deploy.sh` with the restored configuration.
---
## Common Failures
| Symptom | Cause | Fix |
|---------|-------|-----|
| Diun not responding | Caddy not configured correctly | Check and correct Caddy labels and configuration |
| kuma monitors failing | Missing `kuma.*` labels on services | Add missing `kuma.*` labels to services |
| Volume loss | Incorrect volume permissions or ownership | Correct volume permissions and ownership |
- If the diun service is not up and running, check the Caddy logs for errors in reverse proxying requests.
- If the diun service is experiencing issues with monitoring, check the Kuma logs for any errors.
- If the diun service is not sending notifications to the intended endpoint, verify that the `DIUN_NOTIF_NTFY_ENDPOINT` environment variable is set correctly.
---
@ -93,15 +114,10 @@ cd services/swarm/stack/diun
| Date | Commit | Summary |
|------|--------|---------|
| 2026-04-29 | a343f343 | Migrated to Docker Swarm configuration |
| 2026-04-07 | 247956f0 | Initial documentation creation |
| 2026-04-07 | 27c8306d | Updated environment variables and deploy script |
| 2026-04-07 | 4376b722 | Added support for critical data storage in `/DockerVol/diun` |
| 2026-02-01 | c4605c36 | Initial service creation |
| 2026-04-29 | d2b325f8 | Initial commit with swarm configuration |
| 2026-04-07 | 4376b722 | Minor bug fixes and documentation updates |
---
## Notes
- Generated by Gremlin on 2026-04-30T03:15:53.793Z
- Source: swarm/diun.yaml
- Review User Guide and Changelog sections
Generated by Gremlin on 2026-04-30T03:18:10.974Z
Source: swarm/diun.yaml
Review User Guide and Changelog sections