diff --git a/config/settings-default.yaml b/config/settings-default.yaml index 84433ed..491d7a5 100644 --- a/config/settings-default.yaml +++ b/config/settings-default.yaml @@ -165,3 +165,6 @@ retry-delivery-every: # activities received in local inboxes and the result of their processing. # 'null' means disable the report page entirely. #activity-debug-reports: 10 + +# List of (hosts of) other known federating instances. +#instances: [] diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index 9eab741..c806ece 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -222,11 +222,14 @@ instance Yesod App where pc <- widgetToPageContent $ do setTitle $ toHtml $ T.intercalate " → " (map snd bcs) <> " → " <> title - let instanceHost = appInstanceHost $ appSettings master + let settings = appSettings master + instanceHost = appInstanceHost settings federationPage :: Text federationPage = "https://dev.angeley.es\ \/s/fr33domlover/r/vervis/s/FEDERATION.md" + federationDisabled = not $ appFederation settings + federatedServers = appInstances settings $(widgetFile "default-layout") withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet") diff --git a/src/Vervis/Settings.hs b/src/Vervis/Settings.hs index 1620104..9b573e9 100644 --- a/src/Vervis/Settings.hs +++ b/src/Vervis/Settings.hs @@ -152,6 +152,8 @@ data AppSettings = AppSettings -- latest activities received in local inboxes and the result of their -- processing. 'Nothing' means disable the report page entirely. , appInboxDebugReportLength :: Maybe Int + -- | List of (hosts of) other known federating instances. + , appInstances :: [Text] } instance FromJSON AppSettings where @@ -201,6 +203,7 @@ instance FromJSON AppSettings where appDropDeliveryAfter <- ndt <$> o .: "drop-delivery-after" appDeliveryRetryFreq <- interval <$> o .: "retry-delivery-every" appInboxDebugReportLength <- o .:? "activity-debug-reports" + appInstances <- o .:? "instances" .!= [] return AppSettings {..} where diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index e88ccf3..c089583 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -32,6 +32,22 @@ $nothing

Federation status: See here! +$if federationDisabled +

+ + NOTE: Federation is disabled on this instance! + $if null federatedServers + + You can test federation between other instances. + $else + + You can test federation between the following instances: +