This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 87c93d1  Allow for debug of query on live system
87c93d1 is described below

commit 87c93d1f576baa6b43d08da1b16e9abbcdc9f01e
Author: Sebb <[email protected]>
AuthorDate: Fri Oct 1 11:22:49 2021 +0100

    Allow for debug of query on live system
---
 site/api/lib/config.lua.sample | 3 ++-
 site/api/stats.lua             | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/site/api/lib/config.lua.sample b/site/api/lib/config.lua.sample
index 7a84a68..0e97bcd 100644
--- a/site/api/lib/config.lua.sample
+++ b/site/api/lib/config.lua.sample
@@ -37,6 +37,7 @@ local config = {
 --  no_association = {}, -- domains that are not allowed for email association
 --  listsDisplay = 'regex', -- if defined, hide list names that don't match 
the regex
 --  debug = false, -- whether to return debug information
-    antispam = true  -- Whether or not to add anti-spam measures aimed at 
anonymous users.
+    antispam = true,  -- Whether or not to add anti-spam measures aimed at 
anonymous users.
+    showQuery = 'ondemand', -- return query in JSON result: always|ondemand
 }
 return config
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 41460aa..3a99318 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -781,6 +781,9 @@ function handle(r)
     end
     listdata.numparts = allparts
     listdata.unixtime = os.time()
+    if config.showQuery == 'always' or (config.showQuery == 'ondemand' and 
get.showQuery) then
+        listdata.squery = squery
+    end
     
     r:puts(JSON.encode(listdata))
     

Reply via email to