Skip to content

Commit

Permalink
Merge pull request #4172 from esl/mongooseim_tools_renamings
Browse files Browse the repository at this point in the history
Rename db and node to mongooseim
  • Loading branch information
chrzaszcz authored Nov 17, 2023
2 parents 07e5b0d + d18a4d7 commit 07c2263
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ containers:
environment:
- SQL_TEMP_DIR: /tmp/sql
- MYSQL_ROOT_PASSWORD: secret
- MYSQL_DATABASE: ejabberd
- MYSQL_USER: ejabberd
- MYSQL_DATABASE: mongooseim
- MYSQL_USER: mongooseim
- MYSQL_PASSWORD: mongooseim_secret
- OLD_ENTRYPOINT: "./entrypoint.sh mysqld"
- ENV_FILE_CFG_PATH: "/etc/mysql/conf.d/mysql.cnf"
Expand Down Expand Up @@ -80,7 +80,7 @@ containers:
environment:
- ACCEPT_EULA: Y
- SA_PASSWORD: "mongooseim_secret+ESL123"
- DB_NAME: ejabberd
- DB_NAME: mongooseim
- SCHEMA_READY_PORT: 1434
# We are not running as root in this container,
# so we can only write into some directories (in this case, /tmp)
Expand Down
12 changes: 6 additions & 6 deletions big_tests/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@
workers = 5
connection.driver = \"pgsql\"
connection.host = \"localhost\"
connection.database = \"ejabberd\"
connection.username = \"ejabberd\"
connection.database = \"mongooseim\"
connection.username = \"mongooseim\"
connection.password = \"mongooseim_secret\"
connection.tls.required = true
connection.tls.cacertfile = \"priv/ssl/cacert.pem\"
Expand All @@ -279,8 +279,8 @@
workers = 5
connection.driver = \"pgsql\"
connection.host = \"localhost\"
connection.database = \"ejabberd\"
connection.username = \"ejabberd\"
connection.database = \"mongooseim\"
connection.username = \"mongooseim\"
connection.password = \"mongooseim_secret\"
connection.tls.required = true
connection.tls.cacertfile = \"priv/ssl/cacert.pem\"
Expand Down Expand Up @@ -321,8 +321,8 @@
workers = 5
connection.driver = \"mysql\"
connection.host = \"localhost\"
connection.database = \"ejabberd\"
connection.username = \"ejabberd\"
connection.database = \"mongooseim\"
connection.username = \"mongooseim\"
connection.password = \"mongooseim_secret\"
connection.tls.cacertfile = \"priv/ssl/cacert.pem\"
connection.tls.versions = [\"tlsv1.2\", \"tlsv1.3\"]"},
Expand Down
5 changes: 5 additions & 0 deletions doc/developers-guide/Testing-MongooseIM.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ cd $MONGOOSEIM
make devrel
```

If databases are needed, for example PostgreSQL, you can run:
```sh
DB="pgsql" ./tools/setup-db.sh
```

In shell #2:

```sh
Expand Down
2 changes: 1 addition & 1 deletion doc/operation-and-maintenance/MongooseIM-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Metrics specific to an extension, e.g. Message Archive Management, are described
| `[global, nodeUpTime]` | value | Node uptime. |
| `[global, clusterSize]` | value | A number of nodes in a MongooseIM cluster seen by a given MongooseIM node (based on Mnesia). For CETS use `global.cets.system.joined_nodes` instead. |
| `[global, tcpPortsUsed]` | value | A number of open tcp connections. This should relate to the number of connected sessions and databases, as well as federations and http requests, in order to detect connection leaks. |
| `[global, processQueueLengths]` | probe | The number of queued messages in the internal message queue of every erlang process, and the internal queue of every fsm (ejabberd\_c2s). This is sampled every 30 seconds asynchronously. It is a good indicator of an overloaded system: if too many messages are queued at the same time, the system is not able to process the data at the rate it was designed for. |
| `[global, processQueueLengths]` | probe | The number of queued messages in the internal message queue of every erlang process, and the internal queue of every fsm (ejabberd\_s2s). This is sampled every 30 seconds asynchronously. It is a good indicator of an overloaded system: if too many messages are queued at the same time, the system is not able to process the data at the rate it was designed for. |

### Data metrics

