Docker Image Update Notifier - DIUN

I looked in the forums and didn’t see this mentioned so wanted to share with the community.

So, with the release of Electric Eel and the ability to reliably deploy custom docker apps I found the need to be able to monitor my apps so that I could be notified when new updates were available to deploy. This ability is built into the TrueNAS community apps at a basic level; the update notification is displayed when you log into the GUI and check the Apps section. What I was looking for was having the system notify me that a new version was available; in my case using the Pushover app. What I found was DIUN and after some initial setup and configuration I’ve got it monitoring most of my apps including the TrueNAS community ones. All that is needed is to add a simple label to tell the app to monitor the container. The only downside I’ve found is that the community containers are hit/miss on using the “Labels Configuration” section that allows you to add the label needed. I’ve created an issue in github for this so if anyone finds this helpful, give it a thumbs up.

2 Likes

Hey @Spunky17

As was just replied in our Github by one of our Apps team, we’re working on this already for the “v2” library in the Apps catalog, which everything is converting over to now. It’s a bit of an involved process so please bear with us - but that should make all of the apps compatible with DIUN monitoring. :slight_smile:

@HoneyBadger no worries at all. I saw that my github was closed in favor of an existing request which I’ve shared below. Again no pressure at all just wanted to share this out to the community and contribute. :slight_smile:

1 Like

If you want to write up a quick summary of the setup and configuration, I’d be happy to port it into the Resources section on your behalf so it’s easily searchable for future TrueNAS users.

1 Like

I can do that but I have issues posting the configs here as they keep deforming.

We support Markdown here, so you can go straight from .md to here or paste unformatted plaintext and edit in place.

Multi-line codeblocks are supported with triple-backticks as well - ``` text ``` - and will render

just
like
this
1 Like

For those that are curious about setting this up here is a quick summary of the setup I used to monitor my apps and notify via pushover.

Deploy a custom app via Apps → Discover Apps and then click the 3 dots in the upper left corner by “Custom App”.
image

This will bring up the dialog to deploy a custom yaml file. I’ve outlined what I used below. Update accordingly for your environment.

services:
  diun:
    command: serve
    environment:
      - TZ=Etc/UTC
      - CONFIG=/data/diun.yml
      - DIUN_PROVIDERS_DOCKER=true
    hostname: diun
    image: crazymax/diun:latest
    labels:
      - diun.enable=true
    restart: always
    volumes:
      - <host path where you want to store data>:/data
      - /var/run/docker.sock:/var/run/docker.sock
version: '3.5'

In the directory path used above to map to /data in the container, create a file called “diun.yml”. There are a ton of settings from the developers website so again tweak to your needs. Below is what I used in my environment.

db:
  path: /data/diun.db

watch:
  workers: 20
  schedule: "0 */6 * * *"
  jitter: 30s
  firstCheckNotif: false
  runOnStartup: true

notif:
  pushover:
    token: <app token from pushover website>
    recipient: <user token from pushover website>
    priority: -2
    sound: none
    templateTitle: "App Updated: {{ .Meta.Name }}"
    templateBody: "Current version: {{ .Meta.Version }}\n New version: {{ .Entry.Manifest.DockerVersion }}"

providers:
  docker:
    watchStopped: true
    watchByDefault: false

Once you have the above setup all that is needed now is to add the proper label to your apps. If your using TrueNAS community apps you need to edit the app and add the label “diun.enable=true” to the “Labels Configuration” section and make sure to add the container as it’s not selected by default. My setting for Plex is noted below.

If you are using custom deployed apps similar to how this one is deployed, all you need to do is add the labels section to your yaml file and save it. It will redeploy with the new label. Below is my config for my Headphones app.

services:
  headphones:
    container_name: headphones
    environment:
      - PUID=568
      - PGID=568
      - TZ=Etc/UTC
    image: lscr.io/linuxserver/headphones:latest
    labels:
      - diun.enable=true

Once you have setup the apps you want to monitor with the label, stop and restart the DIUN app so that it refreshes it’s database. Once it’s restarted you can connect to the container shell and see the apps it’s monitoring and test the notifications.

That is all there is to it. The container will check every 6 hours for new versions of the configured apps and notify you if a new one is available.

Abracadabra, you’re a Resource Owner!

1 Like