Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
14d4417aec
|
|||
|
bdda37732c
|
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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...,
|
||||
)
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
v0.4.0
|
||||
v0.4.1
|
||||
Reference in New Issue
Block a user