diff --git a/config/settings-default.yaml b/config/settings-default.yaml index 52d1f11..eeb8037 100644 --- a/config/settings-default.yaml +++ b/config/settings-default.yaml @@ -24,6 +24,8 @@ ip-from-header: "_env:IP_FROM_HEADER:false" # Uncomment to set an explicit approot #approot: "_env:APPROOT:http://localhost:3000" +instance-host: "_env:INSTANCE_HOST:localhost" + # Encryption key file for encrypting the session cookie sent to clients client-session-key: config/client_session_key.aes diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index d393883..fcdcbfe 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -174,6 +174,7 @@ instance Yesod App where pc <- widgetToPageContent $ do setTitle $ toHtml $ T.intercalate " → " (map snd bcs) <> " → " <> title + let instanceHost = appInstanceHost $ appSettings master $(widgetFile "default-layout") withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet") diff --git a/src/Vervis/Settings.hs b/src/Vervis/Settings.hs index a6a2e5a..cccbf45 100644 --- a/src/Vervis/Settings.hs +++ b/src/Vervis/Settings.hs @@ -59,6 +59,9 @@ data AppSettings = AppSettings -- | Base for all generated URLs. If @Nothing@, determined from the -- request headers. , appRoot :: Maybe Text + -- | The instance's host (e.g. \"dev.angeley.es\"), currently used just + -- for display. + , appInstanceHost :: Text -- | Host/interface the server should bind to. , appHost :: HostPreference -- | Port to listen on @@ -143,6 +146,7 @@ instance FromJSON AppSettings where appMaxInstanceKeys <- o .:? "max-instance-keys" appMaxActorKeys <- o .:? "max-actor-keys" appRoot <- o .:? "approot" + appInstanceHost <- o .: "instance-host" appHost <- fromString <$> o .: "host" appPort <- o .: "http-port" appIpFromHeader <- o .: "ip-from-header" diff --git a/templates/default-layout.cassius b/templates/default-layout.cassius index dad3bbc..bfa60b4 100644 --- a/templates/default-layout.cassius +++ b/templates/default-layout.cassius @@ -57,3 +57,7 @@ input[type="submit"] padding: 0.618em border: none border-radius: 0.618em + +.instance + color: #{light blue} + font: 180% monospace diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index b996966..f4dfd63 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -33,6 +33,9 @@ $nothing UPDATE: Federation is coming! Very early testing +<.instance> + Vervis @ #{instanceHost} + ^{breadcrumbsW} $maybe msg <- mmsg