crazy-max / diun

Receive notifications when an image is updated on a Docker registry
https://crazymax.dev/diun/
MIT License
2.97k stars 112 forks source link

Only receiving notification after image has already been updated #1123

Closed Circenn5130 closed 6 months ago

Circenn5130 commented 6 months ago

Discussed in https://github.com/crazy-max/diun/discussions/1114

Originally posted by **Circenn5130** March 7, 2024 I've probably done something wrong, but I can't figure out how to get my notification of a new/updated image. Currently the notice is only received after I've already performed an update, and the notice is of the update that I just performed. Ex: - jellyfin/jellyfin:10.8.11 > jellyfin/jellyfin:10.8.13 - Upon next cron I'll get an notice from Diun that jellyfin:10.8.13 is available ``` LOG_LEVEL=info TZ=America/New_York DIUN_WATCH_WORKERS=10 DIUN_WATCH_SCHEDULE=0 */6 * * * DIUN_WATCH_JITTER=30s DIUN_WATCH_FIRSTCHECKNOTIF=true DIUN_WATCH_RUNONSTARTUP=true DIUN_DEFAULTS_NOTIFYON=new,update DIUN_PROVIDERS_KUBERNETES=true PROVIDERS_KUBERNETES_NAMESPACES=redacted DIUN_NOTIF_NTFY_ENDPOINT=https://redacted DIUN_NOTIF_NTFY_TOPIC=redacted DIUN_NOTIF_NTFY_PRIORITY=3 DIUN_NOTIF_NTFY_TEMPLATETITLE={{ .Entry.Image }} {{ if (eq .Entry.Status "new") }}is available{{ else }}has been updated{{ end }} DIUN_NOTIF_NTFY_TEMPLATEBODY=Docker tag {{ if .Entry.Image.HubLink }}[**{{ .Entry.Image }}**]({{ .Entry.Image.HubLink }}){{ else }}**{{ .Entry.Image }}**{{ end }} which you subscribed to through {{ .Entry.Provider }} provider {{ if (eq .Entry.Status "new") }}is available{{ else }}has been updated{{ end }} on {{ .Entry.Image.Domain }} registry (triggered by {{ .Meta.Hostname }} host). ```
Circenn5130 commented 6 months ago

Ok, after circling back around to review my setup, and the docs again I realized I made a lot of mistakes I needed to correct (which includes having Kubernetes annotations that also were the same as some environment variables already defined (but with different settings - I know, I know, I failed, I'm sorry!). My setup now looks as follows. I hope all is well with you crazy-max. Thank you for this product.

LOG_LEVEL=info
TZ=America/New_York
DIUN_WATCH_WORKERS=10
DIUN_WATCH_SCHEDULE=0 */6 * * *
DIUN_WATCH_JITTER=30s
DIUN_WATCH_FIRSTCHECKNOTIF=true
DIUN_DEFAULTS_NOTIFYON=new
DIUN_DEFAULTS_WATCHREPO=true
DIUN_DEFAULTS_MAXTAGS=3
DIUN_DEFAULTS_INCLUDETAGS=^\d+\.\d+\.\d+$;latest;release

DIUN_PROVIDERS_KUBERNETES=true
PROVIDERS_KUBERNETES_NAMESPACES=redacted

DIUN_NOTIF_NTFY_ENDPOINT=https://redacted
DIUN_NOTIF_NTFY_TOPIC=redacted
DIUN_NOTIF_NTFY_PRIORITY=3
DIUN_NOTIF_NTFY_TEMPLATETITLE={{ .Entry.Image }} {{ if (eq .Entry.Status "new") }}is available{{ else }}has been updated{{ end }}
DIUN_NOTIF_NTFY_TEMPLATEBODY=Docker tag {{ if .Entry.Image.HubLink }}[**{{ .Entry.Image }}**]({{ .Entry.Image.HubLink }}){{ else }}**{{ .Entry.Image }}**{{ end }} which you subscribed to through {{ .Entry.Provider }} provider {{ if (eq .Entry.Status "new") }}is available{{ else }}has been updated{{ end }} on {{ .Entry.Image.Domain }} registry (triggered by {{ .Meta.Hostname }} host).