docs(gremlin): create diun

This commit is contained in:
traveler 2026-04-07 12:43:03 -05:00
parent 1c0b25aa25
commit c28e59596c

View file

@ -0,0 +1,119 @@
# diun Stack
description: Diun Stack for NetGrimoire
---
## Overview
The diun stack is a Docker Swarm service that provides the core functionality of the Diun project. It consists of one container running the crazymax/diun:latest image, with user credentials set to 1964:1964.
### Services
| Service | Image | Port | Role |
|---------|-------|------|------|
- **diun** | crazymax/diun:latest | - | Manager/Dashboard |
---
## Architecture
| Service | Image | Port | Role |
|---------|-------|------|------|
- **Host:** docker4
- **Network:** netgrimoire
- **Exposed via:** 0.0.0.0:80 (caddy-docker-proxy labels)
- **Homepage group:** homepage
---
## Build & Configuration
### Prerequisites
None
### Volume Setup
```bash
mkdir -p /DockerVol/diun
chown -R 1964:1964 /DockerVol/diun
```
### Environment Variables
```bash
# generate: openssl rand -hex 32
TZ=America/Chicago
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=default
```
### Deploy
```bash
cd services/swarm/stack/diun
set -a && source .env && set +a
docker stack config --compose-file diun-stack.yml > resolved.yml
docker stack deploy --compose-file resolved.yml diun
rm resolved.yml
docker stack services diun
```
### First Run
```bash
docker stack services diun
# Ensure Caddy is running and forwarding requests to the Diun service
```
---
## User Guide
### Accessing diun
| Service | URL | Purpose |
|---------|-----|---------|
- **Diun**: http://diun.netgrimoire.com (caddy-docker-proxy labels)
### Primary Use Cases
This stack is used as part of the NetGrimoire monitoring setup, providing notification and monitoring functionality.
### NetGrimoire Integrations
This service connects to other services in the NetGrimoire environment through various environment variables and labels.
---
## Operations
### Monitoring
<kuma monitors from kuma.* labels>
```bash
docker stack services diun
<docker service logs commands>
```
### Backups
Critical data is stored on /DockerVol/diun, which should be backed up regularly to prevent loss of data.
### Restore
```bash
cd services/swarm/stack/diun
./deploy.sh
# Redeploys the diun stack with the latest configuration
```
---
## Common Failures
| Failure Mode | Symptom | Cause | Fix |
|-------------|---------|------|-----|
| Diun not starting | No response from Diun | Incorrect environment variables | Check and correct .env file |
| Caddy not forwarding requests | Requests failing to forward to Diun | Incorrect caddy-docker-proxy labels | Verify caddy and Docker Swarm services are running correctly |
---
## Changelog
| Date | Commit | Summary |
|------|--------|---------|
| 2026-04-07 | 4376b722 | Initial documentation for diun stack |
| 2026-02-01 | c4605c36 | Minor updates to Diun configuration |
| 2026-01-10 | 1a374911 | Initial deployment of Diun service |
<Write a paragraph summarizing the evolution of this service based on the diffs above. This is the initial documentation for the diun stack, providing an overview of its functionality and configuration.>
---
## Notes
- Generated by Gremlin on 2026-04-07T17:41:55.262Z
- Source: swarm/diun.yaml
- Review User Guide and Changelog sections