From e95a1649ea769d09780a558d9b539bfa5bbd571b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 2 Sep 2017 10:04:32 +0200 Subject: man prosodyctl: Add text about the `cert import` command --- man/prosodyctl.man | 8 +++++++- man/prosodyctl.markdown | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/man/prosodyctl.man b/man/prosodyctl.man index f7bf44d1..3ea42cdd 100644 --- a/man/prosodyctl.man +++ b/man/prosodyctl.man @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 1.19.2.1 .\" -.TH "PROSODYCTL" "1" "2015\-12\-23" "" "" +.TH "PROSODYCTL" "1" "2017\-09\-02" "" "" .hy .SH NAME .PP @@ -118,6 +118,12 @@ Invoked automatically by \[aq]request\[aq] and \[aq]generate\[aq] if needed. .RS .RE +.TP +.B import hosts paths +Copy certificates for hosts into the certificate path and reload +prosody. +.RS +.RE .SS Debugging .PP prosodyctl can also show some information about the environment, diff --git a/man/prosodyctl.markdown b/man/prosodyctl.markdown index 4dde284f..6e72096d 100644 --- a/man/prosodyctl.markdown +++ b/man/prosodyctl.markdown @@ -2,7 +2,7 @@ author: - 'Dwayne Bent ' - Kim Alvefur -date: '2015-12-23' +date: '2017-09-02' section: 1 title: PROSODYCTL --- @@ -104,6 +104,10 @@ config hosts : Produce a config file for the list of hosts. Invoked automatically by 'request' and 'generate' if needed. +import hosts paths +: Copy certificates for hosts into the certificate path and reload + prosody. + Debugging --------- -- cgit v1.2.3 From 0edbfe8c0b080bb5b5aa852a1162e7a2f7f49392 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 2 Sep 2017 10:05:50 +0200 Subject: man/prosodyctl.markdown: Reflow --- man/prosodyctl.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/prosodyctl.markdown b/man/prosodyctl.markdown index 6e72096d..9cc15985 100644 --- a/man/prosodyctl.markdown +++ b/man/prosodyctl.markdown @@ -115,8 +115,8 @@ prosodyctl can also show some information about the environment, dependencies and such to aid in debugging. about -: Shows environment, various paths used by Prosody and - installed dependencies. +: Shows environment, various paths used by Prosody and installed + dependencies. check \[what\] : Performs various sanity checks on the configuration, DNS setup and -- cgit v1.2.3 From a9333c4f4badb127fca9beca6d1ad0b5933ecc0e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 3 Sep 2017 12:42:25 +0200 Subject: mod_mam: Clone stanza before stripping stanza id after carbons --- plugins/mod_mam/mod_mam.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index a86697e8..cab3e95c 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -314,6 +314,7 @@ end local function strip_stanza_id(event) local strip_by = jid_bare(event.origin.full_jid); + event.stanza = st.clone(event.stanza); event.stanza:maptags(function(tag) if not ( tag.attr.xmlns == xmlns_st_id and tag.attr.by == strip_by ) then return tag; -- cgit v1.2.3 From 3888136262d43c5ca7ac20b50173d8957de96e58 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 3 Sep 2017 17:13:30 +0200 Subject: mod_mam: Factor out stripping so it can be reused in two places --- plugins/mod_mam/mod_mam.lua | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index cab3e95c..32dd0169 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -228,6 +228,22 @@ local function shall_store(user, who) return default; end +local function strip_stanza_id(stanza, user) + if stanza:get_child("stanza-id", xmlns_st_id) then + stanza = st.clone(stanza); + stanza:maptags(function (tag) + if tag.name == "stanza-id" and tag.attr.xmlns == xmlns_st_id then + local by_user, by_host, res = jid_prepped_split(tag.attr.by); + if not res and by_host == host and by_user == user then + return nil; + end + end + return tag; + end); + end + return stanza; +end + -- Handle messages local function message_handler(event, c2s) local origin, stanza = event.origin, event.stanza; @@ -243,19 +259,7 @@ local function message_handler(event, c2s) local with = jid_bare(c2s and orig_to or orig_from); -- Filter out that claim to be from us - if stanza:get_child("stanza-id", xmlns_st_id) then - stanza = st.clone(stanza); - stanza:maptags(function (tag) - if tag.name == "stanza-id" and tag.attr.xmlns == xmlns_st_id then - local by_user, by_host, res = jid_prepped_split(tag.attr.by); - if not res and by_host == module.host and by_user == store_user then - return nil; - end - end - return tag; - end); - event.stanza = stanza; - end + event.stanza = strip_stanza_id(stanza, store_user); -- We store chat messages or normal messages that have a body if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body")) ) then @@ -312,18 +316,13 @@ local function c2s_message_handler(event) return message_handler(event, true); end -local function strip_stanza_id(event) - local strip_by = jid_bare(event.origin.full_jid); - event.stanza = st.clone(event.stanza); - event.stanza:maptags(function(tag) - if not ( tag.attr.xmlns == xmlns_st_id and tag.attr.by == strip_by ) then - return tag; - end - end); +-- Filter out before the message leaves the server to prevent privacy leak. +local function strip_stanza_id_after_other_events(event) + event.stanza = strip_stanza_id(event.stanza, event.origin.username); end -module:hook("pre-message/bare", strip_stanza_id, -1); -module:hook("pre-message/full", strip_stanza_id, -1); +module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1); +module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); local cleanup_after = module:get_option_string("archive_expires_after", "1w"); local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); -- cgit v1.2.3