Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
47c2c1a
Merge pull request #21 from yubiuser/main
yubiuser Sep 8, 2023
d6c9ec7
Bump docker/build-push-action from 4.1.1 to 4.2.1
dependabot[bot] Sep 10, 2023
d2473df
Bump actions/checkout from 3.6.0 to 4.0.0
dependabot[bot] Sep 10, 2023
66c4138
Merge pull request #24 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 10, 2023
22c0094
Merge pull request #25 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 10, 2023
19f961f
Bump docker/build-push-action from 4.2.1 to 5.0.0
dependabot[bot] Sep 17, 2023
3a4a6f1
Bump docker/setup-buildx-action from 2.10.0 to 3.0.0
dependabot[bot] Sep 17, 2023
557dc40
Bump docker/metadata-action from 4 to 5
dependabot[bot] Sep 17, 2023
44aabe4
Bump docker/login-action from 2.2.0 to 3.0.0
dependabot[bot] Sep 17, 2023
e9aaf22
Merge pull request #26 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 17, 2023
d235695
Merge pull request #27 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 17, 2023
cdac339
Merge pull request #28 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 17, 2023
abc4ef5
Merge pull request #29 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 17, 2023
aadf5be
Bump docker/setup-qemu-action from 2.2.0 to 3.0.0
dependabot[bot] Sep 17, 2023
b099b16
Merge pull request #30 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 17, 2023
0fac310
Use multiple runners
yubiuser Sep 8, 2023
757e906
Merge pull request #23 from yubiuser/multiple_runners
yubiuser Sep 18, 2023
37ec807
Use global variable for arguments to avoid passing pointers around an…
yubiuser Sep 21, 2023
741df53
Add SMTP reporter
yubiuser Sep 21, 2023
7d058b5
Merge pull request #31 from yubiuser/smtp
yubiuser Sep 22, 2023
9a4b289
Simplify waitgroup logic
yubiuser Sep 22, 2023
708c78b
Update Dependencies
yubiuser Sep 22, 2023
a0f776c
Make delay conditional
yubiuser Sep 22, 2023
d96e05f
Merge pull request #32 from yubiuser/waitgroup
yubiuser Sep 22, 2023
02e930b
Add SERVER_TAG feature
DL6ER Sep 23, 2023
05a8b0e
Add Houskeeping workflow
yubiuser Sep 23, 2023
1251322
Merge pull request #38 from yubiuser/housekeeping
yubiuser Sep 23, 2023
78ea4f7
Use exlicit username for SMTP login
DL6ER Sep 23, 2023
70b031c
Update Readme.md
yubiuser Sep 23, 2023
310b2ee
Merge pull request #37 from DL6ER/new/servertag
yubiuser Sep 23, 2023
a327b5a
Fall back to using MailFrom is MailUser is unset
DL6ER Sep 23, 2023
b9ff9c8
Merge pull request #39 from DL6ER/tweak/smtp_user
yubiuser Sep 23, 2023
877faf2
MailUser is required, MailFrom not
yubiuser Sep 23, 2023
87529b8
Merge pull request #41 from yubiuser/MailUser
yubiuser Sep 23, 2023
238eaec
Fix mod.go version. Must be in format x.y, not x.y.z
DL6ER Sep 24, 2023
6140584
Bump actions/checkout from 4.0.0 to 4.1.0
dependabot[bot] Sep 24, 2023
654eee2
Bump docker/setup-buildx-action from 2.10.0 to 3.0.0
dependabot[bot] Sep 24, 2023
f722a1d
Merge pull request #42 from yubiuser/fix/go_mod_version
yubiuser Sep 24, 2023
7aadb59
Bump docker/login-action from 2.2.0 to 3.0.0
dependabot[bot] Sep 24, 2023
5fce9eb
Merge pull request #43 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 24, 2023
59c02ad
Merge pull request #46 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 24, 2023
d8eda79
Merge pull request #44 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 24, 2023
f92305d
Bump docker/metadata-action from 4 to 5
dependabot[bot] Sep 24, 2023
fa65b44
Merge pull request #45 from yubiuser/dependabot/github_actions/develo…
yubiuser Sep 24, 2023
48b4661
Fix Housekeeping workflow
yubiuser Sep 23, 2023
f198d5d
Always tag developemnt branch with development
yubiuser Sep 24, 2023
ed7f4e7
Update devcontainer and go version
yubiuser Sep 24, 2023
add634d
Fix dockerfile style
yubiuser Sep 24, 2023
143406f
Delete tagged PR image after closing the PR
yubiuser Sep 24, 2023
b7da99f
Don't run merge (tag) job on Dependabot PRs
yubiuser Sep 24, 2023
620c070
Clean untagged images on schedule
yubiuser Sep 24, 2023
ec70ebe
On push to development, tag 'development'
yubiuser Sep 25, 2023
039800c
Only push images to registry if not comming from a fork
yubiuser Sep 25, 2023
b17d665
Explicitly set FORK_PR
yubiuser Sep 25, 2023
0a03f87
Move fork detection down the line to where we actually need it
DL6ER Sep 26, 2023
72c92f0
Merge pull request #48 from DL6ER/housekeeping2
yubiuser Sep 27, 2023
598ba52
Push only from PRs of this repo
yubiuser Sep 27, 2023
0c4d446
Only remove PR image from repo not forks (as we don't push them, they…
yubiuser Sep 27, 2023
7322716
Delete untagged only from repo not forks
yubiuser Sep 27, 2023
343b90e
Merge pull request #47 from yubiuser/housekeeping2
yubiuser Sep 28, 2023
220af06
Don't fail fast
yubiuser Sep 28, 2023
5700fc7
Fix workflows and add GHA action vscode extension
yubiuser Sep 28, 2023
bff124c
Fail fast as we won't be able to merge a complete image if digest is …
yubiuser Sep 28, 2023
44c1ba5
Merge pull request #49 from yubiuser/no_gha_friend
yubiuser Sep 29, 2023
26eba27
Separate workflows
yubiuser Sep 30, 2023
608268b
Merge pull request #50 from yubiuser/hope_this_is_the_last_time
yubiuser Sep 30, 2023
1f809f3
Restructure title/message and add docker compose context and service …
DL6ER Sep 23, 2023
d7ad98f
Send info string when (re)starting instead of timestamp
DL6ER Sep 23, 2023
13c4fd6
Use strings.Builder where appropriate and remove import of "fmt" (not…
DL6ER Sep 24, 2023
dcba438
Use event instead of current timestamp for email notifications
DL6ER Sep 24, 2023
6cf0c15
Add email content-type to text/plain with UTF-8 encoding
DL6ER Sep 24, 2023
764785c
Move startup message creation into dedicated functio to keep main() c…
DL6ER Sep 24, 2023
f6fb6e8
Push on push
yubiuser Oct 7, 2023
66a5687
Merge pull request #51 from yubiuser/push
yubiuser Oct 7, 2023
56932a1
Look for go.mod in /src/
yubiuser Oct 8, 2023
3d1d125
Merge pull request #52 from yubiuser/fix/dependabot
yubiuser Oct 8, 2023
da49479
Bump actions/checkout from 4.1.0 to 4.1.1
dependabot[bot] Oct 22, 2023
4d0474e
Merge pull request #53 from yubiuser/dependabot/github_actions/develo…
yubiuser Oct 22, 2023
9f5cda1
Bump Chizkiyahu/delete-untagged-ghcr-action from 2.0.1 to 3.1.0
dependabot[bot] Nov 5, 2023
d71a8b6
Merge pull request #54 from yubiuser/dependabot/github_actions/develo…
yubiuser Nov 5, 2023
480ad65
Bump Chizkiyahu/delete-untagged-ghcr-action from 3.1.0 to 3.2.0
dependabot[bot] Nov 12, 2023
0ffceae
Merge pull request #55 from yubiuser/dependabot/github_actions/develo…
yubiuser Nov 12, 2023
423634b
Bump docker/build-push-action from 5.0.0 to 5.1.0
dependabot[bot] Nov 19, 2023
1a058f3
Merge pull request #56 from yubiuser/dependabot/github_actions/develo…
yubiuser Nov 19, 2023
51a9479
Update alpine to 3.19
yubiuser Dec 8, 2023
ed57e18
Rename some variables
yubiuser Jan 24, 2024
2d53a47
Do not include title also in the message; Remove mid_builder
yubiuser Jan 24, 2024
144d589
Improve image handling
yubiuser Jan 24, 2024
32fbd10
Title and message should be separated
yubiuser Jan 24, 2024
bd74e57
Merge branch 'development' into new/compose
yubiuser Jan 25, 2024
fedd13e
Merge pull request #40 from DL6ER/new/compose
yubiuser Jan 25, 2024
16a0dec
Merge pull request #58 from yubiuser/alpine3_19
yubiuser Jan 25, 2024
170c783
Update artifacts upload/download to v4
yubiuser Dec 17, 2023
326a237
Adjust workflow for v4 changes
yubiuser Dec 17, 2023
bfe73b6
Adjust matix
yubiuser Dec 17, 2023
da80f24
Adjust download path
yubiuser Dec 17, 2023
11aeeab
Updarte actions download-artifact to v4.1.0
yubiuser Dec 25, 2023
1640211
Simplify up/download action
yubiuser Jan 3, 2024
66f2da1
Upload 4.1.0 and download 4.1.1.
yubiuser Jan 14, 2024
7e5fd39
Update upload artifacts to 4.2.0
yubiuser Jan 25, 2024
14d49f4
Merge pull request #61 from yubiuser/action_v4
yubiuser Jan 25, 2024
feecba4
Bump actions/delete-package-versions from 4.1.1 to 5.0.0
dependabot[bot] Jan 25, 2024
fffca51
Merge pull request #67 from yubiuser/dependabot/github_actions/develo…
yubiuser Jan 25, 2024
688bdec
Update dependencies
yubiuser Dec 30, 2023
f513dc7
Update dependencies and adjust docker event type and action
yubiuser Jan 25, 2024
3ab7fa3
Capitalize
yubiuser Jan 25, 2024
262005a
Merge pull request #63 from yubiuser/update_dependencies
yubiuser Jan 25, 2024
7ad8f36
Use zerolog as logger
yubiuser Jan 25, 2024
c781a54
Make use of contextual fields in json logs
yubiuser Jan 27, 2024
3aeee7f
Merge pull request #68 from yubiuser/zerolog
yubiuser Jan 27, 2024
65e300f
Bump actions/upload-artifact from 4.2.0 to 4.3.0
dependabot[bot] Jan 28, 2024
279fb3f
Merge pull request #69 from yubiuser/dependabot/github_actions/develo…
yubiuser Jan 28, 2024
719dea9
Enable APIVersionNegotiation for docker connection
yubiuser Jan 31, 2024
371ef66
Close the client obj on exit
yubiuser Jan 31, 2024
08fb853
Merge pull request #70 from yubiuser/docker/apiversionnegotiation
yubiuser Feb 1, 2024
b442388
Push and merge digest on release
yubiuser Feb 1, 2024
2d2fefd
Merge pull request #71 from yubiuser/tags
yubiuser Feb 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
From golang:1.21-alpine3.18
ARG alpine_version=3.19
ARG golang_version=1.21

FROM golang:${golang_version}-alpine${alpine_version}
RUN apk add --no-cache \
git \
nano\
Expand All @@ -15,3 +18,7 @@ RUN adduser $USERNAME -s /bin/sh -D -u $USER_UID $USER_GID && \
chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME

RUN go install -v golang.org/x/tools/gopls@latest
RUN go install -v github.com/go-delve/delve/cmd/dlv@latest
RUN go install -v honnef.co/go/tools/cmd/staticcheck@latest
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"vscode": {
"settings": {},
"extensions": [
"ms-vscode.go",
"eamodio.gitlens",
"EditorConfig.EditorConfig",
"golang.Go"
"golang.Go",
"github.vscode-github-actions"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ updates:
open-pull-requests-limit: 10
target-branch: development
- package-ecosystem: gomod
directory: "/"
directory: "/src/"
schedule:
interval: weekly
day: sunday
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/delete_PR_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Remove obsolet PR images from registry

on:
pull_request:
types: [closed]

env:
PACKAGE_NAME: docker-event-monitor

jobs:
Delete_PR_image:
if: |
github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Get image ID of PR
id: version
run: |
curl -sSL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/users/${{ github.repository_owner }}/packages/container/${{ env.PACKAGE_NAME }}/versions >> containerMeta.json ;
echo "VERSION_ID=$(jq -r '.[] | select(.metadata.container.tags[] == "pr-${{ github.event.pull_request.number }}").id' containerMeta.json)" >> "$GITHUB_ENV" ;

- name: Delete PR image
uses: actions/[email protected]
if: ${{ env.VERSION_ID != '' }}
with:
package-version-ids: ${{ env.VERSION_ID }}
package-type: container
package-name: ${{ env.PACKAGE_NAME }}
31 changes: 31 additions & 0 deletions .github/workflows/delete_untagged_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Remove untagged images from registry

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

env:
PACKAGE_NAME: docker-event-monitor

jobs:
Delete_untagged_images:
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT_TOKEN }}

- name: Delete all images from repository without tags
uses: Chizkiyahu/[email protected]
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
package_name: ${{ env.PACKAGE_NAME }}
untagged_only: true
owner_type: user
except_untagged_multiplatform: true
120 changes: 97 additions & 23 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,128 @@ on:
release:
types: [published]
pull_request:
push:
branches:
- development

env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}

jobs:
build-and-push:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: true
matrix:
include:
- platform: linux/amd64
- platform: linux/arm64
- platform: linux/arm/v6
- platform: linux/arm/v7
- platform: linux/386
steps:
- name: Prepare name for digest up/download
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV

- name: Checkout Code
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
uses: docker/setup-qemu-action@v3.0.0

- name: Set up Docker Buildx
uses: docker/[email protected]
uses: docker/[email protected]
with:
buildkitd-flags: --debug

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
flavor: latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha, enable=${{ !startsWith(github.ref, 'refs/tags/') }}
type=edge

${{ env.REGISTRY_IMAGE }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/[email protected]
uses: docker/[email protected]
id: build
with:
context: .
file: ./Dockerfile
platforms: linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha
provenance: false
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'release' }}
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/[email protected]
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
needs:
- build
if: |
github.actor != 'dependabot[bot]'
&& ( github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'release' )
permissions:
contents: read
packages: write
steps:
- name: Download digests
uses: actions/[email protected]
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY_IMAGE }}
flavor: latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,enable=${{ github.event_name == 'workflow_dispatch' }}
type=ref,event=pr
type=ref,event=branch
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect --raw ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}


