lang03383 commited on
Commit
f38b643
·
verified ·
1 Parent(s): 6e4d497

Upload 7 files

Browse files
Files changed (6) hide show
  1. Dockerfile +121 -0
  2. README.md +5 -4
  3. docker-entrypoint.sh +56 -0
  4. npmrc +1 -0
  5. package.json +191 -0
  6. pnpm-lock.yaml +0 -0
Dockerfile ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20-slim as nodebuilder
2
+
3
+ FROM python:3.11-slim-bullseye as builder
4
+ COPY package.json .npmrc pnpm-lock.yaml /tmp/build/
5
+ COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
6
+ COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
7
+ RUN set -x && \
8
+ ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
9
+ apt-get update && \
10
+ apt-get install --no-install-recommends -y git libatomic1 && \
11
+ npm i -g [email protected] && \
12
+ cd /tmp/build && \
13
+ pnpm install --prod
14
+
15
+ FROM python:3.11-slim-bullseye
16
+
17
+ ARG QL_MAINTAINER="whyour"
18
+ LABEL maintainer="${QL_MAINTAINER}"
19
+ ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git
20
+ ARG QL_BRANCH=debian
21
+
22
+
23
+ ENV PNPM_HOME=/root/.local/share/pnpm \
24
+ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules:$PNPM_HOME \
25
+ NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules \
26
+ LANG=C.UTF-8 \
27
+ SHELL=/bin/bash \
28
+ PS1="\u@\h:\w \$ " \
29
+ QL_DIR=/ql \
30
+ QL_BRANCH=${QL_BRANCH}
31
+
32
+ COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/
33
+ COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/
34
+
35
+
36
+ RUN set -x && \
37
+ ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
38
+ ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \
39
+ apt-get update && \
40
+ apt-get upgrade -y && \
41
+ apt-get install --no-install-recommends -y git \
42
+ curl \
43
+ cron \
44
+ wget \
45
+ tzdata \
46
+ perl \
47
+ openssl \
48
+ openssh-client \
49
+ nginx \
50
+ jq \
51
+ procps \
52
+ netcat \
53
+ sshpass \
54
+ rclone \
55
+ unzip \
56
+ libatomic1 && \
57
+ apt-get clean && \
58
+ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
59
+ echo "Asia/Shanghai" >/etc/timezone && \
60
+ git config --global user.email "qinglong@@users.noreply.github.com" && \
61
+ git config --global user.name "qinglong" && \
62
+ git config --global http.postBuffer 524288000 && \
63
+ npm install -g [email protected] pm2 ts-node && \
64
+ rm -rf /root/.pnpm-store && \
65
+ rm -rf /root/.local/share/pnpm/store && \
66
+ rm -rf /root/.cache && \
67
+ rm -rf /root/.npm && \
68
+ chmod u+s /usr/sbin/cron && \
69
+ ulimit -c 0
70
+
71
+ ARG SOURCE_COMMIT
72
+ RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} && \
73
+ cd ${QL_DIR} && \
74
+ cp -f .env.example .env && \
75
+ chmod 777 ${QL_DIR}/shell/*.sh && \
76
+ chmod 777 ${QL_DIR}/docker/*.sh && \
77
+ git clone --depth=1 -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static && \
78
+ mkdir -p ${QL_DIR}/static && \
79
+ cp -rf /static/* ${QL_DIR}/static && \
80
+ rm -rf /static && \
81
+ rm -f ${QL_DIR}/docker/docker-entrypoint.sh
82
+
83
+ COPY docker-entrypoint.sh ${QL_DIR}/docker
84
+
85
+ RUN mkdir /ql/data && \
86
+ mkdir /ql/data/config && \
87
+ mkdir /ql/data/log && \
88
+ mkdir /ql/data/db && \
89
+ mkdir /ql/data/scripts && \
90
+ mkdir /ql/data/repo && \
91
+ mkdir /ql/data/raw && \
92
+ mkdir /ql/data/deps && \
93
+ chmod -R 777 /ql && \
94
+ chmod -R 777 /var && \
95
+ chmod -R 777 /usr/local && \
96
+ chmod -R 777 /etc/nginx && \
97
+ chmod -R 777 /run && \
98
+ chmod -R 777 /usr && \
99
+ chmod -R 777 /root
100
+
101
+ COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/
102
+
103
+ WORKDIR ${QL_DIR}
104
+
105
+ # Set up a new user named "user" with user ID 1000
106
+ RUN useradd -m -u 1000 user
107
+
108
+ # Switch to the "user" user
109
+ USER user
110
+
111
+ # 创建rclone配置文件
112
+ RUN rclone config -h
113
+
114
+ HEALTHCHECK --interval=5s --timeout=2s --retries=20 \
115
+ CMD curl -sf --noproxy '*' http://127.0.0.1:5400/api/health || exit 1
116
+
117
+ ENTRYPOINT ["./docker/docker-entrypoint.sh"]
118
+
119
+ VOLUME /ql/data
120
+
121
+ EXPOSE 5700
README.md CHANGED
@@ -1,10 +1,11 @@
1
  ---
2
- title: Ql Serv
3
- emoji: 🌖
4
- colorFrom: purple
5
- colorTo: gray
6
  sdk: docker
7
  pinned: false
 
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: ql_serv
3
+ emoji: 📉
4
+ colorFrom: gray
5
+ colorTo: red
6
  sdk: docker
7
  pinned: false
8
+ app_port: 5700
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
docker-entrypoint.sh ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ dir_shell=/ql/shell
4
+ . $dir_shell/share.sh
5
+ . $dir_shell/env.sh
6
+
7
+
8
+ echo -e "======================写入rclone配置========================\n"
9
+ echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf
10
+
11
+ echo -e "======================1. 检测配置文件========================\n"
12
+ import_config "$@"
13
+ make_dir /etc/nginx/conf.d
14
+ make_dir /run/nginx
15
+ init_nginx
16
+ fix_config
17
+
18
+ pm2 l &>/dev/null
19
+
20
+ echo -e "======================2. 安装依赖========================\n"
21
+ patch_version
22
+
23
+
24
+ echo -e "======================3. 启动nginx========================\n"
25
+ nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
26
+ echo -e "nginx启动成功...\n"
27
+
28
+ echo -e "======================4. 启动pm2服务========================\n"
29
+ reload_update
30
+ reload_pm2
31
+
32
+ if [[ $AutoStartBot == true ]]; then
33
+ echo -e "======================5. 启动bot========================\n"
34
+ nohup ql bot >$dir_log/bot.log 2>&1 &
35
+ echo -e "bot后台启动中...\n"
36
+ fi
37
+
38
+ if [[ $EnableExtraShell == true ]]; then
39
+ echo -e "====================6. 执行自定义脚本========================\n"
40
+ nohup ql extra >$dir_log/extra.log 2>&1 &
41
+ echo -e "自定义脚本后台执行中...\n"
42
+ fi
43
+
44
+
45
+ echo -e "############################################################\n"
46
+ echo -e "容器启动成功..."
47
+ echo -e "############################################################\n"
48
+
49
+
50
+ echo -e "##########写入登陆信息############"
51
+ echo "{ \"username\": \"$ADMIN_USERNAME\", \"password\": \"$ADMIN_PASSWORD\" }" > /ql/data/config/auth.json
52
+
53
+
54
+ tail -f /dev/null
55
+
56
+ exec "$@"
npmrc ADDED
@@ -0,0 +1 @@
 
 
1
+ strict-peer-dependencies=false
package.json ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@whyour/qinglong",
3
+ "version": "2.17.9-rc.5",
4
+ "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/whyour/qinglong.git"
8
+ },
9
+ "author": "whyour",
10
+ "license": "Apache License 2.0",
11
+ "bugs": {
12
+ "url": "https://github.com/whyour/qinglong/issues"
13
+ },
14
+ "scripts": {
15
+ "start": "concurrently -n w: npm:start:*",
16
+ "start:front": "max dev",
17
+ "start:back": "nodemon",
18
+ "start:update": "ts-node -P tsconfig.back.json ./back/update.ts",
19
+ "start:public": "ts-node -P tsconfig.back.json ./back/public.ts",
20
+ "start:rpc": "ts-node -P tsconfig.back.json ./back/schedule/index.ts",
21
+ "build:front": "max build",
22
+ "build:back": "tsc -p tsconfig.back.json",
23
+ "panel": "npm run build:back && node static/build/app.js",
24
+ "schedule": "npm run build:back && node static/build/schedule/index.js",
25
+ "public": "npm run build:back && node static/build/public.js",
26
+ "update": "npm run build:back && node static/build/update.js",
27
+ "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",
28
+ "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
29
+ "postinstall": "max setup 2>/dev/null || true",
30
+ "test": "umi-test",
31
+ "test:coverage": "umi-test --coverage"
32
+ },
33
+ "gitHooks": {
34
+ "pre-commit": "lint-staged"
35
+ },
36
+ "lint-staged": {
37
+ "*.{js,jsx,less,md,json}": [
38
+ "prettier --write"
39
+ ],
40
+ "*.ts?(x)": [
41
+ "prettier --parser=typescript --write"
42
+ ]
43
+ },
44
+ "bin": {
45
+ "ql": "shell/update.sh",
46
+ "task": "shell/task.sh",
47
+ "qinglong": "shell/start.sh"
48
+ },
49
+ "pnpm": {
50
+ "peerDependencyRules": {
51
+ "ignoreMissing": [
52
+ "react",
53
+ "react-dom",
54
+ "antd",
55
+ "dva",
56
+ "postcss",
57
+ "webpack",
58
+ "eslint",
59
+ "stylelint",
60
+ "redux",
61
+ "@babel/core",
62
+ "monaco-editor",
63
+ "rc-field-form",
64
+ "@types/lodash.merge",
65
+ "rollup",
66
+ "styled-components"
67
+ ],
68
+ "allowedVersions": {
69
+ "react": "18",
70
+ "react-dom": "18",
71
+ "dva-core": "2"
72
+ }
73
+ }
74
+ },
75
+ "dependencies": {
76
+ "@grpc/grpc-js": "^1.8.13",
77
+ "@otplib/preset-default": "^12.0.1",
78
+ "@sentry/node": "^7.12.1",
79
+ "body-parser": "^1.19.2",
80
+ "celebrate": "^15.0.1",
81
+ "chokidar": "^3.5.3",
82
+ "cors": "^2.8.5",
83
+ "cron-parser": "^4.2.1",
84
+ "cross-spawn": "^7.0.3",
85
+ "dayjs": "^1.11.2",
86
+ "dotenv": "^16.0.0",
87
+ "express": "^4.17.3",
88
+ "express-jwt": "^6.1.1",
89
+ "express-rate-limit": "^7.0.0",
90
+ "express-urlrewrite": "^1.4.0",
91
+ "form-data": "^4.0.0",
92
+ "got": "^11.8.2",
93
+ "hpagent": "^1.2.0",
94
+ "http-proxy-middleware": "^2.0.6",
95
+ "iconv-lite": "^0.6.3",
96
+ "js-yaml": "^4.1.0",
97
+ "jsonwebtoken": "^8.5.1",
98
+ "lodash": "^4.17.21",
99
+ "multer": "1.4.5-lts.1",
100
+ "nedb": "^1.8.0",
101
+ "node-schedule": "^2.1.0",
102
+ "nodemailer": "^6.7.2",
103
+ "p-queue-cjs": "7.3.4",
104
+ "protobufjs": "^7.3.0",
105
+ "pstree.remy": "^1.1.8",
106
+ "reflect-metadata": "^0.1.13",
107
+ "sequelize": "^6.25.5",
108
+ "serve-handler": "^6.1.3",
109
+ "sockjs": "^0.3.24",
110
+ "sqlite3": "git+https://github.com/whyour/node-sqlite3.git#v1.0.3",
111
+ "toad-scheduler": "^1.6.0",
112
+ "typedi": "^0.10.0",
113
+ "uuid": "^8.3.2",
114
+ "winston": "^3.6.0",
115
+ "winston-daily-rotate-file": "^4.7.1",
116
+ "yargs": "^17.3.1",
117
+ "tough-cookie": "^4.0.0",
118
+ "request-ip": "3.3.0",
119
+ "ip2region": "2.3.0"
120
+ },
121
+ "devDependencies": {
122
+ "@ant-design/icons": "^4.7.0",
123
+ "@ant-design/pro-layout": "6.38.22",
124
+ "@monaco-editor/react": "4.2.1",
125
+ "@react-hook/resize-observer": "^1.2.6",
126
+ "@sentry/react": "^7.12.1",
127
+ "@types/body-parser": "^1.19.2",
128
+ "@types/cors": "^2.8.12",
129
+ "@types/cross-spawn": "^6.0.2",
130
+ "@types/express": "^4.17.13",
131
+ "@types/express-jwt": "^6.0.4",
132
+ "@types/file-saver": "2.0.2",
133
+ "@types/js-yaml": "^4.0.5",
134
+ "@types/jsonwebtoken": "^8.5.8",
135
+ "@types/lodash": "^4.14.185",
136
+ "@types/multer": "^1.4.7",
137
+ "@types/nedb": "^1.8.12",
138
+ "@types/node": "^17.0.21",
139
+ "@types/node-schedule": "^1.3.2",
140
+ "@types/nodemailer": "^6.4.4",
141
+ "@types/qrcode.react": "^1.0.2",
142
+ "@types/react": "^18.0.20",
143
+ "@types/react-copy-to-clipboard": "^5.0.4",
144
+ "@types/react-dom": "^18.0.6",
145
+ "@types/serve-handler": "^6.1.1",
146
+ "@types/sockjs": "^0.3.33",
147
+ "@types/sockjs-client": "^1.5.1",
148
+ "@types/uuid": "^8.3.4",
149
+ "@types/request-ip": "0.0.41",
150
+ "@uiw/codemirror-extensions-langs": "^4.21.9",
151
+ "@uiw/react-codemirror": "^4.21.9",
152
+ "@umijs/max": "^4.0.72",
153
+ "@umijs/ssr-darkreader": "^4.9.45",
154
+ "ahooks": "^3.7.8",
155
+ "ansi-to-react": "^6.1.6",
156
+ "antd": "^4.24.8",
157
+ "antd-img-crop": "^4.2.3",
158
+ "axios": "^1.4.0",
159
+ "compression-webpack-plugin": "9.2.0",
160
+ "concurrently": "^7.0.0",
161
+ "react-hotkeys-hook": "^4.4.1",
162
+ "file-saver": "2.0.2",
163
+ "lint-staged": "^13.0.3",
164
+ "monaco-editor": "0.33.0",
165
+ "nodemon": "^3.0.1",
166
+ "prettier": "^2.5.1",
167
+ "pretty-bytes": "6.1.1",
168
+ "qiniu": "^7.4.0",
169
+ "qrcode.react": "^1.0.1",
170
+ "query-string": "^7.1.1",
171
+ "rc-tween-one": "^3.0.6",
172
+ "rc-virtual-list": "3.5.3",
173
+ "react": "18.2.0",
174
+ "react-copy-to-clipboard": "^5.1.0",
175
+ "react-diff-viewer": "^3.1.1",
176
+ "react-dnd": "^14.0.2",
177
+ "react-dnd-html5-backend": "^14.0.0",
178
+ "react-dom": "18.2.0",
179
+ "react-intl-universal": "^2.6.21",
180
+ "react-split-pane": "^0.1.92",
181
+ "sockjs-client": "^1.6.0",
182
+ "ts-node": "^10.9.2",
183
+ "ts-proto": "^1.146.0",
184
+ "tslib": "^2.4.0",
185
+ "typescript": "5.2.2",
186
+ "vh-check": "^2.0.5",
187
+ "virtualizedtableforantd4": "1.3.0",
188
+ "webpack": "^5.70.0",
189
+ "yorkie": "^2.0.0"
190
+ }
191
+ }
pnpm-lock.yaml ADDED
The diff for this file is too large to render. See raw diff