Merge remote-tracking branch 'upstream/master' into feature/flotilla-23-livekit

This commit is contained in:
mplorentz
2026-03-06 09:01:29 -05:00
4 changed files with 5 additions and 14 deletions
-4
View File
@@ -46,14 +46,12 @@ Contains policy and access related configuration.
Configures NIP 29 support. Configures NIP 29 support.
- `enabled` - whether NIP 29 is enabled. - `enabled` - whether NIP 29 is enabled.
- `auto_join` - whether relay members can join groups without approval. Defaults to `false`.
### `[management]` ### `[management]`
Configures NIP 86 support. Configures NIP 86 support.
- `enabled` - whether NIP 86 is enabled. - `enabled` - whether NIP 86 is enabled.
- `methods` - a list of [NIP 86](https://github.com/nostr-protocol/nips/blob/master/86.md) relay management methods enabled for this relay.
### `[blossom]` ### `[blossom]`
@@ -98,11 +96,9 @@ strip_signatures = false
[groups] [groups]
enabled = true enabled = true
auto_join = false
[management] [management]
enabled = true enabled = true
methods = ["supportedmethods", "banpubkey", "allowpubkey"]
[blossom] [blossom]
enabled = false enabled = false
+2 -5
View File
@@ -422,8 +422,7 @@ func TestAPIHandler_PatchRelay(t *testing.T) {
"strip_signatures": false, "strip_signatures": false,
}, },
"groups": map[string]interface{}{ "groups": map[string]interface{}{
"enabled": true, "enabled": true,
"auto_join": false,
}, },
} }
body, _ := json.Marshal(initialConfig) body, _ := json.Marshal(initialConfig)
@@ -701,15 +700,13 @@ func TestAPIHandler_ConfigValidation(t *testing.T) {
"strip_signatures": false, "strip_signatures": false,
}, },
"groups": map[string]interface{}{ "groups": map[string]interface{}{
"enabled": true, "enabled": true,
"auto_join": true,
}, },
"push": map[string]interface{}{ "push": map[string]interface{}{
"enabled": true, "enabled": true,
}, },
"management": map[string]interface{}{ "management": map[string]interface{}{
"enabled": true, "enabled": true,
"methods": []string{"invite"},
}, },
"blossom": map[string]interface{}{ "blossom": map[string]interface{}{
"enabled": true, "enabled": true,
+2 -4
View File
@@ -32,8 +32,7 @@ type Config struct {
} `toml:"policy" json:"policy"` } `toml:"policy" json:"policy"`
Groups struct { Groups struct {
Enabled bool `toml:"enabled" json:"enabled"` Enabled bool `toml:"enabled" json:"enabled"`
AutoJoin bool `toml:"auto_join" json:"auto_join"`
} `toml:"groups" json:"groups"` } `toml:"groups" json:"groups"`
Push struct { Push struct {
@@ -41,8 +40,7 @@ type Config struct {
} `toml:"push" json:"push"` } `toml:"push" json:"push"`
Management struct { Management struct {
Enabled bool `toml:"enabled" json:"enabled"` Enabled bool `toml:"enabled" json:"enabled"`
Methods []string `toml:"methods" json:"methods"`
} `toml:"management" json:"management"` } `toml:"management" json:"management"`
Blossom struct { Blossom struct {
+1 -1
View File
@@ -383,7 +383,7 @@ func (instance *Instance) OnEvent(ctx context.Context, event nostr.Event) (rejec
func (instance *Instance) OnEventSaved(ctx context.Context, event nostr.Event) { func (instance *Instance) OnEventSaved(ctx context.Context, event nostr.Event) {
h := GetGroupIDFromEvent(event) h := GetGroupIDFromEvent(event)
if event.Kind == nostr.KindSimpleGroupJoinRequest && instance.Config.Groups.AutoJoin { if event.Kind == nostr.KindSimpleGroupJoinRequest {
instance.Groups.AddMember(h, event.PubKey) instance.Groups.AddMember(h, event.PubKey)
instance.Groups.UpdateMembersList(h) instance.Groups.UpdateMembersList(h)
} }