Upload 4 files
Browse files- .npmrc +1 -0
- docker-entrypoint.sh +93 -0
- package.json +177 -0
- pnpm-lock.yaml +0 -0
.npmrc
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
strict-peer-dependencies=false
|
docker-entrypoint.sh
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
dir_shell=/ql/shell
|
4 |
+
. $dir_shell/share.sh
|
5 |
+
. $dir_shell/env.sh
|
6 |
+
|
7 |
+
echo -e "======================1. 检测配置文件========================\n"
|
8 |
+
import_config "$@"
|
9 |
+
make_dir /etc/nginx/conf.d
|
10 |
+
make_dir /run/nginx
|
11 |
+
init_nginx
|
12 |
+
fix_config
|
13 |
+
|
14 |
+
pm2 l &>/dev/null
|
15 |
+
|
16 |
+
echo -e "======================2. 安装依赖========================\n"
|
17 |
+
patch_version
|
18 |
+
|
19 |
+
echo -e "======================3. 启动nginx========================\n"
|
20 |
+
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
|
21 |
+
echo -e "nginx启动成功...\n"
|
22 |
+
|
23 |
+
echo -e "======================4. 启动pm2服务========================\n"
|
24 |
+
reload_update
|
25 |
+
reload_pm2
|
26 |
+
|
27 |
+
if [[ $AutoStartBot == true ]]; then
|
28 |
+
echo -e "======================5. 启动bot========================\n"
|
29 |
+
nohup ql bot >$dir_log/bot.log 2>&1 &
|
30 |
+
echo -e "bot后台启动中...\n"
|
31 |
+
fi
|
32 |
+
|
33 |
+
if [[ $EnableExtraShell == true ]]; then
|
34 |
+
echo -e "====================6. 执行自定义脚本========================\n"
|
35 |
+
nohup ql extra >$dir_log/extra.log 2>&1 &
|
36 |
+
echo -e "自定义脚本后台执行中...\n"
|
37 |
+
fi
|
38 |
+
|
39 |
+
echo -e "======================7. 写入rclone配置========================\n"
|
40 |
+
echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf
|
41 |
+
|
42 |
+
echo -e "############################################################\n"
|
43 |
+
echo -e "容器启动成功..."
|
44 |
+
echo -e "############################################################\n"
|
45 |
+
|
46 |
+
|
47 |
+
echo -e "##########8. 写入登陆信息 ############"
|
48 |
+
echo "{ \"username\": \"$USERNAME\", \"password\": \"$PASSWORD\" }" > /ql/data/config/auth.json
|
49 |
+
|
50 |
+
echo -e "##########9. 同步备份信息 ############"
|
51 |
+
if [ -n "$RCLONE_CONF" ]; then
|
52 |
+
echo -e "########## Synchronizing Backup ############"
|
53 |
+
|
54 |
+
# Specify the remote folder path in the format remote:path
|
55 |
+
REMOTE_FOLDER="huggingface:/qinglong"
|
56 |
+
|
57 |
+
# Use rclone ls command to list folder contents, capturing output and errors
|
58 |
+
OUTPUT=$(rclone ls "$REMOTE_FOLDER" 2>&1)
|
59 |
+
|
60 |
+
# Get the exit status code of the rclone command
|
61 |
+
EXIT_CODE=$?
|
62 |
+
|
63 |
+
case $EXIT_CODE in
|
64 |
+
0)
|
65 |
+
# rclone command executed successfully, check if the folder is empty
|
66 |
+
if [ -z "$OUTPUT" ]; then
|
67 |
+
echo "Initial installation"
|
68 |
+
#rclone sync /ql/data $REMOTE_FOLDER
|
69 |
+
else
|
70 |
+
mkdir -p /ql/.tmp/data
|
71 |
+
rclone sync "$REMOTE_FOLDER" /ql/.tmp/data && real_time=true ql reload data
|
72 |
+
fi
|
73 |
+
;;
|
74 |
+
1)
|
75 |
+
# Handle other errors, check if it was a directory not found error
|
76 |
+
if [[ "$OUTPUT" == *"directory not found"* ]]; then
|
77 |
+
echo "Error: Folder does not exist"
|
78 |
+
else
|
79 |
+
echo "Error: $OUTPUT"
|
80 |
+
fi
|
81 |
+
;;
|
82 |
+
*)
|
83 |
+
echo "Error: rclone command failed, exit code: $EXIT_CODE"
|
84 |
+
;;
|
85 |
+
esac
|
86 |
+
else
|
87 |
+
echo "No Rclone configuration detected"
|
88 |
+
fi
|
89 |
+
|
90 |
+
|
91 |
+
tail -f >/dev/null
|
92 |
+
|
93 |
+
exec "$@"
|
package.json
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"private": true,
|
3 |
+
"scripts": {
|
4 |
+
"start": "concurrently -n w: npm:start:*",
|
5 |
+
"start:update": "ts-node -P tsconfig.back.json ./back/update.ts",
|
6 |
+
"start:public": "ts-node -P tsconfig.back.json ./back/public.ts",
|
7 |
+
"start:rpc": "ts-node -P tsconfig.back.json ./back/schedule/index.ts",
|
8 |
+
"start:back": "nodemon",
|
9 |
+
"start:front": "max dev",
|
10 |
+
"build:front": "max build",
|
11 |
+
"build:back": "tsc -p tsconfig.back.json",
|
12 |
+
"panel": "npm run build:back && node static/build/app.js",
|
13 |
+
"schedule": "npm run build:back && node static/build/schedule/index.js",
|
14 |
+
"public": "npm run build:back && node static/build/public.js",
|
15 |
+
"update": "npm run build:back && node static/build/update.js",
|
16 |
+
"gen:proto": "protoc --experimental_allow_proto3_optional --plugin=./node_modules/.bin/protoc-gen-ts_proto ./back/protos/*.proto --ts_proto_out=./ --ts_proto_opt=outputServices=grpc-js,env=node,esModuleInterop=true",
|
17 |
+
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
|
18 |
+
"postinstall": "max setup 2>/dev/null || true",
|
19 |
+
"test": "umi-test",
|
20 |
+
"test:coverage": "umi-test --coverage"
|
21 |
+
},
|
22 |
+
"gitHooks": {
|
23 |
+
"pre-commit": "lint-staged"
|
24 |
+
},
|
25 |
+
"lint-staged": {
|
26 |
+
"*.{js,jsx,less,md,json}": [
|
27 |
+
"prettier --write"
|
28 |
+
],
|
29 |
+
"*.ts?(x)": [
|
30 |
+
"prettier --parser=typescript --write"
|
31 |
+
]
|
32 |
+
},
|
33 |
+
"pnpm": {
|
34 |
+
"peerDependencyRules": {
|
35 |
+
"ignoreMissing": [
|
36 |
+
"react",
|
37 |
+
"react-dom",
|
38 |
+
"antd",
|
39 |
+
"dva",
|
40 |
+
"postcss",
|
41 |
+
"webpack",
|
42 |
+
"eslint",
|
43 |
+
"stylelint",
|
44 |
+
"redux",
|
45 |
+
"@babel/core",
|
46 |
+
"monaco-editor",
|
47 |
+
"rc-field-form",
|
48 |
+
"@types/lodash.merge",
|
49 |
+
"rollup",
|
50 |
+
"styled-components"
|
51 |
+
],
|
52 |
+
"allowedVersions": {
|
53 |
+
"react": "18",
|
54 |
+
"react-dom": "18",
|
55 |
+
"dva-core": "2"
|
56 |
+
}
|
57 |
+
}
|
58 |
+
},
|
59 |
+
"dependencies": {
|
60 |
+
"@grpc/grpc-js": "^1.8.13",
|
61 |
+
"@otplib/preset-default": "^12.0.1",
|
62 |
+
"@sentry/node": "^8.26.0",
|
63 |
+
"body-parser": "^1.19.2",
|
64 |
+
"celebrate": "^15.0.1",
|
65 |
+
"chokidar": "^3.5.3",
|
66 |
+
"cors": "^2.8.5",
|
67 |
+
"cron-parser": "^4.2.1",
|
68 |
+
"cross-spawn": "^7.0.3",
|
69 |
+
"dayjs": "^1.11.2",
|
70 |
+
"dotenv": "^16.0.0",
|
71 |
+
"express": "^4.17.3",
|
72 |
+
"express-jwt": "^6.1.1",
|
73 |
+
"express-rate-limit": "^7.0.0",
|
74 |
+
"express-urlrewrite": "^1.4.0",
|
75 |
+
"form-data": "^4.0.0",
|
76 |
+
"got": "^11.8.2",
|
77 |
+
"hpagent": "^1.2.0",
|
78 |
+
"http-proxy-middleware": "^2.0.6",
|
79 |
+
"iconv-lite": "^0.6.3",
|
80 |
+
"js-yaml": "^4.1.0",
|
81 |
+
"jsonwebtoken": "^8.5.1",
|
82 |
+
"lodash": "^4.17.21",
|
83 |
+
"multer": "1.4.5-lts.1",
|
84 |
+
"nedb": "^1.8.0",
|
85 |
+
"node-schedule": "^2.1.0",
|
86 |
+
"nodemailer": "^6.7.2",
|
87 |
+
"p-queue-cjs": "7.3.4",
|
88 |
+
"protobufjs": "^7.3.0",
|
89 |
+
"pstree.remy": "^1.1.8",
|
90 |
+
"reflect-metadata": "^0.1.13",
|
91 |
+
"sequelize": "^6.25.5",
|
92 |
+
"serve-handler": "^6.1.3",
|
93 |
+
"sockjs": "^0.3.24",
|
94 |
+
"sqlite3": "git+https://github.com/whyour/node-sqlite3.git#v1.0.3",
|
95 |
+
"toad-scheduler": "^1.6.0",
|
96 |
+
"typedi": "^0.10.0",
|
97 |
+
"uuid": "^8.3.2",
|
98 |
+
"winston": "^3.6.0",
|
99 |
+
"winston-daily-rotate-file": "^4.7.1",
|
100 |
+
"yargs": "^17.3.1",
|
101 |
+
"tough-cookie": "^4.0.0",
|
102 |
+
"request-ip": "3.3.0",
|
103 |
+
"ip2region": "2.3.0"
|
104 |
+
},
|
105 |
+
"devDependencies": {
|
106 |
+
"moment": "2.30.1",
|
107 |
+
"@ant-design/icons": "^4.7.0",
|
108 |
+
"@ant-design/pro-layout": "6.38.22",
|
109 |
+
"@monaco-editor/react": "4.2.1",
|
110 |
+
"@react-hook/resize-observer": "^1.2.6",
|
111 |
+
"react-router-dom": "6.26.1",
|
112 |
+
"@sentry/react": "^8.26.0",
|
113 |
+
"@types/body-parser": "^1.19.2",
|
114 |
+
"@types/cors": "^2.8.12",
|
115 |
+
"@types/cross-spawn": "^6.0.2",
|
116 |
+
"@types/express": "^4.17.13",
|
117 |
+
"@types/express-jwt": "^6.0.4",
|
118 |
+
"@types/file-saver": "2.0.2",
|
119 |
+
"@types/js-yaml": "^4.0.5",
|
120 |
+
"@types/jsonwebtoken": "^8.5.8",
|
121 |
+
"@types/lodash": "^4.14.185",
|
122 |
+
"@types/multer": "^1.4.7",
|
123 |
+
"@types/nedb": "^1.8.12",
|
124 |
+
"@types/node": "^17.0.21",
|
125 |
+
"@types/node-schedule": "^1.3.2",
|
126 |
+
"@types/nodemailer": "^6.4.4",
|
127 |
+
"@types/qrcode.react": "^1.0.2",
|
128 |
+
"@types/react": "^18.0.20",
|
129 |
+
"@types/react-copy-to-clipboard": "^5.0.4",
|
130 |
+
"@types/react-dom": "^18.0.6",
|
131 |
+
"@types/serve-handler": "^6.1.1",
|
132 |
+
"@types/sockjs": "^0.3.33",
|
133 |
+
"@types/sockjs-client": "^1.5.1",
|
134 |
+
"@types/uuid": "^8.3.4",
|
135 |
+
"@types/request-ip": "0.0.41",
|
136 |
+
"@uiw/codemirror-extensions-langs": "^4.21.9",
|
137 |
+
"@uiw/react-codemirror": "^4.21.9",
|
138 |
+
"@umijs/max": "^4.0.72",
|
139 |
+
"@umijs/ssr-darkreader": "^4.9.45",
|
140 |
+
"ahooks": "^3.7.8",
|
141 |
+
"ansi-to-react": "^6.1.6",
|
142 |
+
"antd": "^4.24.8",
|
143 |
+
"antd-img-crop": "^4.2.3",
|
144 |
+
"axios": "^1.4.0",
|
145 |
+
"compression-webpack-plugin": "9.2.0",
|
146 |
+
"concurrently": "^7.0.0",
|
147 |
+
"react-hotkeys-hook": "^4.4.1",
|
148 |
+
"file-saver": "2.0.2",
|
149 |
+
"lint-staged": "^13.0.3",
|
150 |
+
"monaco-editor": "0.33.0",
|
151 |
+
"nodemon": "^3.0.1",
|
152 |
+
"prettier": "^2.5.1",
|
153 |
+
"pretty-bytes": "6.1.1",
|
154 |
+
"qiniu": "^7.4.0",
|
155 |
+
"qrcode.react": "^1.0.1",
|
156 |
+
"query-string": "^7.1.1",
|
157 |
+
"rc-tween-one": "^3.0.6",
|
158 |
+
"rc-virtual-list": "3.5.3",
|
159 |
+
"react": "18.2.0",
|
160 |
+
"react-copy-to-clipboard": "^5.1.0",
|
161 |
+
"react-diff-viewer": "^3.1.1",
|
162 |
+
"react-dnd": "^14.0.2",
|
163 |
+
"react-dnd-html5-backend": "^14.0.0",
|
164 |
+
"react-dom": "18.2.0",
|
165 |
+
"react-intl-universal": "^2.6.21",
|
166 |
+
"react-split-pane": "^0.1.92",
|
167 |
+
"sockjs-client": "^1.6.0",
|
168 |
+
"ts-node": "^10.9.2",
|
169 |
+
"ts-proto": "^1.146.0",
|
170 |
+
"tslib": "^2.4.0",
|
171 |
+
"typescript": "5.2.2",
|
172 |
+
"vh-check": "^2.0.5",
|
173 |
+
"virtualizedtableforantd4": "1.3.0",
|
174 |
+
"webpack": "^5.70.0",
|
175 |
+
"yorkie": "^2.0.0"
|
176 |
+
}
|
177 |
+
}
|
pnpm-lock.yaml
ADDED
The diff for this file is too large to render.
See raw diff
|
|