diff --git a/web/lib/potato_mesh/config.rb b/web/lib/potato_mesh/config.rb index fa43ad7..8101b2e 100644 --- a/web/lib/potato_mesh/config.rb +++ b/web/lib/potato_mesh/config.rb @@ -42,6 +42,7 @@ module PotatoMesh DEFAULT_FEDERATION_WORKER_QUEUE_CAPACITY = 128 DEFAULT_FEDERATION_TASK_TIMEOUT_SECONDS = 120 DEFAULT_INITIAL_FEDERATION_DELAY_SECONDS = 2 + DEFAULT_FEDERATION_SEED_DOMAINS = %w[potatomesh.net potatomesh.jmrp.io].freeze # Retrieve the configured API token used for authenticated requests. # @@ -409,7 +410,7 @@ module PotatoMesh # # @return [Array] list of default seed domains. def federation_seed_domains - ["potatomesh.net"].freeze + DEFAULT_FEDERATION_SEED_DOMAINS end # Determine how often we broadcast federation announcements. diff --git a/web/spec/app_spec.rb b/web/spec/app_spec.rb index b099b88..9d1382e 100644 --- a/web/spec/app_spec.rb +++ b/web/spec/app_spec.rb @@ -1080,7 +1080,8 @@ RSpec.describe "Potato Mesh Sinatra app" do targets = application_class.federation_target_domains("self.mesh") - expect(targets.first).to eq("potatomesh.net") + seed_domains = PotatoMesh::Config.federation_seed_domains.map(&:downcase) + expect(targets.first(seed_domains.length)).to eq(seed_domains) expect(targets).to include("remote.mesh") expect(targets).not_to include("self.mesh") end @@ -1090,7 +1091,7 @@ RSpec.describe "Potato Mesh Sinatra app" do targets = application_class.federation_target_domains("self.mesh") - expect(targets).to eq(["potatomesh.net"]) + expect(targets).to eq(PotatoMesh::Config.federation_seed_domains.map(&:downcase)) end it "ignores remote instances that have not updated within a week" do @@ -1118,7 +1119,7 @@ RSpec.describe "Potato Mesh Sinatra app" do targets = application_class.federation_target_domains("self.mesh") - expect(targets).to eq(["potatomesh.net"]) + expect(targets).to eq(PotatoMesh::Config.federation_seed_domains.map(&:downcase)) end end