fgg55778 commited on
Commit
1439131
1 Parent(s): ce11787

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +30 -4
  2. docker-entrypoint.sh +88 -0
  3. services.json +374 -0
README.md CHANGED
@@ -1,10 +1,36 @@
1
  ---
2
- title: Ql
3
- emoji: 📚
4
- colorFrom: green
5
- colorTo: indigo
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: Qinglong
3
+ emoji: 🏃
4
+ colorFrom: yellow
5
+ colorTo: purple
6
  sdk: docker
7
  pinned: false
8
+ app_port: 5700
9
  ---
10
 
11
+ Space secrets(Private)说明:
12
+ ADMIN_USERNAME:登陆用户名
13
+ ADMIN_PASSWORD:登陆密码
14
+ RCLONE_CONF:rclone配置内容,可选
15
+
16
+
17
+ ## 20241020更新
18
+ 加入services.json文件,可自行参照修改,添加更多的邮箱服务支持:serv00仅供参考,需要修改邮箱服务器为注册时收到的地址
19
+ 新添加邮箱:
20
+ cock.li-Cock
21
+ serv00.com-Serv00
22
+ mail.com-Mail.com
23
+
24
+ ## 注意
25
+ docker-entrypoint-rclone.sh为可以在容器重置时恢复数据的配置,需要设置上面的RCLONE_CONF
26
+ 其中名称为huggingface,文件夹为:/qinglong
27
+ rclone远程文件夹为huggingface:/qinglong
28
+ 进入后台后需要新建个同步的计划任务代码为:
29
+ ```
30
+ rclone delete huggingface:/qinglong/db/database.sqlite && rclone sync /ql/data huggingface:/qinglong
31
+ ```
32
+ 备份时间可以根据自己的情况设置我这里设置每天1点更新: 0 1 1 * * *
33
+
34
+ 如需安装linux依赖需要修改Dockerfile手动安装:搜索sshpass在下面继续添加即可。
35
+
36
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
docker-entrypoint.sh ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ if [ -n "$RCLONE_CONF" ]; then
55
+ echo -e "##########同步备份############"
56
+ # 指定远程文件夹路径,格式为 remote:path
57
+ REMOTE_FOLDER="huggingface:/qinglong"
58
+
59
+ # 使用 rclone ls 命令列出文件夹内容,将输出和错误分别捕获
60
+ OUTPUT=$(rclone ls "$REMOTE_FOLDER" 2>&1)
61
+
62
+ # 获取 rclone 命令的退出状态码
63
+ EXIT_CODE=$?
64
+
65
+ # 判断退出状态码
66
+ if [ $EXIT_CODE -eq 0 ]; then
67
+ # rclone 命令成功执行,检查文件夹是否为空
68
+ if [ -z "$OUTPUT" ]; then
69
+ #为空不处理
70
+ #rclone sync --interactive /ql $REMOTE_FOLDER
71
+ echo "初次安装"
72
+ else
73
+ #echo "文件夹不为空"
74
+ mkdir /ql/.tmp/data
75
+ rclone sync $REMOTE_FOLDER /ql/.tmp/data && real_time=true ql reload data
76
+ fi
77
+ elif [[ "$OUTPUT" == *"directory not found"* ]]; then
78
+ echo "错误:文件夹不存在"
79
+ else
80
+ echo "错误:$OUTPUT"
81
+ fi
82
+ else
83
+ echo "没有检测到Rclone配置信息"
84
+ fi
85
+
86
+ tail -f /dev/null
87
+
88
+ exec "$@"
services.json ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "1und1": {
3
+ "host": "smtp.1und1.de",
4
+ "port": 465,
5
+ "secure": true,
6
+ "authMethod": "LOGIN"
7
+ },
8
+
9
+ "Aliyun": {
10
+ "domains": ["aliyun.com"],
11
+ "host": "smtp.aliyun.com",
12
+ "port": 465,
13
+ "secure": true
14
+ },
15
+
16
+ "AOL": {
17
+ "domains": ["aol.com"],
18
+ "host": "smtp.aol.com",
19
+ "port": 587
20
+ },
21
+
22
+ "Bluewin": {
23
+ "host": "smtpauths.bluewin.ch",
24
+ "domains": ["bluewin.ch"],
25
+ "port": 465
26
+ },
27
+
28
+ "Cock": {
29
+ "domains": ["cock.li"],
30
+ "host": "mail.cock.li",
31
+ "port": 465,
32
+ "secure": true
33
+ },
34
+
35
+ "DebugMail": {
36
+ "host": "debugmail.io",
37
+ "port": 25
38
+ },
39
+
40
+ "DynectEmail": {
41
+ "aliases": ["Dynect"],
42
+ "host": "smtp.dynect.net",
43
+ "port": 25
44
+ },
45
+
46
+ "Ethereal": {
47
+ "aliases": ["ethereal.email"],
48
+ "host": "smtp.ethereal.email",
49
+ "port": 587
50
+ },
51
+
52
+ "FastMail": {
53
+ "domains": ["fastmail.fm"],
54
+ "host": "smtp.fastmail.com",
55
+ "port": 465,
56
+ "secure": true
57
+ },
58
+
59
+ "Forward Email": {
60
+ "aliases": ["FE", "ForwardEmail"],
61
+ "domains": ["forwardemail.net"],
62
+ "host": "smtp.forwardemail.net",
63
+ "port": 465,
64
+ "secure": true
65
+ },
66
+
67
+ "Feishu Mail": {
68
+ "aliases": ["Feishu", "FeishuMail"],
69
+ "domains": ["www.feishu.cn"],
70
+ "host": "smtp.feishu.cn",
71
+ "port": 465,
72
+ "secure": true
73
+ },
74
+
75
+ "GandiMail": {
76
+ "aliases": ["Gandi", "Gandi Mail"],
77
+ "host": "mail.gandi.net",
78
+ "port": 587
79
+ },
80
+
81
+ "Gmail": {
82
+ "aliases": ["Google Mail"],
83
+ "domains": ["gmail.com", "googlemail.com"],
84
+ "host": "smtp.gmail.com",
85
+ "port": 465,
86
+ "secure": true
87
+ },
88
+
89
+ "Godaddy": {
90
+ "host": "smtpout.secureserver.net",
91
+ "port": 25
92
+ },
93
+
94
+ "GodaddyAsia": {
95
+ "host": "smtp.asia.secureserver.net",
96
+ "port": 25
97
+ },
98
+
99
+ "GodaddyEurope": {
100
+ "host": "smtp.europe.secureserver.net",
101
+ "port": 25
102
+ },
103
+
104
+ "hot.ee": {
105
+ "host": "mail.hot.ee"
106
+ },
107
+
108
+ "Hotmail": {
109
+ "aliases": ["Outlook", "Outlook.com", "Hotmail.com"],
110
+ "domains": ["hotmail.com", "outlook.com"],
111
+ "host": "smtp-mail.outlook.com",
112
+ "port": 587
113
+ },
114
+
115
+ "iCloud": {
116
+ "aliases": ["Me", "Mac"],
117
+ "domains": ["me.com", "mac.com"],
118
+ "host": "smtp.mail.me.com",
119
+ "port": 587
120
+ },
121
+
122
+ "Infomaniak": {
123
+ "host": "mail.infomaniak.com",
124
+ "domains": ["ik.me", "ikmail.com", "etik.com"],
125
+ "port": 587
126
+ },
127
+ "Loopia": {
128
+ "host": "mailcluster.loopia.se",
129
+ "port": 465
130
+ },
131
+
132
+ "Mail.com": {
133
+ "host": "smtp.mail.com",
134
+ "port": 587
135
+ },
136
+
137
+ "mail.ee": {
138
+ "host": "smtp.mail.ee"
139
+ },
140
+
141
+ "Mail.ru": {
142
+ "host": "smtp.mail.ru",
143
+ "port": 465,
144
+ "secure": true
145
+ },
146
+
147
+ "Mailcatch.app": {
148
+ "host": "sandbox-smtp.mailcatch.app",
149
+ "port": 2525
150
+ },
151
+
152
+ "Maildev": {
153
+ "port": 1025,
154
+ "ignoreTLS": true
155
+ },
156
+
157
+ "Mailgun": {
158
+ "host": "smtp.mailgun.org",
159
+ "port": 465,
160
+ "secure": true
161
+ },
162
+
163
+ "Mailjet": {
164
+ "host": "in.mailjet.com",
165
+ "port": 587
166
+ },
167
+
168
+ "Mailosaur": {
169
+ "host": "mailosaur.io",
170
+ "port": 25
171
+ },
172
+
173
+ "Mailtrap": {
174
+ "host": "live.smtp.mailtrap.io",
175
+ "port": 587
176
+ },
177
+
178
+ "Mandrill": {
179
+ "host": "smtp.mandrillapp.com",
180
+ "port": 587
181
+ },
182
+
183
+ "Naver": {
184
+ "host": "smtp.naver.com",
185
+ "port": 587
186
+ },
187
+
188
+ "One": {
189
+ "host": "send.one.com",
190
+ "port": 465,
191
+ "secure": true
192
+ },
193
+
194
+ "OpenMailBox": {
195
+ "aliases": ["OMB", "openmailbox.org"],
196
+ "host": "smtp.openmailbox.org",
197
+ "port": 465,
198
+ "secure": true
199
+ },
200
+
201
+ "Outlook365": {
202
+ "host": "smtp.office365.com",
203
+ "port": 587,
204
+ "secure": false
205
+ },
206
+
207
+ "OhMySMTP": {
208
+ "host": "smtp.ohmysmtp.com",
209
+ "port": 587,
210
+ "secure": false
211
+ },
212
+
213
+ "Postmark": {
214
+ "aliases": ["PostmarkApp"],
215
+ "host": "smtp.postmarkapp.com",
216
+ "port": 2525
217
+ },
218
+
219
+ "qiye.aliyun": {
220
+ "host": "smtp.mxhichina.com",
221
+ "port": "465",
222
+ "secure": true
223
+ },
224
+
225
+ "QQ": {
226
+ "domains": ["qq.com"],
227
+ "host": "smtp.qq.com",
228
+ "port": 465,
229
+ "secure": true
230
+ },
231
+
232
+ "QQex": {
233
+ "aliases": ["QQ Enterprise"],
234
+ "domains": ["exmail.qq.com"],
235
+ "host": "smtp.exmail.qq.com",
236
+ "port": 465,
237
+ "secure": true
238
+ },
239
+
240
+ "SendCloud": {
241
+ "host": "smtp.sendcloud.net",
242
+ "port": 2525
243
+ },
244
+
245
+ "SendGrid": {
246
+ "host": "smtp.sendgrid.net",
247
+ "port": 587
248
+ },
249
+
250
+ "SendinBlue": {
251
+ "aliases": ["Brevo"],
252
+ "host": "smtp-relay.brevo.com",
253
+ "port": 587
254
+ },
255
+
256
+ "SendPulse": {
257
+ "host": "smtp-pulse.com",
258
+ "port": 465,
259
+ "secure": true
260
+ },
261
+
262
+ "Serv00": {
263
+ "domains": ["serv00.com"],
264
+ "host": "mail3.serv00.com",
265
+ "port": 465,
266
+ "secure": true
267
+ },
268
+
269
+ "SES": {
270
+ "host": "email-smtp.us-east-1.amazonaws.com",
271
+ "port": 465,
272
+ "secure": true
273
+ },
274
+
275
+ "SES-US-EAST-1": {
276
+ "host": "email-smtp.us-east-1.amazonaws.com",
277
+ "port": 465,
278
+ "secure": true
279
+ },
280
+
281
+ "SES-US-WEST-2": {
282
+ "host": "email-smtp.us-west-2.amazonaws.com",
283
+ "port": 465,
284
+ "secure": true
285
+ },
286
+
287
+ "SES-EU-WEST-1": {
288
+ "host": "email-smtp.eu-west-1.amazonaws.com",
289
+ "port": 465,
290
+ "secure": true
291
+ },
292
+
293
+ "SES-AP-SOUTH-1": {
294
+ "host": "email-smtp.ap-south-1.amazonaws.com",
295
+ "port": 465,
296
+ "secure": true
297
+ },
298
+
299
+ "SES-AP-NORTHEAST-1": {
300
+ "host": "email-smtp.ap-northeast-1.amazonaws.com",
301
+ "port": 465,
302
+ "secure": true
303
+ },
304
+
305
+ "SES-AP-NORTHEAST-2": {
306
+ "host": "email-smtp.ap-northeast-2.amazonaws.com",
307
+ "port": 465,
308
+ "secure": true
309
+ },
310
+
311
+ "SES-AP-NORTHEAST-3": {
312
+ "host": "email-smtp.ap-northeast-3.amazonaws.com",
313
+ "port": 465,
314
+ "secure": true
315
+ },
316
+
317
+ "SES-AP-SOUTHEAST-1": {
318
+ "host": "email-smtp.ap-southeast-1.amazonaws.com",
319
+ "port": 465,
320
+ "secure": true
321
+ },
322
+
323
+ "SES-AP-SOUTHEAST-2": {
324
+ "host": "email-smtp.ap-southeast-2.amazonaws.com",
325
+ "port": 465,
326
+ "secure": true
327
+ },
328
+
329
+ "Sparkpost": {
330
+ "aliases": ["SparkPost", "SparkPost Mail"],
331
+ "domains": ["sparkpost.com"],
332
+ "host": "smtp.sparkpostmail.com",
333
+ "port": 587,
334
+ "secure": false
335
+ },
336
+
337
+ "Tipimail": {
338
+ "host": "smtp.tipimail.com",
339
+ "port": 587
340
+ },
341
+
342
+ "Yahoo": {
343
+ "domains": ["yahoo.com"],
344
+ "host": "smtp.mail.yahoo.com",
345
+ "port": 465,
346
+ "secure": true
347
+ },
348
+
349
+ "Yandex": {
350
+ "domains": ["yandex.ru"],
351
+ "host": "smtp.yandex.ru",
352
+ "port": 465,
353
+ "secure": true
354
+ },
355
+
356
+ "Zoho": {
357
+ "host": "smtp.zoho.com",
358
+ "port": 465,
359
+ "secure": true,
360
+ "authMethod": "LOGIN"
361
+ },
362
+
363
+ "126": {
364
+ "host": "smtp.126.com",
365
+ "port": 465,
366
+ "secure": true
367
+ },
368
+
369
+ "163": {
370
+ "host": "smtp.163.com",
371
+ "port": 465,
372
+ "secure": true
373
+ }
374
+ }