From 845f02b381f197645bb548f376a3b38391caf35c Mon Sep 17 00:00:00 2001 From: cr0bar Date: Wed, 18 Sep 2024 08:50:28 +0100 Subject: [PATCH 1/6] Update main.go to support name and version information for NIP-11 --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 5d7b5ce..1c6db18 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,10 @@ import ( "github.com/nbd-wtf/go-nostr" ) +var ( + version string +) + type Config struct { RelayName string RelayPubkey string @@ -74,6 +78,9 @@ func main() { relay.Info.Name = config.RelayName relay.Info.PubKey = config.RelayPubkey relay.Info.Description = config.RelayDescription + relay.Info.Software = "WoT Relay" + relay.Info.Version = version + appendPubkey(config.RelayPubkey) db := getDB() From 1309979d1cadb0b01481af802433f65335c206ae Mon Sep 17 00:00:00 2001 From: cr0bar Date: Wed, 18 Sep 2024 08:51:13 +0100 Subject: [PATCH 2/6] Update README.md for change to build command to support version number --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b68f9a0..f983c79 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ ARCHIVAL_SYNC="FALSE" # set to TRUE to archive every note from every person in t Run the following command to build the relay: ```bash -go build +go build -ldflags "-X main.version=$(git describe --tags --always)" ``` ### 5. Create a Systemd Service (optional) From 372ccbe0c0b210098bc692f0590422a368574196 Mon Sep 17 00:00:00 2001 From: cr0bar Date: Wed, 18 Sep 2024 09:25:51 +0100 Subject: [PATCH 3/6] Update main.go to supp --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 1c6db18..5b161a6 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ type Config struct { RefreshInterval int MinimumFollowers int ArchivalSync bool + Contact string } var pool *nostr.SimplePool @@ -77,6 +78,7 @@ func main() { relay.Info.Name = config.RelayName relay.Info.PubKey = config.RelayPubkey + relay.Info.Contact = config.Contact relay.Info.Description = config.RelayDescription relay.Info.Software = "WoT Relay" relay.Info.Version = version @@ -197,6 +199,7 @@ func LoadConfig() Config { RefreshInterval: refreshInterval, MinimumFollowers: minimumFollowers, ArchivalSync: getEnv("ARCHIVAL_SYNC") == "TRUE", + Contact: getEnv("CONTACT"), } return config From a43e1ff9f89104433321a537469402aadfd1cf50 Mon Sep 17 00:00:00 2001 From: cr0bar Date: Wed, 18 Sep 2024 09:27:01 +0100 Subject: [PATCH 4/6] Update .env.example --- .env.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index b5f8b1e..c6dd4d1 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ RELAY_NAME="utxo WoT relay" RELAY_PUBKEY="e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" # not your npub! RELAY_DESCRIPTION="Only notes in utxo WoT" RELAY_URL="wss://wot.utxo.one" +CONTACT="contact details" # where we should store the database DB_PATH="db" @@ -18,4 +19,4 @@ REFRESH_INTERVAL_HOURS=1 MINIMUM_FOLLOWERS=5 # archive all notes from everyone in your WoT from other relays -ARCHIVAL_SYNC="FALSE" \ No newline at end of file +ARCHIVAL_SYNC="FALSE" From d29125188754d69ea4a41d0c7711a12f32db3c73 Mon Sep 17 00:00:00 2001 From: cr0bar Date: Wed, 18 Sep 2024 12:10:07 +0100 Subject: [PATCH 5/6] Update .env.example added RELAY_ICON and renamed CONTACT --- .env.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index c6dd4d1..2638944 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,8 @@ RELAY_NAME="utxo WoT relay" RELAY_PUBKEY="e2ccf7cf20403f3f2a4a55b328f0de3be38558a7d5f33632fdaaefc726c1c8eb" # not your npub! RELAY_DESCRIPTION="Only notes in utxo WoT" RELAY_URL="wss://wot.utxo.one" -CONTACT="contact details" +RELAY_ICON="https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg" +RELAY_CONTACT="https://utxo.one" # where we should store the database DB_PATH="db" From 0ce65fb5495268bf1031e1a1cd0df1d99b8963bc Mon Sep 17 00:00:00 2001 From: cr0bar Date: Wed, 18 Sep 2024 12:12:48 +0100 Subject: [PATCH 6/6] Update main.go to support icon and rename contact --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5b161a6..4834636 100644 --- a/main.go +++ b/main.go @@ -33,7 +33,8 @@ type Config struct { RefreshInterval int MinimumFollowers int ArchivalSync bool - Contact string + RelayContact string + RelayIcon string } var pool *nostr.SimplePool @@ -78,7 +79,8 @@ func main() { relay.Info.Name = config.RelayName relay.Info.PubKey = config.RelayPubkey - relay.Info.Contact = config.Contact + relay.Info.Icon = config.RelayIcon + relay.Info.Contact = config.RelayContact relay.Info.Description = config.RelayDescription relay.Info.Software = "WoT Relay" relay.Info.Version = version @@ -192,6 +194,8 @@ func LoadConfig() Config { RelayName: getEnv("RELAY_NAME"), RelayPubkey: getEnv("RELAY_PUBKEY"), RelayDescription: getEnv("RELAY_DESCRIPTION"), + RelayContact: getEnv("RELAY_CONTACT"), + RelayIcon: getEnv("RELAY_ICON"), DBPath: getEnv("DB_PATH"), RelayURL: getEnv("RELAY_URL"), IndexPath: getEnv("INDEX_PATH"), @@ -199,7 +203,6 @@ func LoadConfig() Config { RefreshInterval: refreshInterval, MinimumFollowers: minimumFollowers, ArchivalSync: getEnv("ARCHIVAL_SYNC") == "TRUE", - Contact: getEnv("CONTACT"), } return config