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

The format of this file is INI-style (name=value, divided into [sections]). 
Names are case insensitive. All values which are filenames can have shell-style 
tildes (~) in them. All values which are relative filenames are interpreted to 
be relative to the Pyzor homedir. All of these options can be overridden by 
command-line arguments.

It is recommended to use the provided `sample configuration <https://github.co
m/SpamExperts/pyzor/blob/master/config/config.sample>`_. Simply copy it in 
pyzor's ``homedir``, remove the ``.sample`` from the name and alter any 
configurations you prefer.

.. _client-configuration:

client configuration
-----------------------

ServersFile
    Must contain a newline-separated list of server addresses to 
    report/whitelist/check with. All of these server will be contacted for 
    every operation. See :ref:`client-server-file`.

AccountsFile
    File containing information about accounts on servers. See :doc:`accounts`.

LogFile
    If this is empty then logging is done to stdout.
    
LocalWhitelist
    Specify the local whitelist file name. 

Timeout
    This options specifies the number of seconds that the pyzor client should 
    wait for a response from the server before timing out.

Style 
    Specify the message input style. See :ref:`client-input-style`.

ReportThreshold
    If the number of reports exceeds this threshold then the exit code of the 
    pyzor client is 0.

WhitelistThreshold
    If the number of whitelists exceed this threshold then exit code of the 
    pyzor client is 1.

.. _server-configuration:


server configuration
------------------------

Port
    Port to listen on.

ListenAddress
    Address to listen on.

LogFile
    File to contain server logs.
    
SentryDSN
    If set add a SentryHandler to the log file.
    
SentryLogLevel
    Set the log level for the SentryHandler. (default is ``WARN``)

UsageLogFile
    File to contain server usage logs (information about each request).

UsageSentryDSN
    If set add a SentryHandler to the usage log file.
    
UsageSentryLogLevel
    Set the log level for the usage SentryHandler. (default is ``WARN``)

PidFile
    This file contain the pid of the pyzord daemon when used with the 
    `--detach` option.

PasswdFile
    File containing a list of user account information. See :doc:`accounts`.

AccessFile
    File containing information about user privileges. See 
    :ref:`server-access-file`.

Gevent
    If set to true uses the gevent library.

Engine
    Then engine type to be used for storage. See :ref:`server-engines`. 

DigestDB
    The database connection information. Format varies depending on the engine 
    used. See :ref:`server-engines`.

CleanupAge
    The maximum age of a record before it gets removed (in seconds). To 
    disable this set to 0.

PreFork
    The number of workers the pyzor server should start. The server will
    pre-fork itself and split handling the requests among all workers.
    This is disabled by default.

Threads
    If set to true, the pyzor server will use multi-threading to serve 
    requests.

MaxThreads
    The maximum number of concurrent threads (0 means unlimited).

DBConnections
    The number of database connections kept opened by the server (0 means a 
    new one for each request). 

.. note::    
    `DBConnections` only applies to the MySQL engine.

Processes
    If set to true, the pyzor server will use multi-processing to serve 
    requests.

MaxProcesses
    The maximum number of concurrent processes (cannot be unlimited).


