diff --git a/apier/v2/apierv2_it_test.go b/apier/v2/apierv2_it_test.go index 8a6d2c765..82d19b175 100644 --- a/apier/v2/apierv2_it_test.go +++ b/apier/v2/apierv2_it_test.go @@ -47,7 +47,7 @@ var dataDB engine.DataDB // share db connection here so we can check data we set func TestApierV2itLoadConfig(t *testing.T) { apierCfgPath = path.Join(*dataDir, "conf", "samples", "tutmysql") - if apierCfg, err = config.NewCGRConfigFromFolder(tpCfgPath); err != nil { + if apierCfg, err = config.NewCGRConfigFromFolder(apierCfgPath); err != nil { t.Error(err) } } diff --git a/apier/v2/cdrs_it_test.go b/apier/v2/cdrs_it_test.go index 882909f85..b8374ed54 100644 --- a/apier/v2/cdrs_it_test.go +++ b/apier/v2/cdrs_it_test.go @@ -56,7 +56,6 @@ var sTestsCDRsIT = []func(t *testing.T){ } // Tests starting here - func TestCDRsITMySQL(t *testing.T) { cdrsConfDIR = "cdrsv2mysql" for _, stest := range sTestsCDRsIT { diff --git a/config/config_defaults.go b/config/config_defaults.go index 3c3dcad2c..3e786817c 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -88,7 +88,7 @@ const CGRATES_CFG_JSON = ` "db_host": "127.0.0.1", // data_db host address "db_port": 6379, // data_db port to reach the database "db_name": "10", // data_db database name to connect to - "db_user": "", // username to use when connecting to data_db + "db_user": "cgrates", // username to use when connecting to data_db "db_password": "", // password to use when connecting to data_db "load_history_size": 10, // Number of records in the load history }, @@ -100,7 +100,7 @@ const CGRATES_CFG_JSON = ` "db_port": 3306, // the port to reach the stordb "db_name": "cgrates", // stor database name "db_user": "cgrates", // username to use when connecting to stordb - "db_password": "CGRateS.org", // password to use when connecting to stordb + "db_password": "", // password to use when connecting to stordb "max_open_conns": 100, // maximum database connections opened "max_idle_conns": 10, // maximum database connections idle "cdrs_indexes": [], // indexes on cdrs table to speed up queries, used only in case of mongo diff --git a/config/config_json_test.go b/config/config_json_test.go index 06087de28..c1b11f73d 100644 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -123,7 +123,7 @@ func TestDfDbJsonCfg(t *testing.T) { Db_host: utils.StringPointer("127.0.0.1"), Db_port: utils.IntPointer(6379), Db_name: utils.StringPointer("10"), - Db_user: utils.StringPointer(""), + Db_user: utils.StringPointer("cgrates"), Db_password: utils.StringPointer(""), Load_history_size: utils.IntPointer(10), } @@ -138,7 +138,7 @@ func TestDfDbJsonCfg(t *testing.T) { Db_port: utils.IntPointer(3306), Db_name: utils.StringPointer("cgrates"), Db_user: utils.StringPointer("cgrates"), - Db_password: utils.StringPointer("CGRateS.org"), + Db_password: utils.StringPointer(""), Max_open_conns: utils.IntPointer(100), Max_idle_conns: utils.IntPointer(10), Cdrs_indexes: utils.StringSlicePointer([]string{}), diff --git a/config/config_test.go b/config/config_test.go index c2b425450..734cc8cac 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -220,7 +220,7 @@ func TestCgrCfgJSONDefaultsjsnDataDb(t *testing.T) { if cgrCfg.DataDbName != "10" { t.Error(cgrCfg.DataDbName) } - if cgrCfg.DataDbUser != "" { + if cgrCfg.DataDbUser != "cgrates" { t.Error(cgrCfg.DataDbUser) } if cgrCfg.DataDbPass != "" { @@ -247,7 +247,7 @@ func TestCgrCfgJSONDefaultsStorDB(t *testing.T) { if cgrCfg.StorDBUser != "cgrates" { t.Error(cgrCfg.StorDBUser) } - if cgrCfg.StorDBPass != "CGRateS.org" { + if cgrCfg.StorDBPass != "" { t.Error(cgrCfg.StorDBPass) } if cgrCfg.StorDBMaxOpenConns != 100 { diff --git a/data/conf/samples/actions/cgradmin.json b/data/conf/samples/actions/cgradmin.json index be8988523..65d0c457a 100644 --- a/data/conf/samples/actions/cgradmin.json +++ b/data/conf/samples/actions/cgradmin.json @@ -14,6 +14,12 @@ "http": ":2080", // HTTP listening address }, + +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + + "rals": { "enabled": true, // enable Rater service: "pubsubs_conns": [ diff --git a/data/conf/samples/apier/apier.json b/data/conf/samples/apier/apier.json index 51b00893c..67ebd1bdc 100644 --- a/data/conf/samples/apier/apier.json +++ b/data/conf/samples/apier/apier.json @@ -29,10 +29,16 @@ "listen": { "rpc_json": ":2012", // RPC JSON listening address - "rpc_gob": ":2013", // RPC GOB listening address + "rpc_gob": ":2013", // RPC GOB listening address "http": ":2080", // HTTP listening address }, + +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + + "rals": { "enabled": true, // enable Rater service: "aliases_conns": [ diff --git a/data/conf/samples/cdrc_partcsv/cgrates.json b/data/conf/samples/cdrc_partcsv/cgrates.json index 7fadf3380..c9d9bf844 100644 --- a/data/conf/samples/cdrc_partcsv/cgrates.json +++ b/data/conf/samples/cdrc_partcsv/cgrates.json @@ -6,6 +6,9 @@ // This file contains the default configuration hardcoded into CGRateS. // This is what you get when you load CGRateS with an empty configuration file. +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, "rals": { "enabled": true // so we can query CDRs diff --git a/data/conf/samples/cdrccsv/cgrates.json b/data/conf/samples/cdrccsv/cgrates.json index 06768551f..90ce02fe1 100644 --- a/data/conf/samples/cdrccsv/cgrates.json +++ b/data/conf/samples/cdrccsv/cgrates.json @@ -7,6 +7,10 @@ // This is what you get when you load CGRateS with an empty configuration file. +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true // so we can query CDRs }, diff --git a/data/conf/samples/cdrcflatstore/cgrates.json b/data/conf/samples/cdrcflatstore/cgrates.json index 5b637fa20..dd2b5f102 100644 --- a/data/conf/samples/cdrcflatstore/cgrates.json +++ b/data/conf/samples/cdrcflatstore/cgrates.json @@ -11,6 +11,10 @@ "enabled": true, // enable Rater service: }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "scheduler": { "enabled": true, // start Scheduler service: diff --git a/data/conf/samples/cdrcfwv/cgrates.json b/data/conf/samples/cdrcfwv/cgrates.json index 6a3a3f3ab..0ffba3f6c 100644 --- a/data/conf/samples/cdrcfwv/cgrates.json +++ b/data/conf/samples/cdrcfwv/cgrates.json @@ -7,6 +7,10 @@ // This is what you get when you load CGRateS with an empty configuration file. +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/cdrcxml/cgrates.json b/data/conf/samples/cdrcxml/cgrates.json index 4723b19c6..4e73feb18 100644 --- a/data/conf/samples/cdrcxml/cgrates.json +++ b/data/conf/samples/cdrcxml/cgrates.json @@ -3,6 +3,9 @@ // Real-time Charging System for Telecom & ISP environments // Copyright (C) ITsysCOM GmbH +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, "rals": { "enabled": true diff --git a/data/conf/samples/cdrsonexpmaster/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster/cdrsreplicationmaster.json index f6a0267c0..c0a505cdf 100644 --- a/data/conf/samples/cdrsonexpmaster/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster/cdrsreplicationmaster.json @@ -9,6 +9,12 @@ "poster_attempts": 1, }, + +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/cdrsonexpslave/cdrsreplicationslave.json b/data/conf/samples/cdrsonexpslave/cdrsreplicationslave.json index a9d04ca13..5e1b777c8 100644 --- a/data/conf/samples/cdrsonexpslave/cdrsreplicationslave.json +++ b/data/conf/samples/cdrsonexpslave/cdrsreplicationslave.json @@ -10,6 +10,10 @@ "http": "127.0.0.1:12080", // HTTP listening address }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/cdrstats/cdrstats.json b/data/conf/samples/cdrstats/cdrstats.json index fc4d074b0..6833451eb 100644 --- a/data/conf/samples/cdrstats/cdrstats.json +++ b/data/conf/samples/cdrstats/cdrstats.json @@ -10,6 +10,10 @@ "http": ":2080", }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, "cdrstats_conns": [ diff --git a/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json b/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json index 96f37ecf6..55c24bcbd 100644 --- a/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json +++ b/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json @@ -9,6 +9,11 @@ }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/cdrsv2psql/cdrsv2psql.json b/data/conf/samples/cdrsv2psql/cdrsv2psql.json index 0a715bc07..7a5a303ee 100644 --- a/data/conf/samples/cdrsv2psql/cdrsv2psql.json +++ b/data/conf/samples/cdrsv2psql/cdrsv2psql.json @@ -7,6 +7,7 @@ "stor_db": { "db_type": "postgres", // stor database type to use: "db_port": 5432, // the port to reach the stordb + "db_password": "CGRateS.org" }, diff --git a/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json b/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json index d9e52f393..447fd3f19 100644 --- a/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json +++ b/data/conf/samples/multiplecdrc/multiplecdrc_fwexport.json @@ -4,6 +4,10 @@ // Used in mediator_local_test // Starts rater, cdrs and mediator connecting over internal channel +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/multiral1/cgrates.json b/data/conf/samples/multiral1/cgrates.json index db96253dc..140eee26f 100644 --- a/data/conf/samples/multiral1/cgrates.json +++ b/data/conf/samples/multiral1/cgrates.json @@ -10,6 +10,10 @@ "http": ":2080", // HTTP listening address }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/multiral2/cgrates.json b/data/conf/samples/multiral2/cgrates.json index 0c64ac821..c70a5ebeb 100644 --- a/data/conf/samples/multiral2/cgrates.json +++ b/data/conf/samples/multiral2/cgrates.json @@ -10,6 +10,10 @@ "http": ":12080", }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, }, diff --git a/data/conf/samples/smg/cgrates.json b/data/conf/samples/smg/cgrates.json index 211fc624c..0c310c98b 100644 --- a/data/conf/samples/smg/cgrates.json +++ b/data/conf/samples/smg/cgrates.json @@ -14,6 +14,10 @@ "http": ":2080", // HTTP listening address }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/smg_automatic_debits/cgrates.json b/data/conf/samples/smg_automatic_debits/cgrates.json index 720c2d26b..afad6a73d 100644 --- a/data/conf/samples/smg_automatic_debits/cgrates.json +++ b/data/conf/samples/smg_automatic_debits/cgrates.json @@ -7,6 +7,10 @@ "log_level": 7, }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/smgeneric/cgrates.json b/data/conf/samples/smgeneric/cgrates.json index 774102977..47fcff1cb 100644 --- a/data/conf/samples/smgeneric/cgrates.json +++ b/data/conf/samples/smgeneric/cgrates.json @@ -12,6 +12,13 @@ "http": "0.0.0.0:3080", // HTTP listening address }, + +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + + + "cache":{ "destinations": {"limit": 10000, "ttl":"0s", "precache": true}, "reverse_destinations": {"limit": 10000, "ttl":"0s", "precache": true}, diff --git a/data/conf/samples/smgreplcmaster/cgrates.json b/data/conf/samples/smgreplcmaster/cgrates.json index b16c257f6..c5d4e5fff 100644 --- a/data/conf/samples/smgreplcmaster/cgrates.json +++ b/data/conf/samples/smgreplcmaster/cgrates.json @@ -11,6 +11,10 @@ "http": "127.0.0.1:2080", }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, }, diff --git a/data/conf/samples/smgreplcslave/cgrates.json b/data/conf/samples/smgreplcslave/cgrates.json index 086cd6ca4..ea06655b1 100644 --- a/data/conf/samples/smgreplcslave/cgrates.json +++ b/data/conf/samples/smgreplcslave/cgrates.json @@ -9,6 +9,10 @@ "http": "127.0.0.1:22080", // HTTP listening address }, +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + "rals": { "enabled": true, // enable Rater service: }, diff --git a/data/conf/samples/storage/mysql/cgrates.json b/data/conf/samples/storage/mysql/cgrates.json index fd8b92330..d260ed9ef 100644 --- a/data/conf/samples/storage/mysql/cgrates.json +++ b/data/conf/samples/storage/mysql/cgrates.json @@ -7,7 +7,7 @@ "db_port": 3306, // the port to reach the stordb "db_name": "cgrates", // stor database name "db_user": "cgrates", // username to use when connecting to stordb - "db_passwd": "CGRateS.org", // password to use when connecting to stordb + "db_password": "CGRateS.org", // password to use when connecting to stordb }, } diff --git a/data/conf/samples/storage/postgres/cgrates.json b/data/conf/samples/storage/postgres/cgrates.json index d1d700a9d..7c582d02b 100644 --- a/data/conf/samples/storage/postgres/cgrates.json +++ b/data/conf/samples/storage/postgres/cgrates.json @@ -7,7 +7,7 @@ "db_port": 5432, // the port to reach the stordb "db_name": "cgrates", // stor database name "db_user": "cgrates", // username to use when connecting to stordb - "db_passwd": "CGRateS.org", // password to use when connecting to stordb + "db_password": "CGRateS.org", // password to use when connecting to stordb }, } diff --git a/data/conf/samples/tutmysql/cgrates.json b/data/conf/samples/tutmysql/cgrates.json index f53cdc0a0..a55174f79 100644 --- a/data/conf/samples/tutmysql/cgrates.json +++ b/data/conf/samples/tutmysql/cgrates.json @@ -14,6 +14,12 @@ "http": ":2080", }, + +"stor_db": { // database used to store offline tariff plans and CDRs + "db_password": "CGRateS.org", // password to use when connecting to stordb +}, + + "cache":{ "destinations": {"limit": 10000, "ttl":"0s", "precache": true}, "reverse_destinations": {"limit": 10000, "ttl":"0s", "precache": true}, diff --git a/data/conf/samples/tutpostgres/cgrates.json b/data/conf/samples/tutpostgres/cgrates.json index e8b24ddd3..26584eccd 100644 --- a/data/conf/samples/tutpostgres/cgrates.json +++ b/data/conf/samples/tutpostgres/cgrates.json @@ -13,6 +13,7 @@ "stor_db": { "db_type": "postgres", // stor database type to use: "db_port": 5432, // the port to reach the stordb + "db_password": "CGRateS.org", }, "rals": { diff --git a/engine/loader_it_test.go b/engine/loader_it_test.go index 1aaf2f582..64ea72254 100644 --- a/engine/loader_it_test.go +++ b/engine/loader_it_test.go @@ -39,6 +39,7 @@ var tpCsvScenario = flag.String("tp_scenario", "testtp", "Use this scenario fold // Will use 3 different datadbs in order to be able to see differences in data loaded func TestLoaderITConnDataDbs(t *testing.T) { lCfg, _ = config.NewDefaultCGRConfig() + lCfg.StorDBPass = "CGRateS.org" var err error if dataDbCsv, err = ConfigureDataStorage(lCfg.DataDbType, lCfg.DataDbHost, lCfg.DataDbPort, "7", lCfg.DataDbUser, lCfg.DataDbPass, lCfg.DBDataEncoding, nil, 1); err != nil {