From e2057f41f7dfc22ad85b0e087f42364f21bf7fbd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Apr 2013 15:04:35 -0400 Subject: webapp: New --listen= option allows running the webapp on one computer and connecting to it from another. Does not yet use HTTPS. I'd need to generate a certificate, and I'm not sure what's the best way to do that. --- Assistant.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Assistant.hs') diff --git a/Assistant.hs b/Assistant.hs index 0d9dafd96..92cc275b5 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -161,6 +161,7 @@ import Utility.ThreadScheduler import qualified Build.SysConfig as SysConfig import System.Log.Logger +import Network.Socket (HostName) stopDaemon :: Annex () stopDaemon = liftIO . Utility.Daemon.stopDaemon =<< fromRepo gitAnnexPidFile @@ -170,8 +171,8 @@ stopDaemon = liftIO . Utility.Daemon.stopDaemon =<< fromRepo gitAnnexPidFile - - startbrowser is passed the url and html shim file, as well as the original - stdout and stderr descriptors. -} -startDaemon :: Bool -> Bool -> Maybe (Maybe Handle -> Maybe Handle -> String -> FilePath -> IO ()) -> Annex () -startDaemon assistant foreground startbrowser = do +startDaemon :: Bool -> Bool -> Maybe HostName -> Maybe (Maybe Handle -> Maybe Handle -> String -> FilePath -> IO ()) -> Annex () +startDaemon assistant foreground listenhost startbrowser = do pidfile <- fromRepo gitAnnexPidFile logfile <- fromRepo gitAnnexLogFile logfd <- liftIO $ openLog logfile @@ -218,7 +219,7 @@ startDaemon assistant foreground startbrowser = do mapM_ (startthread urlrenderer) [ watch $ commitThread #ifdef WITH_WEBAPP - , assist $ webAppThread d urlrenderer False Nothing webappwaiter + , assist $ webAppThread d urlrenderer False listenhost Nothing webappwaiter #ifdef WITH_PAIRING , assist $ pairListenerThread urlrenderer #endif -- cgit v1.2.3