Skip to content

Commit

Permalink
chore: cleanup dev env
Browse files Browse the repository at this point in the history
closes: #6
  • Loading branch information
evlli committed Feb 13, 2024
1 parent 51f88fd commit 98a0472
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 18 deletions.
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
[![CI](https://github.com/famedly/openmetrics-vici-expoter/actions/workflows/build.yml/badge.svg?event=release)](https://github.com/famedly/openmetrics-vici-expoter/actions/workflows/build.yml)

# openmetrics-vici-exporter

provides an openmetrics compatible endpoint for strongSwan charon's VICI.
initally tested against strongSwan 5.9 and strongSwan 6.0.

## deployment
pull container image from `ghcr.io`, see `docker-compose.yml` in this repo
## Usage
### Deployment
for pre-build binaries see [Releases](/releases)
we also provide a docker container.
`docker pull docker-oss.nexus.famedly.de/openmetrics-vici-exporter`

## Configuration

an exhaustive default configuration is provided as [`config.yml`](/blob/main/config.yml)
<br>
all the keys can also be set as environment variables if you prefer this.
they will be prefixed with `VICI_EXPORTER`
for example, you would configure the vici polling interval by setting `VICI_EXPORTER_VICI_INTERVAL=10`

## development

## Development
you need to make sure to have strongswan running and some connections configured and running, aswell as your user to haev the necessary permissions to access the socket.

1. `nix develop`
1. `sudo groupadd vici`
2. `sudo chown root:vici /var/run/charon.vici`
3. `sudo chmod 0770 /var/run/charon.vici`
4. `sudo usermod -aG vici $user`
4. `sudo usermod -aG vici $(whoami)`
5. `cargo run`
6. `curl http://localhost:8001/metrics`


## license
## License

[AGPL-3.0-only](LICENSE.md)

## authors
## Authors

- Evelyn Alicke <e.alicke@famedly.com>
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
version: '3'

services:
ove:
openmetrics-vici-exporter:
image: docker-oss.famedly.de/openmetrics-vici-exporter
restart: "unless-stopped"
environment:
- VICI_EXPORTER_VICI_SOCKET="/var/run/charon.vici"
- VICI_EXPORTER_VICI_INTERVAL=10
- VICI_EXPORTER_SERVER_ADDRESS=0.0.0.0
- VICI_EXPORTER_SERVER_PORT=8001
volumes:
#- ./config.yml:/opt/openmetrics-vici-exporter/config.yml
# - ./config.yml:/opt/openmetrics-vici-exporter/config.yml
- /var/run/charon.vici:/var/run/charon.vici
ports:
- 8111:80/tcp
- 8001:8001/tcp
130 changes: 130 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion rustfmt.toml

This file was deleted.

5 changes: 0 additions & 5 deletions shell.nix

This file was deleted.

0 comments on commit 98a0472

Please sign in to comment.