https://github.com/harshhome/diun-boost
diun-boost automatically generates and updates your DIUN configuration with smart version matching, keeping your container monitoring fast, accurate, and fully automated.
https://github.com/harshhome/diun-boost
automation diun docker docker-compose monitoring python self-hosted
Last synced: 8 months ago
JSON representation
diun-boost automatically generates and updates your DIUN configuration with smart version matching, keeping your container monitoring fast, accurate, and fully automated.
- Host: GitHub
- URL: https://github.com/harshhome/diun-boost
- Owner: harshhome
- License: mit
- Created: 2025-04-27T19:49:31.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-09T10:28:41.000Z (about 1 year ago)
- Last Synced: 2025-05-13T13:11:55.555Z (about 1 year ago)
- Topics: automation, diun, docker, docker-compose, monitoring, python, self-hosted
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# diun-boost π π³ π¦
[](https://github.com/harshhome/diun-boost/releases/latest)
[](https://hub.docker.com/r/harshbaldwa/diun-boost)
[](https://github.com/harshhome/diun-boost/stargazers)
[](https://hub.docker.com/r/harshbaldwa/diun-boost)
[](https://github.com/harshhome/diun-boost/issues)
[](https://github.com/harshhome/diun-boost)
[](https://hub.docker.com/r/harshbaldwa/diun-boost)
[](https://www.python.org/)


Automated [DIUN](https://crazymax.dev/diun/) File Provider YAML Generator for Smarter Docker Image Monitoring
## π General Description
**diun-boost** is a β‘ **utility tool** β‘ that dynamically generates a `config.yml` file designed to be used with DIUN's [File Provider](https://crazymax.dev/diun/providers/file/).
> *Important*: diun-boost **only generates** the configuration file (`config.yml`) for DIUN. It does **NOT monitor** container updates itself. DIUN will use the generated file to monitor images! π
This tool simplifies managing large DIUN configurations by automatically creating version-aware watch entries based on your running Docker containers and generate rules that monitors only newer [semver](https://semver.org) tags.
## β¨ Features
### π§ Smart Semantic Versioning Support
Version matching is **depth-aware** β only tags with the **same number of components** (segments) are compared:
- β
`1.0.0` matches:
- `1.0.1`, `1.1.0`, `2.0.0`
- β
`1.0` matches:
- `1.1`, `2.0`
- β
`1.2.3.4` matches:
- `1.2.3.5`, `1.2.4.0`, `2.0.0.0`
- β No match to shorter (`1.0`, `1`) or longer (`1.0.0.1`) tags
> π All segments must match in **depth** and be **equal or greater** in value.
### π·οΈ Arbitrary Prefix Support
Supports any prefix (e.g. `v`, `pg`, `nodejs-`, `redis-`), preserving it in all matches:
- Examples:
- `v1.0.0`, `pg13.5.1`, `nodejs-18.16.0`, `nginx1.25.3`
### π― Suffix-Aware Version Comparison
Suffixes and their versions are independently compared:
- A tag like `v1.2.0.12-build12` will match:
- `v1.2.0.12-build13` β
(same main version, higher suffix version)
- `v1.2.0.13-build11` β
(higher main version, lower suffix version still okay)
- Both the **main version** and **suffix version** are evaluated using depth-aware comparison
### β
Non-Semver & Static Tag Matching
Tags that donβt follow semantic versioning β like:
- `latest`, `20240518`, `final-build`, `beta`
- Are matched **exactly**, no version logic is applied.
### π Test Regex Live
π Explore the version matching logic and patterns here: [Regex 101 pattern](https://regex101.com/r/u8sAuo/1)
### π€ Minimal Setup:
- Works out of the box using Docker π³.
- Supports linux/amd64 and linux/arm64 architectures.
- Small and lightweight image (~50MB) πΎ
- No external dependencies required.
- Built using `python:slim` base image with minimal runtime footprint.
## π οΈ How to Run
### Using `docker run`
```bash
docker run -d \
--name diun-boost \
-e DIUN_YAML_PATH="/config/config.yml" \
-e CRON_SCHEDULE="0 */6 * * *" \
-e LOG_LEVEL="INFO" \
-e WATCHBYDEFAULT="false" \
-e DOCKER_COMPOSE_METADATA="false" \
-v "$(pwd)/config:/config" \
-v "/var/run/docker.sock:/var/run/docker.sock" \
harshbaldwa/diun-boost:1.3.0
```
#### Environment Variables
| Variable | Description | Default Value |
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `DIUN_YAML_PATH` | Path to the shared `config.yml` file that DIUN will read. | `/config/config.yml` |
| `CRON_SCHEDULE` | Cron schedule expression to control how often the YAML file is regenerated. | `0 */6 * * *` |
| `LOG_LEVEL` | Logging level for diun-boost. Available options: `DEBUG`, `INFO`, `WARNING`, `ERROR`. | `INFO` |
| `WATCHBYDEFAULT` | Set to `true` to watch **all running containers** by default.
However, any container explicitly labeled with `diun.enable=false` will always be excluded.
If set to `false`, only containers with the label `diun.enable=true` are watched. | `false` |
| `DOCKER_COMPOSE_METADATA` | Set to `true` to include Docker Compose metadata in the generated YAML file.
This is useful for identifying containers in a multi-container setup as well as for notifications with DIUN.
If set to `false`, only the container name will be used. | `false` |
#### Volume Mounts
| Mount Path | Description |
|----------------------------|-------------------------------------------------------|
| `/var/run/docker.sock` | Required for accessing the Docker API from the container. |
| `$(pwd)/config` | Local directory to store the generated `config.yml` file. |
### Using Docker Compose
```yaml
services:
diun-boost:
container_name: diun-boost
image: harshbaldwa/diun-boost:1.3.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
environment:
- DIUN_YAML_PATH=/config/config.yml
- CRON_SCHEDULE=0 */6 * * *
- LOG_LEVEL=INFO
- WATCHBYDEFAULT=false
- DOCKER_COMPOSE_METADATA=false
restart: unless-stopped
```
>**π₯ Tip**: Adjust volume mounts to match your environment.
### π Sample Dummy Code for Diun
Example base `diun.yml` file for DIUN:
```yaml
watch:
workers: 20
schedule: "2 */6 * * *"
defaults:
sortTags: semver
maxTags: 10
providers:
file:
filename: /config/config.yml
```
`docker-compose.yml` file for DIUN and **diun-boost**:
```yaml
services:
diun:
container_name: diun
image: crazymax/diun:latest
volumes:
- ./data:/data
- ./diun.yml:/diun.yml:ro
- ./config:/config:ro
environment:
- "TZ=America/New_York"
restart: unless-stopped
diun-boost:
container_name: diun-boost
image: harshbaldwa/diun-boost:1.3.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
environment:
- DIUN_YAML_PATH=/config/config.yml
- CRON_SCHEDULE=0 */6 * * *
- LOG_LEVEL=INFO
- WATCHBYDEFAULT=false
- DOCKER_COMPOSE_METADATA=false
restart: unless-stopped
```
## β€οΈ Support This Project
If you find diun-boost useful, fuel its growth by buying me a coffee!
[](https://www.buymeacoffee.com/harshbaldwa)
Every coffee helps keep open-source alive and thriving! π
## π License
This project is licensed under the MIT License.
> Made with β€οΈ by **Harshvardhan Baldwa** for the homelab and DevOps community!