Files @ 269f5f376d8a
Branch filter:

Location: libtransport.git/documentation/configuration/config_file.md

vitalyster
Update packages_debian_ubuntu.md
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
---
layout: config
title: Spectrum 2
---

> **\[database\]**
>
> * [database](#databasedatabase)
> * [password](#databasepassword)
> * [port](#databaseport)
> * [prefix](#databaseprefix)
> * [server](#databaseserver)
> * [type](#databasetype)
> * [user](#databaseuser)
>
> **\[logging\]**
>
> * [backend_config](#loggingbackend_config)
> * [config](#loggingconfig)
>
> **\[registration\]**
>
> * [auto_register](#registrationautoregister)
> * [enable_public_registration](#registrationenablepublicregistration)
> * [instructions](#registrationinstructions)
> * [username_label](#registrationusernamelabel)
> * [username_mask](#registrationusernamemask)
>
> **\[service\]**
>
> * [admin_jid](#serviceadminjid)
> * [admin_password](#serviceadminpassword)
> * [backend](#servicebackend)
> * [backend_host](#servicebackendhost)
> * [backend_port](#servicebackendport)
> * [group](#servicegroup)
> * [jid](#servicejid)
> * [password](#servicepassword)
> * [pidfile](#servicepidfile)
> * [user](#serviceuser)
> * [users_per_backend](#servicusersperbackend)
> * [web_directory](#servicewebdirectory)
> * [web_url](#serviceweburl)
> * [working_dir](#serviceworkingdir)




### Types of configuration fields

Following types are used:

integer - Examples: key=0

string - Examples: key=something

boolean - Examples: key=0 or key=1

list - List of strings (or Jabber IDs). You can specify this options more than once:

	allowed_servers=domain.tld
	allowed_servers=example.com

#### database.database

Key | val
----|----
Description:|Configures full path to database or the name of database.
Context:|server-mode and gateway-mode
Type:|string
Default:|/var/lib/spectrum2/$jid/database.sql

This option configures full path to database (in case of SQLite3) or the name of database.

#### database.password

Key | val
----|----
Description:|Configures password to connect the database.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

For server-client databases, this option configures password to be used to connect the database.

#### database.port

Key | val
----|----
Description:|Configures port on which database listens for incoming connections.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

For server-client databases, this option configures port on which database listens for incoming connections.

#### database.prefix

Key | val
----|----
Description:|Configures the prefix for the Spectrum 2 tables in database.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures the prefix for the Spectrum 2 tables in database. When tables are created, they are prefixed
with this prefix.

#### database.server

Key | val
----|----
Description:|Configures the hostname of database server.
Context:|server-mode and gateway-mode
Type:|string
Default:|localhost

For server-client databases, this option configures the hostname of server.

#### database.type

Key | val
----|----
Description:|Configures type of database where Spectrum 2 stores its data.
Context:|server-mode and gateway-mode
Type:|string
Default:|none

This option configures type of database where Spectrum 2 stores its data. It can be `none`, `mysql`, `sqlite3` or `pqxx` for PostgreSQL.

#### database.user

Key | val
----|----
Description:|Configures username to connect the database.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

For server-client databases, this option configures username to be used to connect the database.

#### logging.config

Key | val
----|----
Description:|Configures full path to log4cxx config file which is used for Spectrum 2 instance logs.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures full path to log4cxx config file which is used for Spectrum 2 instance logs.

#### logging.backend_config

Key | val
----|----
Description:|Configures full path to log4cxx config file which is used for backends logs.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures full path to log4cxx config file which is used for backends logs.

#### registration.auto_register

Key | val
----|----
Description:|Configures automatic user registration.
Context:|gateway-mode
Type:|boolean
Default:|0

If this option is enabled and user sends available presence to Spectrum 2 instance (tries to login it), he is registered
automatically. If the available presence was join-the-room request, legacy network name used for registration is determined
according to resource of this presence. This basically means that if user wants to join for example IRC room #test%irc.freenode.org
as "HanzZ", then Spectrum 2 registers him as "HanzZ" automatically and he does not have to fill registration form manually.

#### registration.enable_public_registration

Key | val
----|----
Description:|Configures if registration is allowed publicly.
Context:|gateway-mode
Type:|boolean
Default:|1

This option configures if registration is allowed publicly. This option can be used to disable public
registration or, together with [service.allowed_servers](#serviceallowed_servers) to create white-list of
domains from which users can register.

#### registration.instructions

Key | val
----|----
Description:|Configures instructions string showed in registration form.
Context:|gateway-mode
Type:|string
Default:|Enter your legacy network username and password.

This option configures instructions string showed in registration form.

#### registration.username_label

Key | val
----|----
Description:|Configures label for username field in registration form.
Context:|gateway-mode
Type:|string
Default:|Legacy network username:

This option configures label for username field in registration form.

#### registration.username_mask

Key | val
----|----
Description:|Configures mask which is used to generate legacy network username from username field in registration form.
Context:|gateway-mode
Type:|string
Default:|emptry string

This option configures mask which is used to generate legacy network username from username field in registration form.
An example of this option could be `username_mask=$username@chat.facebook.com`. If the user registers account "my_name", Spectrum 2
will use "my_name@chat.facebook.com" as legacy network username.

#### service.admin_jid

Key | val
----|----
Description:|Configures list of Jabber IDs, which has ability to use Admin Interface.
Context:|server-mode and gateway-mode
Type:|list of Jabber IDs
Default:|empty list

This option configures list of Jabber IDs, which has ability to use Admin Interface. In server-mode, you also have to specify
service.admin_password to set password for Admin Interface. In gatewa-mode, you just specify the list of Jabber IDs, Spectrum 2 does
not check any password in gateway-mode.

#### service.admin_password

Key | val
----|----
Description:|Configures password which is used by clients defined in service.admin_jid to use Admin Interface.
Context:|server-mode
Type:|string
Default:|empty string

This option configures the password which is used by clients defined in service.admin_jid to use Admin Interface.

#### service.backend

Key | val
----|----
Description:|Configures path to backend executable.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures path to backend executable. When user connects, Spectrum 2 spawns new backend process to handle this user's
session. Usually single backend is shared by more users. This can be configured using service.users_per_backend.

#### service.backend_host

Key | val
----|----
Description:|Configures hostname or IP to which backend connects.
Context:|server-mode and gateway-mode
Type:|string
Default:|localhost

This option configures hostname or IP to which backend connects. When Spectrum 2 is started, it listens on service.backend_port
to communicate with backends. When new backend is started, it connects to the hostname configured by this option and starts handling
new users sessions.

#### service.backend_port

Key | val
----|----
Description:|Configures port on which Spectrum 2 listens on for backends connections.
Context:|server-mode and gateway-mode
Type:|integer
Default:|0

This option configures port on which Spectrum 2 listens on for backends connections. If the value of this option is 0, then Spectrum 2
uses randomly generated port number.


#### service.group

Key | val
----|----
Description:|Configures group under which Spectrum 2 instance runs.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures name of group under which Spectrum 2 instance runs. When Spectrum 2 is started, it switches from current group
to this group.


#### service.jid

Key | val
----|----
Description:|Configures Jabber ID of Spectrum 2 instance
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures Jabber ID of particular Spectrum 2 instance. Usually it is a hostname on which this Spectrum 2 instance
runs, so for example `icq.domain.tld`. Note that you have to have DNS records configured for this hostname, so clients will be able
to find out your Jabber server (in case you are running Spectrum 2 in gateway-mode) or the Spectrum 2 itself (if you are running
Spectrum 2 in server-mode).

#### service.password

Key | val
----|----
Description:|Configures password to be used to connect XMPP server
Context:|gateway-mode
Type:|integer
Default:|0

This option configures port on which Spectrum listens to in server-mode or to which connects in gateway-mode. In server-mode
the default port for XMPP servers is 5222, so you should use this port. In gateway-mode, you have to at first configure your
server to allow Spectrum 2 to connect it as its component. On many servers, the default component port is 5347, but this option
depends on particular XMPP server and its configuration.

#### service.pidfile

Key | val
----|----
Description:|Configures path to file when Spectrum 2 stores its process ID.
Context:|server-mode and gateway-mode
Type:|string
Default:|/var/run/spectrum2/$jid.pid

This option configures path to file when Spectrum 2 stores its process ID. This file is later used by `spectrum2_manager` to determine,
if this particular Spectrum 2 instance runs.

#### service.user

Key | val
----|----
Description:|Configures user under which Spectrum 2 instance runs.
Context:|server-mode and gateway-mode
Type:|string
Default:|empty string

This option configures name of user under which Spectrum 2 instance runs. When Spectrum 2 is started, it switches from current user
(usually root) to this user.


#### service.users_per_backend

Key | val
----|----
Description:|Configures maximum number of users who share single backend process.
Context:|server-mode and gateway-mode
Type:|integer
Default:|100

This option configures maximum number of users who share single backend process. Value of this option depends on number of online
users on your Spectrum 2 instance in the same time. There is no strict consensus on what is the best value. Every backend is separated
process and you probably want to keep the number of processes per Spectrum 2 instance less than 30. So if you have 1000 users, it
could be sane to use `users_per_backend=50`. Another idea is to have the same number of backends as the number of CPU cores of the
machine where Spectrum 2 is running.

If you have too big value of users_per_backend, you have just single backend process for all users and Spectrum 2 will not perform so well
as if you have more backends running for the same user-base. Also, if there is some problem with single backend, it will affects only users
connected using this particular backend, so it is good idea to have more backends running. However, the more backends you have
the more processes the machine has and since some point, it will become less useful. There is also some memory overhead, so if you run
500 users on single backend, it will take little bit less memory than 500 users on 5 backends (but it is not significant unless you decide
to have hundreds of backends).

If you presume to have just few users on your personal server, it can be useful to configure `service.users_per_backend=1`. Ever user will
get his own separated backend process.

For bigger user-base, you have to increase the `service.users_per_backend` value, but there is no optimal value to be suggested yet.


#### service.web_directory

Key | val
----|----
Description:|Full path to directory used to save files to which the links are sent to users.
Context:|server-mode and gateway-mode
Type:|string
Default:|

When Spectrum 2 has some image or file for the user and this option is set, the image or file is stored in this directory and
and link based on `service.web_url` is sent to the user so he can download the file.

You can read more about this configuration on [Web Storage page](web_storage.html).

#### service.web_url

Key | val
----|----
Description:|URL on which files in `service.web_directory` are accessible.
Context:|server-mode and gateway-mode
Type:|string
Default:|

When Spectrum 2 has some image or file for the user and this option is set, the image or file is stored in the `service.web_directory` directory and
and link based on `service.web_url` is sent to the user so he can download the file.

You can read more about this configuration on [Web Storage page](web_storage.html).


#### service.working_dir

Key | val
----|----
Description:|Configures path to directory when Spectrum 2 stores its data files.
Context:|server-mode and gateway-mode
Type:|string
Default:|/var/lib/spectrum2/$jid

This option configures path to directory when Spectrum 2 stores its data files like for example SQLite3 database.