Files
Denozordec 2aecbf96fd
CI / changes (push) Successful in 8s
CI / commitlint (push) Has been skipped
CI / openapi (push) Successful in 25s
CI / web (push) Failing after 34s
CI / go (push) Failing after 19s
CI / bird2 (push) Has been skipped
CI / release (push) Has been skipped
feat(remote-speakers): enhance remote speaker management and API integration
- Added support for remote speaker configuration in the README and documentation.
- Implemented a new endpoint for retrieving the bundle signing public key.
- Updated the `evobgp-agent` to include a `serve` command for Panel→Node sync API.
- Enhanced CI workflow to validate remote speaker compose files.
- Introduced new fields in the API and UI for managing speaker metadata, including dispatch status and sync status.
- Improved error handling and response formatting in speaker-related API endpoints.
- Updated documentation to reflect changes in remote speaker functionality and usage guidelines.
2026-05-21 12:42:06 +07:00

36 lines
1.0 KiB
Bash

#!/bin/sh
# Fallback polling: pull → verify → apply signed bundle (profile fallback).
set -eu
INTERVAL="${EVOBGP_SYNC_INTERVAL_SEC:-300}"
BASE="${EVOBGP_CONTROL_PLANE_URL:?EVOBGP_CONTROL_PLANE_URL required}"
TOKEN="${EVOBGP_NODE_TOKEN:?EVOBGP_NODE_TOKEN required}"
SPEAKER="${EVOBGP_SPEAKER_ID:?EVOBGP_SPEAKER_ID required}"
PUB="${EVOBGP_BUNDLE_PUBKEY_BASE64:?EVOBGP_BUNDLE_PUBKEY_BASE64 required}"
EXTRACT="/etc/bird"
BUNDLE="/tmp/evobgp-bundle.tar.gz"
SOCKET="${EVOBGP_BIRDC_SOCKET:-/run/bird/bird.ctl}"
sync_once() {
evobgp-node pull-bundle \
-base-url "$BASE" \
-token "$TOKEN" \
-speaker-id "$SPEAKER" \
-o "$BUNDLE" || return 1
evobgp-node apply-bundle \
-f "$BUNDLE" \
-extract-dir "$EXTRACT" \
-pubkey-base64 "$PUB" \
-socket "$SOCKET"
}
echo "sync-bundle: polling every ${INTERVAL}s speaker=${SPEAKER}"
while true; do
if sync_once; then
echo "sync-bundle: ok $(date -u +%Y-%m-%dT%H:%M:%SZ)"
else
echo "sync-bundle: failed $(date -u +%Y-%m-%dT%H:%M:%SZ)" >&2
fi
sleep "$INTERVAL"
done