summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-05-22 14:52:14 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-05-22 14:52:14 -0700
commita49322636dc8671e959f68b13791e596c65a3338 (patch)
tree6b82ca7f4588b36b487aad5aa10fd1207256cd13
parent31f68db1ac80bb163e040dcb15a0cf6009e0260c (diff)
parentdc753f6815f5b8906ae54ebee801b72c60cdef3a (diff)
downloaddebug-me-a49322636dc8671e959f68b13791e596c65a3338.tar.gz
Merge tag '1.20220324'
tagging package debug-me version 1.20220324 # gpg: Signature made Thu 24 Mar 2022 09:28:11 AM MST # gpg: using RSA key 28A500C35207EAB72F6C0F25DB12DB0FF05F8F38 # gpg: Good signature from "Joey Hess <joeyh@joeyh.name>" [full] # Primary key fingerprint: E85A 5F63 B31D 24C1 EBF0 D81C C910 D922 2512 E3C7 # Subkey fingerprint: 28A5 00C3 5207 EAB7 2F6C 0F25 DB12 DB0F F05F 8F38
-rw-r--r--CHANGELOG10
-rw-r--r--Gpg/Wot.hs13
-rw-r--r--Val.hs4
-rw-r--r--WebSockets.hs18
-rw-r--r--debug-me.cabal6
-rw-r--r--doc/bugs/pgp.cs.uu.nl_is_dead.mdwn2
-rw-r--r--doc/forum/configure_defaultServerUrl.mdwn1
-rw-r--r--doc/news/version_1.20170509.mdwn11
-rw-r--r--doc/news/version_1.20200820.mdwn6
-rw-r--r--stack.yaml6
10 files changed, 48 insertions, 29 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 1071abf..6cb9478 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,13 @@
+debug-me (1.20220324) unstable; urgency=medium
+
+ * Support ghc 8.8.
+ Thanks, Tony Zorman
+ * Support aeson 2.0.
+ Thanks, Tony Zorman
+ * Update to lts-19.0.
+
+ -- Joey Hess <id@joeyh.name> Thu, 24 Mar 2022 11:39:51 -0400
+
debug-me (1.20200820) unstable; urgency=medium
* debug-me.service: Remove /etc from InaccessiblePaths,
diff --git a/Gpg/Wot.hs b/Gpg/Wot.hs
index 2a6d541..d916ebc 100644
--- a/Gpg/Wot.hs
+++ b/Gpg/Wot.hs
@@ -3,6 +3,7 @@
- Licensed under the GNU AGPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
-- | Gpg web of trust checking, using wotsap's JSON output
@@ -15,8 +16,13 @@ import JSON
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import Data.List
-import qualified Data.HashMap.Strict as M
import qualified Data.Text as T
+#if MIN_VERSION_aeson(2, 0, 0)
+import qualified Data.Aeson.KeyMap as AM
+import qualified Data.Aeson.Key as AK
+#else
+import qualified Data.HashMap.Strict as M
+#endif
data WotStats = WotStats
{ key :: Node
@@ -43,9 +49,14 @@ data Node = Node
-- | wotsap's json has some upper-case fields; lowercase field for parsing
jsonLower :: Value -> Value
+#if MIN_VERSION_aeson(2, 0, 0)
+jsonLower (Object o) = Object . AM.mapKeyVal lowerKey id $ o
+ where lowerKey = AK.fromText . T.toLower . AK.toText
+#else
jsonLower (Object o) = Object . M.fromList . map lowerPair . M.toList $ o
where
lowerPair (k, v) = (T.toLower k, v)
+#endif
jsonLower x = x
instance FromJSON WotStats where
diff --git a/Val.hs b/Val.hs
index 5c52c82..d010a2a 100644
--- a/Val.hs
+++ b/Val.hs
@@ -9,8 +9,8 @@ module Val where
import Memory
import JSON
+import qualified GHC.Generics as G
-import GHC.Generics (Generic)
import Data.Aeson.Types
import qualified Codec.Binary.Base64 as B64
import qualified Data.Text as T
@@ -20,7 +20,7 @@ import qualified Data.Semigroup as Sem
-- | Newtype of ByteString so we can have JSON instances without orphans.
newtype Val = Val { val :: B.ByteString }
- deriving (Show, Generic, Eq, Sem.Semigroup, Monoid)
+ deriving (Show, G.Generic, Eq, Sem.Semigroup, Monoid)
instance DataSize Val where
dataSize (Val b) = fromIntegral (B.length b)
diff --git a/WebSockets.hs b/WebSockets.hs
index 7a53c8c..8aec057 100644
--- a/WebSockets.hs
+++ b/WebSockets.hs
@@ -164,16 +164,16 @@ clientApp
-> (AnyMessage -> Maybe received)
-> (TMChan sent -> TMChan (MissingHashes received) -> SessionID -> IO a)
-> ClientApp a
-clientApp mode mksent filterreceived a conn = do
+clientApp mode mksent filterreceived a conn =
-- Ping every 30 seconds to avoid timeouts caused by proxies etc.
- forkPingThread conn 30
- _v <- negotiateWireVersion conn
- sendBinaryData conn (SelectMode ClientSends mode)
- r <- receiveData conn
- case r of
- Ready ServerSends sid -> bracket setup cleanup (go sid)
- WireProtocolError e -> error e
- _ -> protocolError conn "Did not get expected Ready message from server"
+ withPingThread conn 30 (return ()) $ do
+ _v <- negotiateWireVersion conn
+ sendBinaryData conn (SelectMode ClientSends mode)
+ r <- receiveData conn
+ case r of
+ Ready ServerSends sid -> bracket setup cleanup (go sid)
+ WireProtocolError e -> error e
+ _ -> protocolError conn "Did not get expected Ready message from server"
where
setup = do
schan <- newTMChanIO
diff --git a/debug-me.cabal b/debug-me.cabal
index d859cbb..d5a44e9 100644
--- a/debug-me.cabal
+++ b/debug-me.cabal
@@ -1,5 +1,5 @@
Name: debug-me
-Version: 1.20200820
+Version: 1.20220324
Cabal-Version: >= 1.10
Maintainer: Joey Hess <joey@kitenet.net>
Author: Joey Hess
@@ -64,7 +64,7 @@ Executable debug-me
, stm-chans (>= 3.0)
, posix-pty (>= 0.2.1)
, terminal-size (>= 0.3)
- , aeson (>= 0.11 && < 1.5)
+ , aeson (>= 0.11 && < 2.1)
, sandi (>= 0.4)
, text (>= 1.2.2)
, optparse-applicative (>= 0.12)
@@ -81,7 +81,7 @@ Executable debug-me
, http-types (>= 0.9)
, http-client (>= 0.4)
, http-client-tls (>= 0.2)
- , websockets (>= 0.9)
+ , websockets (>= 0.12.6.0)
, wai-websockets (>= 3.0)
, uuid (>= 1.3)
, protobuf (>= 0.2)
diff --git a/doc/bugs/pgp.cs.uu.nl_is_dead.mdwn b/doc/bugs/pgp.cs.uu.nl_is_dead.mdwn
new file mode 100644
index 0000000..eeb82af
--- /dev/null
+++ b/doc/bugs/pgp.cs.uu.nl_is_dead.mdwn
@@ -0,0 +1,2 @@
+Visiting the page in a browser, I see "this page is no longer maintained". That probably explains why the debug-me web-of-trust
+check always fails.
diff --git a/doc/forum/configure_defaultServerUrl.mdwn b/doc/forum/configure_defaultServerUrl.mdwn
new file mode 100644
index 0000000..95b64d6
--- /dev/null
+++ b/doc/forum/configure_defaultServerUrl.mdwn
@@ -0,0 +1 @@
+I'm thinking about using debug-me for a course, and in that setting I'd like to default to a server at the same university. It would be nice if there was some way (environment variable, e.g.) to configure the default server URL. As it is I guess I will make a shell script wrapper.
diff --git a/doc/news/version_1.20170509.mdwn b/doc/news/version_1.20170509.mdwn
deleted file mode 100644
index 7ec6d4b..0000000
--- a/doc/news/version_1.20170509.mdwn
+++ /dev/null
@@ -1,11 +0,0 @@
-debug-me 1.20170509 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * Server: Use "postmaster" as default --from-email address
- rather than "unknown@server".
- * Server: DEBUG\_ME\_FROM\_EMAIL can be used to specify the --from-email.
- This is used in debug-me.default to encourage configuring it.
- Thanks, Sean Whitton.
- * Avoid crash when --use-server is given an url that does not
- include a path.
- * Fix bug that prevented creating ~/.debug-me/log/remote/
- when ~/.debug-me/ didn't already exist."""]] \ No newline at end of file
diff --git a/doc/news/version_1.20200820.mdwn b/doc/news/version_1.20200820.mdwn
new file mode 100644
index 0000000..b72c3f9
--- /dev/null
+++ b/doc/news/version_1.20200820.mdwn
@@ -0,0 +1,6 @@
+debug-me 1.20200820 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * 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."""]] \ No newline at end of file
diff --git a/stack.yaml b/stack.yaml
index 90b2c54..1dea8c4 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,8 +1,8 @@
packages:
- '.'
-resolver: lts-14.27
+resolver: lts-19.0
extra-deps:
-- graphviz-2999.20.0.3
-- posix-pty-0.2.1.1
+- graphviz-2999.20.1.0
+- posix-pty-0.2.2
- sandi-0.5
explicit-setup-deps: