feat(remote-speakers): enhance remote speaker management and API integration
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

- 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.
This commit is contained in:
Denozordec
2026-05-21 12:42:06 +07:00
parent ec65249bf1
commit 2aecbf96fd
29 changed files with 2003 additions and 63 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/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
@@ -0,0 +1,26 @@
#!/bin/sh
# Validates docker-compose.remote-speaker.yaml with example env files.
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
COMPOSE="$ROOT/deploy/compose/docker-compose.remote-speaker.yaml"
ENV1="$ROOT/deploy/compose/.env.remote-speaker.example"
ENV2="$ROOT/deploy/compose/.env.remote-speaker-tls.example"
if ! command -v docker >/dev/null 2>&1; then
echo "validate-remote-speaker-compose: docker not found, skipping"
exit 0
fi
# Mock required vars for compose config (not used at runtime).
export EVOBGP_AGENT_SECRET=ci-test-secret
export EVOBGP_CONTROL_PLANE_URL=https://cp.example.com
export EVOBGP_NODE_TOKEN=ci-test-token
export EVOBGP_SPEAKER_ID=00000000-0000-0000-0000-000000000001
export EVOBGP_BUNDLE_PUBKEY_BASE64=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
export AGENT_DOMAIN=agent.ci.example.com
export LETSENCRYPT_EMAIL=ci@example.com
export CF_DNS_API_TOKEN=ci-token
export PANEL_IP_WHITELIST=127.0.0.1/32
docker compose -f "$COMPOSE" --env-file "$ENV1" --env-file "$ENV2" config >/dev/null
echo "validate-remote-speaker-compose: ok"