<commit_before>/**
 * PUSH Notification server
 * (c) Telefonica Digital, 2012 - All rights reserved
 * License: GNU Affero V3 (see LICENSE file)
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 */

/******************* Servers to run on this machine ********************/
/**
 * Put to true what you want to run
 */
exports.servers = {
  NS_AS: true,
  NS_MSG_monitor: true,
  NS_UA_WS: true,
  NS_UA_UDP: true,
  NS_WakeUp: true
};

////////////////////////////////////////////////////////////////////////
// Common configuration parameters
////////////////////////////////////////////////////////////////////////

/********************* Constants********************************************/
exports.consts = {
  MAX_PAYLOAD_SIZE: 1024,
  PREPRODUCTION_MODE: true,
  MAX_TTL: 2592000, // 30 days, in seconds (60*60*24*30)

  /**
   * This is the Key and the Certificate of the server. Should be shared
   * between all frontends that receive connections (NS_AS, NS_UA_WS).
   * Self-signed: http://stackoverflow.com/questions/9519707/can-nodejs-generate-ssl-certificates
   */

  key: '../examples/ssl_cert/server-key.pem',
  cert: '../examples/ssl_cert/server-cert.pem',

  /**
   * Public base URL to receive notifications. This will be the base to
   * append the /notify/12345abcdef… URL
   */
  publicBaseURL: "https://localhost:8081",

  /**
   * This must be shared between all your NS_UA_WS frontends.
   * This is used to verify if the token to register a UA comes from
   * this server
   */
  cryptokey: "12345678901234567890"
};

/********************* Logger parameters ***********************************/
var loglevel = require('./common/constants.js').loglevels;
exports.logger = {
  /**
   * Log levels:
   *
   * # NONE: Log disabled
   * # DEBUG: Very detailed information about all the things the server is doing
   * # INFO: General information about the things the server is doing
   * # ERROR: Error detected, but the server can continue working
   * # ALERT: Error detected but not directly on this process, so this is a
   *          notification that should be investigated
   * # NOTIFY: General notifications, ie. New connections
   * # CRITICAL: When a CRITICAL trace is sent the process will be STOPPED
   */
  LOGLEVEL: loglevel.DEBUG | loglevel.INFO | loglevel.ERROR | loglevel.CRITICAL | loglevel.ALERT | loglevel.NOTIFY | loglevel.ALARM,
  CONSOLEOUTPUT: 1,
  BASE_PATH: "/var/log/push_server/",
  ALARM: "/var/log/push_server/alarms.log"

};

/********************* Common Queue ***********************************/
/**
 * Choose your host, port and other self-explanatory options
 */
exports.queue = [{
    host: '127.0.0.1',
    port: 5672, //AMQP default port
    login: 'guest',
    password: '<PASSWORD>'
  },
  {
    host: '127.0.0.1',
    port: 5672, //AMQP default port
    login: 'guest',
    password: '<PASSWORD>'
  },
  {
    host: '127.0.0.1',
    port: 5672, //AMQP default port
    login: 'guest',
    password: '<PASSWORD>'
  }
];

/********************* Database configuration *************************/
/**
 * If replicasetName is not set, we ONLY use the first machine, and
 * connect to a single mongo instance.
 */

//DDBB defaults to using MongoDB in a replicaset
/*exports.ddbbsettings = {
  machines: [
    ["owd-push-qa-be1", 27017],
    ["owd-push-qa-be2", 27017]
  ],
  ddbbname: "push_notification_server",
  replicasetName: "Server_Push"
};*/

//DDBB defaults to use a single MongoDB instance
exports.ddbbsettings = {
  machines: [
    ["127.0.0.1", 27017]
  ],
  ddbbname: "push_notification_server",
  replicasetName: null
};

////////////////////////////////////////////////////////////////////////
//Different configurations for the servers
////////////////////////////////////////////////////////////////////////

/********************* NS_AS *****************************************/
exports.NS_AS = {
  logfile: "NS_AS.log",

  /**
   * Binding interfaces and ports to listen to. You can have multiple processes.
   */
  interfaces: [
    {
      ip: "0.0.0.0",
      port: 8081,
      ssl: true
    }
  ]
};

/********************* NS_MSG_monitor ********************************/

exports.NS_Monitor = {
  logfile: "NS_Monitor.log"
};

/********************* NS_UA_WS **************************************/

