Small HTTP service that receives Komodo Alert payloads (the same JSON sent to custom alerter endpoints) and forwards them to a Bark server. Device keys are configured via environment variable, not per-request query params.
- Endpoint:
POST /alert - Body: Komodo
AlertJSON (as sent bysend_custom_alertin Komodo Core). - Device keys: loaded from
BARK_DEVICE_KEYS(comma/semicolon/newline separated). Requests are rejected with400if no keys are configured. - Mapping: The payload is parsed into
AlertDatavariants and rendered into a plain-texttitle+bodyBark request. Komodo severity is mapped to BarklevelasCRITICAL -> timeSensitive,WARNING -> active,OK -> passive. - Forwarded to Bark JSON endpoint (default
https://api.day.app/push, override withBARK_ENDPOINT) with configured device keys, optionalgroup, title (with optional prefix), body, and level. Optional icon and URL are applied when provided (URL removes the default “none” action).
PORT(default8080)BARK_DEVICE_KEYS(required, comma/semicolon/newline separated list)BARK_ENDPOINT(defaulthttps://api.day.app/push)BARK_GROUP(optional Bark group tag)BARK_ICON(optional Bark icon URL)BARK_TITLE_PREFIX(optional prefix added to Bark title)BARK_URL(optional URL to open from the Bark notification)BARK_ALERT_SOUND(optional; one ofalarm,anticipate,bell,calypso,chime,glass,horn,ladder,minuet,news,noir,pulse,suspense,telegraph,healthnotification,update)
export BARK_DEVICE_KEYS="key1,key2"
# export BARK_ENDPOINT="https://api.day.app/push" # optional override
# export BARK_TITLE_PREFIX="MyPrefix" # optional title prefix
# export BARK_URL="https://example.com" # optional tap-through URL
# export BARK_ALERT_SOUND="bell" # optional sound (validated list)
dotnet run --project src/KomodoBarkAlerter.csproj --configuration Release
curl -X POST "http://localhost:8080/alert" \
-H "Content-Type: application/json" \
-d @sample-alert.jsondocker build -t bark-komodo-alerter .
docker run --rm -p 8080:8080 \
-e BARK_DEVICE_KEYS=key1,key2 \
-e BARK_ENDPOINT=https://api.day.app/push \
-e BARK_GROUP=komodo \
ghcr.io/<your-org>/bark-komodo-alerter:latestThis matches the structure produced by Komodo Core:
{
"ts": 1700000000000,
"resolved": false,
"level": "CRITICAL",
"target": { "type": "Server", "id": "abc123" },
"data": {
"type": "ServerUnreachable",
"data": {
"id": "abc123",
"name": "prod-server",
"region": "eu-central",
"err": { "error": "timed out", "trace": [] }
}
}
}- The service responds with
400ifBARK_DEVICE_KEYSis missing or empty. - Bark responses other than 2xx are bubbled back as
502so Komodo can surface failures. BARK_ALERT_SOUNDis only sent when it matches the predefined list; unknown values are ignored.