feat(relay): make NIP-11 name and description configurable - #6880
Open
A-PachecoT wants to merge 1 commit into
Open
feat(relay): make NIP-11 name and description configurable#6880A-PachecoT wants to merge 1 commit into
A-PachecoT wants to merge 1 commit into
Conversation
A self-hosted relay is a distinct workspace to the people using it, but every instance introduces itself as "Buzz Relay" — the product's name, not the operator's. Clients surface this string, so an operator has no way to make their own deployment read as theirs. The Desktop's community Name field only writes to local storage, so it does not close the gap either. Adds RELAY_NAME and RELAY_DESCRIPTION, defaulting to the current strings so no existing deployment moves. Blank or whitespace-only values fall back to the default rather than advertising an empty name. Test covers unset, set-and-trimmed, and blank. Verified to have teeth by mutating the fix back to the hardcoded string and confirming it fails. Signed-off-by: André Pacheco <andre@cofoundy.dev>
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.
Problem
A self-hosted relay is a distinct workspace to the people using it, but every instance introduces itself as
"Buzz Relay"— the product's name, not the operator's:Clients surface this string, so an operator running Buzz for their own team has no way to make the deployment read as theirs. The Desktop's Edit Community → Name field looks like the answer but only writes to
localStorage, so the NIP-11 document — what every other client reads — still says "Buzz Relay".We hit this running Buzz for our own company: the workspace icon propagates fine via the
kind:9033command, so the deployment ends up showing our logo next to someone else's name.Change
Adds
RELAY_NAMEandRELAY_DESCRIPTION, read at NIP-11 build time.Kept deliberately small: two env vars and one helper, no config-struct plumbing, matching how
pairing_relay_urlandiconalready reach this function.Testing
relay_name_and_description_come_from_env_and_ignore_blankscovers unset (defaults), set-and-trimmed, and blank-falls-back.The test was verified to have teeth by mutating the fix back to the hardcoded string and confirming it fails:
Restored, the full
nip11module passes:cargo fmt --checkandcargo clippy -p buzz-relay --libare clean.Notes
Happy to move this into
Configinstead if you'd prefer the values to travel with the rest of the relay configuration — this shape just mirrors what the surrounding code already does.