<ahref="https://www.buymeacoffee.com/jharrison94"><imgsrc="https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee"alt="Buy Me A Coffee"></a>
- Added a detailed Prometheus metrics exporter that now reports not only the number of containers with updates, no-updates, and errors, but also the total number of containers checked, the duration of the update check, and the epoch timestamp of the last check.
- Enhanced documentation with instructions on integrating these metrics with Grafana for visual monitoring.
- **Improved Error Handling & Code Refactoring:**
- Introduced `set -euo pipefail` and local variable scoping within functions to improve reliability and prevent unexpected behaviour.
- Standardised container name handling and refined the Quadlet detection logic.
- **Self-Update Enhancements:**
- Updated the self-update mechanism to support both Git-based and HTTP-based updates, with an automatic restart that preserves the original arguments.
- **Miscellaneous Improvements:**
- Enhanced dependency installer to support both package manager and static binary installations for `jq` and `regctl`.
- General code refactoring across the project for better readability and maintainability.
You only need the `notify_templates/notify_v2.sh` file and any notification templates you wish to enable, but there is no harm in having all of them present.
- Uncomment and set the `NOTIFY_CHANNELS=""` environment variable in `podcheck.config` to a space separated string of your desired notification channels to enable.
- Uncomment and set the environment variables related to the enabled notification channels. Eg. `GOTIFY_DOMAIN=""` + `GOTIFY_TOKEN=""`.
It's recommended to only do configuration with variables within `podcheck.config` and not modify `notify_templates/notify_X.sh` directly. If you wish to customize the notify templates yourself, you may copy them to your project root directory alongside the main `podcheck.sh` (where they're also ignored by git).
Customizing `notify_v2.sh` is handled the same as customizing the templates, but it must be renamed to `notify.sh` within the `podcheck.sh` root directory.
#### Snooze feature:
Configure to receive scheduled notifications only if they're new since the last notification - within a set time frame.
**Example:** *Podcheck is scheduled to run every hour. You will receive an update notification within an hour of availability.*
**Snooze enabled:** You will not receive a repeated notification about an already notified update within the snooze duration.
**Snooze disabled:** You will receive additional (possibly repeated) notifications every hour.
To enable snooze uncomment the `SNOOZE_SECONDS` variable in your `podcheck.config` and set it to the number of seconds you wish to prevent duplicate alerts.
Snooze is split into three categories; container updates, `podcheck.sh` self updates and notification template updates.
If an update becomes available for an item that is not snoozed, notifications will be sent and include all available updates for that item's category, even snoozed items.
- Apprise (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications)
- both native [caronc/apprise](https://github.com/caronc/apprise) and the standalone [linuxserver/docker-apprise-api](https://github.com/linuxserver/docker-apprise-api)
Further additions are welcome - suggestions or PRs!
<sub><sup>Initiated and first contributed by [mag37](https://github.com/mag37).</sup></sub>
#### Notification channel configuration:
All required environment variables for each notification channel are provided in the default.config file as comments and must be uncommented and modified for your requirements.
For advanced users, additional functionality is available via custom configurations and environment variables.
Use cases - all configured in `podcheck.config`:
(replace `<channel>` with the upper case name of the of the channel as listed in `NOTIFY_CHANNELS` variable, eg `TELEGRAM_SKIPSNOOZE`)
- To bypass the snooze feature, even when enabled, add the variable `<channel>_SKIPSNOOZE` and set it to `true`.
- To configure the channel to only send container update notifications, add the variable `<channel>_CONTAINERSONLY` and set it to `true`.
- To send notifications even when there are no updates available, add the variable `<channel>_ALLOWEMPTY` and set it to `true`.
- To use another notification output format, add the variable `<channel>_OUTPUT` and set it to `csv`, `json`, or `text`. If unset or set to an invalid value, defaults to `text`.
- To send multiple notifications using the same notification template:
- Strings in the `NOTIFY_CHANNELS` list are now treated as unique names and do not necessarily refer to the notification template that will be called, though they do by default.
- Add another notification channel to `NOTIFY_CHANNELS` in `podcheck.config`. The name can contain upper and lower case letters, numbers and underscores, but can't start with a number.
- Add the variable `<channel>_TEMPLATE` to `podcheck.config` where `<channel>` is the name of the channel added above and set the value to an available notification template script (`discord`, `apprise`, `gotify`, etc.)
- Add all other environment variables required for the chosen template to function with `<channel>` in upper case as the prefix rather than the template name.
- For example, if `<channel>` is `mynotification` and the template configured is `discord`, you would need to set `MYNOTIFICATION_WEBHOOK_URL`.
## Asyncronous update checks with **xargs**; `-x N` option. (default=1)
Pass `-x N` where N is number of subprocesses allowed, experiment in your environment to find a suitable max!
Change the default value by editing the `MaxAsync=N` variable in `podcheck.sh`. To disable the subprocess function set `MaxAsync=0`.
## Extra plugins and tools:
### Using podcheck.sh with systemd units (Quadlet)
Podcheck automatically detects containers managed by systemd units and will restart them appropriately using `systemctl restart`.
### Prometheus and node_exporter
Podcheck can be used together with [Prometheus](https://github.com/prometheus/prometheus) and [node_exporter](https://github.com/prometheus/node_exporter) to export metrics via the file collector, scheduled with cron or likely.
-`sudo-kraken.podcheck.update: true` will when used with the `-l` option only update containers with this label and skip the rest. Will still list updates as usual.
-`sudo-kraken.podcheck.only-specific-container: true` works instead of the `-F` option, specifying the updated container when doing compose up, like `podman compose up -d homer`.
-`sudo-kraken.podcheck.restart-stack: true` works instead of the `-f` option, forcing stop+restart on the whole compose-stack (Caution: Will restart on every updated container within stack).
Run regctl in a container wrapped in a shell script. Copied from [regclient/docs/install.md](https://github.com/regclient/regclient/blob/main/docs/install.md):
Another option is to run the main script with debugging in a subshell `bash -x podcheck.sh` - if there's a particular container/image that's causing issues you can filter for just that through `bash -x podcheck.sh nginx`.
Podcheck was created to bring the convenience of automated container updates to the Podman ecosystem. As a user of [Dockcheck](https://github.com/mag37/dockcheck) for Docker, the need for a similar tool for Podman became apparent. Podcheck aims to provide the same ease of use and automation, tailored for Podman users.
Podcheck is inspired by the original [Dockcheck](https://github.com/mag37/dockcheck) script. Without Dockcheck, there wouldn't have been a Podcheck. Many thanks to mag37 and all the contributors to Dockcheck for their work and inspiration.