first commit

This commit is contained in:
ansible user
2025-10-23 12:56:30 +02:00
commit d944e464d0
7 changed files with 1048 additions and 0 deletions

28
files/entrypoint.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
log(){ echo "[netbox-reporter][entrypoint] $*"; }
err(){ echo "[netbox-reporter][entrypoint][ERROR] $*" >&2; }
# Sanity: tools
for bin in curl jq; do
command -v "$bin" >/dev/null 2>&1 || { err "Missing $bin"; exit 2; }
done
# Required env (all fed from .env via compose)
: "${RMQ_USER:?RMQ_USER required}"
: "${RMQ_PASS:?RMQ_PASS required}"
: "${RMQ_HOST:?RMQ_HOST required}"
: "${RMQ_PORT:?RMQ_PORT required}"
: "${VHOST:?VHOST required}"
: "${QUEUE:?QUEUE required}"
: "${SLEEP_SECS:?SLEEP_SECS required}"
: "${NB_URL:?NB_URL required}"
: "${NB_TOKEN:?NB_TOKEN required}"
log "RMQ=http://${RMQ_HOST}:${RMQ_PORT} vhost='${VHOST}' queue='${QUEUE}'"
log "NB_URL=${NB_URL}"
# Hand off to main script
exec "$@"