update lts and log headers

This commit is contained in:
Lucy Cifferello
2021-09-08 15:39:42 -06:00
parent c38ea1480b
commit 8fec3b48a3
4 changed files with 5 additions and 12 deletions

View File

@@ -18,7 +18,7 @@ ip-from-header: "_env:YESOD_IP_FROM_HEADER:false"
# Optional values with the following production defaults.
# In development, they default to the inverse.
#
detailed-logging: true
detailed-logging: false
# should-log-all: false
# reload-templates: false
# mutable-static: false

View File

@@ -64,6 +64,7 @@ import Control.Lens
import Control.Arrow ((***))
import Network.HTTP.Types.Header ( hOrigin )
import Data.List (lookup)
import Network.Wai.Middleware.RequestLogger.JSON
-- This line actually creates our YesodDispatch instance. It is the second half
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the
@@ -118,7 +119,6 @@ makeApplication foundation = do
dynamicCorsResourcePolicy :: Request -> Maybe CorsResourcePolicy
dynamicCorsResourcePolicy req = Just . policy . lookup hOrigin $ requestHeaders req
$logInfo $ show $ requestHeaders req
where
policy o = simpleCorsResourcePolicy
{ corsOrigins = (\o' -> ([o'], True)) <$> o
@@ -181,10 +181,6 @@ dynamicCorsResourcePolicy req = Just . policy . lookup hOrigin $ requestHeaders
]
, corsIgnoreFailures = True
}
-- TODO: create a middle ware which will attempt to verify an ecdsa signed transaction against one of the public keys
-- in the validDevices table.
-- makeCheckSigWare :: RegistryCtx -> IO Middleware
-- makeCheckSigWare = _
makeLogWare :: RegistryCtx -> IO Middleware
makeLogWare foundation =
@@ -192,14 +188,10 @@ makeLogWare foundation =
{ outputFormat =
if appDetailedRequestLogging $ appSettings foundation
then Detailed True
else Apache
(if appIpFromHeader $ appSettings foundation
then FromFallback
else FromSocket)
else CustomOutputFormatWithDetailsAndHeaders formatAsJSONWithHeaders
, destination = Logger $ loggerSet $ appLogger foundation
}
-- TODO : what kind of auth is needed here
makeAuthWare :: RegistryCtx -> Middleware
makeAuthWare _ app req res = next
where

View File

@@ -18,6 +18,7 @@ import qualified Yesod.Core.Unsafe as Unsafe
import Settings
import Yesod.Persist.Core
import Lib.Types.AppIndex
import Network.Wai
-- | The foundation datatype for your application. This can be a good place to
-- keep settings and values requiring initialization before your application

View File

@@ -17,7 +17,7 @@
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-18.0
resolver: lts-18.6
# User packages to be built.
# Various formats can be used as shown in the example below.