本页面为机器翻译。阅读英文原文。

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.

来源

官方由本目录认定为官方发布者的签名身份签名。
内容摘要
sha256:5bc7cdb28e1b67707600e7aad52ad8aaf84bc95791511fa480f3f13abfc8a8f5
发布时间
2026-11-10T10:14:38Z
签名身份
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

签名

  • 官方application/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

此版本的引用

oci://hub.aggrega.ai/featurerecipe/compose/compose-bridge-fr:1.0.0
目标
—
实现
core/compose-bridge:1.0.0

提供

此配方为使用方接入的确定性指针模板。

名称模板
servers{{ .locals.servers }}
rewrites{{ .locals.rewrites }}

注入映射

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

Workload

未声明工作负载模板。

局部变量

名称模板
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 -}}

值映射

未声明值映射。

关系

与其他已发布实体之间的类型化边。没有已发布目标的引用会呈现为断开的边,而不是链接。

使用

被使用

目录中没有任何内容依赖此实体。

FeatureRecipe 概念参考 →

Aggrega 目录 — 收录组件、功能、配方以及渲染它们的插件的开放索引。

基于共享的 Aggrega 设计系统构建。

隐私