diff --git a/.env.example b/.env.example index 1006d96..438b759 100644 --- a/.env.example +++ b/.env.example @@ -29,6 +29,7 @@ # # Service Integrations +# (sorted alphabetically by service name) # # BTCPAY_PUBLIC_URL='https://btcpay.example.com' @@ -62,5 +63,9 @@ # MEDIAWIKI_PUBLIC_URL='https://wiki.kosmos.org' +# NOSTR_PRIVATE_KEY='123456abcdef...' +# NOSTR_PUBLIC_KEY='123456abcdef...' +# NOSTR_RELAY_URL='wss://nostr.kosmos.org' + # RS_STORAGE_URL='https://storage.kosmos.org' # RS_REDIS_URL='redis://localhost:6379/2' diff --git a/app/models/setting.rb b/app/models/setting.rb index 15c8755..0b41a30 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -169,6 +169,9 @@ class Setting < RailsSettings::Base field :nostr_public_key, type: :string, default: ENV["NOSTR_PUBLIC_KEY"].presence + field :nostr_relay_url, type: :string, + default: ENV["NOSTR_RELAY_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 302c52a..c5db5e3 100644 --- a/app/views/admin/settings/services/_nostr.html.erb +++ b/app/views/admin/settings/services/_nostr.html.erb @@ -19,6 +19,11 @@ title: "Public key", description: "The corresponding public key of the accounts service" ) %> + <%= render FormElements::FieldsetResettableSettingComponent.new( + key: :nostr_relay_url, + title: "Relay URL", + description: "Websockets URL of a relay associated with #{Setting.primary_domain}" + ) %>