Problem
MAX_COMMUNITIES_PER_OWNER is a hardcoded const (crates/buzz-db/src/relay_members.rs), enforced in community provisioning (create_community_with_owner) and ownership transfer. On a self-hosted multi-tenant deployment (one relay serving many communities via host-based tenancy), the operator's identity hits the cap of 3 almost immediately.
The failure mode is also confusing: POST /operator/communities returns a 409 whose body is limit_reached: owner already owns the maximum number of communities, but since community already exists uses the same status code, provisioning frontends tend to collapse both into "that subdomain is already taken" — which sends the operator chasing a name conflict that doesn't exist (mine did exactly that).
Reproduction
- Provision 3 communities owned by the same pubkey via
POST /operator/communities.
- Provision a 4th with a fresh, unused host.
GET /operator/communities/availability reports the host as available, but the create call 409s with limit_reached.
Proposal
Make the limit deployment-configurable via an env var (BUZZ_MAX_COMMUNITIES_PER_OWNER), defaulting to the current 3 so existing deployments are unaffected. Enforcement should stay in the authoritative relay-layer checks — this is purely about making the ceiling operator-tunable.
PR: #2599
🤖 Generated with Claude Code
Problem
MAX_COMMUNITIES_PER_OWNERis a hardcoded const (crates/buzz-db/src/relay_members.rs), enforced in community provisioning (create_community_with_owner) and ownership transfer. On a self-hosted multi-tenant deployment (one relay serving many communities via host-based tenancy), the operator's identity hits the cap of 3 almost immediately.The failure mode is also confusing:
POST /operator/communitiesreturns a 409 whose body islimit_reached: owner already owns the maximum number of communities, but sincecommunity already existsuses the same status code, provisioning frontends tend to collapse both into "that subdomain is already taken" — which sends the operator chasing a name conflict that doesn't exist (mine did exactly that).Reproduction
POST /operator/communities.GET /operator/communities/availabilityreports the host as available, but the create call 409s withlimit_reached.Proposal
Make the limit deployment-configurable via an env var (
BUZZ_MAX_COMMUNITIES_PER_OWNER), defaulting to the current 3 so existing deployments are unaffected. Enforcement should stay in the authoritative relay-layer checks — this is purely about making the ceiling operator-tunable.PR: #2599
🤖 Generated with Claude Code