Files
meshcore-exporter/.gitea/workflows/pr-check.yml
T
tthandClaude Opus 5.5 2a9126e258
ci / test (push) Successful in 1m12s
image / build (arm64) (push) Successful in 1m52s
image / build (amd64) (push) Successful in 2m1s
image / release (push) Successful in 9s
meshcore-exporter 1.0.0
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>
2026-11-02 21:52:21 +01:00

62 lines
1.9 KiB
YAML

# PR check (Renovate and any other PR): the image must build like in
# image.yml, just without a push, and the tree's dependencies are scanned
# (report only). Renovate automerges only after this and ci.yml are green;
# the image after the merge is still guarded by the Trivy gate.
name: pr-check
"on":
pull_request:
# A newer push to the PR branch (Renovate rebases often) cancels the older run.
concurrency:
group: pr-check-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
# Read-only use of image.yml's layer cache: a PR never writes it.
- name: Registry login (cache import)
env:
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
[ -z "$REGISTRY_TOKEN" ] ||
echo "$REGISTRY_TOKEN" | docker login git.rfa.cz -u "${{ gitea.actor }}" --password-stdin
- name: Build date
id: date
run: echo "day=$(date -u +%F)" >> "$GITHUB_OUTPUT"
- name: Build (no push)
uses: docker/build-push-action@v7
with:
context: .
push: false
load: true
pull: true
provenance: false
platforms: linux/amd64
build-args: OS_UPDATES=${{ steps.date.outputs.day }}
tags: meshcore-exporter:pr
cache-from: type=registry,ref=git.rfa.cz/tth-pub/meshcore-exporter:buildcache-amd64
- name: Smoke test (--help, --version)
run: |
set -euo pipefail
docker run --rm meshcore-exporter:pr --version
docker run --rm meshcore-exporter:pr --help | grep -q -- --repeaters
dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Dependencies in the tree
uses: https://git.rfa.cz/tth-pub/ci-actions/trivy-gate@v11
with:
scan-type: fs
mode: warn