comparison mod_reload_components/README.markdown @ 2391:85d04dd87f14

mod_reload_components: add new module and README file.
author Camilo <camilo@camilo.fm>
date Mon, 21 Nov 2016 16:18:32 -0200
parents
children
comparison
equal deleted inserted replaced
2390:28fbe960adcf 2391:85d04dd87f14
1 Introduction
2 ============
3
4 This module allows to load/unload external components after they have
5 been added/removed to a configuration file. It is necessary to explicitly
6 initiate a reload on Prosody either via prosodyctl reload or config:reload().
7
8 Example 1:
9 --------
10 If Prosody has started with this configuration file:
11
12 ``` {.lua}
13 VirtualHost "example.com"
14 authentication = "internal_plain"
15
16 Component "a.example.com"
17 component_secret = "a"
18
19 Component "b.example.com"
20 component_secret = "b"
21 ```
22
23 And the file has changed manually or dynamically to:
24
25 ``` {.lua}
26 VirtualHost "example.com"
27 authentication = "internal_plain"
28
29 Component "a.example.com"
30 component_secret = "a"
31
32 Component "c.example.com"
33 component_secret = "c"
34 ```
35
36 Then, the following actions will occur if this module is loaded:
37
38 1. The component c.example.com will be loaded and start bouncing for
39 authentication.
40 2. The component b.example.com will be unloaded and deactivated. The
41 connection with it will not be closed, but no further actions will be
42 executed on Prosody.
43
44 Example 2:
45 --------
46
47 If Prosody has started with this configuration file:
48
49 ``` {.lua}
50 VirtualHost "example.com"
51 authentication = "internal_plain"
52
53 Component "a.example.com"
54 component_secret = "a"
55 ```
56
57 And the file has changed manually or dynamically to:
58
59 ``` {.lua}
60 VirtualHost "example.com"
61 authentication = "internal_plain"
62
63 Component "a.example.com"
64 component_secret = "a"
65
66 VirtualHost "newexample.com"
67 authentication = "internal_plain"
68
69 Component "a.newexample.com"
70 component_secret = "a"
71 ```
72
73 Then, the following actions will occur if this module is loaded:
74
75 1. The component a.newexample.com will be loaded and start bouncing for
76 authentication. Note that its respective VirtualHost is not loaded. Bad
77 things may happen.
78
79 Usage
80 =====
81
82 Copy the module folder into your Prosody modules directory. Place the
83 module between your enabled modules either into the global or a vhost
84 section.
85
86 No configuration directives are needed
87
88 Info
89 ====
90
91 - 0.9, works