@whyour/qinglong 0.21.0 → 0.21.1
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
|
@@ -74,7 +74,9 @@ init_env() {
|
|
|
74
74
|
|
|
75
75
|
import_config() {
|
|
76
76
|
[[ -f $file_config_user ]] && . $file_config_user
|
|
77
|
-
[[
|
|
77
|
+
if [[ $LOAD_ENV != 'false' ]] && [[ -f $file_env ]]; then
|
|
78
|
+
. $file_env
|
|
79
|
+
fi
|
|
78
80
|
|
|
79
81
|
ql_base_url=${QlBaseUrl:-"/"}
|
|
80
82
|
ql_port=${QlPort:-"5700"}
|
|
@@ -35,6 +35,8 @@ const uploadPath = path_1.default.join(dataPath, 'upload/');
|
|
|
35
35
|
const sshdPath = path_1.default.join(dataPath, 'ssh.d/');
|
|
36
36
|
const systemLogPath = path_1.default.join(dataPath, 'syslog/');
|
|
37
37
|
const envFile = path_1.default.join(configPath, 'env.sh');
|
|
38
|
+
const jsEnvFile = path_1.default.join(configPath, 'env.js');
|
|
39
|
+
const pyEnvFile = path_1.default.join(configPath, 'env.py');
|
|
38
40
|
const confFile = path_1.default.join(configPath, 'config.sh');
|
|
39
41
|
const crontabFile = path_1.default.join(configPath, 'crontab.list');
|
|
40
42
|
const authConfigFile = path_1.default.join(configPath, 'auth.json');
|
|
@@ -81,6 +83,8 @@ exports.default = {
|
|
|
81
83
|
sampleFile,
|
|
82
84
|
confFile,
|
|
83
85
|
envFile,
|
|
86
|
+
jsEnvFile,
|
|
87
|
+
pyEnvFile,
|
|
84
88
|
dbPath,
|
|
85
89
|
uploadPath,
|
|
86
90
|
configPath,
|
|
@@ -93,6 +97,8 @@ exports.default = {
|
|
|
93
97
|
'crontab.list',
|
|
94
98
|
'dependence-proxy.sh',
|
|
95
99
|
'env.sh',
|
|
100
|
+
'env.js',
|
|
101
|
+
'env.py',
|
|
96
102
|
'token.json',
|
|
97
103
|
],
|
|
98
104
|
writePathList: [configPath, scriptPath],
|
|
@@ -193,6 +193,8 @@ let EnvService = class EnvService {
|
|
|
193
193
|
});
|
|
194
194
|
const groups = (0, groupBy_1.default)(envs, 'name');
|
|
195
195
|
let env_string = '';
|
|
196
|
+
let js_env_string = '';
|
|
197
|
+
let py_env_string = 'import os\n';
|
|
196
198
|
for (const key in groups) {
|
|
197
199
|
if (Object.prototype.hasOwnProperty.call(groups, key)) {
|
|
198
200
|
const group = groups[key];
|
|
@@ -204,10 +206,14 @@ let EnvService = class EnvService {
|
|
|
204
206
|
.replace(/'/g, "'\\''")
|
|
205
207
|
.trim();
|
|
206
208
|
env_string += `export ${key}='${value}'\n`;
|
|
209
|
+
js_env_string += `process.env.${key}='${value}';\n`;
|
|
210
|
+
py_env_string += `os.environ['${key}'] = '${value}'\n`;
|
|
207
211
|
}
|
|
208
212
|
}
|
|
209
213
|
}
|
|
210
214
|
await fs.writeFile(config_1.default.envFile, env_string);
|
|
215
|
+
await fs.writeFile(config_1.default.jsEnvFile, js_env_string);
|
|
216
|
+
await fs.writeFile(config_1.default.pyEnvFile, py_env_string);
|
|
211
217
|
}
|
|
212
218
|
};
|
|
213
219
|
EnvService = __decorate([
|