From 12a1570c7d7acb9c54acc2a81c43cc35af109ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Tue, 11 Aug 2026 14:03:38 -0600 Subject: [PATCH] Add Blossom server URL to global settings --- .env.example | 1 + app/models/concerns/settings/nostr_settings.rb | 3 +++ app/views/admin/settings/services/_nostr.html.erb | 5 +++++ app/views/settings/_nostr.html.erb | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index cd5bd7f..56cd5c8 100644 --- a/.env.example +++ b/.env.example @@ -87,6 +87,7 @@ # NOSTR_PRIVATE_KEY='123456abcdef...' # NOSTR_PUBLIC_KEY='123456abcdef...' # NOSTR_RELAY_URL='wss://nostr.kosmos.org' +# NOSTR_BLOSSOM_SERVER_URL='https://blossom.kosmos.org' # RS_STORAGE_URL='https://storage.kosmos.org' # RS_REDIS_URL='redis://localhost:6379/2' diff --git a/app/models/concerns/settings/nostr_settings.rb b/app/models/concerns/settings/nostr_settings.rb index a9f0657..5fd2399 100644 --- a/app/models/concerns/settings/nostr_settings.rb +++ b/app/models/concerns/settings/nostr_settings.rb @@ -18,6 +18,9 @@ module Settings field :nostr_relay_url, type: :string, default: ENV["NOSTR_RELAY_URL"].presence + field :nostr_blossom_server_url, type: :string, + default: ENV["NOSTR_BLOSSOM_SERVER_URL"].presence + field :nostr_zaps_relay_limit, type: :integer, default: 12 diff --git a/app/views/admin/settings/services/_nostr.html.erb b/app/views/admin/settings/services/_nostr.html.erb index 49aabbe..04e159d 100644 --- a/app/views/admin/settings/services/_nostr.html.erb +++ b/app/views/admin/settings/services/_nostr.html.erb @@ -29,6 +29,11 @@ title: "Relay URL", description: "Websockets URL of a relay associated with #{Setting.primary_domain}" ) %> + <%= render FormElements::FieldsetResettableSettingComponent.new( + key: :nostr_blossom_server_url, + title: "Blossom server URL", + description: "HTTP URL of the Blossom media server to add to users' server lists during onboarding" + ) %> diff --git a/app/views/settings/_nostr.html.erb b/app/views/settings/_nostr.html.erb index edd8469..1949fc3 100644 --- a/app/views/settings/_nostr.html.erb +++ b/app/views/settings/_nostr.html.erb @@ -35,7 +35,10 @@
  • Receive zaps in your Lightning account
  • <% end %> <% if Setting.nostr_relay_url.present? %> -
  • Publish notes on <%= link_to "our relay", Setting.nostr_relay_url_http, class: "ks-text-link", target: "_blank" %>
  • +
  • Publish notes and other stuff on our Nostr relay
  • + <% end %> + <% if Setting.nostr_blossom_server_url.present? %> +
  • Publish media files on our Nostr media server
  • <% end %> <% end %>