From cd8a34fcc89fd04162dc94f1aa48bc0a51ce34dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Sep 2019 20:05:55 -0400 Subject: add news item for debug-me 1.20190926 --- doc/news/version_1.20170505.mdwn | 3 --- doc/news/version_1.20190926.mdwn | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 doc/news/version_1.20170505.mdwn create mode 100644 doc/news/version_1.20190926.mdwn diff --git a/doc/news/version_1.20170505.mdwn b/doc/news/version_1.20170505.mdwn deleted file mode 100644 index 221b369..0000000 --- a/doc/news/version_1.20170505.mdwn +++ /dev/null @@ -1,3 +0,0 @@ -debug-me 1.20170505 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * First release of debug-me."""]] \ No newline at end of file diff --git a/doc/news/version_1.20190926.mdwn b/doc/news/version_1.20190926.mdwn new file mode 100644 index 0000000..b7f929f --- /dev/null +++ b/doc/news/version_1.20190926.mdwn @@ -0,0 +1,5 @@ +debug-me 1.20190926 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Avoid a crash when run without a controlling tty, which may happen + in some container environments. + * Update to lts-13.29, support ghc 8.6.5, and aeson 1.4."""]] \ No newline at end of file -- cgit v1.2.3 From 7e0068496236b4a013a2bd8f13b3195875d846af Mon Sep 17 00:00:00 2001 From: iank Date: Mon, 13 Apr 2020 14:50:33 +0000 Subject: fix instructions: they had an incorrect path and running directly fails on trisquel 8 --- doc/install.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install.mdwn b/doc/install.mdwn index f6b1dc7..c48e6d9 100644 --- a/doc/install.mdwn +++ b/doc/install.mdwn @@ -5,7 +5,7 @@ To use: tar xf debug-me-standalone-amd64.tar.gz - debug-me/debug-me + debug-me/runshell debug-me/bin/debug-me ## Distributions -- cgit v1.2.3 From 22071468c7351d214d4dde34d6897d9d093b0d8c Mon Sep 17 00:00:00 2001 From: "david@1439a1cab13195a56248b6a8fd98a62028bcba8a" Date: Wed, 19 Aug 2020 15:03:45 +0000 Subject: --- doc/forum/support_for_https_proxy__63__.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/forum/support_for_https_proxy__63__.mdwn diff --git a/doc/forum/support_for_https_proxy__63__.mdwn b/doc/forum/support_for_https_proxy__63__.mdwn new file mode 100644 index 0000000..da89550 --- /dev/null +++ b/doc/forum/support_for_https_proxy__63__.mdwn @@ -0,0 +1,16 @@ +I tried a simple nginx port forward +[[!format text """ +location /debug-me/ { + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Proto https; + proxy_redirect off; + proxy_pass https://127.0.0.1:8081; + proxy_http_version 1.1; +} +"""]] + +I'm not sure if I botched the proxy configuration, or if debug-me needs something added to support proxying? + +[[!format text """ +Connecting to debug-me server...debug-me: MalformedResponse (ResponseHead {responseCode = 301, responseMessage = "Moved Permanently", responseHeaders = [("Server","nginx/1.14.2"),("Date","Wed, 19 Aug 2020 15:02:36 GMT"),("Content-Type","text/html"),("Content-Length","185"),("Location","http://pivot.cs.unb.ca/debug-me/"),("Connection","keep-alive")]}) "Wrong response status or message." +"""]] -- cgit v1.2.3 From 294438a3e2bdbd28dadaa2abdba127a1abe49cbf Mon Sep 17 00:00:00 2001 From: "david@1439a1cab13195a56248b6a8fd98a62028bcba8a" Date: Thu, 20 Aug 2020 15:22:56 +0000 Subject: --- doc/bugs/logs_not_being_mailed.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/bugs/logs_not_being_mailed.mdwn diff --git a/doc/bugs/logs_not_being_mailed.mdwn b/doc/bugs/logs_not_being_mailed.mdwn new file mode 100644 index 0000000..4c8b7c2 --- /dev/null +++ b/doc/bugs/logs_not_being_mailed.mdwn @@ -0,0 +1,5 @@ +I just ran a test session `http://debug-me.joeyh.name:8081/75e73467-e2bb-4d0e-809b-5b1991228710`. + +It seemed to work ok, except that no logs were mailed afterwards. I checked the logs on the MX, and didn't see any connects. + +Seperately, but possibly related I reported a [debian bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968717) about trying to get emailing logs working on my own server. -- cgit v1.2.3 From 8b55bdf07277327d5169bb4b4144f30f606200ae Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Aug 2020 13:21:10 -0400 Subject: debug-me.service: Remove /etc from InaccessiblePaths As that prevents the server sending email using eg postfix, which needs to read its config files. This locking down was inherited from keysafe, which has more stringent security needs, and is not needed here. I left /home in the list, because why not. This commit was sponsored by Brett Eisenberg on Patreon. --- CHANGELOG | 8 ++++++++ debug-me.service | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 34dbbcd..d87ca68 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +debug-me (1.20190927) UNRELEASED; urgency=medium + + * debug-me.service: Remove /etc from InaccessiblePaths, + as that prevents the server sending email using eg postfix, + which needs to read its config files. + + -- Joey Hess Thu, 20 Aug 2020 13:15:22 -0400 + debug-me (1.20190926) unstable; urgency=medium * Avoid a crash when run without a controlling tty, which may happen diff --git a/debug-me.service b/debug-me.service index 7b184c8..4b7c27a 100644 --- a/debug-me.service +++ b/debug-me.service @@ -6,7 +6,7 @@ Documentation=https://debug-me.branchable.com/ Environment='DAEMON_PARAMS=--server /var/log/debug-me/ --delete-old-logs' EnvironmentFile=-/etc/default/debug-me ExecStart=/usr/bin/debug-me $DAEMON_PARAMS -InaccessiblePaths=/home /etc +InaccessiblePaths=/home ReadWritePaths=/var/log/debug-me User=debug-me Group=debug-me -- cgit v1.2.3 From d924e65f5b62c808872d56d9385745d900132bea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Aug 2020 13:21:32 -0400 Subject: add --- .../comment_1_94104cd2832c9a4e0fcdadc9f286a6f6._comment | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/bugs/logs_not_being_mailed/comment_1_94104cd2832c9a4e0fcdadc9f286a6f6._comment diff --git a/doc/bugs/logs_not_being_mailed/comment_1_94104cd2832c9a4e0fcdadc9f286a6f6._comment b/doc/bugs/logs_not_being_mailed/comment_1_94104cd2832c9a4e0fcdadc9f286a6f6._comment new file mode 100644 index 0000000..541144f --- /dev/null +++ b/doc/bugs/logs_not_being_mailed/comment_1_94104cd2832c9a4e0fcdadc9f286a6f6._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2020-08-20T17:08:03Z" + content=""" +This is caused by debug-me.service containing + + InaccessiblePaths=/home /etc + +I've fixed the server and will release a new debug-me version fixing it. +"""]] -- cgit v1.2.3 From 694777dd3af7eb4aa68e2b971789b7d5b7f8da9c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Aug 2020 13:21:51 -0400 Subject: close --- doc/bugs/logs_not_being_mailed.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/bugs/logs_not_being_mailed.mdwn b/doc/bugs/logs_not_being_mailed.mdwn index 4c8b7c2..a833d48 100644 --- a/doc/bugs/logs_not_being_mailed.mdwn +++ b/doc/bugs/logs_not_being_mailed.mdwn @@ -3,3 +3,5 @@ I just ran a test session `http://debug-me.joeyh.name:8081/75e73467-e2bb-4d0e-80 It seemed to work ok, except that no logs were mailed afterwards. I checked the logs on the MX, and didn't see any connects. Seperately, but possibly related I reported a [debian bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968717) about trying to get emailing logs working on my own server. + +> [[fixed|done]] --[[Joey]] -- cgit v1.2.3 From af32cc830d2989d1589ee5dc056f8a50df902709 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Aug 2020 13:32:28 -0400 Subject: comment --- .../comment_1_e09730934629688660cc71df5bb464cd._comment | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/forum/support_for_https_proxy__63__/comment_1_e09730934629688660cc71df5bb464cd._comment diff --git a/doc/forum/support_for_https_proxy__63__/comment_1_e09730934629688660cc71df5bb464cd._comment b/doc/forum/support_for_https_proxy__63__/comment_1_e09730934629688660cc71df5bb464cd._comment new file mode 100644 index 0000000..399f072 --- /dev/null +++ b/doc/forum/support_for_https_proxy__63__/comment_1_e09730934629688660cc71df5bb464cd._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2020-08-20T17:25:45Z" + content=""" +Well, debug-me does not follow redirects, and it seems that the http proxy +is adding one for some reason. + +It looks like Network.Websockets.Client.runClientWith +is where that is coming from, and the websockets library does not currently +support redirs. Actually, that library implements https itself, +which is a surprise to me. It seems it would need some work to support +redirs. +"""]] -- cgit v1.2.3 From 3c24c417841e231c5bb38e296c136f74b0e94be8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Aug 2020 14:04:26 -0400 Subject: Update to lts-14.27, support websockets 0.12.7. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon. --- CHANGELOG | 1 + Server.hs | 19 +++++++++---------- stack.yaml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d87ca68..7da480b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ debug-me (1.20190927) UNRELEASED; urgency=medium * debug-me.service: Remove /etc from InaccessiblePaths, as that prevents the server sending email using eg postfix, which needs to read its config files. + * Update to lts-14.27, support websockets 0.12.7. -- Joey Hess Thu, 20 Aug 2020 13:15:22 -0400 diff --git a/Server.hs b/Server.hs index 70ded97..81b573f 100644 --- a/Server.hs +++ b/Server.hs @@ -16,7 +16,6 @@ import Log import Network.Wai import Network.Wai.Handler.Warp import Network.Wai.Handler.WebSockets -import Network.WebSockets hiding (Message) import qualified Network.WebSockets as WS import Network.HTTP.Types import Control.Concurrent @@ -124,7 +123,7 @@ websocketApp :: ServerOpts -> TVar ServerState -> WS.ServerApp websocketApp o ssv pending_conn = do conn <- WS.acceptRequest pending_conn _v <- negotiateWireVersion conn - r <- receiveData conn + r <- WS.receiveData conn case r of SelectMode ClientSends (InitMode email) -> user email o ssv conn SelectMode ClientSends (ConnectMode t) -> @@ -136,7 +135,7 @@ websocketApp o ssv pending_conn = do user :: EmailAddress -> ServerOpts -> TVar ServerState -> WS.Connection -> IO () user email o ssv conn = do sid <- withSessionID (serverDirectory o) $ \(loghv, sid) -> do - sendBinaryData conn (Ready ServerSends sid) + WS.sendBinaryData conn (Ready ServerSends sid) bracket (setup sid loghv) (cleanup sid) go return sid doneSessionLog email o sid @@ -173,7 +172,7 @@ user email o ssv conn = do case v of Just (Broadcast l _from) -> case loggedMessage l of Developer m -> do - sendBinaryData conn (AnyMessage (Developer m)) + WS.sendBinaryData conn (AnyMessage (Developer m)) relaytouser userchan User _ -> relaytouser userchan Nothing -> return () @@ -188,12 +187,12 @@ developer o ssv sid conn = bracket setup cleanup go sessionLogFile (serverDirectory o) sid if exists then do - sendBinaryData conn (Ready ServerSends sid) + WS.sendBinaryData conn (Ready ServerSends sid) replayBacklog o sid conn - sendBinaryData conn Done + WS.sendBinaryData conn Done else protocolError conn "Unknown session ID" go (Just session) = do - sendBinaryData conn (Ready ServerSends sid) + WS.sendBinaryData conn (Ready ServerSends sid) devchan <- replayBacklogAndListen o sid session conn mytid <- mkWeakThreadId =<< myThreadId _ <- relayfromdeveloper mytid session @@ -216,7 +215,7 @@ developer o ssv sid conn = bracket setup cleanup go v <- atomically $ readTMChan devchan case v of Just (Broadcast l from) -> do - let sendit = sendBinaryData conn + let sendit = WS.sendBinaryData conn (AnyMessage $ loggedMessage l) case loggedMessage l of User _ -> sendit @@ -231,7 +230,7 @@ developer o ssv sid conn = bracket setup cleanup go else sendit relaytodeveloper mytid devchan Nothing -> do - sendBinaryData conn Done + WS.sendBinaryData conn Done return () -- | Replay the log of what's happened in the session so far, @@ -253,7 +252,7 @@ replayBacklog :: ServerOpts -> SessionID -> WS.Connection -> IO () replayBacklog o sid conn = do ls <- streamLog (sessionLogFile (serverDirectory o) sid) forM_ ls $ \l -> case loggedMessage <$> l of - Right m -> sendBinaryData conn (AnyMessage m) + Right m -> WS.sendBinaryData conn (AnyMessage m) Left _ -> return () doneSessionLog :: EmailAddress -> ServerOpts -> SessionID -> IO () diff --git a/stack.yaml b/stack.yaml index c8d8fef..90b2c54 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,6 +1,6 @@ packages: - '.' -resolver: lts-13.29 +resolver: lts-14.27 extra-deps: - graphviz-2999.20.0.3 - posix-pty-0.2.1.1 -- cgit v1.2.3 From 77b9e79d7a08bf568d0325dc3cbc661822f16ce5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Aug 2020 14:06:36 -0400 Subject: releasing package debug-me version 1.20200820 --- CHANGELOG | 4 ++-- debug-me.cabal | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7da480b..1071abf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,11 +1,11 @@ -debug-me (1.20190927) UNRELEASED; urgency=medium +debug-me (1.20200820) unstable; urgency=medium * debug-me.service: Remove /etc from InaccessiblePaths, as that prevents the server sending email using eg postfix, which needs to read its config files. * Update to lts-14.27, support websockets 0.12.7. - -- Joey Hess Thu, 20 Aug 2020 13:15:22 -0400 + -- Joey Hess Thu, 20 Aug 2020 14:04:40 -0400 debug-me (1.20190926) unstable; urgency=medium diff --git a/debug-me.cabal b/debug-me.cabal index 31aaad2..d859cbb 100644 --- a/debug-me.cabal +++ b/debug-me.cabal @@ -1,6 +1,6 @@ Name: debug-me -Version: 1.20190926 -Cabal-Version: >= 1.8 +Version: 1.20200820 +Cabal-Version: >= 1.10 Maintainer: Joey Hess Author: Joey Hess Stability: Experimental @@ -51,6 +51,7 @@ custom-setup Executable debug-me Main-Is: debug-me.hs GHC-Options: -threaded -Wall -fno-warn-tabs -O2 + Default-Language: Haskell98 Build-Depends: base (>= 4.9 && < 5.0) , network (>= 2.6) -- cgit v1.2.3