Prometheus exporter for MeshCore repeaters, read over the mesh: a companion (USB, BLE, or a companion identity in openHop over TCP) logs in to each repeater, asks for status and telemetry with direct packets and serves battery, temperature/humidity, noise floor, RSSI/SNR, packet counters, airtime and uptime on :9200/metrics. - meshcore_exporter.py: command line, MC_* environment or a TOML file with a password per repeater; --check reads every repeater once and exits; interval 1 h (min 15 min); a failed repeater is retried once after 3 min; contacts fetched once per round. - dashboards/: the Grafana dashboard, generated from generate.py (datasource, job and the rate window are variables; TX drawn above zero, RX below). - stack/: Docker Compose with Prometheus and Grafana provisioned, for a USB companion, or on the host network for openHop on the same machine. - systemd/: running without Docker. - README.md (Czech) and AGENTS.md for setting it up with an AI agent. - CI: lint and tests, gitleaks; PR check builds the image; single-platform images per architecture behind a Trivy gate (latest-<arch>, and X.Y.Z-<arch> with a release on tag vX.Y.Z); dependencies by Renovate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
# Lint + tests on every push and PR; the image is built by image.yml.
|
|
name: ci
|
|
|
|
"on":
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
RUFF_VERSION: "0.15.7"
|
|
MYPY_VERSION: "1.19.1"
|
|
YAMLLINT_VERSION: "1.38.0"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: gitleaks
|
|
uses: https://git.rfa.cz/tth-pub/ci-actions/gitleaks@v11
|
|
with:
|
|
mode: block
|
|
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.15"
|
|
|
|
- name: Install
|
|
run: |
|
|
set -euo pipefail
|
|
python -m pip install --quiet -r requirements.txt pytest \
|
|
"ruff==$RUFF_VERSION" "mypy==$MYPY_VERSION" "yamllint==$YAMLLINT_VERSION"
|
|
|
|
- name: Lint
|
|
run: |
|
|
set -euo pipefail
|
|
ruff check .
|
|
ruff format --check .
|
|
mypy meshcore_exporter.py
|
|
yamllint stack .gitea .yamllint
|
|
|
|
- name: Dashboard is generated from generate.py
|
|
run: |
|
|
set -euo pipefail
|
|
python dashboards/generate.py
|
|
git diff --exit-code dashboards/
|
|
|
|
- name: Tests
|
|
run: python -m pytest -q
|