feat(docs): update speaker installation instructions and logging details
quality / commitlint (push) Skipped
quality / changes (push) Successful in 8s
quality / docker-check (push) Skipped
quality / openapi (push) Successful in 26s
quality / web (push) Successful in 1m27s
quality / go (push) Successful in 1m18s
quality / bird2 (push) Successful in 16s
CD / quality (push) Successful in 3m43s
CD / publish (push) Successful in 3m11s

- Enhanced the speaker installation documentation to clarify the use of TCP port 179 and the logging commands for monitoring BIRD and evobgp-agent.
- Updated the speaker form dialog to include additional information about MikroTik connections and logging commands.
- Modified the BIRD configuration to include logging to stderr for better visibility during operations.
- Adjusted the Docker Compose configuration to ensure proper network settings and sysctl configurations for BGP functionality.
This commit is contained in:
Denozordec
2026-08-21 16:11:28 +07:00
parent 5255cd2d30
commit 927e27640a
14 changed files with 132 additions and 20 deletions
+21 -2
View File
@@ -7,6 +7,7 @@ import (
"fmt"
"log"
"net/http"
"net/url"
"os"
"strings"
"time"
@@ -117,6 +118,9 @@ func (s *Server) handleSync(w http.ResponseWriter, r *http.Request) {
if timeout <= 0 {
timeout = 45 * time.Second
}
revID := strings.TrimSpace(req.RevisionID)
log.Printf("agentserver: sync start speaker_id=%s revision_id=%q control_plane=%s",
strings.TrimSpace(s.cfg.SpeakerID), revID, controlPlaneHost(s.cfg.ControlPlaneURL))
ctx, cancel := context.WithTimeout(r.Context(), timeout)
defer cancel()
@@ -124,7 +128,7 @@ func (s *Server) handleSync(w http.ResponseWriter, r *http.Request) {
BaseURL: s.cfg.ControlPlaneURL,
Token: s.cfg.NodeToken,
SpeakerID: s.cfg.SpeakerID,
RevisionID: strings.TrimSpace(req.RevisionID),
RevisionID: revID,
PubKeyB64: s.cfg.PubKeyB64,
PubKeyHex: s.cfg.PubKeyHex,
ExtractDir: s.cfg.ExtractDir,
@@ -134,13 +138,16 @@ func (s *Server) handleSync(w http.ResponseWriter, r *http.Request) {
Timeout: timeout,
})
if err != nil {
log.Printf("agentserver: sync: %v", err)
log.Printf("agentserver: sync failed speaker_id=%s revision_id=%q err=%v",
strings.TrimSpace(s.cfg.SpeakerID), revID, err)
writeProblem(w, http.StatusBadGateway, upstreamErrorDetail)
return
}
if s.cfg.OnSyncSuccess != nil {
s.cfg.OnSyncSuccess(res.RevisionID)
}
log.Printf("agentserver: sync ok speaker_id=%s applied_revision_id=%s",
strings.TrimSpace(s.cfg.SpeakerID), res.RevisionID)
writeJSON(w, http.StatusOK, map[string]any{
"ok": true,
"applied_revision_id": res.RevisionID,
@@ -148,6 +155,18 @@ func (s *Server) handleSync(w http.ResponseWriter, r *http.Request) {
})
}
func controlPlaneHost(raw string) string {
raw = strings.TrimSpace(raw)
if raw == "" {
return ""
}
u, err := url.Parse(raw)
if err != nil || strings.TrimSpace(u.Host) == "" {
return raw
}
return u.Host
}
func (s *Server) authorize(r *http.Request) bool {
secret := strings.TrimSpace(s.cfg.Secret)
if secret == "" {