Ubicall / ubicall-web-service

exposed ubicall web service for public and internal use , to make CRUD operations on calls , feedback , agent and queues tables
https://api.ubicall.com
GNU General Public License v2.0
2 stars 2 forks source link

ubicall.js : main ubicall configuration file , contain such critiacl info #4

Closed waleedsamy closed 9 years ago

waleedsamy commented 9 years ago

save this code as ~/.conf/ubicall.js

var fs = require('fs');

var DEFAULT_SECRET_KEY = "super-secret-key"

// will sign with ~/.conf/agent/ssl/ubicall.com.key otherwise  super-secret-key
function getSecret() {
  var secret = DEFAULT_SECRET_KEY;
  var pem = process.env.HOME + '/.conf/agent/ssl/ubicall.com.key';
  if (fs.existsSync(pem)) {
    secretFile = fs.readFileSync(pem, 'utf8');
    var lines = secretFile.split("\n");
    if (lines.length <= 0) {
      return secret;
    } else {
      return lines[1];
    }
  } else {
    return secret;
  }
}

module.exports = {
  auth: {
      secret: getSecret()
  },
  storage: {
    //TODO in production replce db hosts with internal ip
    mysql: {
      ubicall: {
        database: 'ubicall',
        username: 'ubiuser',
        password: 'UbIPaWd15dB@1',
        host: "23.253.158.160",
        internalHost:"10.176.192.120"
      },
      ast_rt: {
        database: 'ast_rt',
        username: 'ubiuser',
        password: 'UbIPaWd15dB@1',
        host: "23.253.158.160",
        internalHost:"10.176.192.120"
      },
      webservice: {
        database: 'ubicall',
        username: 'ubiuser',
        password: 'UbIPaWd15dB@1',
        host: "23.253.158.160",
        internalHost:"10.176.192.120"
      },
      WEB_FS_DB: {
        database: 'WEB_FS_DB',
        username: 'root',
        password: 'root',
        host: "10.0.0.170",
        //username: 'ubiuser',
        //password: 'UbIPaWd15dB@1',
        //host: "104.239.164.247",
        //internalHost:"10.209.68.186"
      }
    }
  },
  cache: {
    redis: {
      host:"127.0.0.1",
      port:"6379",
      username: 'XXXXX',
      password: 'XXXXX'
    }
  },
  infra: {
    agentServer: {
      ip: '104.239.164.247',
      port: '8021',
      password: 'UbiFS2015esl'
    },
    clientServer: {
      mobile :{
        public : "104.239.166.30",
        internal: "10.209.96.174"
      },
      web :{
        public : "162.242.253.195",
        internal: "10.208.201.195",
        // used in POST : https://api.ubicall.com/v1/webAccount
        dialString : '\${rtmp_contact(default/\${dialed_user}@162.242.253.195)}'
      }
    },
  },
  defaultPlistHost : 'https://designer.ubicall.com/plist/',
  endPoints : {
    // https://platform.ubicall.com/api/widget/{License}/{0,1}{version}
    // -H "plisturl : {0,1}{https://designer.ubicall.com/plist}
    widgetDeploy : "https://platform.ubicall.com/api/widget/"
  }
}
hagry commented 9 years ago
waleedsamy commented 9 years ago

after @sandrepo updates

file content will be like

{
    "storage": {
        "mysql": {
            "ubicall_db": {
                "database": "ubicall",
                "username": "ubiuser",
                "password": "UbIPaWd15dB@1",
                "external_ip": "23.253.158.160",
                "external_port": 3306,
                "internal_ip": "10.176.192.120",
                "internal_port": 3306
            },
            "ast_rt": {
                "database": "ast_rt",
                "username": "ubiuser",
                "password": "UbIPaWd15dB@1",
                "external_ip": "23.253.158.160",
                "internal_ip": "10.176.192.120",
                "external_port": 3306,
                "internal_port": 3306
            },
            "WEB_FS_DB": {
                "database": "WEB_FS_DB",
                "username": "ubiuser",
                "password": "UbIPaWd15dB@1",
                "external_ip": "104.239.164.247",
                "internal_ip": "10.209.68.186",
                "external_port": 3306,
                "internal_port": 3306
            }
        }
    },
    "cache": {
        "redis": {
            "username": "XXXXX",
            "password": "XXXXX",
            "internal_ip": "127.0.0.1",
            "internal_port": "6379"
        }
    },
    "voice_infra": {
        "agent_voice_server": {
            "internal_ip": "104.239.164.247",
            "internal_port": "8021",
            "password": "UbiFS2015esl",
            "_comment": "FREESWITCH Server"
        },
        "client_voice_server": {
            "mobile_voice_server": {
                "external_ip": "104.239.166.30",
                "external_port": 5060,
                "internal_ip": "10.209.96.174",
                "internal_port": 5060,
                "_comment": "ASTERISK Server"
            },
            "web_voice_server": {
                "external_ip": "162.242.253.195",
                "external_port": 5080,
                "internal_ip": "10.208.201.195",
                "internal_port": 5080,
                "_comment": "FREESWITCH Server"
            }
        }
    },
    "defaultPlistHost": "https://designer.ubicall.com/plist/",
    "endPoints": {
        "widgetDeploy": "https://platform.ubicall.com/api/widget/",
        "_comment_widgetDeploy": "check documentation"
    }
}
hagry commented 9 years ago

files updated

waleedsamy commented 9 years ago

This issue was moved to Ubicall/ubicall-conf#1