chore(status): add very simple status page with nix/docker/version numbers

This commit is contained in:
Steffen Jost 2021-10-21 16:26:56 +02:00
parent ca7a4d917f
commit 426af0f183
3 changed files with 26 additions and 0 deletions

1
routes
View File

@ -69,6 +69,7 @@
/info/glossary GlossaryR GET !free
/info/faq FaqR GET !free
/version VersionR GET !free
/status StatusR GET !free
/help HelpR GET POST !free

View File

@ -132,6 +132,7 @@ breadcrumb HelpR = i18nCrumb MsgMenuHelp Nothing
breadcrumb HealthR = i18nCrumb MsgMenuHealth Nothing
breadcrumb InstanceR = i18nCrumb MsgMenuInstance Nothing
breadcrumb StatusR = i18nCrumb MsgMenuHealth Nothing -- never displayed
breadcrumb ProfileR = i18nCrumb MsgBreadcrumbProfile Nothing
breadcrumb SetDisplayEmailR = i18nCrumb MsgUserDisplayEmail $ Just ProfileR

View File

@ -11,6 +11,8 @@ import qualified Data.Set as Set
import Control.Concurrent.STM.Delay
import Data.FileEmbed (embedStringFile)
getHealthR :: Handler TypedContent
getHealthR = do
@ -94,3 +96,25 @@ getInstanceR = do
|]
provideJson instanceInfo
provideRep . return $ tshow instanceInfo
-- Most simple page for simple liveness checks
getStatusR :: Handler Html
getStatusR = withUrlRenderer
[hamlet|
$doctype 5
<html lang=en>
<head>
<title>Alive
<body>
<p>
Alive #{vnr_full}
<p>
Demo #{vnr_demo}
<p>
CI #{vnr_ci}
|]
where
vnr_full :: Text = $(embedStringFile "nix/docker/version.json")
vnr_demo :: Text = $(embedStringFile "nix/docker/demo-version.json")
vnr_ci :: Text = $(embedStringFile "nix/docker/ci-version.json")