Add a dummy route for /.well-known/host-meta

This was removed from the diaspora_federation gem, since it's not used
for the federation/discovery anymore since a long time. But old versions
of the ConnectionTester up to version 0.7.17 still check if this route
exist or else they mark the pod as offline. So lets add a dummy
host-meta with an empty response back, so the ConnectionTester is happy
again until we can remove this workaround again.
This commit is contained in:
Benjamin Neff 2022-07-23 00:17:06 +02:00
parent 9b24407b68
commit ed8e340fa2
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 11 additions and 1 deletions

View file

@ -20,4 +20,14 @@ class NodeInfoController < ApplicationController
format.all { @statistics = NodeInfoPresenter.new("1.0") }
end
end
# TODO: this is only a dummy endpoint, because old versions of the ConnectionTester (<= 0.7.17.0)
# checked for this endpoint. Remove this endpoint again once most pods are updated to >= 0.7.18.0
def host_meta
render xml: <<~XML
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
</XRD>
XML
end
end

View file

@ -11,7 +11,6 @@ Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins "*"
resource "/api/*", methods: :any
resource "/.well-known/host-meta"
resource "/.well-known/webfinger"
resource "/.well-known/openid-configuration"
end

View file

@ -213,6 +213,7 @@ Rails.application.routes.draw do
get ".well-known/nodeinfo", to: "node_info#jrd"
get "nodeinfo/:version", to: "node_info#document", as: "node_info", constraints: {version: /\d+\.\d+/}
get "statistics", to: "node_info#statistics"
get ".well-known/host-meta", to: "node_info#host_meta"
# Terms
if AppConfig.settings.terms.enable? || Rails.env.test?