confgure external services for prosody
[ansible.git] / roles / prosody / templates / prosody.cfg.lua
1 -- Prosody Configuration File
2 --
3 -- Information on configuring Prosody can be found on our
4 -- website at https://prosody.im/doc/configure
5 --
6 -- Tip: You can check that the syntax of this file is correct
7 -- when you have finished by running this command:
8 --     prosodyctl check config
9 -- If there are any errors, it will let you know what and where
10 -- they are, otherwise it will keep quiet.
11 --
12 -- The only thing left to do is rename this file to remove the .dist ending, and fill in the
13 -- blanks. Good luck, and happy Jabbering!
14
15
16 ---------- Server-wide settings ----------
17 -- Settings in this section apply to the whole server and are the default settings
18 -- for any virtual hosts
19
20 -- This is a (by default, empty) list of accounts that are admins
21 -- for the server. Note that you must create the accounts separately
22 -- (see https://prosody.im/doc/creating_accounts for info)
23 -- Example: admins = { "user1@example.com", "user2@example.net" }
24 admins = {
25   {% for item in prosody.admins %}
26     "{{ item }}",
27   {% endfor %}
28 }
29
30 -- Enable use of libevent for better performance under high load
31 -- For more information see: https://prosody.im/doc/libevent
32 --use_libevent = true
33
34 -- Prosody will always look in its source directory for modules, but
35 -- this option allows you to specify additional locations where Prosody
36 -- will look for modules first. For community modules, see https://modules.prosody.im/
37 plugin_paths = { "{{ prosody.paths.modules }}" }
38
39 -- This is the list of modules Prosody will load on startup.
40 -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
41 -- Documentation for bundled modules can be found at: https://prosody.im/doc/modules
42 modules_enabled = {
43
44     -- Generally required
45         "roster"; -- Allow users to have a roster. Recommended ;)
46         "saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
47         "tls"; -- Add support for secure TLS on c2s/s2s connections
48         "dialback"; -- s2s dialback support
49         "disco"; -- Service discovery
50
51     -- Not essential, but recommended
52         "carbons"; -- Keep multiple clients in sync
53         "pep"; -- Enables users to publish their mood, activity, playing music and more
54         "private"; -- Private XML storage (for room bookmarks, etc.)
55         "blocklist"; -- Allow users to block communications with other users
56         "vcard"; -- Allow users to set vCards
57
58     -- Nice to have
59         "version"; -- Replies to server version requests
60         "uptime"; -- Report how long server has been running
61         "time"; -- Let others know the time here on this server
62         "ping"; -- Replies to XMPP pings with pongs
63         "register"; -- Allow users to register on this server using a client and change passwords
64         "mam"; -- Store messages in an archive and allow users to access it
65
66     -- Admin interfaces
67         "admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
68         --"admin_telnet"; -- Opens telnet console interface on localhost port 5582
69
70         -- HTTP modules
71         --"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
72         --"websocket"; -- XMPP over WebSockets
73         --"http_files"; -- Serve static files from a directory over HTTP
74
75     -- Other specific functionality
76         --"limits"; -- Enable bandwidth limiting for XMPP connections
77         --"groups"; -- Shared roster support
78         --"server_contact_info"; -- Publish contact information for this service
79         "announce"; -- Send announcement to all online users
80         --"welcome"; -- Welcome users who register accounts
81         "watchregistrations"; -- Alert admins of registrations
82         --"motd"; -- Send a message to users when they log in
83         --"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
84         --"proxy65"; -- Enables a file transfer proxy service which clients behind NAT can use
85         "external_services"; -- XEP-0215: External Service Discovery
86
87     -- Community modules
88         "smacks"; -- XEP-0198: Stream Management
89         "csi_battery_saver"; -- XEP-0352: Client State Indication
90         "http_upload"; -- XEP-0363: HTTP File Upload
91         "register_web"; -- what it says on the tin
92 };
93
94 -- These modules are auto-loaded, but should you want
95 -- to disable them then uncomment them here:
96 modules_disabled = {
97     -- "offline"; -- Store offline messages
98     -- "c2s"; -- Handle client connections
99     -- "s2s"; -- Handle server-to-server connections
100     -- "posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
101 };
102 -- Disable account creation by default, for security
103 -- For more information see https://prosody.im/doc/creating_accounts
104 allow_registration = false
105
106 -- Debian:
107 --   send the server to background.
108 --
109 daemonize = false
110
111 -- Debian:
112 --   Please, don't change this option since /var/run/prosody/
113 --   is one of the few directories Prosody is allowed to write to
114 --
115 pidfile = "/var/run/prosody/prosody.pid"
116
117 -- These are the SSL/TLS-related settings. If you don't want
118 -- to use SSL/TLS, you may comment or remove this
119 ssl = {
120         key = "/etc/ssl/private/letsencrypt/live.key";
121         certificate = "/etc/ssl/mycerts/letsencrypt/live.crt";
122         ciphers = "ALL:!EXPORT:!LOW:!MEDIUM:!aNULL:!3DES";
123         dhparam = "/etc/ssl/dh2048.pem";
124 }
125 -- support legacy clients
126 legacy_ssl_ports = { 5223 }
127
128 -- Force clients to use encrypted connections? This option will
129 -- prevent clients from authenticating unless they are using encryption.
130
131 c2s_require_encryption = true
132
133 -- Force servers to use encrypted connections? This option will
134 -- prevent servers from authenticating unless they are using encryption.
135 -- Note that this is different from authentication
136
137 s2s_require_encryption = true
138
139 -- Force certificate authentication for server-to-server connections?
140 -- This provides ideal security, but requires servers you communicate
141 -- with to support encryption AND present valid, trusted certificates.
142 -- NOTE: Your version of LuaSec must support certificate verification!
143 -- For more information see https://prosody.im/doc/s2s#security
144
145 s2s_secure_auth = false
146
147 -- Some servers have invalid or self-signed certificates. You can list
148 -- remote domains here that will not be required to authenticate using
149 -- certificates. They will be authenticated using DNS instead, even
150 -- when s2s_secure_auth is enabled.
151 -- However, if require_encryption is enabled, these hosts will still have
152 -- to use (unauthenticated) encryption.
153
154 s2s_insecure_domains = { "gmail.com"; "googlemail.com" }
155
156 -- Even if you leave s2s_secure_auth disabled, you can still require valid
157 -- certificates for some domains by specifying a list here.
158
159 -- s2s_secure_domains = { "jabber.org" }
160
161 -- Select the authentication backend to use. The 'internal' providers
162 -- use Prosody's configured data storage to store the authentication data.
163 -- To allow Prosody to offer secure authentication mechanisms to clients, the
164 -- default provider stores passwords in plaintext. If you do not trust your
165 -- server please see https://prosody.im/doc/modules/mod_auth_internal_hashed
166 -- for information about using the hashed backend.
167
168 authentication = "internal_hashed"
169
170 -- Select the storage backend to use. By default Prosody uses flat files
171 -- in its configured data directory, but it also supports more backends
172 -- through modules. An "sql" backend is included by default, but requires
173 -- additional dependencies. See https://prosody.im/doc/storage for more info.
174
175 --storage = "sql" -- Default is "internal" (Debian: "sql" requires one of the
176 -- lua-dbi-sqlite3, lua-dbi-mysql or lua-dbi-postgresql packages to work)
177
178 -- For the "sql" backend, you can uncomment *one* of the below to configure:
179 --sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
180 --sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
181 --sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
182
183
184 -- Archiving configuration
185 -- If mod_mam is enabled, Prosody will store a copy of every message. This
186 -- is used to synchronize conversations between multiple clients, even if
187 -- they are offline. This setting controls how long Prosody will keep
188 -- messages in the archive before removing them.
189
190 archive_expires_after = "2d" -- Remove archived messages after 2 days
191
192 -- You can also configure messages to be stored in-memory only. For more
193 -- archiving options, see https://prosody.im/doc/modules/mod_mam
194
195
196 -- Logging configuration
197 -- For advanced logging see https://prosody.im/doc/logging
198 --
199 -- Debian:
200 --  Logs info and higher to /var/log
201 --  Logs errors to syslog also
202 log = {
203         -- Log files (change 'info' to 'debug' for debug logs):
204         warn = "/var/log/prosody/prosody.log";
205         error = "/var/log/prosody/prosody.err";
206         -- Syslog:
207         { levels = { "error" }; to = "syslog";  };
208 }
209
210 -- Registration notification
211 registration_watchers = admins
212
213 -- Set up HTTP
214 http_default_host = "{{ prosody.host }}"
215
216 http_upload_file_size_limit = 5 * 1024 * 1024
217 http_upload_expire_after = 60 * 60 * 24 * 7 -- a week in seconds
218 http_upload_quota = 50 * 1024 * 1024
219
220 -- Set up external services
221 external_services = {
222     {
223         type = "stun",
224         transport = "udp",
225         host = "{{ prosody.host }}",
226         port = 3478
227     }, {
228         type = "turn",
229         transport = "udp",
230         host = "{{ prosody.host }}",
231         port = 3478,
232         secret = "{{ prosody.turn.secret }}"
233     }
234 }
235
236 ----------- Virtual hosts -----------
237 -- You need to add a VirtualHost entry for each domain you wish Prosody to serve.
238 -- Settings under each VirtualHost entry apply *only* to that host.
239
240 VirtualHost "{{ prosody.host }}"
241
242 ------ Components ------
243 -- You can specify components to add hosts that provide special services,
244 -- like multi-user conferences, and transports.
245 -- For more information on components, see https://prosody.im/doc/components
246
247 ---Set up a MUC (multi-user chat) room server on conference.example.com:
248 Component "conference.{{ prosody.host }}" "muc"
249
250 -- Set up a SOCKS5 bytestream proxy for server-proxied file transfers:
251 Component "proxy.{{ prosody.host }}" "proxy65"
252
253 ---Set up an external component (default component port is 5347)
254 --
255 -- External components allow adding various services, such as gateways/
256 -- transports to other networks like ICQ, MSN and Yahoo. For more info
257 -- see: https://prosody.im/doc/components#adding_an_external_component
258 --
259 --Component "gateway.example.com"
260 --      component_secret = "password"
261
262 ------ Additional config files ------
263 -- For organizational purposes you may prefer to add VirtualHost and
264 -- Component definitions in their own config files. This line includes
265 -- all config files in /etc/prosody/conf.d/
266
267 --Include "conf.d/*.cfg.lua"