@waline/vercel 1.25.2 → 1.26.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 +6 -6
- package/src/config/adapter.js +25 -0
- package/src/config/config.js +5 -0
- package/src/service/storage/tidb.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waline/vercel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "vercel server for waline comment system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"waline",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"@koa/cors": "4.0.0",
|
|
20
20
|
"akismet": "2.0.7",
|
|
21
21
|
"deta": "1.1.0",
|
|
22
|
-
"dompurify": "2.4.
|
|
22
|
+
"dompurify": "2.4.3",
|
|
23
23
|
"dy-node-ip2region": "1.0.1",
|
|
24
24
|
"fast-csv": "4.3.6",
|
|
25
25
|
"form-data": "4.0.0",
|
|
26
|
-
"jsdom": "
|
|
26
|
+
"jsdom": "21.1.0",
|
|
27
27
|
"jsonwebtoken": "9.0.0",
|
|
28
28
|
"katex": "0.16.4",
|
|
29
29
|
"leancloud-storage": "4.14.0",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"markdown-it-sub": "1.0.0",
|
|
33
33
|
"markdown-it-sup": "1.0.0",
|
|
34
34
|
"mathjax-full": "3.2.2",
|
|
35
|
-
"node-fetch": "2.6.
|
|
36
|
-
"nodemailer": "6.
|
|
35
|
+
"node-fetch": "2.6.8",
|
|
36
|
+
"nodemailer": "6.9.1",
|
|
37
37
|
"nunjucks": "3.2.3",
|
|
38
38
|
"phpass": "0.1.1",
|
|
39
39
|
"prismjs": "1.29.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"think-mongo": "2.2.1",
|
|
48
48
|
"think-router-rest": "1.0.5",
|
|
49
49
|
"thinkjs": "3.2.14",
|
|
50
|
-
"ua-parser-js": "1.0.
|
|
50
|
+
"ua-parser-js": "1.0.33"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=14"
|
package/src/config/adapter.js
CHANGED
|
@@ -19,6 +19,13 @@ const {
|
|
|
19
19
|
MYSQL_PREFIX,
|
|
20
20
|
MYSQL_CHARSET,
|
|
21
21
|
MYSQL_SSL,
|
|
22
|
+
TIDB_HOST,
|
|
23
|
+
TIDB_PORT,
|
|
24
|
+
TIDB_DB,
|
|
25
|
+
TIDB_USER,
|
|
26
|
+
TIDB_PASSWORD,
|
|
27
|
+
TIDB_PREFIX,
|
|
28
|
+
TIDB_CHARSET,
|
|
22
29
|
SQLITE_PATH,
|
|
23
30
|
SQLITE_DB,
|
|
24
31
|
SQLITE_PREFIX,
|
|
@@ -62,6 +69,8 @@ if (MONGO_DB) {
|
|
|
62
69
|
type = 'sqlite';
|
|
63
70
|
} else if (MYSQL_DB) {
|
|
64
71
|
type = 'mysql';
|
|
72
|
+
} else if (TIDB_DB) {
|
|
73
|
+
type = 'tidb';
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
exports.model = {
|
|
@@ -130,6 +139,22 @@ exports.model = {
|
|
|
130
139
|
}
|
|
131
140
|
: null,
|
|
132
141
|
},
|
|
142
|
+
|
|
143
|
+
tidb: {
|
|
144
|
+
handle: Mysql,
|
|
145
|
+
dateStrings: true,
|
|
146
|
+
host: TIDB_HOST || '127.0.0.1',
|
|
147
|
+
port: TIDB_PORT || '4000',
|
|
148
|
+
database: TIDB_DB,
|
|
149
|
+
user: TIDB_USER,
|
|
150
|
+
password: TIDB_PASSWORD,
|
|
151
|
+
prefix: TIDB_PREFIX || 'wl_',
|
|
152
|
+
charset: TIDB_CHARSET || 'utf8mb4',
|
|
153
|
+
ssl: {
|
|
154
|
+
minVersion: 'TLSv1.2',
|
|
155
|
+
rejectUnauthorized: true,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
133
158
|
};
|
|
134
159
|
|
|
135
160
|
/**
|
package/src/config/config.js
CHANGED
|
@@ -3,6 +3,8 @@ const {
|
|
|
3
3
|
LEAN_KEY,
|
|
4
4
|
MYSQL_DB,
|
|
5
5
|
MYSQL_PASSWORD,
|
|
6
|
+
TIDB_DB,
|
|
7
|
+
TIDB_PASSWORD,
|
|
6
8
|
SQLITE_PATH,
|
|
7
9
|
PG_DB,
|
|
8
10
|
PG_PASSWORD,
|
|
@@ -59,6 +61,9 @@ if (LEAN_KEY) {
|
|
|
59
61
|
} else if (MYSQL_DB) {
|
|
60
62
|
storage = 'mysql';
|
|
61
63
|
jwtKey = jwtKey || MYSQL_PASSWORD;
|
|
64
|
+
} else if (TIDB_DB) {
|
|
65
|
+
storage = 'tidb';
|
|
66
|
+
jwtKey = jwtKey || TIDB_PASSWORD;
|
|
62
67
|
} else if (GITHUB_TOKEN) {
|
|
63
68
|
storage = 'github';
|
|
64
69
|
jwtKey = jwtKey || GITHUB_TOKEN;
|