diff --git a/config/settings.yml b/config/settings.yml index 7c561ddfb..3211d42db 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -27,6 +27,7 @@ notification-rate-limit: 3600 notification-collate-delay: 300 notification-expiration: 259201 session-timeout: 7200 +maximum-content-length: 52428800 log-settings: detailed: "_env:DETAILED_LOGGING:false" diff --git a/src/Foundation.hs b/src/Foundation.hs index 7e729cc8f..1cdab14f8 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -753,7 +753,7 @@ instance Yesod UniWorX where (getCachedDate, _) <- clientSessionDateCacher appSessionTimeout return . Just $ clientSessionBackend appSessionKey getCachedDate - maximumContentLength _ _ = Just $ 50 * 2^20 + maximumContentLength UniWorX{appSettings=AppSettings{appMaximumContentLength}} _ = appMaximumContentLength -- Yesod Middleware allows you to run code before and after each handler function. -- The defaultYesodMiddleware adds the response header "Vary: Accept, Accept-Language" and performs authorization checks. diff --git a/src/Settings.hs b/src/Settings.hs index f3ad5f7ac..81f98eb45 100644 --- a/src/Settings.hs +++ b/src/Settings.hs @@ -99,6 +99,7 @@ data AppSettings = AppSettings , appNotificationCollateDelay :: NominalDiffTime , appNotificationExpiration :: NominalDiffTime , appSessionTimeout :: NominalDiffTime + , appMaximumContentLength :: Maybe Word64 , appInitialLogSettings :: LogSettings @@ -354,6 +355,8 @@ instance FromJSON AppSettings where appSessionTimeout <- o .: "session-timeout" + appMaximumContentLength <- o .: "maximum-content-length" + appReloadTemplates <- o .:? "reload-templates" .!= defaultDev appMutableStatic <- o .:? "mutable-static" .!= defaultDev appSkipCombining <- o .:? "skip-combining" .!= defaultDev