feat: update OpenAPI documentation and internal logic for BIRD settings. Enhance the description of BIRD parameters in openapi.yaml, adding details for optional BGP source addresses. Modify refresh.go to include handling for new BGP source address fields and update peer rendering logic accordingly. Improve user interface documentation in settings page to reflect changes in BIRD configuration options.
CI / changes (push) Successful in 6s
CI / openapi (push) Successful in 25s
CI / go (push) Successful in 22s
CI / docker-web (deploy/docker/evobgp-web/Dockerfile, , evobgp-web) (push) Successful in 1m1s
CI / docker-web (deploy/docker/evobgp-web/Dockerfile, evobgp-all, evobgp-web-all) (push) Successful in 1m0s
CI / docker-bird (push) Has been skipped
CI / bird2 (push) Successful in 15s
CI / docker-go (deploy/docker/evobgp-agent/Dockerfile, , evobgp-agent) (push) Successful in 1m3s
CI / docker-go (evobgp-all, 1, deploy/docker/gobinary/Dockerfile, , evobgp-all) (push) Successful in 1m26s
CI / docker-go (evobgp-api, 1, deploy/docker/gobinary/Dockerfile, , evobgp-api) (push) Successful in 1m27s
CI / docker-go (evobgp-deploy, 0, deploy/docker/gobinary/Dockerfile, , evobgp-deploy) (push) Successful in 1m22s
CI / docker-go (evobgp-ingest, 0, deploy/docker/gobinary/Dockerfile, , evobgp-ingest) (push) Successful in 1m23s
CI / docker-go (evobgp-node, 0, deploy/docker/gobinary/Dockerfile, , evobgp-node) (push) Successful in 1m13s
CI / docker-go (evobgp-render, 0, deploy/docker/gobinary/Dockerfile, , evobgp-render) (push) Successful in 1m35s
CI / docker-go (evobgp-scheduler, 0, deploy/docker/gobinary/Dockerfile, , evobgp-scheduler) (push) Successful in 1m22s

This commit is contained in:
Denozordec
2026-04-06 11:35:36 +07:00
parent 431c6a90f1
commit 62bf987a19
3 changed files with 52 additions and 5 deletions
+25 -2
View File
@@ -333,6 +333,9 @@ type birdLocals struct {
localV4 string
localV6 string
localASN uint32
// Optional BGP TCP source (BIRD "source address"); empty => use effective local per peer.
sourceV4 string
sourceV6 string
}
func birdLocalsFromStore(st store.Backend, tenantID string) birdLocals {
@@ -359,9 +362,29 @@ func birdLocalsFromStore(st store.Backend, tenantID string) birdLocals {
if n := uint32FromSettingsMap(settings, "bird_local_asn"); n != 0 {
loc.localASN = n
}
if s := stringFromSettingsMap(settings, "bird_bgp_source_ipv4"); s != "" {
loc.sourceV4 = s
}
if s := stringFromSettingsMap(settings, "bird_bgp_source_ipv6"); s != "" {
loc.sourceV6 = s
}
return loc
}
func bgpPeerSourceIPv4(loc birdLocals, effectiveLocal string) string {
if s := strings.TrimSpace(loc.sourceV4); s != "" {
return s
}
return effectiveLocal
}
func bgpPeerSourceIPv6(loc birdLocals, effectiveLocal string) string {
if s := strings.TrimSpace(loc.sourceV6); s != "" {
return s
}
return effectiveLocal
}
func stringFromSettingsMap(m map[string]any, key string) string {
v, ok := m[key]
if !ok || v == nil {
@@ -455,7 +478,7 @@ func renderPeersBirdFragment(st store.Backend, tenantID string, loc birdLocals)
TemplateName: birdfmt.BGPTemplateNameV4,
NeighborIP: addr.String(),
NeighborASN: ra,
SourceAddress: lv4,
SourceAddress: bgpPeerSourceIPv4(loc, lv4),
}
if peerNeedsLocalOverride(loc, lv4, asn, true) {
opts.OverrideLocalIP = lv4
@@ -474,7 +497,7 @@ func renderPeersBirdFragment(st store.Backend, tenantID string, loc birdLocals)
TemplateName: birdfmt.BGPTemplateNameV6,
NeighborIP: addr.String(),
NeighborASN: ra,
SourceAddress: lv6,
SourceAddress: bgpPeerSourceIPv6(loc, lv6),
}
if peerNeedsLocalOverride(loc, lv6, asn, false) {
opts.OverrideLocalIP = lv6