From b0f8a010254b97548b5a7140cc7137c53e30f8cd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Apr 2017 14:58:32 -0400 Subject: server: email logs to user, and option to delete old ones --- Role/User.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Role/User.hs') diff --git a/Role/User.hs b/Role/User.hs index e999b1c..90d19de 100644 --- a/Role/User.hs +++ b/Role/User.hs @@ -21,6 +21,7 @@ import Control.Concurrent.STM import Control.Concurrent.STM.TMChan import System.Process import System.Exit +import qualified Data.Text.IO as T import qualified Data.ByteString as B import Data.List.NonEmpty (NonEmpty(..), toList) import Data.Monoid @@ -33,11 +34,17 @@ run :: UserOpts -> IO ExitCode run os = fromMaybe (ExitFailure 101) <$> connect where connect = do + putStrLn "A debug-me session lets someone else run commands on your computer" + putStrLn "to debug your problem. A log of this session can be emailed to you" + putStrLn "at the end, which you can use to prove what they did in this session." + putStr "Enter your email address: " + hFlush stdout + email <- T.getLine (controlinput, controloutput) <- openControlWindow putStr "Connecting to debug-me server..." hFlush stdout usv <- newEmptyTMVarIO - runClientApp $ clientApp (InitMode mempty) User developerMessages $ \ochan ichan sid -> do + runClientApp $ clientApp (InitMode email) User developerMessages $ \ochan ichan sid -> do let url = sessionIDUrl sid "localhost" 8081 putStrLn "" putStrLn "Others can connect to this session and help you debug by running:" -- cgit v1.2.3