Software /
code /
prosody-modules
Annotate
mod_pubsub_serverinfo/README.markdown @ 5828:55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
This module caches the disco/info results of remote domains. This commit introduces a new configuration option that allows an admin to configure the cache expiry duration.
author | Guus der Kinderen <guus.der.kinderen@gmail.com> |
---|---|
date | Thu, 04 Jan 2024 12:05:51 +0100 |
parent | 5826:f55e65315ba0 |
child | 5829:d4612e7f6724 |
rev | line source |
---|---|
5824
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
1 --- |
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
2 labels: |
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
3 - 'Statistics' |
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
4 ... |
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
5 |
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
6 Exposes server information over Pub/Sub per ProtoXEP: PubSub Server Information. |
73887dcb2129
mod_pubsub_serverinfo: New module that uses pub/sub to make accessible server info
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
diff
changeset
|
7 |
5826
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
8 This version, announces support (used to 'opt-in', per the XEP) and publishes the name of the local domain via a Pub/Sub node. The published data |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
9 will contain an unnamed 'remote-domain' element for each inbound or outgoing s2s connection. |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
10 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
11 Features yet to be implemented: |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
12 - For 'remote-domain' elements, add domain name _only if_ through service discovery that domain advertises the 'urn:xmpp:serverinfo:0' feature. |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
13 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
14 Installation |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
15 ============ |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
16 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
17 Enable this module in the global or a virtual host. |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
18 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
19 The default configuration requires the existence of a Pub/Sub component that uses the 'pubsub' subdomain of the host in which the module is enabled: |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
20 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
21 Component "pubsub.example.org" "pubsub" |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
22 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
23 The module will create a node and publish data, using a JID that matches the XMPP domain name of the host. Ensure that this actor is an admin of the |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
24 Pub/Sub service: |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
25 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
26 admins = { "example.org" } |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
27 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
28 Configuration |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
29 ============= |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
30 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
31 The Pub/Sub service on which data is published, by default, is a component addressed as the `pubsub` subdomain of the domain of the virtual host that |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
32 the module is loaded under. To change this, apply this configuration setting: |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
33 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
34 pubsub_serverinfo_service = "anotherpubsub.example.org" |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
35 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
36 The Pub/Sub node on which data is published is, by default, a leaf-node named `serverinfo`. To change this, apply this configuration setting: |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
37 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
38 pubsub_serverinfo_node = "foobar" |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
39 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
40 To prevent a surplus of event notifications, this module will only publish new data after a certain period of time has expired. The default duration |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
41 is 300 seconds (5 minutes). To change this simply put in the config: |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
42 |
f55e65315ba0
mod_pubsub_serverinfo: implemented all basic features
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5824
diff
changeset
|
43 pubsub_serverinfo_publication_interval = 180 -- or any other number of seconds |
5828
55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5826
diff
changeset
|
44 |
55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5826
diff
changeset
|
45 To detect if remote domains allow their domain name to be included in the data that this module publishes, this module will perform a service |
55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5826
diff
changeset
|
46 discovery request to each remote domain. To prevent a continuous flood of disco/info requests, the response to these requests is cached. By default, |
55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5826
diff
changeset
|
47 a cached value will remain in cache for one hour. This duration can be modified by adding this configuration option: |
55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5826
diff
changeset
|
48 |
55b99f593c3a
mod_pubsub_serverinfo: Disco/info cache TTL should be configurable
Guus der Kinderen <guus.der.kinderen@gmail.com>
parents:
5826
diff
changeset
|
49 pubsub_serverinfo_cache_ttl = 1800 -- or any other number of seconds |