fix(relay): use deployment tenant binding for startup membership

Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf
2026-06-26 22:29:59 -04:00
parent 139d6dbda5
commit fb0d6a4ea0
+4 -11
View File
@@ -300,18 +300,11 @@ async fn main() -> anyhow::Result<()> {
// host (single-community per deployment), failing closed if the host
// isn't mapped — the membership list is community-scoped now, so the
// relay-signed startup publish must carry a resolved tenant.
let raw_host = url::Url::parse(
&startup_state
.config
.relay_url
.replace("ws://", "http://")
.replace("wss://", "https://"),
let tenant = match buzz_relay::tenant::bind_deployment_community(
&startup_state.db,
&startup_state.config.relay_url,
)
.ok()
.and_then(|u| u.host_str().map(|h| h.to_string()))
.unwrap_or_default();
let tenant = match buzz_relay::tenant::bind_community(&startup_state.db, &raw_host)
.await
.await
{
Ok(ctx) => ctx,
Err(e) => {