mod_cloud_notify/README.markdown
author Matthew Wild <mwild1@gmail.com>
Sat, 24 Sep 2022 08:06:11 +0100
changeset 5060 2583bd7eb5d1
parent 4972 487f1eb829cf
child 5062 39c2824c2880
permissions -rw-r--r--
mod_cloud_notify: Add warnings about options including real body/sender
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1807
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
     1
---
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
     2
labels:
2253
d3e697c141e4 mod_cloud_notify/README: Let's call it Beta
Kim Alvefur <zash@zash.se>
parents: 2252
diff changeset
     3
- 'Stage-Beta'
1807
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
     4
summary: 'XEP-0357: Cloud push notifications'
2203
2582d09d2ec4 mod_cloud_notify/README: Fixup markdown
Kim Alvefur <zash@zash.se>
parents: 2202
diff changeset
     5
---
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
     6
1807
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
     7
Introduction
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
     8
============
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
     9
2254
f5cc6328b20f mod_cloud_notify/README: Reflow text
Kim Alvefur <zash@zash.se>
parents: 2253
diff changeset
    10
This is an implementation of the server bits of [XEP-0357: Push Notifications].
f5cc6328b20f mod_cloud_notify/README: Reflow text
Kim Alvefur <zash@zash.se>
parents: 2253
diff changeset
    11
It allows clients to register an "app server" which is notified about new
2399
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    12
messages while the user is offline, disconnected or the session is hibernated
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    13
by [mod_smacks]. 
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    14
Implementation of the "app server" is not included[^1].
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    15
3093
5b5c6ba527fc mod_cloud_notify: last cleanup
tmolitor <thilo@eightysoft.de>
parents: 3092
diff changeset
    16
**Please note: Multi client setups don't work properly if MAM is disabled and using this module won't change this at all!**
5b5c6ba527fc mod_cloud_notify: last cleanup
tmolitor <thilo@eightysoft.de>
parents: 3092
diff changeset
    17
1807
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
    18
Details
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
    19
=======
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    20
2613
6ab46ff685d0 mod_cloud_notify: Respect Daniel's business rules and remove endpoints on error
tmolitor <thilo@eightysoft.de>
parents: 2399
diff changeset
    21
App servers are notified about offline messages, messages stored by [mod_mam]
6ab46ff685d0 mod_cloud_notify: Respect Daniel's business rules and remove endpoints on error
tmolitor <thilo@eightysoft.de>
parents: 2399
diff changeset
    22
or messages waiting in the smacks queue.
3092
6eaa1aa4f8ae mod_cloud_notify: more cleanup
tmolitor <thilo@eightysoft.de>
parents: 3091
diff changeset
    23
