Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"encoding/json"
"fmt"
"log"
"os"
"runtime/debug"
Expand Down Expand Up @@ -32,6 +33,7 @@ type Config struct {
RelayBindAddress string `json:"relay_bind_address"`
RelaySoftware string `json:"relay_software"`
RelayVersion string `json:"relay_version"`
UserAgent string `json:"user_agent"`
PrivateRelayName string `json:"private_relay_name"`
PrivateRelayNpub string `json:"private_relay_npub"`
PrivateRelayDescription string `json:"private_relay_description"`
Expand Down Expand Up @@ -66,6 +68,8 @@ type Config struct {
S3Config *S3Config `json:"s3_config"`
}

const relaySoftware = "https://github.com/bitvora/haven"

func loadConfig() Config {
_ = godotenv.Load(".env")

Expand All @@ -78,8 +82,9 @@ func loadConfig() Config {
RelayURL: getEnv("RELAY_URL"),
RelayPort: getEnvInt("RELAY_PORT", 3355),
RelayBindAddress: getEnvString("RELAY_BIND_ADDRESS", "0.0.0.0"),
RelaySoftware: "https://github.com/bitvora/haven",
RelaySoftware: relaySoftware,
RelayVersion: getVersion(),
UserAgent: fmt.Sprintf("Haven/%s (+%s)", getVersion(), relaySoftware),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Semisol, is this ok for you? Given the shared Pool, having specific RFC like comments is a bit painful, but basically: read = either import or refresh WoT, Write = Blastr

PrivateRelayName: getEnv("PRIVATE_RELAY_NAME"),
PrivateRelayNpub: getEnv("PRIVATE_RELAY_NPUB"),
PrivateRelayDescription: getEnv("PRIVATE_RELAY_DESCRIPTION"),
Expand Down
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ func main() {
log.Fatal("🚫 error creating blossom path:", err)
}

pool = nostr.NewSimplePool(mainCtx, nostr.WithPenaltyBox())
pool = nostr.NewSimplePool(mainCtx,
nostr.WithPenaltyBox(),
nostr.WithRelayOptions(
nostr.WithRequestHeader{
"User-Agent": []string{config.UserAgent},
}),
)

if len(os.Args) > 1 {
switch os.Args[1] {
Expand All @@ -49,6 +55,7 @@ func main() {
runRestore(mainCtx)
return
case "import":
ensureImportRelays()
runImport(mainCtx)
return
case "help":
Expand Down
26 changes: 13 additions & 13 deletions relays_blastr.example.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[
"relay.damus.io",
"nostr-01.yakihonne.com",
"nos.lol",
"relay.nostr.band",
"relay.snort.social",
"nostr.bitcoiner.social",
"nostr.land",
"nostr.mom",
"relay.nos.social",
"relay.primal.net",
"no.str.cr",
"nostr.oxtr.dev",
"nostr21.com",
"nostrue.com",
"wot.utxo.one",
"nostrelites.org",
"wot.nostr.party",
"wot.sovbit.host",
"wot.girino.org",
"relay.damus.io",
"relay.fountain.fm",
"relay.lexingtonbitcoin.org",
"zap.watch",
"relay.nos.social",
"relay.primal.net",
"relay.snort.social",
"satsage.xyz",
"wons.calva.dev"
"sendit.nosflare.com",
"wons.calva.dev",
"wot.girino.org",
"wot.nostr.party",
"wot.sovbit.host"
]
26 changes: 13 additions & 13 deletions relays_import.example.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[
"relay.damus.io",
"no.str.cr",
"nos.lol",
"relay.nostr.band",
"relay.snort.social",
"nostr.bitcoiner.social",
"nostr.land",
"nostr.mom",
"relay.nos.social",
"relay.primal.net",
"no.str.cr",
"nostr.oxtr.dev",
"nostr21.com",
"nostrue.com",
"wot.utxo.one",
"nostrelites.org",
"wot.nostr.party",
"wot.sovbit.host",
"wot.girino.org",
"offchain.pub",
"relay.damus.io",
"relay.fountain.fm",
"relay.lexingtonbitcoin.org",
"zap.watch",
"relay.nos.social",
"relay.primal.net",
"relay.snort.social",
"satsage.xyz",
"wons.calva.dev"
"wons.calva.dev",
"wot.girino.org",
"wot.nostr.party",
"wot.sovbit.host"
]