Skip to content

Per-owner community limit is hardcoded (MAX_COMMUNITIES_PER_OWNER = 3), blocking multi-tenant operators #2600

Description

@leesalminen

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

  1. Provision 3 communities owned by the same pubkey via POST /operator/communities.
  2. Provision a 4th with a fresh, unused host.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions