Skip to content

Commit 5331c58

Browse files
Merge pull request #15 from RobinHeidenis/feat/add-readme
feat: 🎸 add README.md
2 parents 0940a74 + 5d7c0ca commit 5331c58

14 files changed

+208
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ go.work
2424

2525
heimdall
2626
dist/
27+
main

README.md

Lines changed: 182 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,184 @@
1-
## Using Docker Desktop
2-
Run this command to create a symlink to the docker.sock file:
1+
<div align="center">
2+
<a href="https://hermes.fractum.nl">
3+
<img src="public/logo.png" alt="Logo" width="80" height="80">
4+
</a>
5+
<h1>Heimdall</h1>
6+
<p><i>Docker container state monitor with notifications for Discord</i></p>
7+
</div>
8+
9+
<!-- TOC -->
10+
<details>
11+
<summary>Table of Contents</summary>
12+
<ol>
13+
<li>
14+
<a href="#about-heimdall">About Heimdall</a>
15+
</li>
16+
<li>
17+
<a href="#features">Features</a>
18+
</li>
19+
<li>
20+
<a href="#usage">Usage</a>
21+
<ul>
22+
<li><a href="#docker-container">Docker container</a></li>
23+
<ul>
24+
<li><a href="#using-docker-desktop-1">Using Docker Desktop</a></li>
25+
</ul>
26+
<li><a href="#standalone-application">Standalone application</a></li>
27+
<ul>
28+
<li><a href="#using-docker-desktop-2">Using Docker Desktop</a></li>
29+
</ul>
30+
</ul>
31+
</li>
32+
<li>
33+
<a href="#technologies">Technologies</a>
34+
<ul>
35+
<li><a href="#language">Language</a></li>
36+
<li><a href="#deployed-to">Deployed to</a></li>
37+
<li><a href="#ci--cd">CI/CD</a></li>
38+
<li><a href="#released-using">Released using</a></li>
39+
<li><a href="#logo-created-using">Logo created using</a></li>
40+
</ul>
41+
</li>
42+
<li>
43+
<a href="#screenshots">Screenshots</a>
44+
</li>
45+
</ol>
46+
</details>
47+
<!-- TOC -->
48+
49+
## About Heimdall
50+
Heimdall is a monitoring application for your Docker containers. It sends you notifications through a webhook whenever the state of a container changes.
51+
It does this by using the Docker socket to listen for events. Heimdall also provides the option to receive periodic notifications about the state of your containers, where it sends you an overview of every container's status.
52+
53+
## Features
54+
- [x] Easy monitoring for Docker containers
55+
- [x] Receive notifications through Discord webhooks
56+
- [x] Receive periodic notifications about the state of your containers
57+
- [ ] Status API
58+
- [ ] Web UI
59+
- [ ] Bugs (hopefully)
60+
61+
## Usage
62+
Heimdall can be used in a couple different ways:
63+
1. As a Docker container
64+
2. As a standalone application
65+
66+
### Docker container
67+
The easiest way to use Heimdall is by running it as a Docker container. You can do this by running the following command:
68+
```bash
69+
docker run -d \
70+
-v /var/run/docker.sock:/var/run/docker.sock \
71+
-e HEIMDALL_WEBHOOK_URL=<your-webhook-url> \
72+
--name heimdall \
73+
drfractum/heimdall:latest
74+
```
75+
76+
#### Using Docker Desktop
77+
In some cases, Docker Desktop puts the Docker socket in a different location than the standard Docker installation.
78+
You can change the above command to the following to point to the right location:
79+
```diff
80+
docker run -d \
81+
- -v /var/run/docker.sock:/var/run/docker.sock \
82+
+ -v ~/.docker/desktop/docker.sock:/var/run/docker.sock \
83+
-e HEIMDALL_WEBHOOK_URL=<your-webhook-url> \
84+
--name heimdall \
85+
drfractum/heimdall:latest
86+
```
87+
88+
### Standalone application
89+
You can also run Heimdall as a standalone application. This is useful if you want to run it on a server or your local machine.
90+
To run Heimdall as a standalone application, you can download the latest release from the [releases page](https://github.com/RobinHeidenis/heimdall/releases).
91+
92+
Be sure to download the right binary for your operating system.
93+
94+
| Platform | Binary |
95+
|----------------------------------------------------------------------------------------------------------|-------------------------|
96+
| ![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) | heimdall_Linux_x86_64 |
97+
| ![Raspberry Pi](https://img.shields.io/badge/-RaspberryPi-C51A4A?style=for-the-badge&logo=Raspberry-Pi) | heimdall_Linux_armv7 |
98+
| ![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white) | heimdall_Windows_x86_64 |
99+
| ![macOS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=macos&logoColor=F0F0F0) | heimdall_Darwin_x86_64 |
100+
101+
Other binaries are available in case you have a different architecture or operating system.
102+
Other binaries are available in case you have a different architecture or operating system.
103+
104+
105+
After downloading the release, you can run it by executing the following command:
106+
```bash
107+
./heimdall --webhook-url=<your-webhook-url>
108+
```
109+
110+
On Windows you can run it by executing the following command:
111+
```bash
112+
heimdall.exe --webhook-url=<your-webhook-url>
113+
```
114+
115+
#### Using Docker Desktop
116+
In some cases if you're using Docker Desktop, you might run into an error where Heimdall can't connect to the Docker socket.
117+
By default, Docker Desktop puts the Docker socket in a different location than the standard Docker installation.
118+
If Heimdall doesn't automatically detect your environment and the right location for the Docker socket, you'll need to create a symlink to the docker.sock file. You can do this by running the following command:
3119
```bash
4120
sudo ln -s ~/.docker/desktop/docker.sock /var/run/docker.sock
5-
``
121+
```
122+
123+
## Customisation
124+
Heimdall can be customised by using the following environment variables:
125+
126+
| Long flag | Short flag | Environment Variable | Default | Required | Explanation |
127+
|---------------------------|------------|----------------------------------|-----------|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
128+
| `--periodic-notification` | `-n` | `HEIMDALL_PERIODIC_NOTIFICATION` | `false` | No | Enable periodic notifications |
129+
| `--notification-interval` | `-i` | `HEIMDALL_NOTIFICATION_INTERVAL` | `60` | Only if periodic notifications are enabled and you want a different value than default | How often (in minutes) periodic notifications should be sent |
130+
| `--all-containers` | `-a` | `HEIMDALL_ALL_CONTAINERS` | `false` | Only if periodic notifications are enabled and you want periodic notifications on all containers | Enable periodic notification reporting on all containers, including stopped ones |
131+
| `--retry` | `-r` | `HEIMDALL_RETRY` | `10` | No | How long Heimdall should sleep before retrying in case the Docker event stream ends unexpectedly |
132+
| `--provider` | `-p` | `HEIMDALL_PROVIDER` | `discord` | No | What notification provider should be used. Possible values: `discord` |
133+
| `--webhook-url` | `-w` | `HEIMDALL_WEBHOOK_URL` | - | Yes | What URL Heimdall should use to send notifications to |
134+
| `--debug` | `-d` | `HEIMDALL_DEBUG` | `false` | No | Enable extra debug messages |
135+
136+
137+
## Technologies
138+
Heimdall was created using Go. The CI/CD pipeline is handled by GitHub Actions and the Docker image is hosted on Docker Hub.
139+
140+
The program is mostly based on the [Docker SDK for Go](https://pkg.go.dev/github.com/docker/docker/client#section-readme)
141+
142+
It uses the following technologies:
143+
### Language
144+
[![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)](https://go.dev)
145+
146+
### Deployed to
147+
[![Docker](https://img.shields.io/badge/docker-%231d63ed.svg?style=for-the-badge&logo=docker&logoColor=white)](https://hub.docker.com/r/drfractum/heimdall)
148+
149+
### CI/CD
150+
[![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)](https://github.com/RobinHeidenis/heimdall/actions)
151+
152+
### Released using
153+
[![GoReleaser](https://img.shields.io/badge/goreleaser-%23000.svg?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAQX0lEQVRoQ7VaCXCb5Zl+fv26JeuwJFuSbfmSrfiKcye4HMkCbZfQMlzmmG1LSzvAljLATDs7u53uDttlm93Z7bS06TXp9gqF7W6XKyRQAgQIcRySOImJr1i2JVu2JcuSLOv6de37yTFxHMuSk/ZjxEys73+/772e93nfXxz+fEtEomQ6XY1MpORLkOFKOKTVIi4lA8RcOp1JZjlxWMal5yN8MhyemIjR/gR90n+OK3DXKIQ9rzVabPVKlb5JKlNslMlVjbxUVi2RKkp4XqzgRCIxwCGbzaTTqWQsLcQjqWTCIyQT/YlY+Ew8Mt87PTE1DMz7SVbmau9zLYqUWWscuzV6660qTekmmaLELJHK1LxYwnMcD44j0eyzdGWzYP9lMhlk0qlMWkhEE4mINzrn7w3PTr3tcva+QttHrkaZq1FEoTda7zSZbU8bKxpb5CqdRMSLRHRHuvsaxdFD9FSWvJ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xOCJidG+rwa841e8vcqbBypdWXtV9brvU77cJJVfUmapFViy89koDArKC2V6QRG6/HSE6AgbxoV8uD/mAmNNb6TlGDNSN01hVWjktNxTDOZnPMMfT4yee2rW63mLvr+iSVk1oXU6S7W5uuGXZbZ1u6Ry1Yp7mTKXUIO9RV8YyjFCx00MwhINYFJHHaDeAhF7DVEkcVhUhr3Gm/Fc6J0YG/ja7PRoN/19xWFaQWRinqmoWfes2bbuFgozuknBR3J3YArSrxxy1bzQWGelXGH2oRxMUzid9oz2//2s13U4nxKXDJkv6y7+XU7DL3N53ZMmq/0+tdZkzr3g+QsuBrHR+dmAf9J5aGba/T3KCTZxX3WsWZx5Fy6traxr2a03Wh7VGCu3K1T6v4g2rNiF/J7+4MzET8YGe/6Hzp0uxmZrUWRRnsFsrXnCWNHwDYOlTl+ozyjqEpRT9CMBBL3uqNfd/7sJ1+Aees5ZzLOLe65GEfYsg+Tm6ob2To3BcrNKa7JT/uh4XiKh9nThNymrzHAZELDZFdUFun9sLjLvd80Hpt73uAdejIXDJ0g2FY+1ratVZPEUsVyuqyi1lLcrFZrNUoWmXSJTVJNSRrFUqhKJiFBxHPXPlLmU+zS7EugnQRGaHQeERMwVj4bPCZHQqeC8ryc8MzNGQgkdrm5dqyJLPStXq81qhY76ALHMkMpmjTwnMtLbXuqWaEKdpReO6fQsDbi9WZEwG4oEghGvl/1gJkqf1YdXRej2/7tsyvMgscqKAAAAAElFTkSuQmCC)](https://goreleaser.com)
154+
155+
### Logo created using
156+
[![Bing Image Creator](https://img.shields.io/badge/bing%20image%20creator-%230078D4.svg?style=for-the-badge&logo=microsoftbing&logoColor=white)](https://www.bing.com/images/create)
157+
158+
159+
## Screenshots
160+
### Terminal output
161+
![logo.png](public/terminal-output.png)
162+
163+
### Discord notifications
164+
#### Container started
165+
![container-started.png](public/container-started.png)
166+
167+
#### Container stopped
168+
![container-stopped.png](public/container-stopped.png)
169+
170+
#### Container healthy
171+
![container-healthy.png](public/container-healthy.png)
172+
173+
#### Container unhealthy
174+
![container-unhealthy.png](public/container-unhealthy.png)
175+
176+
#### Container errored
177+
![container-errored.png](public/container-errored.png)
178+
179+
### Periodic notification
180+
#### Running containers
181+
![container-list.png](public/container-list.png)
182+
183+
#### All containers
184+
![container-list-all.png](public/container-list-all.png)

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ require (
1717
github.com/docker/go-connections v0.4.0 // indirect
1818
github.com/docker/go-units v0.5.0 // indirect
1919
github.com/gogo/protobuf v1.3.2 // indirect
20-
github.com/mattn/go-runewidth v0.0.13 // indirect
20+
github.com/mattn/go-runewidth v0.0.15 // indirect
2121
github.com/moby/term v0.5.0 // indirect
2222
github.com/morikuni/aec v1.0.0 // indirect
2323
github.com/opencontainers/go-digest v1.0.0 // indirect
2424
github.com/opencontainers/image-spec v1.0.2 // indirect
2525
github.com/pkg/errors v0.9.1 // indirect
26-
github.com/rivo/uniseg v0.2.0 // indirect
26+
github.com/rivo/uniseg v0.4.4 // indirect
2727
github.com/stretchr/testify v1.8.4 // indirect
28-
golang.org/x/mod v0.8.0 // indirect
29-
golang.org/x/net v0.6.0 // indirect
30-
golang.org/x/sys v0.5.0 // indirect
28+
golang.org/x/mod v0.14.0 // indirect
29+
golang.org/x/net v0.19.0 // indirect
30+
golang.org/x/sys v0.15.0 // indirect
3131
golang.org/x/time v0.4.0 // indirect
32-
golang.org/x/tools v0.6.0 // indirect
32+
golang.org/x/tools v0.16.0 // indirect
3333
gotest.tools/v3 v3.5.1 // indirect
3434
)

0 commit comments

Comments
 (0)