增加数据备份功能

This commit is contained in:
whyour
2023-07-16 00:23:29 +08:00
parent 8affff96f3
commit 88b87de391
7 changed files with 110 additions and 13 deletions
+5
View File
@@ -20,6 +20,7 @@ const rootPath = process.env.QL_DIR as string;
const envFound = dotenv.config({ path: path.join(rootPath, '.env') });
const dataPath = path.join(rootPath, 'data/');
const tmpPath = path.join(rootPath, '.tmp/');
const samplePath = path.join(rootPath, 'sample/');
const configPath = path.join(dataPath, 'config/');
const scriptPath = path.join(dataPath, 'scripts/');
@@ -42,6 +43,7 @@ const authError = '错误的用户名密码,请重试';
const loginFaild = '请先登录!';
const configString = 'config sample crontab shareCode diy';
const versionFile = path.join(rootPath, 'version.yaml');
const dataTgzFile = path.join(tmpPath, 'data.tgz');
if (envFound.error) {
throw new Error("⚠️ Couldn't find .env file ⚠️");
@@ -59,6 +61,9 @@ export default {
prefix: '/api',
},
rootPath,
tmpPath,
dataPath,
dataTgzFile,
configString,
loginFaild,
authError,