Merge branch 'master' of git://git-annex.branchable.com

This commit is contained in:
Joey Hess 2014-03-12 12:25:49 -04:00
commit 91c5955bab
3 changed files with 16 additions and 3 deletions

View file

@ -22,6 +22,9 @@ buildFlags = filter (not . null)
#else #else
#warning Building without the webapp. You probably need to install Yesod.. #warning Building without the webapp. You probably need to install Yesod..
#endif #endif
#ifdef WITH_WEBAPP_HTTPS
, "Webapp-https"
#endif
#ifdef WITH_PAIRING #ifdef WITH_PAIRING
, "Pairing" , "Pairing"
#else #else

View file

@ -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__

View file

@ -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
@ -180,6 +183,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