aboutsummaryrefslogtreecommitdiff
path: root/Assistant.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-08 15:04:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-08 15:04:35 -0400
commite2057f41f7dfc22ad85b0e087f42364f21bf7fbd (patch)
tree19769bf97ca9263d814be6a54b8af51e599702bd /Assistant.hs
parenta664ee5e45a57713d5b47d9fa592e78881994055 (diff)
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.
Diffstat (limited to 'Assistant.hs')
-rw-r--r--Assistant.hs7
1 files changed, 4 insertions, 3 deletions
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