diff --git a/routes b/routes index cfefc9671..40f7529bc 100644 --- a/routes +++ b/routes @@ -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 diff --git a/src/Foundation/Navigation.hs b/src/Foundation/Navigation.hs index 6aa443c3a..ebed962d2 100644 --- a/src/Foundation/Navigation.hs +++ b/src/Foundation/Navigation.hs @@ -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 diff --git a/src/Handler/Health.hs b/src/Handler/Health.hs index 050644330..02d224e1d 100644 --- a/src/Handler/Health.hs +++ b/src/Handler/Health.hs @@ -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 + + + 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") + \ No newline at end of file