prosody/templates/etc/prosody/prosody.cfg.lua.j2

228 lines
8.4 KiB
Django/Jinja

-- {{ ansible_managed }}
-- Prosody Example Configuration File
--
-- Information on configuring Prosody can be found on our
-- website at https://prosody.im/doc/configure
--
-- Tip: You can check that the syntax of this file is correct
-- when you have finished by running this command:
-- prosodyctl check config
-- If there are any errors, it will let you know what and where
-- they are, otherwise it will keep quiet.
--
-- The only thing left to do is rename this file to remove the .dist ending, and fill in the
-- blanks. Good luck, and happy Jabbering!
---------- Server-wide settings ----------
-- Settings in this section apply to the whole server and are the default settings
-- for any virtual hosts
-- This is a (by default, empty) list of accounts that are admins
-- for the server. Note that you must create the accounts separately
-- (see https://prosody.im/doc/creating_accounts for info)
-- Example: admins = { "user1@example.com", "user2@example.net" }
admins = { {{ prosody_admins }} }
{% for item in prosody_modules %}
{% if item.name == 'server_contact_info' %}
{% if item.module_enabled == 'false' %}
contact_info = { {{ prosody_contact_info }} }
{% endif %}
{% endif %}
{% endfor %}
http_host = "{{ prosody_http_host }}"
http_external_url = "{{ prosody_http_external_url }}"
http_ports = "{{ prosody_http_ports }}"
http_interfaces = { "{{ prosody_http_interfaces }}" }
http_paths = {
{% for item in prosody_http_paths %}
{{ item.name }} = "{{ item.path }}";
{% endfor %}
}
-- See https://prosody.im/doc/configure
c2s_direct_tls_ports = { {{ prosody_c2s_direct_tls_ports }} }
s2s_direct_tls_ports = { {{ prosody_s2s_direct_tls_ports }} }
-- Enable use of libevent for better performance under high load
-- For more information see: https://prosody.im/doc/libevent
network_backend = "{{ prosody_network_backend }}"
-- These paths are searched in the order specified, and before the default path
plugin_paths = { "{{ prosody_core_modules_path }}","{{ prosody_community_modules_path }}" }
-- Prosody Plugin Installer
-- CHeck https://prosody.im/doc/plugin_installer
-- By default plugins are installed into a directory custom_plugins under the data path. It can be customized by setting
plugin_server = "https://modules.prosody.im/rocks/"
installer_plugin_path = "{{ prosody_installer_plugin_path }}"
-- This path MUST be readable by the user Prosody runs as, and should be writable for prosodyctl install to work.
-- The installer path does not need to be added to plugin_paths.
-- This is the list of modules Prosody will load on startup.
-- Documentation for bundled modules can be found at: https://prosody.im/doc/modules
modules_enabled = {
{% for item in prosody_modules %}
{% if item.module_enabled == 'true' %}
"{{ item.name }}"; -- {{ item.description }}
{% endif %}
{% endfor %}
}
-- These modules are auto-loaded, but should you want
-- to disable them then uncomment them here:
modules_disabled = {
{% for item in prosody_modules %}
{% if item.module_enabled == 'false' %}
"{{ item.name }}"; -- {{ item.description }}
{% endif %}
{% endfor %}
};
-- Disable account creation by default, for security
-- For more information see https://prosody.im/doc/creating_accounts
allow_registration = {{ prosody_allow_registration }};
-- Rate limits
-- Enable rate limits for incoming client and server connections. These help
-- protect from excessive resource consumption and denial-of-service attacks.
limits = {
c2s = {
rate = "10kb/s";
};
s2sin = {
rate = "30kb/s";
};
}
-- Debian:
-- Please, don't change this option since /var/run/prosody/
-- is one of the few directories Prosody is allowed to write to
-- Required for init scripts and prosodyctl
pidfile = "/var/run/prosody/prosody.pid";
-- Force clients to use encrypted connections? This option will
-- prevent clients from authenticating unless they are using encryption.
c2s_require_encryption = {{ prosody_c2s_encryption }}
-- See https://prosody.im/doc/modules/mod_c2s
c2s_stanza_size_limit = {{ prosody_c2s_stanza_size_limit }} -- 256 * 1024 -- 256kb
-- Force servers to use encrypted connections? This option will
-- prevent servers from authenticating unless they are using encryption.
s2s_require_encryption = {{ prosody_s2s_encryption }}
-- Server-to-server authentication
-- Require valid certificates for server-to-server connections?
-- If false, other methods such as dialback (DNS) may be used instead.
s2s_secure_auth = {{ prosody_s2s_auth }}
-- Some servers have invalid or self-signed certificates. You can list
-- remote domains here that will not be required to authenticate using
-- certificates. They will be authenticated using other methods instead,
-- even when s2s_secure_auth is enabled.
{% if prosody_insecure_domains is defined %}
s2s_insecure_domains = { "{{ prosody_insecure_domains }}" }
{% endif %}
-- Even if you disable s2s_secure_auth, you can still require valid
-- certificates for some domains by specifying a list here.
--s2s_secure_domains = { "{{ prosody_secure_domains }}" }
-- See https://prosody.im/doc/s2s
s2s_stanza_size_limit = {{ prosody_s2s_stanza_size_limit }} -- 512 * 1000 -- 512kb
-- Storage
-- Select the storage backend to use. By default Prosody uses flat files
-- in its configured data directory, but it also supports more backends
-- through modules. An "sql" backend is included by default, but requires
-- additional dependencies. See https://prosody.im/doc/storage for more info.
--storage = "sql" -- Default is "internal"
storage = "{{ prosody_storage }}"
{% if prosody_storage == 'sql' %}
-- For the "sql" backend, you can uncomment *one* of the below to configure:
--sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
--sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
--sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
{% if prosody_sql_driver == 'SQLite3' %}
sql = { driver = "{{ prosody_sql_driver }}", database = "{{ prosody_sql_databasename }}" }
{% else %}
sql = { driver = "{{ prosody_sql_driver }}", database = "{{ prosody_sql_databasename }}", username = "{{ prosody_sql_username }}", password = "{{ prosody_sql_passwd }}", host = "{{ prosody_sql_host }}" }
{% endif %}
{% endif %}
-- Archiving configuration
-- If mod_mam is enabled, Prosody will store a copy of every message. This
-- is used to synchronize conversations between multiple clients, even if
-- they are offline. This setting controls how long Prosody will keep
-- messages in the archive before removing them.
archive_expires_after = "{{ prosody_archive_expires_after }}" -- Remove archived messages after X weeks or months
-- You can also configure messages to be stored in-memory only. For more
-- archiving options, see https://prosody.im/doc/modules/mod_mam
-- Logging configuration
-- For advanced logging see https://prosody.im/doc/logging
log = {
-- Log files:
{{ prosody_loglevel }} = "{{ prosody_log_path }}"; -- Change 'info' to 'debug' for verbose logging
error = "{{ prosody_err_log }}";
-- "*syslog"; -- Uncomment this for logging to syslog
-- "*console"; -- Log to the console, useful for debugging with daemonize=false
}
-- Uncomment to enable statistics
-- For more info see https://prosody.im/doc/statistics
{% if prosody_statistics|length %}
statistics = "{{ prosody_statistics }}"
{% else %}
-- statistics = "internal"
{% endif %}
-- Certificates
-- Every virtual host and component needs a certificate so that clients and
-- servers can securely verify its identity. Prosody will automatically load
-- certificates/keys from the directory specified here.
-- For more information, including how to use 'prosodyctl' to auto-import certificates
-- (from e.g. Let's Encrypt) see https://prosody.im/doc/certificates
-- Location of directory to find certificates in (relative to main config file):
certificates = "{{ prosody_certificates }}"
{% if prosody_component_interface is defined %}
{% for item in prosody_component_interface %}
-- Prosody external component ports
component_ports = { {{ item.component_ports }} }
component_interface = "{{ item.component_interface }}"
{% endfor %}
{% endif %}
-- Additional module Settings
{% for module in prosody_modules %}
{% if module.extra_options is defined and module.module_enabled == 'true' %}
-- {{ module.name }}
{% for item in module.extra_options %}
{{ item }}
{% endfor %}
{% endif %}
{% endfor %}
--
Include "conf.d/*.cfg.lua"