<commit_before>.. index:: configuring-socorro

Configure and run Socorro
=========================

Storing configuration in Consul
-------------------------------

Socorro apps get their configuration from environment variables. We suggest
using Consul to hold configuration:
https://consul.io/intro/getting-started/install.html

Consul must be running in order for Socorro apps to start up and access
their configuration. Normally you want to run a cluster (see the docs above)
but to start in a single node configuration add this to
/etc/consul/server.json::

  {
      "server": true,
      "bootstrap_expect": 1
  }

And restart Consul::

  sudo systemctl restart consul

The Socorro systemd service scripts use envconsul
(https://github.com/hashicorp/envconsul) to read the configuration from Consul
and set the environment.

To keep track of your configuration, it's recommended to make a "socorro-config"
directory and store these values there, and then load those into Consul as
a separate step.

Below is the minimum viable configuration to get collection working on a
single node:

.. code-block:: bash
    # Tell the Socorro app dispatcher which collector App to use
    application=socorro.collector.collector_app.CollectorApp

    # Run collector in WSGI mode, instead of the default dev server
    web_server__wsgi_server_class='socorro.webapi.servers.WSGIServer'

Put this into a file named "collector.conf" in your socorro-config folder.

Now, configure processor:

.. code-block:: bash

    new_crash_source__crashstorage_class='socorro.external.fs.crashstorage.FSDatedPermanentStorage'
    source__crashstorage_class='socorro.external.fs.crashstorage.FSPermanentStorage'

Put this into a file named "processor.conf" in your socorro-config folder.

For processing to work, you must provide debug symbols from your build.
See http://code.google.com/p/google-breakpad/wiki/LinuxStarterGuide#Producing_symbols_for_your_application for more information.

You can put your symbols into `/home/socorro/symbols` which is the default,
or you can change this location if necessary:<commit_msg>fix missing new line in PR#3047<commit_after>.. index:: configuring-socorro

Configure and run Socorro
=========================

Storing configuration in Consul
-------------------------------

Socorro apps get their configuration from environment variables. We suggest
using Consul to hold configuration:
https://consul.io/intro/getting-started/install.html

Consul must be running in order for Socorro apps to start up and access
their configuration. Normally you want to run a cluster (see the docs above)
but to start in a single node configuration add this to
/etc/consul/server.json::

  {
      "server": true,
      "bootstrap_expect": 1
  }

And restart Consul::

  sudo systemctl restart consul

The Socorro systemd service scripts use envconsul
(https://github.com/hashicorp/envconsul) to read the configuration from Consul
and set the environment.

To keep track of your configuration, it's recommended to make a "socorro-config"
directory and store these values there, and then load those into Consul as
a separate step.

Below is the minimum viable configuration to get collection working on a
single node:

.. code-block:: bash

    # Tell the Socorro app dispatcher which collector App to use
    application=socorro.collector.collector_app.CollectorApp

    # Run collector in WSGI mode, instead of the default dev server
    web_server__wsgi_server_class='socorro.webapi.servers.WSGIServer'

Put this into a file named "collector.conf" in your socorro-config folder.

Now, configure processor:

.. code-block:: bash

    new_crash_source__crashstorage_class='socorro.external.fs.crashstorage.FSDatedPermanentStorage'
    source__crashstorage_class='socorro.external.fs.crashstorage.FSPermanentStorage'

Put this into a file named "processor.conf" in your socorro-config folder.

For processing to work, you must provide debug symbols from your build.
See http://code.google.com/p/google-breakpad/wiki/LinuxStarterGuide#Producing_symbols_for_your_application for more information.

You can put your symbols into `/home/socorro/symbols` which is the default,
or you can change this location if necessary:
{'fraction_non_alphanumeric': 0.08643144683874023, 'fraction_numerical': 0.0014207909069381957, 'mean_word_length': 4.35361216730038, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6316665', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1120, 'n_words': 458}