feat(relay): make NIP-11 name and description configurable - #4165
Open
kajukabla wants to merge 1 commit into
Open
feat(relay): make NIP-11 name and description configurable#4165kajukabla wants to merge 1 commit into
kajukabla wants to merge 1 commit into
Conversation
The NIP-11 information document hardcoded name and description, so self-hosters could not brand their relay. Add BUZZ_RELAY_NAME and BUZZ_RELAY_DESCRIPTION env vars (trimmed; unset or blank falls back to the existing defaults) and thread them through RelayInfo::build as deployment-global config scalars, preserving the multi-tenant static-input fence's no-enumeration-oracle property. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: kajukabla <106099463+kajukabla@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The NIP-11 information document hardcoded
name: "Buzz Relay"anddescription: "Buzz — private team communication relay", so self-hosters had no way to brand their relay. This adds two env vars, following the existing config patterns incrates/buzz-relay/src/config.rs:BUZZ_RELAY_NAME— NIP-11name(default:Buzz Relay)BUZZ_RELAY_DESCRIPTION— NIP-11description(default:Buzz — private team communication relay)Values are trimmed; unset or blank values fall back to the current defaults, so existing deployments are unchanged.
Changes
crates/buzz-relay/src/config.rs— newrelay_name/relay_descriptionconfig fields withDEFAULT_RELAY_NAME/DEFAULT_RELAY_DESCRIPTIONconsts; env parsing + tests (override, trim, blank fallback, defaults).crates/buzz-relay/src/nip11.rs—RelayInfo::buildtakesname/descriptionas leading scalar params;nip11_documentthreads them from config. The_RELAY_INFO_BUILD_STATIC_INPUT_FENCEsignature is updated accordingly — the new inputs are deployment-global config scalars resolved at startup (identical for every community), so the multi-tenant no-enumeration-oracle property is preserved;docs/multi-tenant-conformance.mdrow updated to match. New tests cover default branding and configured values served verbatim..env.example(commented, dev) anddeploy/compose/.env.example(self-host template) document the new vars. The compose relay service already passes the whole.envthrough viaenv_file, so no compose changes needed.Client behavior (why this matters, and what it doesn't fix yet)
Neither client currently reads NIP-11
name/description— both fetch the NIP-11 document only for theiconfield:fetch_workspace_icon(desktop/src-tauri/src/commands/workspace.rs) deserializes onlyicon. The community display label comes fromderiveCommunityName()(desktop/src/features/communities/communityStorage.ts), which string-parses the relay hostname (first subdomain label, withlocalhost/staging special cases), or from a user/deep-link-supplied name, and is user-renamable afterward.community_icon_provider.dartreads onlydocument['icon']. Labels come fromCommunity.nameFromUrl()(hostname parsing) or the raw tenant host returned by/api/invites/claim— also hostname-derived, just server-side.So this PR makes the relay advertise a proper operator-chosen identity (visible to any standard Nostr client and to future Buzz client work), but desktop/mobile will keep showing hostname-derived labels until they grow a NIP-11
namepreference — a natural follow-up that this PR unblocks.Testing
cargo test -p buzz-relay --lib— nip11 + config suites pass, including new tests (default branding, configured values served verbatim, env override/trim/blank-fallback).just ci— every gate passes (fmt, clippy, Rust unit tests, desktop test/build, Tauri check/test, web build) except one pre-existing mobile widget test failure (channel_detail_page_test.dart:1042, "keeps follow mode off while a tall newest message stays visible"), which fails identically on a cleanmaincheckout and is unrelated to this Rust-only change.🤖 Generated with Claude Code