Mercurial > libervia-pubsub
annotate doc/installation.rst @ 423:af73d57829ed
error: fixed NotLeafNodeError class definition
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 01 Jun 2020 12:24:39 +0200 |
parents | f124ed5ea78b |
children | 968091cea547 |
rev | line source |
---|---|
404 | 1 ============ |
2 Installation | |
3 ============ | |
4 | |
5 This are the instructions to install SàT Pubsub. | |
6 | |
7 .. note:: | |
8 | |
9 SàT PubSub is not released yet and this documentation is work in progress | |
10 | |
11 | |
12 Requirements | |
13 ------------ | |
14 | |
421
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
15 - Python 3.7+ |
404 | 16 - Twisted >= 15.2.0: |
17 - Twisted Core | |
18 - Twisted Words | |
19 - Wokkel >= 0.7.1 (http://wokkel.ik.nu/) | |
20 - A XMPP server that supports the component protocol (XEP-0114), | |
21 and, to enable the micro-blogging feature, Namespace Delegation (XEP-0355) | |
22 and privileged entity (XEP-0356) are needed. | |
23 We recommend using Prosody with mod_privilege and mod_delegation modules (those modules | |
24 are maintained by us). | |
25 - SàT tmp (http://repos.goffi.org/sat_tmp) is currently needed for MAM and RSM handling | |
26 | |
27 For the PostgreSQL backend, the following is also required: | |
28 | |
29 - PostgreSQL >= 9.5 (including development files for psycopg2) | |
30 - psycopg2 | |
31 | |
32 Installation From Sources | |
33 ------------------------- | |
34 | |
35 To install SàT PubSub we'll work in a virtual environment. On Debian and derivatives you | |
36 should easily install dependencies with this:: | |
37 | |
409 | 38 sudo apt-get install postgresql python-dev mercurial virtualenv |
404 | 39 |
40 Now go in a location where you can install SàT Pubsub, for instance your home directory:: | |
41 | |
42 $ cd | |
43 | |
421
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
44 And enter the following commands:: |
404 | 45 |
421
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
46 $ python3 -m venv env |
404 | 47 $ source env/bin/activate |
48 $ pip install hg+https://repos.goffi.org/sat_pubsub | |
49 | |
421
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
50 .. note:: |
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
51 |
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
52 If your are installing from a local clone of the repository, it has been reported that |
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
53 installation with ``python setup.py install`` is not working properly. Please use ``pip |
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
54 install .`` instead. |
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
55 |
f124ed5ea78b
doc: remove python2 references + added a warning for `python setup.py install`
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
56 |
404 | 57 Post Installation |
58 ----------------- | |
59 | |
60 Once SàT Pubsub is installed, you'll need to create a PostgreSQL user, and create the | |
61 database:: | |
62 | |
63 % sudo -u postgres createuser -d -P $(whoami) | |
64 % createdb pubsub | |
65 % cd /tmp && wget https://repos.goffi.org/sat_pubsub/raw-file/tip/db/pubsub.sql | |
66 % psql pubsub < pubsub.sql | |
67 | |
68 | |
69 .. _prosody_configuration: | |
70 | |
71 Prosody Configuration | |
72 --------------------- | |
73 | |
74 SàT PubSub can work with any XMPP server (which supports components), but if you want to | |
75 use it as your PEP service, you need a server which supports `XEP-0355`_ and `XEP-0356`_. | |
76 | |
77 Below you'll find the instruction to use SàT PubSub as a PEP service with Prosody: | |
78 | |
79 - add these two lines at the end of your ``prosody.cfg.lua`` file, adapting them to your XMPP | |
80 server domain (virtual host) and selecting a password of your choice: | |
81 | |
82 .. sourcecode:: lua | |
83 | |
84 Component "sat-pubsub.<xmpp_domain>" | |
85 component_secret = "<password>" | |
86 | |
87 - there are extra steps to enable the micro-blogging feature with Prosody. Please follow | |
88 the installation and configuration instructions that are given on these pages: | |
89 | |
90 - https://modules.prosody.im/mod_delegation.html | |
91 - https://modules.prosody.im/mod_privilege.html | |
92 | |
93 To keep your modules up to date, we recommend to clone the full modules | |
94 repository and then to symlink them like that: | |
95 | |
96 .. sourcecode:: shell | |
97 | |
98 % cd /path/to/install_dir | |
99 % hg clone https://hg.prosody.im/prosody-modules | |
100 % cd /path/to/prosody_plugins | |
101 % ln -sf /path/to/install_dir/prosody-modules/mod_delegation ./ | |
102 % ln -sf /path/to/install_dir/prosody-modules/mod_privilege ./ | |
103 | |
104 Or course, you have to adapt ``/path/to/install_dir`` to the directory where you want to | |
105 install the modules, and ``/path/to/prosody_plugins`` to the directory where prosody | |
106 modules are installed (hint: check ``prosodyctl about`` to find the latter). The ``ln`` | |
107 commands may have to be run as root depending on your installation. | |
108 | |
109 Once your symlinks are set, to update the modules we just need to type this: | |
110 | |
111 .. sourcecode:: shell | |
112 | |
113 % cd /path/to/install_dir/prosody-modules | |
114 % hg pull -u | |
115 | |
116 Here is an example of how your ``prosody.cfg.lua`` should look like with | |
117 ``mod_delegation`` and ``mod_privilege`` activated: | |
118 | |
119 .. sourcecode:: lua | |
120 | |
121 [...] | |
122 modules_enabled = { | |
123 [...] | |
124 "delegation"; | |
125 "privilege"; | |
126 } | |
127 [...] | |
128 VirtualHost "<xmpp_domain>" | |
129 privileged_entities = { | |
130 ["sat-pubsub.<xmpp_domain>"] = { | |
131 roster = "get"; | |
132 message = "outgoing"; | |
133 presence = "roster"; | |
134 }, | |
135 } | |
136 delegations = { | |
137 ["urn:xmpp:mam:2"] = { | |
138 filtering = {"node"}; | |
139 jid = "sat-pubsub.<xmpp_domain>"; | |
140 }, | |
141 ["http://jabber.org/protocol/pubsub"] = { | |
142 jid = "sat-pubsub.<xmpp_domain>"; | |
143 }, | |
144 ["http://jabber.org/protocol/pubsub#owner"] = { | |
145 jid = "sat-pubsub.<xmpp_domain>"; | |
146 }, | |
147 ["https://salut-a-toi/protocol/schema:0"] = { | |
148 jid = "sat-pubsub.<xmpp_domain>"; | |
149 }, | |
150 ["http://jabber.org/protocol/disco#items:*"] = { | |
151 jid = "sat-pubsub.<xmpp_domain>"; | |
152 }, | |
153 ["https://salut-a-toi.org/spec/pubsub_admin:0"] = { | |
154 jid = "sat-pubsub.<xmpp_domain>"; | |
155 }, | |
156 } | |
157 | |
158 Component "sat-pubsub.<xmpp_domain>" | |
159 component_secret = "<password>" | |
160 modules_enabled = {"delegation", "privilege"} | |
161 | |
162 Of course, you still have to replace and adapt to your own settings. | |
163 | |
164 .. _XEP-0355: https://xmpp.org/extensions/xep-0355.html | |
165 .. _XEP-0356: https://xmpp.org/extensions/xep-0356.html | |
166 | |
167 Running SàT PubSub | |
168 ------------------ | |
169 | |
170 The minimal example for running sat_pubsub is: | |
171 | |
172 % twistd sat_pubsub | |
173 | |
174 This will start the service and run it in the background. It generates a | |
175 file twistd.pid that holds the PID of the service and a log file twistd.log. | |
176 The twistd utility has a fair number of options that might be useful, and | |
177 can be viewed with: | |
178 | |
179 % twistd --help | |
180 | |
181 When the service starts, it will connect to the XMPP server at the local machine using the | |
182 component protocol, and assumes the JID ``pubsub``. This assumes a couple of defaults | |
183 which can be overridden by passing parameters to the twistd plugin. You can get an | |
184 overview of the parameters and their defaults using: | |
185 | |
186 % twistd sat_pubsub --help | |
187 | |
188 In particular, the following parameters will be of interest: | |
189 | |
190 ``--jid`` | |
191 The Jabber ID the component will assume. | |
192 | |
193 ``--rport`` | |
194 the port number of the XMPP server to connect to | |
195 | |
196 ``--xmpp_pwd`` | |
197 the secret used to authenticate with the XMPP server. | |
198 | |
199 For example:: | |
200 | |
201 twistd sat_pubsub --jid=sat-pubsub.<your_xmpp_domain> --xmpp_pwd=<password> | |
202 | |
203 You can set your options in ``sat.conf`` which is the same file used as for Salut à Toi | |
204 ecosystem. Please check backend ``configuration`` section for details. The SàT PubSub | |
205 options must be in ``[pubsub]`` section. | |
206 |