Expand Down
2 changes: 1 addition & 1 deletion rel/files/cets_disco.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mongooseim@localhost
ejabberd2@localhost
mongooseim2@localhost
mongooseim3@localhost
8 changes: 4 additions & 4 deletions test/common/config_parser_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ options("mongooseim-pgsql") ->
fun pool_config/1,
[#{type => rdbms,
opts => #{workers => 5},
conn_opts => #{driver => pgsql, host => "localhost", port => 5432, database => "ejabberd",
username => "ejabberd", password => "mongooseim_secret",
conn_opts => #{driver => pgsql, host => "localhost", port => 5432, database => "mongooseim",
username => "mongooseim", password => "mongooseim_secret",
tls => #{required => true,
cacertfile => "priv/ca.pem",
server_name_indication => #{enabled => false}}
Expand Down Expand Up @@ -347,8 +347,8 @@ options("outgoing_pools") ->
#{type => rdbms,
opts => #{workers => 5},
conn_opts => #{query_timeout => 5000, keepalive_interval => 30,
driver => pgsql, host => "localhost", port => 5432, database => "ejabberd",
username => "ejabberd", password => "mongooseim_secret",
driver => pgsql, host => "localhost", port => 5432, database => "mongooseim",
username => "mongooseim", password => "mongooseim_secret",
tls => #{required => true,
cacertfile => "priv/ca.pem",
server_name_indication => #{enabled => false}}
Expand Down
4 changes: 2 additions & 2 deletions test/config_parser_SUITE_data/mongooseim-pgsql.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
[outgoing_pools.rdbms.default.connection]
driver = "pgsql"
host = "localhost"
database = "ejabberd"
username = "ejabberd"
database = "mongooseim"
username = "mongooseim"
password = "mongooseim_secret"
tls.required = true
tls.cacertfile = "priv/ca.pem"
Expand Down
4 changes: 2 additions & 2 deletions test/config_parser_SUITE_data/outgoing_pools.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
[outgoing_pools.rdbms.default.connection]
driver = "pgsql"
host = "localhost"
database = "ejabberd"
username = "ejabberd"
database = "mongooseim"
username = "mongooseim"
password = "mongooseim_secret"
keepalive_interval = 30
tls.required = true
Expand Down
6 changes: 3 additions & 3 deletions tools/docker-setup-postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cp ${SQL_TEMP_DIR}/pg_hba.conf ${PGSQLDIR}/.
cp ${SQL_TEMP_DIR}/pg.sql ${PGSQLDIR}/.

# Configuring postgres
psql -U postgres -c "CREATE ROLE ejabberd PASSWORD 'mongooseim_secret' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"
psql -U postgres -c "CREATE DATABASE ejabberd;"
psql -U postgres -c "CREATE ROLE mongooseim PASSWORD 'mongooseim_secret' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"
psql -U postgres -c "CREATE DATABASE mongooseim;"
# Creating schema
psql -U postgres -q -d ejabberd -f ${PGSQLDIR}/pg.sql
psql -U postgres -q -d mongooseim -f ${PGSQLDIR}/pg.sql
2 changes: 1 addition & 1 deletion tools/install_odbc_ini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Setup = $ODBC_SETUP
Driver = $ODBC_DRIVER
Server = 127.0.0.1
Port = $MSSQL_PORT
Database = ejabberd
Database = mongooseim
Username = sa
Password = mongooseim_secret+ESL123
Charset = UTF-8
Expand Down
8 changes: 4 additions & 4 deletions tools/open-test-database-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ db=$1

case $db in
mysql)
$DOCKER exec -e MYSQL_PWD=secret -it mongooseim-mysql mysql -h localhost -u root -D ejabberd
$DOCKER exec -e MYSQL_PWD=secret -it mongooseim-mysql mysql -h localhost -u root -D mongooseim
;;
pgsql)
$DOCKER exec -e PGPASSWORD=password -it mongooseim-pgsql psql -U postgres -d ejabberd -h 127.0.0.1
$DOCKER exec -e PGPASSWORD=password -it mongooseim-pgsql psql -U postgres -d mongooseim -h 127.0.0.1
;;
mssql-sqlcmd)
$DOCKER exec -it mongooseim-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P mongooseim_secret+ESL123 -d ejabberd
$DOCKER exec -it mongooseim-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P mongooseim_secret+ESL123 -d mongooseim
;;
mssql)
$DOCKER run --link mongooseim-mssql -it --rm shellmaster/sql-cli mssql --server mongooseim-mssql --user sa --pass mongooseim_secret+ESL123 --database ejabberd
$DOCKER run --link mongooseim-mssql -it --rm shellmaster/sql-cli mssql --server mongooseim-mssql --user sa --pass mongooseim_secret+ESL123 --database mongooseim
;;
*)
echo "Unknown argument $db"
Expand Down
6 changes: 3 additions & 3 deletions tools/setup-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function setup_db(){
-p $MYSQL_PORT:3306 \
-e SQL_TEMP_DIR=/tmp/sql \
-e MYSQL_ROOT_PASSWORD=secret \
-e MYSQL_DATABASE=ejabberd \
-e MYSQL_USER=ejabberd \
-e MYSQL_DATABASE=mongooseim \
-e MYSQL_USER=mongooseim \
-e MYSQL_PASSWORD=mongooseim_secret \
-e OLD_ENTRYPOINT="./entrypoint.sh mysqld" \
-e ENV_FILE_CFG_PATH="/etc/mysql/conf.d/mysql.cnf" \
Expand Down Expand Up @@ -240,7 +240,7 @@ function setup_db(){
--user root \
-e "ACCEPT_EULA=Y" \
-e "SA_PASSWORD=mongooseim_secret+ESL123" \
-e "DB_NAME=ejabberd" \
-e "DB_NAME=mongooseim" \
-e "SQL_FILE=/tmp/mongoose.sql" \
-e SCHEMA_READY_PORT=1434 \
-e SQL_FILE="/tmp/mongoose.sql" \
Expand Down
10 changes: 5 additions & 5 deletions tools/ssl/openssl-mongooseim.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ DNS.1 = localhost

##adding node names to let tls distribution with OTP 20.3
DNS.2 = mongooseim@localhost
DNS.3 = ejabberd2@localhost
DNS.4 = fed1@localhost
DNS.5 = reg1@localhost
DNS.6 = mongooseim3@localhost
DNS.3 = mongooseim2@localhost
DNS.4 = mongooseim3@localhost
DNS.5 = fed1@localhost
DNS.6 = reg1@localhost

IP = 127.0.0.1
IP = 127.0.0.1

0 comments on commit 07c2263

Please sign in to comment.