:banner: banners/flectra_command_line_interface.jpg .. _reference/cmdline: =================================== Command-line interface: flectra-bin =================================== .. _reference/cmdline/server: Running the server ================== .. program:: flectra-bin .. option:: -d , --database database used when installing or updating modules. .. option:: -i , --init comma-separated list of modules to install before running the server (requires :option:`-d`). .. option:: -u , --update comma-separated list of modules to update before running the server (requires :option:`-d`). .. option:: --addons-path comma-separated list of directories in which modules are stored. These directories are scanned for modules (nb: when and why?) .. option:: --workers if ``count`` is not 0 (the default), enables multiprocessing and sets up the specified number of HTTP workers (sub-processes processing HTTP and RPC requests). .. note:: multiprocessing mode is only available on Unix-based systems A number of options allow limiting and recycling workers: .. option:: --limit-request Number of requests a worker will process before being recycled and restarted. Defaults to 8196. .. option:: --limit-memory-soft Maximum allowed virtual memory per worker. If the limit is exceeded, the worker is killed and recycled at the end of the current request. Defaults to 640MB. .. option:: --limit-memory-hard Hard limit on virtual memory, any worker exceeding the limit will be immediately killed without waiting for the end of the current request processing. Defaults to 768MB. .. option:: --limit-time-cpu Prevents the worker from using more than CPU seconds for each request. If the limit is exceeded, the worker is killed. Defaults to 60. .. option:: --limit-time-real Prevents the worker from taking longer than seconds to process a request. If the limit is exceeded, the worker is killed. Differs from :option:`--limit-time-cpu` in that this is a "wall time" limit including e.g. SQL queries. Defaults to 120. .. option:: --max-cron-threads number of workers dedicated to cron jobs. Defaults to 2. The workers are threads in multi-threading mode and processes in multi-processing mode. For multi-processing mode, this is in addition to the HTTP worker processes. .. option:: -c , --config provide an alternate configuration file .. option:: -s, --save saves the server configuration to the current configuration file (:file:`{$HOME}/.flectrarc` by default, and can be overridden using :option:`-c`) .. option:: --proxy-mode enables the use of ``X-Forwarded-*`` headers through `Werkzeug's proxy support`_. .. warning:: proxy mode *must not* be enabled outside of a reverse proxy scenario .. option:: --test-enable runs tests after installing modules .. option:: --dev * ``all``: all the features below are activated * ``xml``: read template qweb from xml file directly instead of database. Once a template has been modified in database, it will be not be read from the xml file until the next update/init. * ``reload``: restart server when python file are updated (may not be detected depending on the text editor used) * ``qweb``: break in the evaluation of qweb template when a node contains ``t-debug='debugger'`` * ``(i)p(u)db``: start the chosen python debugger in the code when an unexpected error is raised before logging and returning the error. .. _reference/cmdline/server/database: database -------- .. option:: -r , --db_user database username, used to connect to PostgreSQL. .. option:: -w , --db_password database password, if using `password authentication`_. .. option:: --db_host host for the database server * ``localhost`` on Windows * UNIX socket otherwise .. option:: --db_port port the database listens on, defaults to 5432 .. option:: --db-filter hides databases that do not match ````. The filter is a `regular expression`_, with the additions that: - ``%h`` is replaced by the whole hostname the request is made on. - ``%d`` is replaced by the subdomain the request is made on, with the exception of ``www`` (so domain ``flectrahq.com`` and ``www.flectrahq.com`` both match the database ``flectra``). These operations are case sensitive. Add option ``(?i)`` to match all databases (so domain ``flectrahq.com`` using ``(?i)%d`` matches the database ``Flectra``). .. option:: --db-template