exports.NS_UA_WS = {
  logfile: "NS_UA_WS.log",

  /**
   * Binding interfaces and ports
   * [ iface, port ]
   */
  interfaces: [
    // Internal network
    {
      ip: "0.0.0.0",
      port: 8080,
      ssl: false
    }
  ],

  /**
   * Websocket configuration
   * @see https://github.com/Worlize/WebSocket-Node/blob/master/lib/WebSocketServer.js
   * Be sure to know exactly what are you changing. Short keepaliveIntervals
   * on 3G networks causes a lot of signalling and also dropping too many connections
   * because timeouts on handset status change time.
   * It's disabled because we do not want to track if we have an open connection
   * with a client. It's the client who needs to keep track of it (with a PING message)<commit_msg>By default, all security enabled<commit_after>/**
 * PUSH Notification server
 * (c) Telefonica Digital, 2012 - All rights reserved
 * License: GNU Affero V3 (see LICENSE file)
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 */

/******************* Servers to run on this machine ********************/
/**
 * Put to true what you want to run
 */
exports.servers = {
  NS_AS: true,
  NS_MSG_monitor: true,
  NS_UA_WS: true,
  NS_UA_UDP: true,
  NS_WakeUp: true
};

////////////////////////////////////////////////////////////////////////
// Common configuration parameters
////////////////////////////////////////////////////////////////////////

/********************* Constants********************************************/
exports.consts = {
  MAX_PAYLOAD_SIZE: 1024,
  PREPRODUCTION_MODE: true,
  MAX_TTL: 2592000, // 30 days, in seconds (60*60*24*30)

  /**
   * This is the Key and the Certificate of the server. Should be shared
   * between all frontends that receive connections (NS_AS, NS_UA_WS).
   * Self-signed: http://stackoverflow.com/questions/9519707/can-nodejs-generate-ssl-certificates
   */

  key: '../examples/ssl_cert/server-key.pem',
  cert: '../examples/ssl_cert/server-cert.pem',

  /**
   * Public base URL to receive notifications. This will be the base to
   * append the /notify/12345abcdef… URL
   */
  publicBaseURL: "https://localhost:8081",

  /**
   * This must be shared between all your NS_UA_WS frontends.
   * This is used to verify if the token to register a UA comes from
   * this server
   */
  cryptokey: "12345678901234567890"
};

/********************* Logger parameters ***********************************/
var loglevel = require('./common/constants.js').loglevels;
exports.logger = {
  /**
   * Log levels:
   *
   * # NONE: Log disabled
   * # DEBUG: Very detailed information about all the things the server is doing
   * # INFO: General information about the things the server is doing
   * # ERROR: Error detected, but the server can continue working
   * # ALERT: Error detected but not directly on this process, so this is a
   *          notification that should be investigated
   * # NOTIFY: General notifications, ie. New connections
   * # CRITICAL: When a CRITICAL trace is sent the process will be STOPPED
   */
  LOGLEVEL: loglevel.DEBUG | loglevel.INFO | loglevel.ERROR | loglevel.CRITICAL | loglevel.ALERT | loglevel.NOTIFY | loglevel.ALARM,
  CONSOLEOUTPUT: 1,
  BASE_PATH: "/var/log/push_server/",
  ALARM: "/var/log/push_server/alarms.log"

};

/********************* Common Queue ***********************************/
/**
 * Choose your host, port and other self-explanatory options
 */
exports.queue = [{
    host: '127.0.0.1',
    port: 5672, //AMQP default port
    login: 'guest',
    password: '<PASSWORD>'
  },
  {
    host: '127.0.0.1',
    port: 5672, //AMQP default port
    login: 'guest',
    password: '<PASSWORD>'
  },
  {
    host: '127.0.0.1',
    port: 5672, //AMQP default port
    login: 'guest',
    password: '<PASSWORD>'
  }
];

/********************* Database configuration *************************/
/**
 * If replicasetName is not set, we ONLY use the first machine, and
 * connect to a single mongo instance.
 */

//DDBB defaults to using MongoDB in a replicaset
/*exports.ddbbsettings = {
  machines: [
    ["owd-push-qa-be1", 27017],
    ["owd-push-qa-be2", 27017]
  ],
  ddbbname: "push_notification_server",
  replicasetName: "Server_Push"
};*/

//DDBB defaults to use a single MongoDB instance
exports.ddbbsettings = {
  machines: [
    ["127.0.0.1", 27017]
  ],
  ddbbname: "push_notification_server",
  replicasetName: null
};

////////////////////////////////////////////////////////////////////////
//Different configurations for the servers
////////////////////////////////////////////////////////////////////////

/********************* NS_AS *****************************************/
exports.NS_AS = {
  logfile: "NS_AS.log",

  /**
   * Binding interfaces and ports to listen to. You can have multiple processes.
   */
  interfaces: [
    {
      ip: "0.0.0.0",
      port: 8081,
      ssl: true
    }
  ]
};

/********************* NS_MSG_monitor ********************************/

exports.NS_Monitor = {
  logfile: "NS_Monitor.log"
};

/********************* NS_UA_WS **************************************/

exports.NS_UA_WS = {
  logfile: "NS_UA_WS.log",

  /**
   * Binding interfaces and ports
   * [ iface, port ]
   */
  interfaces: [
    // Internal network
    {
      ip: "0.0.0.0",
      port: 8080,
      ssl: true
    }
  ],

  /**
   * Websocket configuration
   * @see https://github.com/Worlize/WebSocket-Node/blob/master/lib/WebSocketServer.js
   * Be sure to know exactly what are you changing. Short keepaliveIntervals
   * on 3G networks causes a lot of signalling and also dropping too many connections
   * because timeouts on handset status change time.
   * It's disabled because we do not want to track if we have an open connection
   * with a client. It's the client who needs to keep track of it (with a PING message)
{'fraction_non_alphanumeric': 0.2461767626613704, 'fraction_numerical': 0.026415094339622643, 'mean_word_length': 2.629189189189189, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, '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': '5645301', 'n_tokens_mistral': 3218, 'n_tokens_neox': 2962, 'n_words': 891}