The business rules outlined [here](//mail.jabber.org/pipermail/standards/2016-February/030925.html) are all honored[^2].
6eaa1aa4f8ae mod_cloud_notify: more cleanup
tmolitor <thilo@eightysoft.de>
parents: 3091
diff changeset
    24
2399
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    25
To cooperate with [mod_smacks] this module consumes some events:
2980
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    26
`smacks-ack-delayed`, `smacks-hibernation-start` and `smacks-hibernation-end`.
2399
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    27
These events allow this module to send out notifications for messages received
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    28
while the session is hibernated by [mod_smacks] or even when smacks
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    29
acknowledgements for messages are delayed by a certain amount of seconds
2980
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    30
configurable with the [mod_smacks] setting `smacks_max_ack_delay`.
2399
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    31
2980
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    32
The `smacks_max_ack_delay` setting allows to send out notifications to clients
2399
2e641ab995b3 mod_cloud_notify: added code to respond to the new event "smacks-ack-delayed" issued by mod_smacks when acks are delayed for a certain amount of time. This allows to send out notification requests before the read timeout or connection close event really happens, thus allowing conversations to be smoother.
tmolitor <thilo@eightysoft.de>
parents: 2254
diff changeset
    33
which aren't already in smacks hibernation state (because the read timeout or
2980
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    34
connection close didn't already happen) but also aren't responding to acknowledgement
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    35
request in a timely manner. This setting thus allows conversations to be smoother
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    36
under such circumstances.
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    37
2980
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    38
The new event `cloud-notify-ping` can be used by any module to send out a cloud
2613
6ab46ff685d0 mod_cloud_notify: Respect Daniel's business rules and remove endpoints on error
tmolitor <thilo@eightysoft.de>
parents: 2399
diff changeset
    39
notification to either all registered endpoints for the given user or only the endpoints
6ab46ff685d0 mod_cloud_notify: Respect Daniel's business rules and remove endpoints on error
tmolitor <thilo@eightysoft.de>
parents: 2399
diff changeset
    40
given in the event data.
6ab46ff685d0 mod_cloud_notify: Respect Daniel's business rules and remove endpoints on error
tmolitor <thilo@eightysoft.de>
parents: 2399
diff changeset
    41
2980
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    42
The config setting `push_notification_important_body` can be used to specify an alternative
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    43
body text to send to the remote pubsub node if the stanza is encrypted or has a body.
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    44
This way the real contents of the message aren't revealed to the push appserver but it
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    45
can still see that the push is important.
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    46
This is used by Chatsecure on iOS to send out high priority pushes in those cases for example.
df86ce6bb0b4 Implement dummy body message to indicate high priority push
tmolitor <thilo@eightysoft.de>
parents: 2615
diff changeset
    47
2202
eb53a830864c mod_cloud_notify: default false for sending body and sender
Chris Ballinger <chrisballinger@gmail.com>
parents: 2145
diff changeset
    48
Configuration
eb53a830864c mod_cloud_notify: default false for sending body and sender
Chris Ballinger <chrisballinger@gmail.com>
parents: 2145
diff changeset
    49
=============
eb53a830864c mod_cloud_notify: default false for sending body and sender
Chris Ballinger <chrisballinger@gmail.com>
parents: 2145
diff changeset
    50
3059
6abee021d9db mod_cloud_notify: Limit number of devices to 5 and change some default settings
tmolitor <thilo@eightysoft.de>
parents: 2980
diff changeset
    51
  Option                               Default           Description
6abee021d9db mod_cloud_notify: Limit number of devices to 5 and change some default settings
tmolitor <thilo@eightysoft.de>
parents: 2980
diff changeset
    52
  ------------------------------------ ----------------- -------------------------------------------------------------------------------------------------------------------
5060
2583bd7eb5d1 mod_cloud_notify: Add warnings about options including real body/sender
Matthew Wild <mwild1@gmail.com>
parents: 4972
diff changeset
    53
  `push_notification_with_body`        `false`           Whether or not to send the real message body to remote pubsub node. Without end-to-end encryption, enabling this may expose your message contents to your client developers and OS vendor. Not recommended.
2583bd7eb5d1 mod_cloud_notify: Add warnings about options including real body/sender
Matthew Wild <mwild1@gmail.com>
parents: 4972
diff changeset
    54
  `push_notification_with_sender`      `false`           Whether or not to send the real message sender to remote pubsub node.  Enabling this may expose your contacts to your client developers and OS vendor. Not recommended.
3059
6abee021d9db mod_cloud_notify: Limit number of devices to 5 and change some default settings
tmolitor <thilo@eightysoft.de>
parents: 2980
diff changeset
    55
  `push_max_errors`                    `16`              How much persistent push errors are tolerated before notifications for the identifier in question are disabled
6abee021d9db mod_cloud_notify: Limit number of devices to 5 and change some default settings
tmolitor <thilo@eightysoft.de>
parents: 2980
diff changeset
    56
  `push_notification_important_body`   `New Message!`    The body text to use when the stanza is important (see above), no message body is sent if this is empty
6abee021d9db mod_cloud_notify: Limit number of devices to 5 and change some default settings
tmolitor <thilo@eightysoft.de>
parents: 2980
diff changeset
    57
  `push_max_devices`                   `5`               The number of allowed devices per user (the oldest devices are automatically removed if this threshold is reached)
4972
487f1eb829cf mod_cloud_notify: Compat for prosody 0.12
tmolitor <thilo@eightysoft.de>
parents: 3948
diff changeset
    58
  `push_max_hibernation_timeout`       `6220800`         Number of seconds to extend the smacks timeout if no push was triggered yet (default: 72 hours)
2202
eb53a830864c mod_cloud_notify: default false for sending body and sender
Chris Ballinger <chrisballinger@gmail.com>
parents: 2145
diff changeset
    59
2203
2582d09d2ec4 mod_cloud_notify/README: Fixup markdown
Kim Alvefur <zash@zash.se>
parents: 2202
diff changeset
    60
There are privacy implications for enabling these options because
2582d09d2ec4 mod_cloud_notify/README: Fixup markdown
Kim Alvefur <zash@zash.se>
parents: 2202
diff changeset
    61
plaintext content and metadata will be shared with centralized servers
2582d09d2ec4 mod_cloud_notify/README: Fixup markdown
Kim Alvefur <zash@zash.se>
parents: 2202
diff changeset
    62
(the pubsub node) run by arbitrary app developers.
2202
eb53a830864c mod_cloud_notify: default false for sending body and sender
Chris Ballinger <chrisballinger@gmail.com>
parents: 2145
diff changeset
    63
1807
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
    64
Installation
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
    65
============
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    66
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    67
Same as any other module.
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    68
1807
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
    69
Configuration
4d73a1a6ba68 Convert all wiki pages to Markdown
Kim Alvefur <zash@zash.se>
parents: 1789
diff changeset
    70
=============
1787
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    71
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    72
Configured in-band by supporting clients.
b31fe2d22310 mod_cloud_notify: XEP-0357: Push - the server bits ("app server" not included)
Kim Alvefur <zash@zash.se>
parents:
diff changeset
    73
2252
3ecf65dabb6e mod_cloud_notify/README: Add compatibility section
Kim Alvefur <zash@zash.se>
parents: 2203
diff changeset
    74
Compatibility
3ecf65dabb6e mod_cloud_notify/README: Add compatibility section
Kim Alvefur <zash@zash.se>
parents: 2203
diff changeset
    75
=============
3ecf65dabb6e mod_cloud_notify/README: Add compatibility section
Kim Alvefur <zash@zash.se>
parents: 2203
diff changeset
    76
3948
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    77
------ -----------------------------------------------------------------------------
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    78
  trunk  Works
4972
487f1eb829cf mod_cloud_notify: Compat for prosody 0.12
tmolitor <thilo@eightysoft.de>
parents: 3948
diff changeset
    79
  0.12   Works
3948
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    80
  0.11   Works
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    81
  0.10   Works
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    82
  0.9    Support dropped, use last supported version [675726ab06d3](//hg.prosody.im/prosody-modules/raw-file/675726ab06d3/mod_cloud_notify/mod_cloud_notify.lua)
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    83
------ -----------------------------------------------------------------------------
7630d4ade7cd mod_cloud_notify: fix link and table layout in readme
tmolitor <thilo@eightysoft.de>
parents: 3947
diff changeset
    84
2252
3ecf65dabb6e mod_cloud_notify/README: Add compatibility section
Kim Alvefur <zash@zash.se>
parents: 2203
diff changeset
    85
3090
3e91eb1bdd84 mod_cloud_notify: Some readme cleanup
tmolitor <thilo@eightysoft.de>
parents: 3083
diff changeset
    86
[^1]: The service which is expected to forward notifications to something like Google Cloud Messaging or Apple Notification Service
3094
1d0925d008b2 mod_cloud_notify: fix link to business rules description
tmolitor <thilo@eightysoft.de>
parents: 3093
diff changeset
    87
[^2]: [business_rules.markdown](//hg.prosody.im/prosody-modules/file/tip/mod_cloud_notify/business_rules.markdown)