2 changes: 1 addition & 1 deletion .github/workflows/sync-back-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.1
- name: Opening pull request
run: gh pr create -B development -H main --title 'Sync main back into development' --body 'Created by Github action' --label 'internal'
env:
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
From golang:1.21-alpine3.18 as builder
ARG alpine_version=3.19
ARG golang_version=1.21

FROM golang:${golang_version}-alpine${alpine_version} as builder

COPY /src /src
WORKDIR /src
RUN go mod download
RUN CGO_ENABLED=0 go build -ldflags "-s -w" docker-event-monitor.go

From scratch as deploy
FROM scratch as deploy
COPY --from=builder /src/docker-event-monitor docker-event-monitor
# the tls certificates:
# this pulls directly from the upstream image, which already has ca-certificates:
Expand Down
48 changes: 32 additions & 16 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ Monitor Docker events and send push notifications for each event.
## Features

- Small memory and CPU footprint
- Pushover integration
- Gotify integration
- Pushover notification
- Gotify notification
- E-Mail notification (SMTP)
- Filter events

## Background

I've been using [Monocker](https://github.com/petersem/monocker) to monitor my Docker containers and get push notifications on status changes. However, it's using polling (with hard lower limit of 10 sec) to poll for status changes. This is too long to catch all status changes (e.g. watchtower updating an container). While I did remove the limit in my own Monocker fork, I noticed that the CPU usage goes up quite a bit for polling times < 1sec.
I've been using [Monocker](https://github.com/petersem/monocker) to monitor my Docker containers and get push notifications on status changes. However, it's using polling (with hard lower limit of 10 sec) to poll for status changes. This is too long to catch all status changes (e.g. watchtower updating a container). While I did remove the limit in my own Monocker fork, I noticed that the CPU usage goes up quite a bit for polling times < 1sec.
I needed another soultion, and found [docker-events-notifier](https://github.com/hasnat/docker-events-notifier), but Pushover integration was missing.

So I started to develop my own solution which ended up being a `bash` script doing exactly what I wanted it to do (you can still find it in `/legacy/`). However, the used `jq` caused CPU spikes for each processed event. As I could not find a good solution, I decied to write my own application and to learn something new - [Go](https://go.dev/).
Expand All @@ -29,7 +30,7 @@ The application uses Docker's API to connect to the [event stream](https://docs.
The simplest way to use the docker event monitor is to run the docker container. It'a very small ( < 10MB) image. You can download it via

```shell
docker pull ghcr.io/yubiuser/yubiuser/docker-event-monitor:latest
docker pull ghcr.io/yubiuser/docker-event-monitor:latest
```

### Docker compose
Expand All @@ -40,7 +41,7 @@ version: '2.4'
services:
docker-event-monitor:
container_name: docker-event-monitor
image: ghcr.io/yubiuser/yubiuser/docker-event-monitor:latest
image: ghcr.io/yubiuser/docker-event-monitor:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
Expand All @@ -52,6 +53,13 @@ services:
GOTIFY: false
GOTIFY_URL: 'URL'
GOTIFY_TOKEN: 'TOKEN'
MAIL: false
MAIL_FROM: '[email protected]'
MAIL_TO: '[email protected]'
MAIL_USER: 'SMTP USER'
MAIL_PASSWORD: 'PASSWORD'
MAIL_PORT: 587
MAIL_HOST: '[email protected]'
FILTER: 'event=start,event=stop,type=container'
DELAY: '500ms'
LOG_LEVEL: 'info'
Expand All @@ -74,14 +82,22 @@ If you have a suitable `Go` environment set up, you can build the binary from `/

Configurations can use the CLI flags or environment variables. The table below outlines all supported options and their respective env vars.

| Flag | Env Variable | Default | Details |
| ---------------- | ---------------------- | ------- |-------- |
| `--pushover` | `PUSHOVER` | `false` |Enable/Disable Pushover notification|
| `--pushoverapitoken` | `PUSHOVER_APITOKEN` | `""` | |
| `--pushoveruserkey` | `PUSHOVER_USER` | `""` | |
| `--delay` | `DELAY` | `500ms` |Delay befor processing next event. Can be useful if messages arrive in wrong order |
| `--gotify` | `GOTIFY` | `false` |Enable/Disable Gotify notification|
| `--gotifyurl` | `GOTIFY_URL` | `""` | |
| `--gotifytoken` | `GOTIFY_TOKEN` | `""` | |
| `--filter` | `FILTER` | `""` | Filter events. Uses the same filters as `docker events` (see [here](https://docs.docker.com/engine/reference/commandline/events/#filter)) |
| `--loglevel` | `LOG_LEVEL` | `"info"`| Use `debug` for more verbose logging` |
| Flag | Env Variable | Default | Details |
| ---------------- | ---------------------- | ------- |-------- |
| `--pushover` | `PUSHOVER` | `false` | Enable/Disable Pushover notification|
| `--pushoverapitoken` | `PUSHOVER_APITOKEN` | `""` | |
| `--pushoveruserkey` | `PUSHOVER_USER` | `""` | |
| `--delay` | `DELAY` | `500ms` | Delay befor processing next event. Can be useful if messages arrive in wrong order |
| `--gotify` | `GOTIFY` | `false` | Enable/Disable Gotify notification|
| `--gotifyurl` | `GOTIFY_URL` | `""` | |
| `--gotifytoken` | `GOTIFY_TOKEN` | `""` | |
| `--mail` | `MAIL` | `false` | Enable/Disable E-Mail (SMTP) notification|
| `--mailfrom` | `MAIL_FROM` | `""` | optional: `[email protected]`, set to MAIL_USER if empty/unset |
| `--mailto` | `MAIL_TO` | `""` | `[email protected]` |
| `--mailuser` | `MAIL_USER` | `""` | SMTP username |
| `--mailpassword` | `MAIL_PASSWORD` | `""` | |
| `--mailport` | `MAIL_PORT` | `587` | |
| `--mailhost` | `MAIL_HOST` | `""` | `[email protected]` |
| `--filter` | `FILTER` | `""` | Filter events. Uses the same filters as `docker events` (see [here](https://docs.docker.com/engine/reference/commandline/events/#filter)) |
| `--loglevel` | `LOG_LEVEL` | `"info"`| Use `debug` for more verbose logging |
| `--servertag` | `SERVER_TAG` | `""` | Prefix to include in the title of notifications. Useful when running docker-event-monitors on multiple machines |
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '2.4'
services:
docker-event-monitor:
container_name: docker-event-monitor
image: ghcr.io/yubiuser/yubiuser/docker-event-monitor:latest
image: ghcr.io/yubiuser/docker-event-monitor:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
Expand All @@ -15,6 +15,13 @@ services:
GOTIFY: false
GOTIFY_URL: 'URL'
GOTIFY_TOKEN: 'TOKEN'
MAIL: false
MAIL_FROM: '[email protected]'
MAIL_TO: '[email protected]'
MAIL_USER: 'SMTP USER'
MAIL_PASSWORD: 'PASSWORD'
MAIL_PORT: 587
MAIL_HOST: '[email protected]'
FILTER: 'event=start,event=stop,type=container'
DELAY: '500ms'
LOG_LEVEL: 'info'
Expand Down
Loading