Annotate

mod_server_info/README.md @ 5817:174c77da03f5

mod_server_info: New module to add custom service extension forms to disco
author Matthew Wild <mwild1@gmail.com>
date Tue, 12 Dec 2023 19:08:28 +0000
child 5866:ed82916e5796
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5817
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 ---
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 labels:
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 - 'Stage-Alpha'
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 summary: Manually configure extended service discovery info
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 ...
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 XEP-0128 defines a way for servers to provide custom information via service
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 discovery. Various XEPs and plugins make use of this functionality, so that
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 e.g. clients can look up necessary information.
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 This module allows the admin to manually configure service discovery
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 extensions in the config file. It may be useful as a way to advertise certain
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 information.
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 Everything configured here is publicly visible to other XMPP entities.
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 ## Configuration
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 The `server_info` option accepts a list of dataforms. A dataform is an array
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 of fields. A field has three required properties:
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22 - `type` - usually `text-single` or `list-multi`
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 - `var` - the field name
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 - `value` the field value
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26 Example configuration:
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28 ``` lua
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 server_info = {
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 -- Our custom form
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 {
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 -- Conventionally XMPP dataforms have a 'FORM_TYPE' field to
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 -- indicate what type of form it is
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 { type = "hidden", var = "FORM_TYPE", value = "urn:example:foo" };
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 -- Advertise that our maximum speed is 88 mph
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 { type = "text-single", var = "speed", value = "88" };
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 -- Advertise that the time is 1:20 AM and zero seconds
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41 { type = "text-single", var = "time", value = "01:21:00" };
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 };
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 }
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 ```
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 ## Compatibility
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 This module should be compatible with Prosody 0.12, and possibly earlier
174c77da03f5 mod_server_info: New module to add custom service extension forms to disco
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 versions.