@whyour/qinglong 0.20.2 → 0.20.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "0.20.2",
3
+ "version": "0.20.4",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
package/shell/share.sh CHANGED
@@ -6,7 +6,7 @@ dir_tmp=$dir_root/.tmp
6
6
  dir_data=$dir_root/data
7
7
 
8
8
  if [[ $QL_DATA_DIR ]]; then
9
- dir_data=$QL_DATA_DIR
9
+ dir_data="${QL_DATA_DIR%/}"
10
10
  fi
11
11
 
12
12
  dir_shell=$dir_root/shell
@@ -376,25 +376,25 @@ patch_version() {
376
376
 
377
377
  if [[ -d "$dir_root/db" ]]; then
378
378
  echo -e "检测到旧的db目录,拷贝到data目录...\n"
379
- cp -rf $dir_root/config $dir_root/data
379
+ cp -rf $dir_root/config $dir_data
380
380
  echo
381
381
  fi
382
382
 
383
383
  if [[ -d "$dir_root/scripts" ]]; then
384
384
  echo -e "检测到旧的scripts目录,拷贝到data目录...\n"
385
- cp -rf $dir_root/scripts $dir_root/data
385
+ cp -rf $dir_root/scripts $dir_data
386
386
  echo
387
387
  fi
388
388
 
389
389
  if [[ -d "$dir_root/log" ]]; then
390
390
  echo -e "检测到旧的log目录,拷贝到data目录...\n"
391
- cp -rf $dir_root/log $dir_root/data
391
+ cp -rf $dir_root/log $dir_data
392
392
  echo
393
393
  fi
394
394
 
395
395
  if [[ -d "$dir_root/config" ]]; then
396
396
  echo -e "检测到旧的config目录,拷贝到data目录...\n"
397
- cp -rf $dir_root/config $dir_root/data
397
+ cp -rf $dir_root/config $dir_data
398
398
  echo
399
399
  fi
400
400
  }
package/shell/start.sh CHANGED
@@ -47,10 +47,10 @@ if [[ $os_name == 'alpine' ]]; then
47
47
  netcat-openbsd
48
48
  elif [[ $os_name == 'debian' ]] || [[ $os_name == 'ubuntu' ]]; then
49
49
  apt update
50
- apt install -y git curl wget tzdata perl openssl jq nginx procps netcat openssh-client
50
+ apt install -y git curl wget tzdata perl openssl jq nginx procps netcat-openbsd openssh-client
51
51
  elif [[ $os_name == 'centos' ]]; then
52
52
  yum update
53
- yum install -y epel-release git curl wget tzdata perl openssl jq nginx procps netcat openssh-client
53
+ yum install -y epel-release git curl wget tzdata perl openssl jq nginx procps nc openssh-client
54
54
  else
55
55
  echo -e "暂不支持此系统部署 $os_name"
56
56
  exit 1
@@ -97,4 +97,4 @@ fi
97
97
 
98
98
  echo -e "############################################################\n"
99
99
  echo -e "启动完成..."
100
- echo -e "############################################################\n"
100
+ echo -e "############################################################\n"
package/shell/update.sh CHANGED
@@ -242,8 +242,8 @@ reload_qinglong() {
242
242
  fi
243
243
 
244
244
  if [[ "$reload_target" == 'data' ]]; then
245
- rm -rf ${dir_root}/data/*
246
- mv -f ${dir_tmp}/data/* ${dir_root}/data/
245
+ rm -rf ${dir_data}/*
246
+ mv -f ${dir_tmp}/data/* ${dir_data}/
247
247
  fi
248
248
 
249
249
  reload_pm2
@@ -20,11 +20,11 @@ const lastVersionFile = `https://qn.whyour.cn/version.yaml`;
20
20
  const rootPath = process.env.QL_DIR;
21
21
  const envFound = dotenv_1.default.config({ path: path_1.default.join(rootPath, '.env') });
22
22
  let dataPath = path_1.default.join(rootPath, 'data/');
23
- const shellPath = path_1.default.join(rootPath, 'shell/');
24
- const tmpPath = path_1.default.join(rootPath, '.tmp/');
25
23
  if (process.env.QL_DATA_DIR) {
26
- dataPath = process.env.QL_DATA_DIR;
24
+ dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
27
25
  }
26
+ const shellPath = path_1.default.join(rootPath, 'shell/');
27
+ const tmpPath = path_1.default.join(rootPath, '.tmp/');
28
28
  const samplePath = path_1.default.join(rootPath, 'sample/');
29
29
  const configPath = path_1.default.join(dataPath, 'config/');
30
30
  const scriptPath = path_1.default.join(dataPath, 'scripts/');
@@ -113,17 +113,17 @@ exports.default = async () => {
113
113
  }
114
114
  if (doc.command.includes(`${config_1.default.rootPath}/log/`)) {
115
115
  await cron_1.CrontabModel.update({
116
- command: `${config_1.default.rootPath}/data/log/${doc.command.replace(`${config_1.default.rootPath}/log/`, '')}`,
116
+ command: `${config_1.default.dataPath}/log/${doc.command.replace(`${config_1.default.rootPath}/log/`, '')}`,
117
117
  }, { where: { id: doc.id } });
118
118
  }
119
119
  if (doc.command.includes(`${config_1.default.rootPath}/config/`)) {
120
120
  await cron_1.CrontabModel.update({
121
- command: `${config_1.default.rootPath}/data/config/${doc.command.replace(`${config_1.default.rootPath}/config/`, '')}`,
121
+ command: `${config_1.default.dataPath}/config/${doc.command.replace(`${config_1.default.rootPath}/config/`, '')}`,
122
122
  }, { where: { id: doc.id } });
123
123
  }
124
124
  if (doc.command.includes(`${config_1.default.rootPath}/db/`)) {
125
125
  await cron_1.CrontabModel.update({
126
- command: `${config_1.default.rootPath}/data/db/${doc.command.replace(`${config_1.default.rootPath}/db/`, '')}`,
126
+ command: `${config_1.default.dataPath}/db/${doc.command.replace(`${config_1.default.rootPath}/db/`, '')}`,
127
127
  }, { where: { id: doc.id } });
128
128
  }
129
129
  }
@@ -11,7 +11,7 @@ const util_1 = require("../config/util");
11
11
  const rootPath = process.env.QL_DIR;
12
12
  let dataPath = path_1.default.join(rootPath, 'data/');
13
13
  if (process.env.QL_DATA_DIR) {
14
- dataPath = process.env.QL_DATA_DIR;
14
+ dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
15
15
  }
16
16
  const configPath = path_1.default.join(dataPath, 'config/');
17
17
  const scriptPath = path_1.default.join(dataPath, 'scripts/');
@@ -294,7 +294,7 @@ let UserService = class UserService {
294
294
  }
295
295
  async getNotificationMode() {
296
296
  const doc = await this.getDb({ type: system_1.AuthDataType.notification });
297
- return doc.info;
297
+ return (doc.info || {});
298
298
  }
299
299
  async updateAuthDb(payload) {
300
300
  let doc = await system_1.SystemModel.findOne({ type: payload.type });