badmfck-api-server 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,11 +23,13 @@ class MysqlService extends BaseService_1.BaseService {
23
23
  super("mysql");
24
24
  this.options = options;
25
25
  if (this.options.host.startsWith("_"))
26
- this.options.host = decrypt(this.options.host) ?? this.options.host;
26
+ this.options.host = decrypt(this.options.host.substring(1)) ?? this.options.host;
27
27
  if (this.options.user.startsWith("_"))
28
- this.options.user = decrypt(this.options.user) ?? this.options.user;
28
+ this.options.user = decrypt(this.options.user.substring(1)) ?? this.options.user;
29
29
  if (this.options.database.startsWith("_"))
30
- this.options.database = decrypt(this.options.database) ?? this.options.database;
30
+ this.options.database = decrypt(this.options.database.substring(1)) ?? this.options.database;
31
+ if (this.options.password.startsWith("_"))
32
+ this.options.password = decrypt(this.options.password.substring(1)) ?? this.options.password;
31
33
  }
32
34
  static async executeQuery(query) { return await exports.REQ_MYSQL_QUERY.request(query); }
33
35
  async init() {
@@ -46,7 +48,7 @@ class MysqlService extends BaseService_1.BaseService {
46
48
  }
47
49
  async recreatePool() {
48
50
  if (this.options.onLog)
49
- this.options.onLog(2, "Mysql server trying to create pool");
51
+ this.options.onLog(1, "Mysql server trying to create pool");
50
52
  this.serviceStarted = false;
51
53
  const ok = await this.createPool();
52
54
  if (!ok) {
@@ -254,7 +256,7 @@ class MysqlService extends BaseService_1.BaseService {
254
256
  }
255
257
  async createPool() {
256
258
  if (this.options.onLog)
257
- this.options.onLog(1, "Connecting to mysql: \n HOST: " + this.options.host + '\n USER:' + this.options.user + '\n PORT:' + this.options.port);
259
+ this.options.onLog(1, "Connecting to mysql: \n HOST: " + this.options.host + '\n PORT:' + this.options.port);
258
260
  let err = false;
259
261
  if (this.pool) {
260
262
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",