keter 1.3.1 → 1.3.2
raw patch · 3 files changed
+30/−10 lines, 3 filesdep ~wai-extraPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: wai-extra
API changes (from Hackage documentation)
+ Keter.Types.V10: raRedirectDest :: RedirectAction -> !RedirectDest
+ Keter.Types.V10: raSourcePath :: RedirectAction -> !SourcePath
+ Keter.Types.V10: raSourceSecure :: RedirectAction -> !(Maybe Bool)
- Keter.Types.V10: RedirectAction :: !SourcePath -> !RedirectDest -> RedirectAction
+ Keter.Types.V10: RedirectAction :: !SourcePath -> !RedirectDest -> !(Maybe Bool) -> RedirectAction
Files
- Keter/Proxy.hs +11/−4
- Keter/Types/V10.hs +15/−5
- keter.cabal +4/−1
Keter/Proxy.hs view
@@ -33,6 +33,7 @@ ssListing, staticApp) import qualified Network.Wai.Handler.Warp as Warp import qualified Network.Wai.Handler.WarpTLS as WarpTLS+import Network.Wai.Middleware.Gzip (gzip, def) import Prelude hiding (FilePath, (++)) import WaiAppStatic.Listing (defaultListing) import System.Timeout.Lifted (timeout)@@ -42,7 +43,7 @@ reverseProxy :: Bool -> Manager -> HostLookup -> ListeningPort -> IO () reverseProxy useHeader manager hostLookup listener =- run $ withClient useHeader manager hostLookup+ run $ gzip def $ withClient useHeader manager hostLookup where warp host port = Warp.setHost host $ Warp.setPort port Warp.defaultSettings run =@@ -106,10 +107,16 @@ redirectApp RedirectConfig {..} req = V.foldr checkAction noAction redirconfigActions where- checkAction (RedirectAction SPAny dest) _ = sendTo $ mkUrl dest- checkAction (RedirectAction (SPSpecific path) dest) other- | encodeUtf8 path == Wai.rawPathInfo req = sendTo $ mkUrl dest+ checkAction (RedirectAction SPAny dest msecure) other+ | checkSecure msecure req = sendTo $ mkUrl dest | otherwise = other+ checkAction (RedirectAction (SPSpecific path) dest msecure) other+ | encodeUtf8 path == Wai.rawPathInfo req && checkSecure msecure req =+ sendTo $ mkUrl dest+ | otherwise = other++ checkSecure Nothing _ = True+ checkSecure (Just needsSecure) req = needsSecure == Wai.isSecure req noAction = Wai.responseBuilder status404
Keter/Types/V10.hs view
@@ -221,7 +221,7 @@ { redirconfigHosts = Set.singleton from , redirconfigStatus = 301 , redirconfigActions = V.singleton $ RedirectAction SPAny- $ RDPrefix False to Nothing+ (RDPrefix False to Nothing) Nothing } instance ParseYamlFile RedirectConfig where@@ -237,22 +237,32 @@ , "actions" .= redirconfigActions ] -data RedirectAction = RedirectAction !SourcePath !RedirectDest+data RedirectAction = RedirectAction+ { raSourcePath :: !SourcePath+ , raRedirectDest :: !RedirectDest+ , raSourceSecure :: !(Maybe Bool)+ } deriving Show instance FromJSON RedirectAction where parseJSON = withObject "RedirectAction" $ \o -> RedirectAction <$> (maybe SPAny SPSpecific <$> (o .:? "path")) <*> parseJSON (Object o)+ <*> o .:? "secure" instance ToJSON RedirectAction where- toJSON (RedirectAction path dest) =+ toJSON (RedirectAction path dest sourceSecure) = case toJSON dest of Object o -> case path of- SPAny -> Object o- SPSpecific x -> Object $ HashMap.insert "path" (String x) o+ SPAny -> Object $ addSecureSource o+ SPSpecific x -> Object $ addSecureSource $ HashMap.insert "path" (String x) o v -> v+ where+ addSecureSource =+ case sourceSecure of+ Nothing -> id+ Just b -> HashMap.insert "secure" (Bool b) data SourcePath = SPAny | SPSpecific !Text
keter.cabal view
@@ -1,11 +1,13 @@ Name: keter-Version: 1.3.1+Version: 1.3.2 Synopsis: Web application deployment manager, focusing on Haskell web frameworks Description: Handles deployment of web apps, providing a reverse proxy to achieve zero downtime deployments. For more information, please see the README on Github: <https://github.com/snoyberg/keter#readme> . Release history: .+ [1.3.2] Enable GZIP middleware+ . [1.3.1] Upgrade to WAI 3.0 . [1.3.0] Upgrade to conduit 1.1@@ -59,6 +61,7 @@ , unix >= 2.5 , wai-app-static >= 3.0 && < 3.1 , wai >= 3.0 && < 3.1+ , wai-extra >= 3.0 && < 3.1 , http-types , regex-tdfa >= 1.1 , attoparsec >= 0.10