@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
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
|
|
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 $
|
|
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 $
|
|
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 $
|
|
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 $
|
|
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
|
|
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
|
@@ -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.
|
|
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.
|
|
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.
|
|
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 });
|