hola-server 0.7.9 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/bash.js CHANGED
@@ -11,7 +11,7 @@ const LOG_BASH = "bash";
11
11
  */
12
12
  const run_script = async (host, script) => {
13
13
  return new Promise((resolve) => {
14
- exec(`sshpass -p '${host.pwd}' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${host.port} ${host.user}@${host.ip} /bin/bash <<'EOT' \n ${script} \nEOT\n`, { maxBuffer: 1024 * 150000 }, (error, stdout) => {
14
+ exec(`ssh -i ${host.private} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${host.port} ${host.user}@${host.ip} /bin/bash <<'EOT' \n ${script} \nEOT\n`, { maxBuffer: 1024 * 150000 }, (error, stdout) => {
15
15
  if (error) {
16
16
  if (is_log_error()) {
17
17
  log_error(LOG_BASH, "error running on host:" + host.name + " the script:" + script + ",error:" + error);
@@ -29,7 +29,7 @@ const run_script = async (host, script) => {
29
29
 
30
30
  const run_script_file = async (host, script_file) => {
31
31
  return new Promise((resolve) => {
32
- exec(`sshpass -p '${host.pwd}' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${host.port} ${host.user}@${host.ip} /bin/bash < ${script_file}`, (error, stdout) => {
32
+ exec(`ssh -i ${host.private} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${host.port} ${host.user}@${host.ip} /bin/bash < ${script_file}`, (error, stdout) => {
33
33
  if (error) {
34
34
  if (is_log_error()) {
35
35
  log_error(LOG_BASH, "error running on host:" + host.name + " the script_file:" + script_file + ",error:" + error);
@@ -77,7 +77,7 @@ const run_local_cmd = async (cmd, log_extra) => {
77
77
  */
78
78
  const scp = async (host, remote_file, local_file) => {
79
79
  return new Promise((resolve) => {
80
- exec(`sshpass -p '${host.pwd}' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P ${host.port} -q ${host.user}@${host.ip}:${remote_file} ${local_file}`, (error, stdout) => {
80
+ exec(`scp -C -i ${host.private} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P ${host.port} -q ${host.user}@${host.ip}:${remote_file} ${local_file}`, (error, stdout) => {
81
81
  if (error) {
82
82
  if (is_log_error()) {
83
83
  log_error(LOG_BASH, "error scp on host:" + host.name + " remote:" + remote_file + ",local:" + local_file + ",error:" + error);
package/db/db.js CHANGED
@@ -131,12 +131,12 @@ const bulk_update = async (col, items, attrs) => {
131
131
  };
132
132
 
133
133
  class DB {
134
- constructor(url, poolSize, callback) {
134
+ constructor(url, options, callback) {
135
135
  if (!url) {
136
136
  return;
137
137
  }
138
138
 
139
- this.db = mongoist(url, { autoReconnect: true, poolSize: poolSize });
139
+ this.db = mongoist(url, options);
140
140
 
141
141
  this.db.on("error", function (err) {
142
142
  if (is_log_error()) {
@@ -368,7 +368,7 @@ const get_db = (callback) => {
368
368
  } else {
369
369
  const mongo = get_settings().mongo;
370
370
 
371
- db_instance = new DB(mongo.url, mongo.pool, callback);
371
+ db_instance = new DB(mongo.url, mongo.options, callback);
372
372
  return db_instance;
373
373
  }
374
374
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hola-server",
3
- "version": "0.7.9",
3
+ "version": "0.8.2",
4
4
  "description": "a meta programming framework used to build nodejs restful api",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -43,4 +43,4 @@
43
43
  "url": "https://github.com/hery-node/hola-server/issues"
44
44
  },
45
45
  "homepage": "https://github.com/hery-node/hola-server#readme"
46
- }
46
+ }