Diese Seite wurde maschinell übersetzt. Englisches Original lesen.

FeatureRecipe

compose-bridge-fr

Network bridge for compose, between the networks of one compose file (each boundary's aggrega.ai/namespace, else the file's own network). Runs once per boundary attachment (executionScope: boundary) and renders one nginx-stream gateway named "aggrega-gw" into the boundary's own compose file. Its templates compute everything from the boundary's uses edges, so no address is hand-authored: an edge is bridged when both of its ends are assembled into the gateway's own file and sit on different networks there. Each bridged edge gets a `server { listen <port>; proxy_pass <target> }` block, the gateway joins the networks of every bridged end, and each consumer's variables delivered from the target's address are rewritten to reach it through the gateway.

Herkunft

OffiziellSigniert von einer Signaturidentität, die dieser Katalog als offiziellen Herausgeber anerkennt.
Inhalts-Digest
sha256:5bc7cdb28e1b67707600e7aad52ad8aaf84bc95791511fa480f3f13abfc8a8f5
Veröffentlicht
2026-11-10T10:14:38Z
Signaturidentität
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Signatur

  • Offiziellapplication/vnd.dev.sigstore.bundle.v0.3+json

    https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

    sha256:3f7f613d05ea1ddb450e6141d45b28314497fc5d3c0f27d80f2dd7595d6df4d8

Referenz zu dieser Version

oci://hub.aggrega.ai/featurerecipe/compose/compose-bridge-fr:1.0.0
Ziel
—
Implementiert
core/compose-bridge:1.0.0

Stellt bereit

Deterministische Zeigervorlagen, die dieses Rezept für Konsumenten verdrahtet.

NameVorlage
servers{{ .locals.servers }}
rewrites{{ .locals.rewrites }}

Injektionszuordnung

{{- $rewrites := fromJson (index .features .attachment_name).provides.rewrites -}} {{- with get $rewrites .context.instance_id -}}{{ toJson . }}{{- end -}}

Workload

Keine Workload-Vorlage deklariert.

Lokale Variablen

NameVorlage
servers{{- $hostField := .infra.providesField -}} {{- $portBase := int .infra.portBase -}} {{- $own := .boundary.assembly_path -}} {{- $byKey := dict -}} {{- $keys := list -}} {{- range $e := .boundary.internal_uses_edges -}} {{- $srcPath := toString (get $e "source_assembly_path") -}} {{- $tgtPath := toString (get $e "target_assembly_path") -}} {{- $srcNet := or (toString (get $e "source_namespace")) $srcPath -}} {{- $tgtNet := or (toString (get $e "target_namespace")) $tgtPath -}} {{- if and (eq $srcPath $own) (eq $tgtPath $own) (ne $srcNet $tgtNet) -}} {{- $key := printf "%s\x00%s\x00%s" (toString (get $e "source")) (toString (get $e "target")) (toString (get $e "socket")) -}} {{- $keys = append $keys $key -}} {{- $_ := set $byKey $key $e -}} {{- end -}} {{- end -}} {{- $keys = sortAlpha $keys -}} {{- $used := dict -}} {{- $rows := list -}} {{- range $key := $keys -}} {{- $e := get $byKey $key -}} {{- $provides := get $e "provides" | default dict -}} {{- $targetPort := atoi (toString (get $provides "port")) -}} {{- $listen := $targetPort -}} {{- if hasKey $used (toString $listen) -}} {{- $listen = $portBase -}} {{- range $keys -}} {{- if hasKey $used (toString $listen) -}} {{- $listen = add $listen 1 -}} {{- end -}} {{- end -}} {{- end -}} {{- $_ := set $used (toString $listen) true -}} {{- $env := get (get $e "inject" | default dict) "env" | default dict -}} {{- $hostVars := list -}} {{- $portVars := list -}} {{- range $in, $from := $env -}} {{- if eq (toString $from) $hostField -}} {{- $hostVars = append $hostVars $in -}} {{- else if eq (toString $from) "port" -}} {{- $portVars = append $portVars $in -}} {{- end -}} {{- end -}} {{- $consumer := get (get $.boundary.components (toString (get $e "source"))) "instance_id" -}} {{- $rows = append $rows (dict "source" (get $e "source") "target" (get $e "target") "consumer" $consumer "upstream" (printf "%s:%d" (toString (get $provides $hostField)) $targetPort) "listen" $listen "host_variables" $hostVars "port_variables" $portVars) -}} {{- end -}} {{- toJson $rows -}}
rewrites{{- $out := dict -}} {{- range $row := fromJson .locals.servers -}} {{- if $row.host_variables -}} {{- $consumer := get $out $row.consumer | default dict -}} {{- if $row.port_variables -}} {{- range $row.host_variables -}} {{- $_ := set $consumer . "aggrega-gw" -}} {{- end -}} {{- range $row.port_variables -}} {{- $_ := set $consumer . (printf "%d" (int $row.listen)) -}} {{- end -}} {{- else -}} {{- range $row.host_variables -}} {{- $_ := set $consumer . (printf "aggrega-gw:%d" (int $row.listen)) -}} {{- end -}} {{- end -}} {{- $_ := set $out $row.consumer $consumer -}} {{- end -}} {{- end -}} {{- toJson $out -}}

Wertezuordnung

Keine Wertezuordnung deklariert.

Beziehungen

Typisierte Kanten zu und von anderen veröffentlichten Entitäten. Eine Referenz ohne veröffentlichtes Ziel wird als unterbrochene Kante statt als Link dargestellt.

Verwendet

Verwendet von

Nichts im Katalog hängt von dieser Entität ab.

Konzeptreferenz zu FeatureRecipe →

Der Aggrega-Katalog — ein offener Index von Komponenten, Funktionen, Rezepten und den Plugins, die sie rendern.

Erstellt mit dem gemeinsamen Aggrega-Designsystem.

Datenschutz