diff --git a/src/Handler/Package/V0/Info.hs b/src/Handler/Package/V0/Info.hs index 636f39a..29fbf89 100644 --- a/src/Handler/Package/V0/Info.hs +++ b/src/Handler/Package/V0/Info.hs @@ -6,14 +6,14 @@ import Foundation (Handler, RegistryCtx (..)) import Handler.Util (tickleMAU) import Model (Category (..), EntityField (..)) import Settings (AppSettings (..)) -import Startlude (Generic, Show, Text, pure, ($), (.), (<$>), (&&&)) +import Startlude (Generic, Show, Text, pure, ($), (.), (<$>), (&&&), Maybe) import Yesod (ToContent (..), ToTypedContent (..), YesodPersist (runDB), getsYesod) import Yesod.Core.Types (JSONResponse (..)) data InfoRes = InfoRes { name :: !Text - , description:: !Text + , description:: !(Maybe Text) , categories :: ![Text] } deriving (Show, Generic) diff --git a/src/Settings.hs b/src/Settings.hs index 66a3b63..917b492 100644 --- a/src/Settings.hs +++ b/src/Settings.hs @@ -39,7 +39,7 @@ import Data.Aeson ( (.!=) ) import Data.Aeson.Types ( parseMaybe ) import Data.FileEmbed ( embedFile ) -import Data.Maybe ( fromJust ) +import Data.Maybe ( fromJust, Maybe ) import Data.Version ( showVersion ) import Data.Yaml ( decodeEither' ) import Data.Yaml.Config ( applyEnvValue ) @@ -85,7 +85,7 @@ data AppSettings = AppSettings , staticBinDir :: !FilePath , errorLogRoot :: !FilePath , marketplaceName :: !Text - , marketplaceDescription :: !Text + , marketplaceDescription :: !(Maybe Text) } instance Has PkgRepo AppSettings where extract = liftA2 PkgRepo (( "apps") . resourcesDir) staticBinDir @@ -115,7 +115,7 @@ instance FromJSON AppSettings where staticBinDir <- o .: "static-bin-dir" errorLogRoot <- o .: "error-log-root" marketplaceName <- o .: "marketplace-name" - marketplaceDescription <- o .: "marketplace-description" + marketplaceDescription <- o .:? "marketplace-description" let sslKeyLocation = sslPath "key.pem" let sslCsrLocation = sslPath "certificate.csr"