From e718d7fa4ba4987d38b9acff34a725d22a160dd8 Mon Sep 17 00:00:00 2001 From: Barry Deen Date: Tue, 29 Oct 2024 17:52:32 -0400 Subject: [PATCH] add blossom url --- config.go | 2 ++ main.go | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 5a64c2a..8ef13ca 100644 --- a/config.go +++ b/config.go @@ -45,6 +45,7 @@ type Config struct { BackupIntervalHours int `json:"backup_interval_hours"` BlastrRelays []string `json:"blastr_relays"` BlossomPath string `json:"blossom_path"` + BlossomURL string `json:"blossom_url"` } type AwsConfig struct { @@ -61,6 +62,7 @@ func loadConfig() Config { OwnerNpub: getEnv("OWNER_NPUB"), DBEngine: getEnvString("DB_ENGINE", "lmdb"), BlossomPath: getEnvString("BLOSSOM_PATH", "blossom"), + BlossomURL: getEnvString("BLOSSOM_URL", "http://localhost:3355"), RelayURL: getEnv("RELAY_URL"), RelayPort: getEnvInt("RELAY_PORT", 3355), RelayBindAddress: getEnvString("RELAY_BIND_ADDRESS", "0.0.0.0"), diff --git a/main.go b/main.go index 230d4ec..98cd809 100644 --- a/main.go +++ b/main.go @@ -287,9 +287,7 @@ func makeNewRelay(relayType string, w http.ResponseWriter, r *http.Request) *kha } }) - addr := fmt.Sprintf("%s:%d", config.RelayBindAddress, config.RelayPort) - - bl := blossom.New(outboxRelay, addr) + bl := blossom.New(outboxRelay, config.BlossomURL) bl.Store = blossom.EventStoreBlobIndexWrapper{Store: outboxDB, ServiceURL: bl.ServiceURL} bl.StoreBlob = append(bl.StoreBlob, func(ctx context.Context, sha256 string, body []byte) error { // if khatru.GetAuthed(ctx) != nPubToPubkey(config.OwnerNpub) {