Compare commits

...

2 Commits

Author SHA1 Message Date
14d4417aec Bump version and add spider type configuration
pkg/version/version
- Updated version number from v0.4.0 to v0.4.1

pkg/app/config/config.go
- Added new config field `SpiderType` with default value "directory"

pkg/app/relay/peers.go
- Added check to skip empty addresses before processing peer information

pkg/app/relay/spider.go
- Modified spider fetch logic to conditionally execute based on spider type
- Added support for different kinds of events based on spider type
2025-08-01 08:52:22 +01:00
bdda37732c Remove redundant log statements from addEvent.go
- pkg/app/relay/addEvent.go
  - Removed log.I.S(pubkeys) statement
  - Removed log.I.F("sending to replica %s", a) statement
2025-07-31 22:37:34 +01:00
5 changed files with 15 additions and 11 deletions

View File

@@ -38,6 +38,7 @@ type C struct {
AuthRequired bool `env:"ORLY_AUTH_REQUIRED" default:"false" usage:"require authentication for all requests"`
PublicReadable bool `env:"ORLY_PUBLIC_READABLE" default:"true" usage:"allow public read access to regardless of whether the client is authed"`
SpiderSeeds []string `env:"ORLY_SPIDER_SEEDS" usage:"seeds to use for the spider (relays that are looked up initially to find owner relay lists) (comma separated)" default:"wss://relay.nostr.band/,wss://relay.damus.io/,wss://nostr.wine/,wss://nostr.land/,wss://theforest.nostr1.com/"`
SpiderType string `env:"ORLY_SPIDER_TYPE" usage:"whether to spider, and what degree of spidering: none, directory, follows (follows means to the second degree of the follow graph)" default:"directory"`
Owners []string `env:"ORLY_OWNERS" usage:"list of users whose follow lists designate whitelisted users who can publish events, and who can read if public readable is false (comma separated)"`
Private bool `env:"ORLY_PRIVATE" usage:"do not spider for user metadata because the relay is private and this would leak relay memberships" default:"false"`
Whitelist []string `env:"ORLY_WHITELIST" usage:"only allow connections from this list of IP addresses"`

View File

@@ -125,7 +125,6 @@ func (s *Server) AddEvent(
// (they're unpacked from a string containing both, appended at the
// same time), so if the pubkeys from the http event endpoint sent
// us here matches the index of this address, we can skip it.
log.I.S(pubkeys)
for _, pk := range pubkeys {
if bytes.Equal(s.Peers.Pubkeys[i], pk) {
log.I.F(
@@ -135,7 +134,6 @@ func (s *Server) AddEvent(
continue replica
}
}
log.I.F("sending to replica %s", a)
var ur *url.URL
if ur, err = url.Parse(a + "/api/event"); chk.E(err) {
continue

View File

@@ -33,6 +33,9 @@ func (p *Peers) Init(
addresses []string, sec string,
) (err error) {
for _, address := range addresses {
if len(address) == 0 {
continue
}
split := strings.Split(address, "@")
if len(split) != 2 {
log.E.F("invalid peer address: %s", address)

View File

@@ -97,16 +97,18 @@ func (s *Server) Spider(noFetch ...bool) (err error) {
s.SetFollowedFollows(followedFollows)
s.SetOwnersMuted(ownersMuted)
// lastly, update all followed users new events in the background
if !dontFetch {
if !dontFetch && s.C.SpiderType != "none" {
go func() {
var k *kinds.T
if s.C.SpiderType == "directory" {
k = kinds.New(
kind.ProfileMetadata, kind.RelayListMetadata,
kind.DMRelaysList,
)
}
everyone := append(ownersFollowed, followedFollows...)
s.SpiderFetch(
// kinds.New(
// kind.ProfileMetadata, kind.RelayListMetadata,
// kind.DMRelaysList,
// ),
nil,
false, true, everyone...,
_, _ = s.SpiderFetch(
k, false, true, everyone...,
)
}()
}

View File

@@ -1 +1 @@
v0.4.0
v0.4.1