Mercurial > libervia-pubsub
annotate INSTALL @ 400:371e72871e19
privilege: fill hash_map before jid_caps to avoid KeyError in getAutoSubscribers
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 07 May 2019 08:25:31 +0200 |
parents | e93a9fd329d9 |
children |
rev | line source |
---|---|
155 | 1 Requirements |
2 ============ | |
3 | |
327 | 4 - Python 2.7.x |
5 - Twisted >= 15.2.0: | |
193 | 6 - Twisted Core |
7 - Twisted Words | |
327 | 8 - Wokkel >= 0.7.1 (http://wokkel.ik.nu/) |
9 - A XMPP server that supports the component protocol (XEP-0114), | |
10 and, to enable the micro-blogging feature, Namespace Delegation (XEP-0355) | |
11 and privileged entity (XEP-0356) are needed. | |
12 We recommend using Prosody with mod_privilege and mod_delegation modules. | |
13 - SàT backend (http://repos.goffi.org/sat) is currently needed for MAM and RSM handling | |
155 | 14 |
15 For the PostgreSQL backend, the following is also required: | |
16 | |
331 | 17 - PostgreSQL >= 9.5 (including development files for psycopg2) |
276
b757c29b20d7
import changes from idavoll changeset 233 (24be3a11ddbc), by Ralph Meijer and based on a patch by Nuno Santos
souliane <souliane@mailoo.org>
parents:
264
diff
changeset
|
18 - psycopg2 |
155 | 19 |
193 | 20 |
155 | 21 Installation |
22 ============ | |
23 | |
264 | 24 sat_pubsub uses setuptools for package building and installing. |
25 To build from the source run: | |
193 | 26 |
27 python setup.py build | |
28 | |
29 Then, to install run the following, possibly as root: | |
155 | 30 |
31 python setup.py install | |
32 | |
193 | 33 See the setuptools documentation for further information on changing |
34 installation locations. | |
35 | |
36 | |
155 | 37 Configuration |
38 ============= | |
39 | |
327 | 40 sat_pubsub uses Twisted's twistd command for running its services. |
193 | 41 |
264 | 42 Idavoll, on which sat_pubsub is based, provides two types of storage for the backend: |
43 a memory-based storage facility, which is volatile, and a persistent storage facility | |
44 using PostgreSQL. For now, sat_pubsub only uses the persistent storage facility. | |
193 | 45 |
264 | 46 For using the PostgreSQL backend, create a database (for example named pubsub): |
193 | 47 |
264 | 48 sudo -u postgres createuser -d -P `whoami` |
49 createdb pubsub | |
50 psql pubsub < sat_pubsub/db/pubsub.sql | |
193 | 51 |
52 | |
327 | 53 Your XMPP server must also be configured to accept component connections and, |
54 to enable the micro-blogging feature, privileged entity and namespace delegation. | |
55 See below for details. | |
264 | 56 |
193 | 57 |
264 | 58 Running sat_pubsub |
59 ================== | |
193 | 60 |
264 | 61 The minimal example for running sat_pubsub is: |
193 | 62 |
264 | 63 twistd sat_pubsub |
193 | 64 |
65 This will start the service and run it in the background. It generates a | |
66 file twistd.pid that holds the PID of the service and a log file twistd.log. | |
67 The twistd utility has a fair number of options that might be useful, and | |
68 can be viewed with: | |
69 | |
70 twistd --help | |
71 | |
327 | 72 When the service starts, it will connect to the XMPP server at the local |
193 | 73 machine using the component protocol, and assumes the JID 'pubsub'. This |
74 assumes a couple of defaults which can be overridden by passing parameters to | |
75 the twistd plugin. You can get an overview of the parameters and their defaults | |
76 using: | |
77 | |
264 | 78 twistd sat_pubsub --help |
193 | 79 |
80 In particular, the following parameters will be of interest: | |
155 | 81 |
82 --jid: The Jabber ID the component will assume. | |
327 | 83 --rport: the port number of the XMPP server to connect to |
84 --secret: the secret used to authenticate with the XMPP server. | |
155 | 85 |
264 | 86 For example: |
87 | |
327 | 88 twistd sat_pubsub --jid=sat-pubsub.<your_xmpp_domain> --secret=<password> |
193 | 89 |
90 You may also want to provide the --verbose flag to see the traffic flow, | |
91 for example to debug the configuration. Below some specifics for the | |
264 | 92 Prosody XMPP server implementation. |
193 | 93 |
155 | 94 |
327 | 95 Running sat_pubsub with Prosody |
264 | 96 =============================== |
155 | 97 |
264 | 98 To enable the micro-blogging feature with Prosody XMPP server, you need |
327 | 99 the mod_delegation and privileged_entity plugins. |
100 Check if the mod_delegation and mod_privilege plugins are already | |
101 in your Prosody installation: | |
155 | 102 |
327 | 103 cd prosody/plugins |
104 ls mod_delegation.lua | |
105 ls mod_privilege.lua | |
264 | 106 |
327 | 107 If you can't see it, download them from http://modules.prosody.im: |
108 | |
109 wget http://hg.prosody.im/prosody-modules/raw-file/tip/mod_delegation/mod_delegation.lua | |
110 wget http://hg.prosody.im/prosody-modules/raw-file/tip/mod_privilege/mod_privilege.lua | |
264 | 111 |
327 | 112 Edit the prosody.cfg.lua file to add this module: |
113 | |
114 modules_enabled = { | |
115 [...] | |
116 "delegation"; | |
117 "privilege"; | |
118 [...] | |
119 } | |
120 | |
121 In your VirtualHost, add this lines: | |
122 | |
123 VirtualHost "<your_xmpp_domain>" | |
326
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
124 privileged_entities = { |
327 | 125 ["sat-pubsub.<your_xmpp_domain>"] = { |
326
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
126 roster = "get"; |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
127 message = "outgoing"; |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
128 }, |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
129 } |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
130 delegations = { |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
131 ["urn:xmpp:mam:1"] = { |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
132 filtering = {"node"}; |
327 | 133 jid = "sat-pubsub.<your_xmpp_domain>"; |
326
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
134 }, |
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
135 ["http://jabber.org/protocol/pubsub"] = { |
327 | 136 jid = "sat-pubsub.<your_xmpp_domain>"; |
326
b76cbf59772b
update INSTALL file, we don't use remote roster anymore
souliane <souliane@mailoo.org>
parents:
276
diff
changeset
|
137 }, |
264 | 138 } |
155 | 139 |
327 | 140 Also add these two lines at the end of the file, adapting them to your XMPP server |
141 domain (virtual host) and selecting a password of your choice: | |
155 | 142 |
327 | 143 Component "sat-pubsub.<your_xmpp_domain>" |
144 component_secret = "<password>" | |
145 modules_enabled = {"delegation", "privilege"} | |
155 | 146 |
327 | 147 For a more complete installation and configuration of Prosody to be used with |
148 sat_pubsub, please report yourself to the Salut à Toi wiki: | |
264 | 149 |
327 | 150 http://wiki.goffi.org/wiki/Libervia/en#XMPP_server |