# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

##
## Copy this file to commonconfig.py
##  - then fix the values to match your test environment
##

#---------------------------------------------------------------------------
# Relational Database Section

import socorro.lib.ConfigurationManager as cm
databaseHost = cm.Option()
databaseHost.doc = 'the hostname of the database servers'
databaseHost.default = 'localhost'

databaseName = cm.Option()
databaseName.doc = 'the name of the database within the server'
databaseName.default = 'socorro_integration_test'

oldDatabaseName = cm.Option()
oldDatabaseName.doc = 'the name of the old, deprecated test database within the server'
oldDatabaseName.default = 'socorro_test'

databaseUserName = cm.Option()
databaseUserName.doc = 'the user name for the database servers'
databaseUserName.default = 'breakpad_rw'

databasePassword = cm.Option()
databasePassword.doc = 'the password for the database user'
databasePassword.default = 'aPassword'

databaseSuperUserName = cm.Option()
databaseSuperUserName.doc = 'the super user name for the database servers'
databaseSuperUserName.default = 'test'

databaseSuperUserPassword = cm.Option()
databaseSuperUserPassword.doc = 'the super user password for the database user'
databaseSuperUserPassword.default = 'aPassword'

#---------------------------------------------------------------------------
# RabbitMQ config

rabbitMQUsername = cm.Option()
rabbitMQUsername.doc = 'the username of the rabbitmq user'
rabbitMQUsername.default = 'guest'

rabbitMQPassword = cm.Option()
rabbitMQPassword.doc = 'the password of the rabbitmq user'
rabbitMQPassword.default = 'guest'

rabbitMQHost = cm.Option()
rabbitMQHost.doc = 'the hostname of the rabbitmq service'
rabbitMQHost.default = 'localhost'

rabbitMQPort = cm.Option()
rabbitMQPort.doc = 'the port of the rabbitmq service'
rabbitMQPort.default = 5672

rabbitMQVirtualhost = cm.Option()
rabbitMQVirtualhost.doc = 'the virtual host for rabbitmq'
rabbitMQVirtualhost.default = '/'


rabbitMQStandardQueue = cm.Option()
rabbitMQStandardQueue.doc = 'the standard queue for rabbitmq'
rabbitMQStandardQueue.default = 'socorro.normal'

rabbitMQPriorityQueue = cm.Option()
rabbitMQPriorityQueue.doc = 'the standard queue for rabbitmq'
rabbitMQPriorityQueue.default = 'socorro.priority'

#---------------------------------------------------------------------------
# HBase storage system

hbaseHost = cm.Option()
hbaseHost.doc = 'Hostname for hbase hadoop cluster. May be a VIP or load balancer'
hbaseHost.default = 'localhost'

hbasePort = cm.Option()
hbasePort.doc = 'hbase port number'
hbasePort.default = 9090

hbaseTimeout = cm.Option()
hbaseTimeout.doc = 'timeout in milliseconds for an HBase connection'
hbaseTimeout.default = 5000

#---------------------------------------------------------------------------
# elasticsearch storage system

searchMaxNumberOfDistinctSignatures = cm.Option()
searchMaxNumberOfDistinctSignatures.doc = (
        "Integer containing the maximum allowed number of distinct signatures "
        "the system should retrieve. "
        "Used mainly for performances in ElasticSearch")
searchMaxNumberOfDistinctSignatures.default = 1000

elasticSearchHostname = cm.Option()
elasticSearchHostname.doc = 'String containing the URI of the Elastic Search instance.'
elasticSearchHostname.default = 'localhost'

elasticSearchPort = cm.Option()
elasticSearchPort.doc = 'String containing the port on which calling the Elastic Search instance.'
elasticSearchPort.default = '9200'

elasticsearch_urls = cm.Option()
elasticsearch_urls.doc = 'the urls to the elasticsearch instances'
elasticsearch_urls.default = 'http://localhost:9200'

elasticsearch_index = cm.Option()
elasticsearch_index.doc = (
    'an index format to pull crashes from elasticsearch '
    "(use datetime's strftime format to have daily, weekly or monthly indexes)"
)
elasticsearch_index.default = 'socorro_integration_test'

elasticsearch_doctype = cm.Option()
elasticsearch_doctype.doc = 'the default doctype to use in elasticsearch'
elasticsearch_doctype.default = 'crash_reports'

elasticsearch_timeout = cm.Option()
elasticsearch_timeout.doc = 'the time in seconds before a query to elasticsearch fails'
elasticsearch_timeout.default = 30

facets_max_number = cm.Option()
facets_max_number.doc = 'the maximum number of results a facet will return in search'
facets_max_number.default = 50

#---------------------------------------------------------------------------
# statsd config

statsdHost = cm.Option()
statsdHost.doc = ''
statsdHost.default = ''

statsdPort = cm.Option()
statsdPort.doc = ''
statsdPort.default = 8125

statsdPrefix = cm.Option()
statsdPrefix.doc = ''
statsdPrefix.default = ''

#---------------------------------------------------------------------------
# Platforms
platforms = cm.Option()
platforms.doc = 'Array associating OS ids to full names.'
platforms.default = (
    {
        "id" : "windows",
        "name" : "Windows NT"
    },
    {
        "id" : "mac",
        "name" : "Mac OS X"
    },
    {
        "id" : "linux",
        "name" : "Linux"
    },
)

#---------------------------------------------------------------------------
# Release Channels
non_release_channels = cm.Option()
non_release_channels.doc = 'List of channels, excluding the `release` one.'
non_release_channels.default = ['beta', 'aurora', 'nightly']

restricted_channels = cm.Option()
restricted_channels.doc = 'List of channels to restrict based on build ids.'
restricted_channels.default = ['beta']
