From b89d0d82c3208642a66009d60fcf5283e7de8fb0 Mon Sep 17 00:00:00 2001 From: Akos Marton Date: Sun, 23 Feb 2020 14:41:10 +0100 Subject: [PATCH 1/2] Increase overall level of compiler warnings. --- keter.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keter.cabal b/keter.cabal index 861c0f6..561fe09 100644 --- a/keter.cabal +++ b/keter.cabal @@ -97,7 +97,7 @@ Executable keter Main-is: keter.hs hs-source-dirs: main Build-depends: base, keter, data-default, filepath - ghc-options: -threaded -Wall + ghc-options: -threaded -Weverything -Wcompat other-modules: Paths_keter test-suite test From 5d24a5d2e1799745e7f99a1872ddeaf71d5ad6eb Mon Sep 17 00:00:00 2001 From: Akos Marton Date: Sun, 23 Feb 2020 14:41:35 +0100 Subject: [PATCH 2/2] Fix all warnings of ghc-8.2.2. --- Keter/App.hs | 2 +- Keter/Main.hs | 4 ++-- Keter/Proxy.hs | 4 ++++ Keter/Types/Middleware.hs | 1 - Keter/Types/V10.hs | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Keter/App.hs b/Keter/App.hs index 44fb06e..8fbc59e 100644 --- a/Keter/App.hs +++ b/Keter/App.hs @@ -151,7 +151,7 @@ withActions asc bconfig f = return (p, c) ) ) - (\(port, cert) -> releasePort (ascPortPool asc) port) + (\(port, _) -> releasePort (ascPortPool asc) port) (\(port, cert) -> loop stanzas (wac { waconfigPort = port } : wacs) diff --git a/Keter/Main.hs b/Keter/Main.hs index a8dc353..b5cb57b 100644 --- a/Keter/Main.hs +++ b/Keter/Main.hs @@ -38,7 +38,7 @@ import Data.Text.Encoding (encodeUtf8) import qualified Data.Text.Read import Data.Time (getCurrentTime) import Data.Yaml.FilePath -import qualified Network.HTTP.Conduit as HTTP (conduitManagerSettings, +import qualified Network.HTTP.Conduit as HTTP (tlsManagerSettings, newManager) import Prelude hiding (FilePath, log) import System.Directory (createDirectoryIfMissing, @@ -208,7 +208,7 @@ listDirectoryTree fp = do startListening :: KeterConfig -> HostMan.HostManager -> IO () startListening KeterConfig {..} hostman = do - manager <- HTTP.newManager HTTP.conduitManagerSettings + manager <- HTTP.newManager HTTP.tlsManagerSettings runAndBlock kconfigListeners $ Proxy.reverseProxy kconfigIpFromHeader -- calculate the number of microseconds since the diff --git a/Keter/Proxy.hs b/Keter/Proxy.hs index a903000..8834528 100644 --- a/Keter/Proxy.hs +++ b/Keter/Proxy.hs @@ -34,6 +34,7 @@ import Network.HTTP.ReverseProxy (defaultWaiProxySettings, import Network.HTTP.ReverseProxy (ProxyDest (ProxyDest), SetIpHeader (..), WaiProxyResponse (..), + WaiProxySettings, LocalWaiProxySettings, setLpsTimeBound, waiProxyToSettings, @@ -55,7 +56,10 @@ import WaiAppStatic.Listing (defaultListing) import qualified Network.TLS as TLS #if !MIN_VERSION_http_reverse_proxy(0,6,0) +defaultWaiProxySettings :: WaiProxySettings defaultWaiProxySettings = def + +defaultLocalWaiProxySettings :: LocalWaiProxySettings defaultLocalWaiProxySettings = def #endif diff --git a/Keter/Types/Middleware.hs b/Keter/Types/Middleware.hs index 6be3d03..d6cc010 100644 --- a/Keter/Types/Middleware.hs +++ b/Keter/Types/Middleware.hs @@ -9,7 +9,6 @@ import Network.Wai import Control.Monad import Control.Arrow ((***)) -import Control.Applicative -- various Middlewares import Network.Wai.Middleware.AcceptOverride (acceptOverride) diff --git a/Keter/Types/V10.hs b/Keter/Types/V10.hs index 3e61efa..f9bd1d5 100644 --- a/Keter/Types/V10.hs +++ b/Keter/Types/V10.hs @@ -11,7 +11,7 @@ import Data.Aeson (FromJSON (..), Value (Object, String, Bool), withObject, withBool, (.!=), (.:), (.:?)) -import Data.Aeson (Value (Bool), object, (.=)) +import Data.Aeson (object, (.=)) import qualified Data.CaseInsensitive as CI import Data.Conduit.Network (HostPreference) import Data.Default