mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 11:04:53 +09:00
Display instance host at the top of all pages
This commit is contained in:
parent
ad034dbacc
commit
c41f1183e0
5 changed files with 14 additions and 0 deletions
|
@ -24,6 +24,8 @@ ip-from-header: "_env:IP_FROM_HEADER:false"
|
||||||
# Uncomment to set an explicit approot
|
# Uncomment to set an explicit approot
|
||||||
#approot: "_env:APPROOT:http://localhost:3000"
|
#approot: "_env:APPROOT:http://localhost:3000"
|
||||||
|
|
||||||
|
instance-host: "_env:INSTANCE_HOST:localhost"
|
||||||
|
|
||||||
# Encryption key file for encrypting the session cookie sent to clients
|
# Encryption key file for encrypting the session cookie sent to clients
|
||||||
client-session-key: config/client_session_key.aes
|
client-session-key: config/client_session_key.aes
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,7 @@ instance Yesod App where
|
||||||
pc <- widgetToPageContent $ do
|
pc <- widgetToPageContent $ do
|
||||||
setTitle $ toHtml $
|
setTitle $ toHtml $
|
||||||
T.intercalate " → " (map snd bcs) <> " → " <> title
|
T.intercalate " → " (map snd bcs) <> " → " <> title
|
||||||
|
let instanceHost = appInstanceHost $ appSettings master
|
||||||
$(widgetFile "default-layout")
|
$(widgetFile "default-layout")
|
||||||
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
|
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,9 @@ data AppSettings = AppSettings
|
||||||
-- | Base for all generated URLs. If @Nothing@, determined from the
|
-- | Base for all generated URLs. If @Nothing@, determined from the
|
||||||
-- request headers.
|
-- request headers.
|
||||||
, appRoot :: Maybe Text
|
, 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.
|
-- | Host/interface the server should bind to.
|
||||||
, appHost :: HostPreference
|
, appHost :: HostPreference
|
||||||
-- | Port to listen on
|
-- | Port to listen on
|
||||||
|
@ -143,6 +146,7 @@ instance FromJSON AppSettings where
|
||||||
appMaxInstanceKeys <- o .:? "max-instance-keys"
|
appMaxInstanceKeys <- o .:? "max-instance-keys"
|
||||||
appMaxActorKeys <- o .:? "max-actor-keys"
|
appMaxActorKeys <- o .:? "max-actor-keys"
|
||||||
appRoot <- o .:? "approot"
|
appRoot <- o .:? "approot"
|
||||||
|
appInstanceHost <- o .: "instance-host"
|
||||||
appHost <- fromString <$> o .: "host"
|
appHost <- fromString <$> o .: "host"
|
||||||
appPort <- o .: "http-port"
|
appPort <- o .: "http-port"
|
||||||
appIpFromHeader <- o .: "ip-from-header"
|
appIpFromHeader <- o .: "ip-from-header"
|
||||||
|
|
|
@ -57,3 +57,7 @@ input[type="submit"]
|
||||||
padding: 0.618em
|
padding: 0.618em
|
||||||
border: none
|
border: none
|
||||||
border-radius: 0.618em
|
border-radius: 0.618em
|
||||||
|
|
||||||
|
.instance
|
||||||
|
color: #{light blue}
|
||||||
|
font: 180% monospace
|
||||||
|
|
|
@ -33,6 +33,9 @@ $nothing
|
||||||
UPDATE: Federation is coming!
|
UPDATE: Federation is coming!
|
||||||
<a href=@{OutboxR}>Very early testing
|
<a href=@{OutboxR}>Very early testing
|
||||||
|
|
||||||
|
<.instance>
|
||||||
|
Vervis @ #{instanceHost}
|
||||||
|
|
||||||
^{breadcrumbsW}
|
^{breadcrumbsW}
|
||||||
|
|
||||||
$maybe msg <- mmsg
|
$maybe msg <- mmsg
|
||||||
|
|
Loading…
Reference in a new issue