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
+8 -4
View File
@@ -19,9 +19,13 @@ func BirdLocalsForSpeaker(st store.Backend, tenantID, speakerID string) birdLoca
return loc
}
meta := store.ParseSpeakerMeta(sp.MetaJSON)
if s := strings.TrimSpace(meta.BirdBgpSourceIPv4); s != "" {
loc.routerID = s
loc.localV4 = s
src := strings.TrimSpace(meta.BirdBgpSourceIPv4)
if src == "" {
src = strings.TrimSpace(meta.NodeIPv4)
}
if src != "" {
loc.routerID = src
loc.localV4 = src
}
if s := strings.TrimSpace(meta.BirdBgpSourceIPv6); s != "" {
loc.localV6 = s
@@ -32,7 +36,7 @@ func BirdLocalsForSpeaker(st store.Backend, tenantID, speakerID string) birdLoca
// OverlayFragmentsForSpeaker re-renders bird.conf and peers fragment with speaker-specific BIRD locals.
func OverlayFragmentsForSpeaker(st store.Backend, tenantID, speakerID, revisionID string, frags map[string]string) (map[string]string, error) {
if frags == nil {
return nil, fmt.Errorf("pipeline: overlay: nil fragments")
frags = map[string]string{}
}
locals := BirdLocalsForSpeaker(st, tenantID, speakerID)
out := make(map[string]string, len(frags))
+45
View File
@@ -40,3 +40,48 @@ func TestOverlayFragmentsForSpeaker_differentRouterID(t *testing.T) {
t.Fatalf("sp2 router: %s", out2["bird.conf"])
}
}
func TestOverlayFragmentsForSpeaker_nodeIPv4Fallback(t *testing.T) {
m := store.NewMemory()
m.SeedDemo()
tenant, _, _, _, _ := m.DemoIDs()
sp, err := m.CreateSpeaker(tenant, &store.Speaker{
Role: "replica",
Endpoint: "https://node.example.com",
MetaJSON: `{"node_ipv4":"198.51.100.9"}`,
})
if err != nil {
t.Fatal(err)
}
out, err := pipeline.OverlayFragmentsForSpeaker(m, tenant, sp.ID, "rev1", nil)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(out["bird.conf"], "198.51.100.9") {
t.Fatalf("expected node_ipv4 as router id, got: %s", out["bird.conf"])
}
}
func TestOverlayFragmentsForSpeaker_sourceOverridesNodeIPv4(t *testing.T) {
m := store.NewMemory()
m.SeedDemo()
tenant, _, _, _, _ := m.DemoIDs()
sp, err := m.CreateSpeaker(tenant, &store.Speaker{
Role: "replica",
Endpoint: "https://node.example.com",
MetaJSON: `{"node_ipv4":"198.51.100.9","bird_bgp_source_ipv4":"203.0.113.40"}`,
})
if err != nil {
t.Fatal(err)
}
out, err := pipeline.OverlayFragmentsForSpeaker(m, tenant, sp.ID, "rev1", map[string]string{})
if err != nil {
t.Fatal(err)
}
if !strings.Contains(out["bird.conf"], "203.0.113.40") {
t.Fatalf("source should win: %s", out["bird.conf"])
}
if strings.Contains(out["bird.conf"], "198.51.100.9") {
t.Fatalf("node_ipv4 should not win over source: %s", out["bird.conf"])
}
}