From 5941425799127719a3ae43c662b0c4868bedfcac Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Tue, 11 Feb 2025 09:42:58 +1300 Subject: [PATCH] Update docs and sample config files --- contrib/chorus.toml | 16 ++++------------ docs/CONFIG.md | 10 ++-------- docs/MANAGEMENT.md | 29 ++++++++++++++++++++++++----- sample/sample.config.toml | 5 +---- test_blossom/config.toml | 5 +---- 5 files changed, 32 insertions(+), 33 deletions(-) diff --git a/contrib/chorus.toml b/contrib/chorus.toml index e475bde..ba21e7a 100644 --- a/contrib/chorus.toml +++ b/contrib/chorus.toml @@ -126,21 +126,13 @@ key_pem_path = "/opt/chorus/etc/tls/privkey.pem" # open_relay = false -# These are the public keys (hex format) of your relay's authorized users. See BEHAVIOR.md -# to understand how chorus uses these. +# These are the public keys (hex format) of your relay's administrators. This does NOT +# automatically make them a relay user, but it will eventually allow them to add/remove users +# and moderators. # # Default is [] # -user_hex_keys = [] - - -# These are the public keys (hex format) of your relay's moderators. -# Moderators can moderate the relay using the following NIP PR: -# https://github.com/nostr-protocol/nips/pull/1325 -# -# Default is [] -# -moderator_hex_keys = [] +admin_hex_keys = [] # This is a boolean indicating whether or not chorus verifies incoming events. diff --git a/docs/CONFIG.md b/docs/CONFIG.md index e85965b..bfc9b96 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -116,15 +116,9 @@ If open_relay true, the relay behaves as an open public relay. Default is false. -### user_hex_keys +### admin_hex_keys -These are the public keys (hex format) of your relay's authorized users. See [BEHAVIOR.md](BEHAVIOR.md) to understand how chorus uses these. - -Default is `[]` - -### moderator_hex_keys - -These are the public keys (hex format) of your relay's moderators. Moderators can moderate the relay using the [NIP 86: Relay Management API](https://github.com/nostr-protocol/nips/pull/1325) +These are the public keys (hex format) of your relay's administrators. This does NOT automatically make them a relay user, but it will eventually allow them to add/remove users and moderators. Default is `[]` diff --git a/docs/MANAGEMENT.md b/docs/MANAGEMENT.md index 3fc95c7..124508e 100644 --- a/docs/MANAGEMENT.md +++ b/docs/MANAGEMENT.md @@ -1,8 +1,27 @@ # Chorus Management -This page is about using the online Management API. +This page is about using the online Management API or command line [TOOLS.md](TOOLS.md) +to manage users and moderate events. -You can also do management and moderation via command line [TOOLS.md](TOOLS.md). +## Managing users + +To list users: `chorus_cmd dump_users` + +To add a user: `chorus_cmd add_user 0` + +To add a moderator: `chorus_cmd add_user 1` + +To remove moderator flag, just add the user again with 0. + +To remove a user: `chorus_cmd rm_user ` + +## Managing events + +To cycle through all events needing moderation, and address each one, use `chorus_moderate ` + +To remove an event by id: `chorus_cmd delete_by_id ` + +To remove multiple events by pubkey: `chorus_cmd delete_by_pubkey ` ## Relay Management NIP @@ -10,11 +29,11 @@ The Relay Management API is in flux currently. It is still a pull request on the This document may go out of date as things are changing rapidly. -## The status of a pubkey +## The status of a pubkey (user) -Users can be in one of four states: Authorized, Approved, Banned, and Default. +Users can be in one of four moderation states: Authorized, Approved, Banned, and Default. -**Authorized**: These are the users you configured in your chorus.toml file, the users that the chorus was setup to serve, or the paying users (if you sell service). These user's events are always accepted and these users can read everything (except other user's DMs for example). These users are statically configured in the config file and cannot be changed dynamically. +**Authorized**: These are the users you have added as authorized (whether or not they are a moderator). These user's events are always accepted and these users can read everything (except other user's DMs for example). **Approved**: These are users who are not authorized, but which via moderation have been approved. Approved user's posts are publically available to anybody to read. Because they are not authorized, they can only post replies to authorized users. diff --git a/sample/sample.config.toml b/sample/sample.config.toml index 5ae74d4..441b21e 100644 --- a/sample/sample.config.toml +++ b/sample/sample.config.toml @@ -12,10 +12,7 @@ name = "Chorus Sample" description = "A sample run of the Chorus relay" # icon_url = open_relay = false -user_hex_keys = [ - "ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49" -] -moderator_hex_keys = [ +admin_hex_keys = [ "ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49" ] verify_events = true diff --git a/test_blossom/config.toml b/test_blossom/config.toml index fb49bb3..d2999e9 100644 --- a/test_blossom/config.toml +++ b/test_blossom/config.toml @@ -12,10 +12,7 @@ name = "Chorus Sample" description = "A sample run of the Chorus relay" # icon_url = open_relay = false -user_hex_keys = [ - "12bb541d03bfc3cab0f4a8e4db28947f60faae6fca4e315eb27f809c6eff9a0b" -] -moderator_hex_keys = [ +admin_hex_keys = [ "12bb541d03bfc3cab0f4a8e4db28947f60faae6fca4e315eb27f809c6eff9a0b" ] verify_events = true