quick fix to build with old warp-tls
Debian stable's warp-tls is too old to support the new https feature well,
so only use http with that old version.
Note that the webapp still depends on warp-tls, because the TLSSettings
type is used.
(cherry picked from commit 06218428c7
)
This commit is contained in:
parent
fb5d12ab92
commit
40634fb683
3 changed files with 16 additions and 3 deletions
|
@ -18,6 +18,9 @@ buildFlags = filter (not . null)
|
||||||
#ifdef WITH_WEBAPP
|
#ifdef WITH_WEBAPP
|
||||||
, "Webapp"
|
, "Webapp"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef WITH_WEBAPP_HTTPS
|
||||||
|
, "Webapp-https"
|
||||||
|
#endif
|
||||||
#ifdef WITH_PAIRING
|
#ifdef WITH_PAIRING
|
||||||
, "Pairing"
|
, "Pairing"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -74,11 +74,15 @@ browserProc url = proc "xdg-open" [url]
|
||||||
runWebApp :: Maybe TLSSettings -> Maybe HostName -> Wai.Application -> (SockAddr -> IO ()) -> IO ()
|
runWebApp :: Maybe TLSSettings -> Maybe HostName -> Wai.Application -> (SockAddr -> IO ()) -> IO ()
|
||||||
runWebApp tlssettings h app observer = withSocketsDo $ do
|
runWebApp tlssettings h app observer = withSocketsDo $ do
|
||||||
sock <- getSocket h
|
sock <- getSocket h
|
||||||
void $ forkIO $
|
void $ forkIO $ run webAppSettings sock app
|
||||||
(maybe runSettingsSocket (\ts -> runTLSSocket ts) tlssettings)
|
|
||||||
webAppSettings sock app
|
|
||||||
sockaddr <- fixSockAddr <$> getSocketName sock
|
sockaddr <- fixSockAddr <$> getSocketName sock
|
||||||
observer sockaddr
|
observer sockaddr
|
||||||
|
where
|
||||||
|
#ifdef WITH_WEBAPP_HTTPS
|
||||||
|
run = (maybe runSettingsSocket (\ts -> runTLSSocket ts) tlssettings)
|
||||||
|
#else
|
||||||
|
run = runSettingsSocket
|
||||||
|
#endif
|
||||||
|
|
||||||
fixSockAddr :: SockAddr -> SockAddr
|
fixSockAddr :: SockAddr -> SockAddr
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
|
|
|
@ -43,6 +43,9 @@ Flag Assistant
|
||||||
Flag Webapp
|
Flag Webapp
|
||||||
Description: Enable git-annex webapp
|
Description: Enable git-annex webapp
|
||||||
|
|
||||||
|
Flag Webapp-https
|
||||||
|
Description: Enable git-annex webapp https
|
||||||
|
|
||||||
Flag Pairing
|
Flag Pairing
|
||||||
Description: Enable pairing
|
Description: Enable pairing
|
||||||
|
|
||||||
|
@ -181,6 +184,9 @@ Executable git-annex
|
||||||
blaze-builder, crypto-api, hamlet, clientsession,
|
blaze-builder, crypto-api, hamlet, clientsession,
|
||||||
template-haskell, data-default, aeson, network-conduit
|
template-haskell, data-default, aeson, network-conduit
|
||||||
CPP-Options: -DWITH_WEBAPP
|
CPP-Options: -DWITH_WEBAPP
|
||||||
|
if flag(Webapp) && flag (Webapp-https)
|
||||||
|
Build-Depends: warp-tls (>= 1.4)
|
||||||
|
CPP-Options: -DWITH_WEBAPP_HTTPS
|
||||||
|
|
||||||
if flag(Pairing)
|
if flag(Pairing)
|
||||||
Build-Depends: network-multicast, network-info
|
Build-Depends: network-multicast, network-info
|
||||||
|
|
Loading…
Reference in a new issue