Update docs and sample config files

This commit is contained in:
Mike Dilger 2025-02-11 09:42:58 +13:00
parent ef4ec80fa0
commit 5941425799
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4
5 changed files with 32 additions and 33 deletions

View File

@ -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.

View File

@ -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 `[]`

View File

@ -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 <configtoml> dump_users`
To add a user: `chorus_cmd <configtoml> add_user <pubkeyhex> 0`
To add a moderator: `chorus_cmd <configtoml> add_user <pubkeyhex> 1`
To remove moderator flag, just add the user again with 0.
To remove a user: `chorus_cmd <configtoml> rm_user <pubkeyhex>`
## Managing events
To cycle through all events needing moderation, and address each one, use `chorus_moderate <configtoml>`
To remove an event by id: `chorus_cmd <configtoml> delete_by_id <idhex>`
To remove multiple events by pubkey: `chorus_cmd <configtoml> delete_by_pubkey <pubkeyhex>`
## 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.

View File

@ -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

View File

@ -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