summaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-15 13:34:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-15 13:34:59 -0400
commitb236c46dbb20cfbb42201b7cccdaa153b7bd2ed1 (patch)
tree59915ff94b6cb0bb1df8858f30e06b5408af8b44 /Utility/WebApp.hs
parentfd9d5f0d9c3de99c53ba12c85e6c985baeb38901 (diff)
webapp: Now always logs to .git/annex/daemon.log
It used to not log to daemon.log when a repository was first created, and when starting the webapp. Now both do. Redirecting stdout and stderr to the log is tricky when starting the webapp, because the web browser may want to communicate with the user. (Either a console web browser, or web.browser = echo) This is handled by restoring the original fds when running the browser.
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r--Utility/WebApp.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs
index 51300c9cf..c6aae9db5 100644
--- a/Utility/WebApp.hs
+++ b/Utility/WebApp.hs
@@ -40,16 +40,12 @@ import Control.Concurrent
localhost :: String
localhost = "localhost"
-{- Runs a web browser on a given url.
- -
- - Note: The url *will* be visible to an attacker. -}
-runBrowser :: String -> (Maybe [(String, String)]) -> IO Bool
-runBrowser url env = boolSystemEnv cmd [Param url] env
- where
+{- Command to use to run a web browser. -}
+browserCommand :: FilePath
#ifdef darwin_HOST_OS
- cmd = "open"
+browserCommand = "open"
#else
- cmd = "xdg-open"
+browserCommand = "xdg-open"
#endif
{- Binds to a socket on localhost, and runs a webapp on it.