..  GENERATED FILE, DO NOT EDIT DIRECTLY

    This file is automatically generated using https://codeberg.org/slidge/legacy-module-template/
    Its source is at:
    https://codeberg.org/slidge/legacy-module-template/src/branch/main/docs/source/admin/config.rst.jinja
    Open a pull request for this repository instead, to benefit the documentation of all slidge-based gateways.

.. _config:

Configuration
=============

.. _config-file:

Config file location
********************

By default, matridge uses all config files found in ``/etc/slidge/conf.d/*``.
You can change this using the ``SLIDGE_CONF_DIR`` env var, eg ``SLIDGE_CONF_DIR=/path/dir1:/path/dir2:/path/dir3``.

It is recommended to use ``/etc/slidge/conf.d/`` to store configuration options
common to all slidge components (eg, attachment handling, logging options,
etc.), and to specify a plugin-specific file on startup, eg:

.. code-block:: bash

    slidge -c /etc/slidge/superduper.conf

matridge-specific config
************************

matridge provides the component-wide options displayed in the table below.
They can be used:

* as ``key=value`` in a :ref:`config file <config-file>`;
* as command line arguments, prepended with ``--``, e.g., ``--some-option=value``;
* as environment variables, upper case, prepended with ``MATRIDGE_``, and with dashes substituted with underscores, e.g., ``MATRIDGE_SOME_OPTION=value``.

.. config-obj:: matridge.config

.. _generic-config:

Generic slidge config
*********************

.. warning::

    Because of an ugly mess that will soon™ be fixed, it is impossible to use
    the config file to turn off boolean arguments that are true by default.
    As a workaround, use CLI args instead, e.g., ``--some-opt=false``.

The following options can be used:

* as ``key=value`` in a :ref:`config file <config-file>`;
* as command line arguments, prepended with ``--``, e.g., ``--some-option=value``;
* as environment variables, upper case, prepended with ``SLIDGE_``,
  and with dashes substituted with underscores, e.g., ``SLIDGE_SOME_OPTION=value``.


.. note::

    The following options are for slidge version |slidge_version|.
    Depending on how you installed matridge, you might have a different version of slidge.
    Use ``matridge --help`` for the exact list of options you can use.


.. config-obj:: slidge.core.config


Advanced logging configuration
******************************

To customize the output of the slidge, you can use the command line argument ``--log-config``
to specify a `logging configuration file
<https://docs.python.org/3/library/logging.config.html#configuration-file-format>`_.
