module.exports = {
  stores: process.env.STORES ? process.env.STORES.split(',') : [
    'elasticsearch',
    'postgresql',
    'leveldb'
  ],
  
  postgresql: {
    host: process.env.POSTGRESQL_HOST || 'localhost',
    port: process.env.POSTGRESQL_PORT || '5432',
    username: process.env.POSTGRESQL_USER || 'postgres',
    password: process.env.POSTGRESQL_PASSWORD || 'postgres'
  },

  elasticsearch: {
    hosts: [
      process.env.ELASTICSEARCH_HOST || 'http://localhost:9200'
    ]
  },

  level: {
    path: process.env.LEVEL_PATH || '/tmp/level'
  },

  queue: {
    client: process.env.QUEUE_CLIENT || 'kue',
    kue: {
      port: process.env.QUEUE_KUE_PORT ? Number(process.env.QUEUE_KUE_PORT) : 3000
    },
    rabbitmq: {
      connectionString: process.env.QUEUE_RABBITMQ_CONNECTIONSTRING
    }
  },

  project: {
    client: process.env.PROJECT_CLIENT || 'file',
    file: {
      path: process.env.PROJECT_FILE_PATH || '/tmp/dstore'
    }
  },

  api: {
    port: (process.env.API_PORT ? Number(process.env.API_PORT) : (process.env.PORT ? process.env.PORT : 2020))
  }
};
