Esta página foi traduzida automaticamente. Leia o original em inglês.

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.

Procedência

OficialAssinado por uma identidade de assinatura que este catálogo reconhece como publicador oficial.
Digest do conteúdo
sha256:5bc7cdb28e1b67707600e7aad52ad8aaf84bc95791511fa480f3f13abfc8a8f5
Publicado
2026-11-10T10:14:38Z
Identidade de assinatura
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Assinatura

  • Oficialapplication/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

Referência nesta versão

oci://hub.aggrega.ai/featurerecipe/compose/compose-bridge-fr:1.0.0
Destino
—
Implementa
core/compose-bridge:1.0.0

Fornece

Modelos de ponteiros determinísticos que esta receita liga para os consumidores.

NomeModelo
servers{{ .locals.servers }}
rewrites{{ .locals.rewrites }}

Mapeamento de injeção

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

Workload

Nenhum modelo de carga de trabalho declarado.

Variáveis locais

NomeModelo
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 -}}

Mapeamento de valores

Nenhum mapeamento de valores declarado.

Relações

Arestas tipadas de e para outras entidades publicadas. Uma referência sem destino publicado é exibida como uma aresta quebrada em vez de um link.

Usa

Usado por

Nada no catálogo depende desta entidade.

Referência do conceito FeatureRecipe →

O catálogo Aggrega — um índice aberto de componentes, funcionalidades, receitas e dos plugins que os renderizam.

Criado com o sistema de design compartilhado do Aggrega.

Privacidade