summaryrefslogtreecommitdiffhomepage
path: root/Role
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-30 14:58:32 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-30 14:58:32 -0400
commitb0f8a010254b97548b5a7140cc7137c53e30f8cd (patch)
tree705319640348385f286bb40d0b0160d35a64c09a /Role
parentcf8d59b2fbcc52378f5ae840e2153f444a3283bf (diff)
downloaddebug-me-b0f8a010254b97548b5a7140cc7137c53e30f8cd.tar.gz
server: email logs to user, and option to delete old ones
Diffstat (limited to 'Role')
-rw-r--r--Role/User.hs9
1 files changed, 8 insertions, 1 deletions
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:"