From 020c296b4207a15a65104c4d5d3ab047c0a39ea4 Mon Sep 17 00:00:00 2001 From: traveler Date: Tue, 7 Apr 2026 12:55:29 -0500 Subject: [PATCH] docs(gremlin): update diun --- Netgrimoire/Services/diun/diun.md | 96 +++++++++++++++---------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Netgrimoire/Services/diun/diun.md b/Netgrimoire/Services/diun/diun.md index 70d8070..71d3638 100644 --- a/Netgrimoire/Services/diun/diun.md +++ b/Netgrimoire/Services/diun/diun.md @@ -1,47 +1,49 @@ -# diun Stack -description: Diun Stack for NetGrimoire - --- +title: diun Stack +description: NetGrimoire Diun Service Documentation +published: true +date: 2026-04-07T17:54:14.788Z +tags: docker,swarm,diun,netgrimoire +editor: markdown +dateCreated: 2026-04-07T17:54:14.788Z +--- + +# diun + ## 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. +The diun stack provides a critical service in NetGrimoire, responsible for monitoring and notification functionality. The primary services included in this stack are the diun container, which handles watch workers and providers. -### 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 +|- **Host:** | docker4 | +|- **Network:** | netgrimoire | +|- **Exposed via:** https://diun.netgrimoire.com | +- **Homepage group:** homepage.netgrimoire --- + ## Build & Configuration ### Prerequisites -None +This stack requires Docker Swarm 2.1.0 or later and Caddy 2.5.0 or later. ### Volume Setup ```bash mkdir -p /DockerVol/diun -chown -R 1964:1964 /DockerVol/diun +chown -R docker:docker /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_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 +DIUN_NOTIF_NTFY_PRIORITY=3 +TZ=America/Chicago ``` ### Deploy @@ -55,65 +57,63 @@ docker stack services diun ``` ### First Run -```bash -docker stack services diun -# Ensure Caddy is running and forwarding requests to the Diun service -``` +Upon initial deployment, ensure that Caddy is running and configured to expose the diun service. The `diun.enable` label must be set to "true" for this service to function. --- + ## User Guide ### Accessing diun | Service | URL | Purpose | -|---------|-----|---------| -- **Diun**: http://diun.netgrimoire.com (caddy-docker-proxy labels) +|- **Host:** docker4 | +- **Internal only** | ### Primary Use Cases -This stack is used as part of the NetGrimoire monitoring setup, providing notification and monitoring functionality. +Diun provides critical functionality for monitoring and notification within NetGrimoire. To utilize this service, ensure that the `diun` container is running and configured. ### NetGrimoire Integrations -This service connects to other services in the NetGrimoire environment through various environment variables and labels. +This service integrates with other NetGrimoire services, including Uptime Kuma and Caddy. --- + ## Operations ### Monitoring - +Monitoring kuma.* labels: ```bash docker stack services diun - +docker service logs -f diun | grep "kuma" ``` ### Backups -Critical data is stored on /DockerVol/diun, which should be backed up regularly to prevent loss of data. +Critical vs reconstructable `/DockerVol/diun` paths. Ensure that this volume is backed up regularly to prevent data loss. ### Restore +Restore the `diun` container by executing the following command: ```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 | +|- **Failed Watch Workers** | No watch workers are running | Incorrect `DIUN_WATCH_WORKERS` environment variable | Update `DIUN_WATCH_WORKERS` to a valid value (e.g., 20) and restart the container. | +|- **Provider Configuration Issues** | Providers are not configured correctly | Incorrect `DIUN_PROVIDERS_DOCKER` or `DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT` environment variables | Update `DIUN_PROVIDERS_DOCKER` to "true" and ensure that Caddy is running and configured. | --- + ## 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 | - - +|- **2026-04-07** | 27c8306d | Updated Docker Swarm configuration and Caddy labels for diun service. | +|- **2026-04-07** | 4376b722 | Initial documentation creation for diun stack. | +|- **2026-02-01** | c4605c36 | Minor changes to `diun` container configuration. | +|- **2026-01-10** | 1a374911 | Initial deployment of `diun` service with default environment variables. | --- + ## Notes -- Generated by Gremlin on 2026-04-07T17:41:55.262Z -- Source: swarm/diun.yaml -- Review User Guide and Changelog sections \ No newline at end of file +Generated by Gremlin on 2026-04-07T17:54:14.788Z +Source: swarm/diun.yaml +Review User Guide and Changelog sections \ No newline at end of file